public static void EnemyAttack() { foreach (EnemyBehaviour enemy in instance.activeEnemies) { if (enemy.Active != false) { Transform target = CharacterObserver.GetEnemyTarget(); if (target != null) { PlayerMoveCommand move = new PlayerMoveCommand(); move.AssignMove(enemy.transform, enemy.transform.position, target.position); PlayerCommand.AddCommand(move); AttackCommand attack = new AttackCommand(); attack.AssignCommand(10, target.gameObject); attack.AssignAnimation(enemy.gameObject, "Attack", 0f); PlayerCommand.AddCommand(attack); PlayerMoveCommand move2 = new PlayerMoveCommand(); move2.AssignMove(enemy.transform, target.position, enemy.transform.position); PlayerCommand.AddCommand(move2); } } } }
private void Awake() { if (instance == null) { instance = this; } instance.characterIndex = -1; }
void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
/// <summary> /// Respawn the current character (Don't recreate the objects) /// </summary> private void RespawnCharacters() { // Force everything to respawn foreach (Character character in characters) { character.Respawn(); } PlaceCharactersInRing(); // Reset observer CharacterObserver observer = FindObjectOfType <CharacterObserver>(); observer.SelectNewTarget(); }
public static void Complete() { if (Instance.EnemyTurn) { Instance.executeCommands = true; Instance.executeIndex = 0; EnemyObserver.EnemyAttack(); Instance.StartCoroutine(ExecuteEnemiesCommands()); Instance.EnemyTurn = false; } else { ExecutionComplete(); CharacterObserver.ResetTurn(); } }
List <CharacterDirector> curRegisterList; //ギミックに接触しているキャラクターのリスト void Start() { charOb = GetComponent <CharacterObserver>(); curRegisterList = new List <CharacterDirector>(); }