public void SetIt(ChaseBase newIt)
 {
     currentIt = newIt;
     foreach (var player in players)
     {
         player.SetIt(newIt);
     }
 }
Example #2
0
 public void SetIt(ChaseBase newIt)
 {
     currentIt = newIt;
     isIt      = (this == currentIt) ? true : false;
     spotted   = false;
     ClearSpottedList();
     itResetTime = 0f;
 }
Example #3
0
    private void OnCollisionEnter2D(Collision2D other)
    {
        ChaseBase hider = other.gameObject.GetComponent <ChaseBase>();

        if (hider != null && itResetTime > itSwapTimer)
        {
            if (isIt)
            {
                // Someone has been caught. Either this npc or the player
                Debug.Log("Gotcha! New it is: " + hider.gameObject.name);

                gameControl.SetIt(hider);
            }
        }
    }