private void OnTriggerEnter(Collider other) { if (other.tag == "Key") { if (other.GetComponent <ItemScript>().isUsed == true) { return; } other.GetComponent <ItemScript>().MakeDisappear(); nbKey++; UpdateKeyNbr(); } if (other.tag == "Life") { if (other.GetComponent <ItemScript>().isUsed == true) { return; } other.GetComponent <ItemScript>().MakeDisappear(); nbLife++; UpdateLifeNbr(); } if (other.tag == "Clock") { if (other.GetComponent <ItemScript>().isUsed == true) { return; } timer.AddTime(10); other.GetComponent <ItemScript>().MakeDisappear(); } }
void OnTriggerEnter(Collider other) { if (other.tag == "StickyFloor") { onStickyFloor = true; SlowDown(); } if (other.gameObject.CompareTag("Barrel")) { PS.BarrelHit(); timer.AddTime(addStunTime); plusTimer.SetActive(true); stun = true; ninjaController.Play("Stun"); time2 = Time.time; print("BARREL HIT"); //ninjaController.CrossFade("Stun", aniCrossFade); } if (other.gameObject.CompareTag("SliderFloor")) { onSlippery = true; myRigidBody.AddForce(0, 0, slipperyFloorSpeed * Time.deltaTime, ForceMode.Impulse); print("SlipperyFloor Activated"); } if (other.gameObject.CompareTag("Rome")) { drunkTimer = timeDrunk; flaskHit = true; // Destroy(Flask.gameObject); /* Destroy(Flask2.gameObject); * Destroy(Flask3.gameObject); * Destroy(Flask4.gameObject); * Destroy(Flask5.gameObject);*/ // print("FLASK IS HIT"); } }
public void AddTime() { timer.AddTime(15); }