Ejemplo n.º 1
0
    public void BackToOrigin(MoveBackHandler callback = null, float moveTime = 0.3f)
    {
        moveBackCallback_ = callback;
        Transform aimOrigin = Battle.Instance.GetStagePointByIndex(BattlePos);

        if (aimOrigin == null)
        {
            return;
        }

        if (ControlEntity == null)
        {
            ApplicationEntry.Instance.PostSocketErr(57557);
            return;
        }

        ControlEntity.MoveTo(aimOrigin.position, (int data) => {
            if (ControlEntity == null)
            {
                ApplicationEntry.Instance.PostSocketErr(57557);
                return;
            }
            ControlEntity.SetAnimationParam(GlobalValue.FMove, AnimatorParamType.APT_Float, GlobalValue.MoveMinGap);
            if (moveBackCallback_ != null)
            {
                moveBackCallback_();
                moveBackCallback_ = null;
            }
        }, false, false, moveTime);
    }