void DisableMainPlayer() { if (MainAnimal == this) { MainAnimal = null; OnMainPlayer.Invoke(isPlayer.Value = false); } }
/// <summary>Set an Animal as the Main Player and remove the otherOne</summary> public virtual void SetMainPlayer() { if (MainAnimal) { MainAnimal.isPlayer.Value = false; MainAnimal.OnMainPlayer.Invoke(false); } this.isPlayer.Value = true; MainAnimal = this; OnMainPlayer.Invoke(true); }