protected override void UpdateState() { if (Vector2.Distance(Player.transform.position, transform.position) < ViewRange) { State = AIState.FIRING; } else { State = AIState.WAITING; } switch (State) { case AIState.WAITING: break; case AIState.FIRING: RotateTowards(Player.transform.position); CharacterRef.Fire(); break; } }
public static Character GetCharacter() { string characterString = Read().ToLowerInvariant(); Character character; while (!CharacterRef.TryGetValue(characterString, out character)) { PrintLine("Enter a valid Character. See included 'characters.txt' for a list of valid characters: "); Print("Main Character: "); characterString = Read().ToLowerInvariant(); } PrintLine($"Got character {character.ToOutput()}"); return(character); }
public void Fire() { CharacterRef.Fire(); }