void OnEnable() { SetRandomLight(); if (Time.time < PV.startDestroyingTime + 2) { TrafficLightsScripts.PushUsedTraffic(gameObject); //Debug.Log ("Destroying Seconds: " + (int)(Time.time - PV.startDestroyingTime)); } }
void Start() { PV = FindObjectOfType <PlayerValue>(); trafficManager = FindObjectOfType <TrafficLightsScripts>(); itemsSpawn = FindObjectOfType <ItemSpawn>(); time = 0f; PV.colorOfPlayer = PlayerPrefs.GetInt("colorOfPlayer"); charGWalking.SetActive(false); charYWalking.SetActive(false); charRWalking.SetActive(false); ChooseColor(); }