Пример #1
0
    public override void UpdateAction()
    {
        base.UpdateAction();
        PlayerUtil.CardInterfaceLogicMacro();

        if (EntityUtil.HitDeadLogicMacro(Owner, "PlayerHitAction", "PlayerDeadAction"))
        {
            return;
        }

        float currentAnimTime = AnimUtil.GetAnimNormalizedTime(Owner);

        if (currentAnimTime > 0.6f)
        {
            if (PlayerUtil.GetAttackInput())
            {
                isAttackCommand = true;
            }
        }

        Owner.NavAgent.Move(Owner.transform.forward * Isometric.IsometricTileSize.x * -0.3f * Time.deltaTime);

        if (AnimUtil.IsLastFrame(Owner))
        {
            Owner.CurrentAction = isAttackCommand ? (CharacterAction)PlayerAttack2Action.GetInstance()
                : (CharacterAction)PlayerIdleAction.GetInstance();
            return;
        }
    }
Пример #2
0
    public override void UpdateAction()
    {
        base.UpdateAction();

        if (EntityUtil.StateActionMacro(Owner))
        {
            return;
        }

        if (PlayerUtil.GetAttackInput())
        {
            Owner.CurrentAction = PlayerAttackAction.GetInstance();
            return;
        }

        Vector3 velocity = PlayerUtil.GetVelocityInput();

        if (velocity.magnitude < 0.1f)
        {
            Owner.CurrentAction = PlayerIdleAction.GetInstance();
            return;
        }

        Owner.transform.rotation = Quaternion.LookRotation(velocity, Vector3.up);
        Owner.NavAgent.Move(velocity * Owner.Status.CurrentSpeed * Time.deltaTime);

        AnimUtil.RotationAnim(Owner, "run");
    }
Пример #3
0
    public override void UpdateAction()
    {
        base.UpdateAction();
        if (EntityUtil.StateActionMacro(Owner))
        {
            return;
        }

        Owner.NavAgent.Move(Owner.transform.forward * Isometric.IsometricGridSize * Owner.Status.CurrentSpeed * curve.Evaluate(ElapsedTime) * Time.deltaTime
                            + Owner.transform.forward * Mathf.Clamp01(Vector3.Dot(PlayerUtil.GetVelocityInput(), Owner.transform.forward)) * Isometric.IsometricGridSize * Owner.Status.CurrentSpeed * Time.deltaTime);

        float currentAnimTime = AnimUtil.GetAnimNormalizedTime(Owner);

        if (AnimUtil.IsLastFrame(Owner))
        {
            Owner.CurrentAction = isAttackCommand ? (CharacterAction)PlayerAttack1Action.GetInstance()
                : (CharacterAction)PlayerIdleAction.GetInstance();
            return;
        }

        if (currentAnimTime >= 0.78f && isAttackCommand)
        {
            Owner.CurrentAction = (CharacterAction)PlayerAttack1Action.GetInstance();
            return;
        }

        if (currentAnimTime <= 0.77f)
        {
            if (PlayerUtil.GetAttackInput())
            {
                isAttackCommand = true;
            }
        }
    }
Пример #4
0
    public override void UpdateAction()
    {
        base.UpdateAction();
        PlayerUtil.CardInterfaceLogicMacro();


        if (EntityUtil.HitDeadLogicMacro(Owner, "PlayerHitAction", "PlayerDeadAction"))
        {
            return;
        }

        if (PlayerUtil.GetAttackInput())
        {
            Owner.CurrentAction = PlayerAttackAction.GetInstance();
            return;
        }

        Vector3 velocity = PlayerUtil.GetVelocityInput();

        if (velocity.magnitude < 0.1f)
        {
            Owner.CurrentAction = PlayerIdleAction.GetInstance();
            return;
        }

        Owner.transform.rotation = Quaternion.LookRotation(velocity, Vector3.up);
        Owner.NavAgent.Move(velocity * 1.1f * Time.deltaTime);

        AnimUtil.RotationAnim(Owner, "run");
    }
Пример #5
0
    public override void UpdateAction()
    {
        base.UpdateAction();

        if (EntityUtil.StateActionMacro(Owner))
        {
            return;
        }

        if (PlayerUtil.GetAttackInput())
        {
            Owner.CurrentAction = PlayerAttackAction.GetInstance();
            return;
        }

        Vector3 velocity = PlayerUtil.GetVelocityInput();

        if (velocity.magnitude > 0.1f)
        {
            Owner.CurrentAction = PlayerMoveAction.GetInstance();
            return;
        }
    }
Пример #6
0
    public override void UpdateAction()
    {
        base.UpdateAction();
        PlayerUtil.CardInterfaceLogicMacro();

        if (EntityUtil.HitDeadLogicMacro(Owner, "PlayerHitAction", "PlayerDeadAction"))
        {
            return;
        }

        if (PlayerUtil.GetAttackInput())
        {
            Owner.CurrentAction = PlayerAttackAction.GetInstance();
            return;
        }

        Vector3 velocity = PlayerUtil.GetVelocityInput();

        if (velocity.magnitude > 0.1f)
        {
            Owner.CurrentAction = PlayerMoveAction.GetInstance();
            return;
        }
    }
Пример #7
0
 public static bool GetAttackInput()
 {
     return(PlayerUtil.GetAttackInput());
 }