private void Start() { anim.enabled = false; ButtonClickSource.clip = ButtonClickSound; if (events.getState().WallEventActive&& this.transform.childCount > 0) { Transform child = this.transform.GetChild(0); child.localPosition = new Vector3(0, 0.69f, 0); } }
private void LateUpdate() { if (events.getState().currentCheckpoint >= spawnNumber) { this.gameObject.SetActive(false); } else { this.gameObject.SetActive(true); } }
// Update is called once per frame void Update() { if (events.getState().WallEventActive) { m_Material.color = Color.green; } }
/**private void LateUpdate() * { * if (events.getState().currentCheckpoint >= spawnNumber) * { * this.gameObject.SetActive(false); * } * else * { * this.gameObject.SetActive(true); * } * }**/ private void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("Player")) { CheckpointSource.Play(); collected = true; StartCoroutine(fadeOut(tube, 2)); if (events.getState().currentCheckpoint < spawnNumber) { events.nextCheckpoint(); } } }