void OnCollisionEnter(Collision collision) { if (collision.collider.gameObject.tag == "Temple") { TempleController dmg = collision.collider.GetComponent <TempleController>(); dmg.ApplyDamage(damage); } if (collision.collider.gameObject.tag == "GroundGod") { GodPride dmg = collision.collider.GetComponent <GodPride>(); GroundGodController addSa = collision.collider.GetComponent <GroundGodController>(); dmg.ApplyDamage(damage); dmg.ApplySpecialAbility(sa); addSa.ApplySpecialAbility(sa); Debug.Log(""); } }
void Start() { IsGroundGodExpired = false; OnGroundGodExpired += GodSwitchManager_OnGroundGodExpired; _templeDestroyed = false; _godController = God.GetComponent <GodController>(); _groundGodController = GroundGod.GetComponent <GroundGodController>(); _temples = GameObject.FindGameObjectsWithTag("Temple"); foreach (GameObject temple in _temples) { TempleController cont = temple.GetComponent <TempleController>(); cont.OnTempleDestroyed += TempleDestroyed; } _groundGodController.enabled = false; GroundGod.SetActive(false); }