private void OnTriggerExit(Collider other) { CharachterModel charachter = other.GetComponent <CharachterModel>(); if (charachter != null) { charachter.ReverseSlow(slowPercent); if (charachter is FoxController) { if (disableFoxSkill) { charachter.EnableSkills(); } } if (charachter is RabbitController) { if (disableRabbitSkill) { charachter.EnableSkills(); } } if (charachter is BearController) { if (disableBearSkill) { charachter.EnableSkills(); } } } }
private void OnTriggerExit(Collider other) { CharachterModel charachterModel = other.GetComponent <CharachterModel>(); if (charachterModel != null) { characterModels.Remove(charachterModel); } }
private void OnCollisionEnter(Collision collision) { CharachterModel charachterModel = collision.gameObject.GetComponent <CharachterModel>(); if (charachterModel != null) { onCollisionWithCharacter?.Invoke(); playerModel?.Die(); } }
private void OnTriggerEnter(Collider other) { Vector3 pushBackDirection = (other.gameObject.transform.position - transform.position).normalized; CharachterModel charachter = other.GetComponent <CharachterModel>(); if (charachter != null) { charachter.AddAceeleration(pushBackDirection * pushBackVelocity); } }
private void Awake() { character = GetComponent <CharachterModel>(); character.OnLanding.AddListener(PlayLandSound); character.onUseSkill.AddListener(PlaySkill); }