コード例 #1
0
 public override void Reason(float timeElapse)
 {
     if (timeElapse > _Duration)
     {
         MMachine.PerformTransition(EBehaviourTransition.ToIdle);
     }
 }
コード例 #2
0
    public override void Reason(float timeElapse)
    {
        base.Reason(timeElapse);
        //---没有下一步就停下
        if (MHeroController._NextDirection == EDirection.None)
        {
            MMachine.PerformTransition(EBehaviourTransition.ToIdle);
            return;
        }

        if (NoumenonT.position.MDistanceIgnoreY(aimPosition) < 0.08f)
        {
            //--
            MHeroController.SetCurToNext();
            MHeroController.CleanNext();

            if (MHeroController._AimDirection != EDirection.None)
            {
                bool canMove = MissionManager.I.CanMove(MHeroController.MCurCoordinate, MHeroController._AimDirection);
                if (canMove)
                {
                    MHeroController.SetAimToNext();
                    aimPosition = MHeroController.GetNextPosition();
                }

                MHeroController.CleanAim();
                MHeroController.TrunToNext();
            }
        }
    }
コード例 #3
0
    public void OnDirectionContrl(EDirection dir)
    {
        bool canMove = MissionManager.I.CanMove(MHeroController.MCurCoordinate, dir);

        //---转向方向;
        MHeroController.TrunToDirection(dir);
        if (canMove)
        {
            MHeroController.SetNextDirection(dir);
            MMachine.PerformTransition(EBehaviourTransition.ToMove);
        }
    }
コード例 #4
0
 public void OnFire()
 {
     MMachine.PerformTransition(EBehaviourTransition.ToKick);
 }