public void SetIt(ChaseBase newIt) { currentIt = newIt; foreach (var player in players) { player.SetIt(newIt); } }
public void SetIt(ChaseBase newIt) { currentIt = newIt; isIt = (this == currentIt) ? true : false; spotted = false; ClearSpottedList(); itResetTime = 0f; }
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); } } }