private void OnTriggerEnter(Collider other) { if (other.GetComponentInChildren <TagHarpoon>()) { ScriptDolphinStamina dolphin_stamina = ScriptGlobalVariables.player.GetComponentInChildren <ScriptDolphinStamina>(); ScriptHarpoonDamage harpoon = other.GetComponentInChildren <ScriptHarpoonDamage>(); dolphin_stamina.actual_stamina_value -= harpoon.harpoon_damage; } }
private void OnTriggerEnter(Collider other) { if (other.GetComponentInChildren <TagPlastic>()) { ScriptDolphinStamina dolphin_stamina = ScriptGlobalVariables.player.GetComponentInChildren <ScriptDolphinStamina>(); dolphin_stamina.actual_stamina_value -= other.GetComponentInChildren <ScriptPlasticDamage>().plastic_damage; dolphin_stamina.max_stamina_value -= other.GetComponentInChildren <ScriptPlasticDamage>().plastic_damage; Destroy(other.gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.GetComponent <TagAir>()) { ScriptDolphinStamina dolphin_stamina = ScriptGlobalVariables.player.GetComponentInChildren <ScriptDolphinStamina>(); dolphin_stamina.FullStaminaRecover(); } else if (other.GetComponent <TagDirtyAir>()) { ScriptDolphinStamina dolphin_stamina = ScriptGlobalVariables.player.GetComponentInChildren <ScriptDolphinStamina>(); dolphin_stamina.PartialStaminaRecover(); } }
// Use this for initialization void Start() { GameObject player = GameObject.FindGameObjectWithTag("Player"); dolphin_stamina = player.GetComponentInChildren <ScriptDolphinStamina>(); }