Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
    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);
        }
    }