<repo_name>MichaelYungLee/heliedge<file_sep>/Assets/Scripts/AudioOffset.cs
using UnityEngine;
using System.Collections;

public class AudioOffset : MonoBehaviour
{
	IEnumerator Start ()
	{
		Random.seed = System.DateTime.Now.Millisecond;
		yield return new WaitForSeconds(Random.Range(0f, 1.5f));
		GetComponent<AudioSource>().Play();
	}
}
<file_sep>/Assets/Scripts/WheelsRotation.cs
using UnityEngine;
using System.Collections;

public class WheelsRotation : MonoBehaviour
{
	public float relativeSpeed = 100f;
	
	private UnityEngine.AI.NavMeshAgent nav;
	private Transform[] wheels = new Transform[4];
	
	
	void Awake ()
	{
		nav = GetComponent<UnityEngine.AI.NavMeshAgent>();
		wheels[0] = GameObject.Find("vehicle_rcLand_wheel_frontLeft").transform;
		wheels[1] = GameObject.Find("vehicle_rcLand_wheel_frontRight").transform;
		wheels[2] = GameObject.Find("vehicle_rcLand_wheel_rearLeft").transform;
		wheels[3] = GameObject.Find("vehicle_rcLand_wheel_rearRight").transform;
	}
	
	
	void Update ()
	{
		float navSpeed = nav.velocity.magnitude;
		foreach(Transform wheel in wheels)
		{
			wheel.Rotate(Vector3.right * relativeSpeed * navSpeed * Time.deltaTime);
		}
	}
}
<file_sep>/Assets/Scripts/RandomFloorBotMovement.cs
using UnityEngine;
using System.Collections;

public class RandomFloorBotMovement : MonoBehaviour
{
	public Vector2 minimumCoordinates;
	public Vector2 maximumCoordinates;
	public Vector2 speedVariance;
	public Vector2 newDestinationTimeVariance;
	public Vector2 newSpeedTimeVariance;
	
	
	private UnityEngine.AI.NavMeshAgent nav;
	private float newDestinationTime;
	private float destinationTimer;
	private float newSpeedTime;
	private float speedTimer;
	
	
	void Awake ()
	{
		nav = GetComponent<UnityEngine.AI.NavMeshAgent>();
		SetRandomDestination();
		SetRandomSpeed();
	}
	

	void FixedUpdate ()
	{
		destinationTimer += Time.deltaTime;
		speedTimer += Time.deltaTime;
		
		if(destinationTimer >= newDestinationTime)
			SetRandomDestination();
		
		if(speedTimer >= newSpeedTime)
			SetRandomSpeed();
	}
	
	
	void SetRandomDestination ()
	{
		float newX = Random.Range(minimumCoordinates.x, maximumCoordinates.x);
		float newZ = Random.Range(minimumCoordinates.y, maximumCoordinates.y);
		nav.destination = new Vector3(newX, -1f, newZ);
		SetNewDestinationTime();
	}
	
	void SetRandomSpeed ()
	{
		nav.speed = Random.Range(speedVariance.x, speedVariance.y);
		SetNewSpeedTime();
	}
	
	void SetNewDestinationTime ()
	{
		newDestinationTime = Random.Range(newDestinationTimeVariance.x, newDestinationTimeVariance.y);
		destinationTimer = 0f;
	}
	
	
	void SetNewSpeedTime ()
	{
		newSpeedTime = Random.Range(newSpeedTimeVariance.x, newSpeedTimeVariance.y);
		speedTimer = 0f;
	}
}
<file_sep>/Assets/Workplace Tools/README.txt
This is the free package "Workplace Tools" by ikapoura. 

The content provided is free and you can use them and modify them freely in your projects. 
This project aims to provide a fast prototyping experience by providing some simple but 
detailed models to get you going.

- How to use the package

Simply drag and drop any model you want from the Prefabs folder into your scene and you are ready!

- Materials

The materials are simple colors and every model has it's own materials named after it. This will
help altering only the color of one model to avoid confusion. (Except bolts. Bolts are mean.)

- Colliders

I have pre-enabled the Mesh Colliders for every objects and set Convex to true. If you want physics
interactions, simply add a Rigidbody Component to the root GameObject of each prefab.

- Help / questions

For any help, questions or even suggestions please email me at:

<EMAIL>

Enjoy!<file_sep>/Assets/Scripts/CaptureNormals.cs
using UnityEngine;
using System.Collections;

public class CaptureNormals : MonoBehaviour
{
    private Material mat;

    void OnPostRender()
    {
        if(!mat)
        {
            mat = new Material("Shader \"Hidden/SetAlpha\" {" +
            "SubShader {" +
            "    Pass {" +
            "        ZTest Always Cull Off ZWrite Off" +
            "        SetTexture [_CameraNormalsTexture] { combine texture } " +
            "   } " +
            "   }" +
            "}"
            );
        }


        GL.PushMatrix();
        GL.LoadOrtho();
        for(int i = 0 ; i < mat.passCount ; ++i )
        {
            mat.SetPass(i);
            GL.Begin(GL.QUADS);
            GL.TexCoord(new Vector3(0, 0, 0));
            GL.Vertex3(0, 0, 0.1f);
            GL.TexCoord(new Vector3(1, 0, 0));
            GL.Vertex3(1, 0, 0.1f);
            GL.TexCoord(new Vector3(1, 1, 0));
            GL.Vertex3(1, 1, 0.1f);
            GL.TexCoord(new Vector3(0, 1, 0));
            GL.Vertex3(0, 1, 0.1f);
            GL.End();
        }

        GL.PopMatrix();



    }
}
<file_sep>/README.md
Due to versioning complications from using git and Unity together, our most up-to-date code base is located in branch "feature/factoryObject"
<file_sep>/Assets/Scripts/Punch.cs
using UnityEngine;
using System.Collections;

public class Punch : MonoBehaviour
{
	private Animator anim;
	private int hitState;
	private int doPunchBool;
	
	
	void Awake ()
	{
		anim = GetComponent<Animator>();
		hitState = Animator.StringToHash("Base Layer.Hit");
		doPunchBool = Animator.StringToHash("DoPunch");
	}
	
	
	void OnTriggerExit (Collider other)
	{
		anim.SetBool(doPunchBool, true);
	}
	
	void Update ()
	{
		if(anim.GetCurrentAnimatorStateInfo(0).nameHash == hitState)
			anim.SetBool(doPunchBool, false);
	}
}
<file_sep>/Assets/Scripts/Rotator.cs
using UnityEngine;
using System.Collections;

public class Rotator : MonoBehaviour {
	
	public float rotateSpeed = 5f;
	
	void Update () {
		transform.Rotate (new Vector3(0, rotateSpeed*Time.deltaTime,0));
	}
}
