public void PickupAbility(AbilityManager.Ability p_ability, string p_key) { AbilityManager.instance.AddAbility(p_ability); PopupManager.instance.ShowMessage(p_key); SoftPauseScript.softPaused = true; Time.timeScale = 0f; }
void OnTriggerEnter2D(Collider2D p_other) { if (p_other.CompareTag("Hazard")) { Player.instance.Die(); } if (p_other.CompareTag("Checkpoint")) { CheckpointManager.instance.GetCheckpoint(p_other.GetComponent <Checkpoint>()); } if (p_other.CompareTag("Goal")) { ProgressManager.instance.HitGoal(); } if (p_other.CompareTag("Advance")) { Player.instance.HitAdvance(); } if (p_other.CompareTag("Ability")) { AbilityPickup l_pickup = p_other.GetComponent <AbilityPickup> (); AbilityManager.Ability l_ability = l_pickup.ability; string l_key = l_pickup.messageKey; Player.instance.PickupAbility(l_ability, l_key); p_other.gameObject.SetActive(false); } }