Fix mesh issues, add robotics room robot, poster

This commit is contained in:
Toomas Tamm
2021-04-07 20:29:16 +03:00
parent 6e40533863
commit 9f2bccac8e
131 changed files with 14630 additions and 3888 deletions

44
Assets/Scripts/Poster.cs Normal file
View File

@@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Poster : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Vector2[] uvSingleFace = {
new Vector2(0, 0),
new Vector2(1, 0),
new Vector2(0, 1),
new Vector2(1, 1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1),
new Vector2(-1, -1)
};
GetComponent<MeshFilter>().mesh.uv = uvSingleFace;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dac1c67daec8f264da85a77c48bf5f0d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bd9f7a9938a4bf24a84872811c68d93f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NavPoint : MonoBehaviour
{
public NavPoint previous;
public NavPoint next;
public NavPoint GetNext()
{
return next;
}
void OnDrawGizmos()
{
if (next == null) return;
Gizmos.color = Color.yellow;
Gizmos.DrawLine(transform.position, next.transform.position);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e665a34866aa84947a9189411e8b1f63
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
public class NavPointFollower : MonoBehaviour
{
public NavPoint startNavPoint;
public float rotationSpeed = 1f;
public float speed = 1f;
private Rigidbody _rigidbody;
private void Start()
{
_rigidbody = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
var transform1 = transform;
var position = transform1.position;
_rigidbody.MovePosition(position + transform1.forward * (speed * Time.deltaTime));
var nextNavPointDirectionFlat =
new Vector3(startNavPoint.transform.position.x, 0, startNavPoint.transform.position.z);
var direction = (startNavPoint.transform.position - position).normalized;
direction.y = 0;
var lookRotation = Quaternion.LookRotation(direction);
transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime * rotationSpeed);
if (Vector3.Distance(transform.position, startNavPoint.transform.position) < 0.3f)
{
startNavPoint = startNavPoint.GetNext();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5ce1c79856036c740b25a576b37e4476
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RGB : MonoBehaviour
{
public float colorChangeInterval = 2f;
public float minColor = 0;
public float maxColor = 100;
private Light _light;
private float _nextColorChange;
// Start is called before the first frame update
void Start()
{
_light = GetComponent<Light>();
_nextColorChange = Time.time;
}
// Update is called once per frame
void Update()
{
if (!(_nextColorChange <= Time.time)) return;
var r = Random.Range(minColor, maxColor);
var g = Random.Range(minColor, maxColor);
var b = Random.Range(minColor, maxColor);
_light.color = new Color(r, g, b);
_nextColorChange = Time.time + colorChangeInterval;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a78c20c4f2fa24043a42f6640a85fb21
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: