コード例 #1
0
 private void Move(Vector3 destination)
 {
     if (gameObject.transform.position.x > destination.x)
     {
         Log("Moving Left");
         _player.AIMove(gameObject, -0.5f * _player.DirectionModifier, 0);
     }
     else
     {
         Log("Moving Right");
         _player.AIMove(gameObject, 0.5f * _player.DirectionModifier, 0);
     }
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: KevinThielen/LD35_NetBrawlers
    // Update is called once per frame
    void FixedUpdate()
    {
        if (!initialized)
        {
            Reset();
        }

        if (gameOver)
        {
            gameOverTimer -= Time.deltaTime;
            if (gameOverTimer <= 0)
            {
                Reset();
            }
            return;
        }
        else
        {
            checkWinCondition();
        }

        if (waitForAction && currentPlayer == opponent)
        {
            currentPlayer.AIMove();
        }
        if (actionStack.Count > 0)
        {
            if (actionStack.Peek().Execute(this))
            {
                actionStack.Pop();
            }
        }
        else
        {
            StartTurn();
        }
    }