public override void TriggerEvent()
 {
     this.UsedUp = true;
     playerCharacter.interact -= TriggerEvent;
     HideInteractObj();
     if (PipSystem.Chest.Locked)
     {
         PipSystem.Chest.Locked = false;
     }
     PipSystem.Chest.MaxCap++;
     PipSystem.UpdatePipPad(PipSystem.Chest);
     Animator.SetTrigger(ActivateHash);
 }
Esempio n. 2
0
 public override void TriggerEvent()
 {
     this.UsedUp = true;
     playerCharacter.interact -= TriggerEvent;
     HideInteractObj();
     if (PipSystem.Arms.Locked)
     {
         PipSystem.Arms.Locked = false;
     }
     PipSystem.Arms.MaxCap++;
     PipSystem.UpdatePipPad(PipSystem.Arms);
     Animator.SetTrigger(ActivateHash);
     PowerUpSound.Play();
     PowerUpDarwinSound.PlayDelayed(PowerUpSound.clip.length);
 }
        // Using OnEnable because it is being called after PlayerCharacter onawake but before pipsystems start
        // This allows the player character to become initialized the pipdisplay to be able to call it and sub to
        // the pipsystems delegates and then have them call the PipDisplay functions.
        void OnEnable()
        {
            if (pipSystem == null)
            {
                Debug.LogError("Did Not Add A pipSystem to PipDisplay. Fix It.");
                pipSystem = GetComponent <PipSystem>();
                if (pipSystem == null)
                {
                    pipSystem = GameObject.Find("Darwin").GetComponent <PipSystem>();
                }
            }

            if (pipSystem != null)
            {
                pipSystem.Updated        += UpdatePipPadDisplay;
                pipSystem.DisplayUpdated += UpdatePipPoolDisplay;
            }

            pipFullHPPrefab = (GameObject)Resources.Load("Prefabs/Pip", typeof(GameObject));
            pipLentHPPrefab = (GameObject)Resources.Load("Prefabs/FunnelPip", typeof(GameObject));
        }