using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NPC : MonoBehaviour
{
    public int WaveChecks = 0;
    public Color OriginalColor;

	// Use this for initialization
	void Start ()
    {
        transform.localScale = Random.Range(1f, 3f) * Vector3.one;
        OriginalColor = new Color(1f, Random.Range(0.25f, 0.75f), Random.Range(0.25f, 0.75f));
        gameObject.GetComponent<Renderer>().material.color = OriginalColor;
	}

    void Update()
    {
        if (WaveChecks == 1)
            gameObject.GetComponent<Renderer>().material.color = Color.yellow;
        else if (WaveChecks == 2)
            gameObject.GetComponent<Renderer>().material.color = Color.green;
        else
            gameObject.GetComponent<Renderer>().material.color = OriginalColor;
    }

    private void OnCollisionEnter(Collision Col)
    {
        if (WaveChecks == 2)
            gameObject.GetComponent<Rigidbody>().AddForce(Vector3.up * 400f);
    }	
}
