Esempio n. 1
0
    protected override void FSMFixedUpdate()
    {
        //最近玩家
        Transform player = GetCloselyPlayer(playerTransform);

        //玩家死亡
        if (player.GetComponent <Player>().Hp == 0)
        {
            player = null;
        }
        //当前状态进行转换
        CurrentState.Reason(player, transform);
        //在新的状态下ACT
        CurrentState.Act(player, transform);
        //更新路点
        if (path.IsReach(transform))
        {
            path.NextWaypoint();
        }
    }