Пример #1
0
 public void DestroySpecialCube(Enumeration.playerState state)
 {
     if (state == Enumeration.playerState.secondState)
     {
         Destroy(gameObject);
     }
 }
Пример #2
0
 /// <summary>
 /// changes variables if player dies
 /// </summary>
 /// <param name="stateDeath"> this is the state that died on the event call</param>
 void PlayerDied(Enumeration.playerState stateDeath)
 {
     if (stateDeath == Enumeration.playerState.playerState)
     {
         openable = false;
     }
 }
Пример #3
0
 /// <summary>
 /// looks to see if a puzzle piece was placed, uses the death of second state for check
 /// </summary>
 /// <param name="state"></param>
 void CheckPlacedPiece(Enumeration.playerState state)
 {
     if (state == Enumeration.playerState.secondState && placedPiece)
     {
         placedPiece = false;
     }
 }
Пример #4
0
 void CheckForRemoveTarget(Enumeration.playerState enumeration)
 {
     if (enumeration == Enumeration.playerState.secondState)
     {
         target            = null;
         secondStateExists = false;
     }
 }
Пример #5
0
 /// <summary>
 /// looks to see if a puzzle piece was placed, uses the death of second state for check
 /// </summary>
 /// <param name="state"></param>
 void CheckPlacedPiece(Enumeration.playerState state)
 {
     // if the second state died, then we want to clear both
     if (state == Enumeration.playerState.secondState && placedPiece)
     {
         placedPiece = false;
     }
 }
Пример #6
0
 /// <summary>
 /// checks which state needs to be changes
 /// </summary>
 /// <param name="stateToChange"> indicated which state to change</param>
 /// <param name="changeValue"> indicates how much should be changed</param>
 void CheckHealthChange(Enumeration.playerState stateToChange, float changeValue)
 {
     if (stateToChange == Enumeration.playerState.playerState)
     {
         //Debug.Log("Changing: player");
         ChangeHealth(changeValue);
     }
     else
     {
         //Debug.Log("Changing: Second");
         ChangeImagination(changeValue);
     }
 }
    /// <summary>
    /// kills the player or second state if their death is triggered
    /// by the event system
    /// </summary>
    /// <param name="whoDies"></param>
    void Die(Enumeration.playerState whoDies)
    {
        if (whoDies == Enumeration.playerState.playerState)
        {
            if (myDeathMenu == null)
            {
                myDeathMenu = Instantiate(deathMenu);
            }
            transform.position = spawnLocation;
            healthChangedEvent.Invoke(Enumeration.playerState.playerState, -400);
        }
        else
        {
            // handles audio needs
            myAudio.clip = removed;
            myAudio.Play();

            twoBeings = false;
            Destroy(mySecondState);
            mySecondState = null;
            secondStateTransitionEvent.Invoke(Enumeration.secondStateTransitions.removeState);
        }
    }