public int LayerOnExit; // BallOnTable void OnTriggerEnter(Collider other) { if (ObjectSystem.IsObjectHittable(other.gameObject.tag) != -1) { other.gameObject.layer = LayerOnEnter; } }
void OnTriggerStay(Collider col) { int tmp = ObjectSystem.IsObjectHittable(col.gameObject.tag); if (tmp == 5) { for (int i = 0; i < ashCount; i++) { Vector3 pos = col.transform.position + new Vector3(1, 1, 1) * Random.Range(0.5f, 0.9f); Instantiate(ashParent, pos, col.transform.rotation, col.transform.parent); } Destroy(col.gameObject); } }
void OnTriggerStay(Collider other) { if (other.gameObject.tag.Equals("Button/Normal")) { other.gameObject.GetComponent <LoadLevels>().Load(); } else { int tmp = ObjectSystem.IsObjectHittable(other.gameObject.tag); if (tmp != -1) { if (!isEndless) { if (other.tag.Equals("Object/Popcorn")) { targetScale += new Vector3(0.01f, 0f, 0.01f); } else { if (PowerupSystem.IsCurrentPowerup(PowerupSystem.Powerups.DoubleSize)) { targetScale += new Vector3(scale * 2, 0f, scale * 2); } else { targetScale += new Vector3(scale, 0f, scale); } cylinder.transform.localScale += new Vector3(0, 0.5f, 0); cam.newTargetVector(); } } Destroy(other.gameObject); PowerupSystem.ChoosePowerup(tmp); } } }