Пример #1
0
    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);
                }
            }
        }
    }
Пример #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     instance.characterIndex = -1;
 }
Пример #3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Пример #4
0
    /// <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();
    }
Пример #5
0
 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();
     }
 }
Пример #6
0
    List <CharacterDirector> curRegisterList; //ギミックに接触しているキャラクターのリスト

    void Start()
    {
        charOb          = GetComponent <CharacterObserver>();
        curRegisterList = new List <CharacterDirector>();
    }