Ejemplo n.º 1
0
        void CastAction(Skill.IAction action_)
        {
            foreach (var otherAction in currentActions)
            {
                if (otherAction.ActionLocked() || otherAction == action_)
                {
                    return;
                }
            }

            action_.Cast();
            currentActions.Add(action_);
        }
Ejemplo n.º 2
0
        // Use this for initialization
        IEnumerator Start()
        {
            yield return(StartCoroutine(App.Content.SkillList.Load()));

            yield return(StartCoroutine(session.Load()));

            dashForward  = new Skill.DashForward(this);
            dashBackward = new Skill.DashBackward(this);
            dashLeft     = new Skill.DashLeft(this);
            dashRight    = new Skill.DashRight(this);

            actionController.SetForwardDashAction(() => { CastAction(dashForward); });
            actionController.SetBackwardDashAction(() => { CastAction(dashBackward); });
            actionController.SetLeftDashAction(() => { CastAction(dashLeft); });
            actionController.SetRightDashAction(() => { CastAction(dashRight); });

            rb2d = gameObject.GetComponent <Rigidbody2D>();
        }