예제 #1
0
 // ------------------
 void Update()
 {
     if (!string.IsNullOrEmpty(this.actionButonName) && CF2Input.GetButtonDown(this.actionButonName))
     {
         this.PerformAction();
     }
 }
        // -------------
        void Update()
        {
            if (this.character == null)
            {
                return;
            }


            if (CF2Input.GetButtonDown("Left-Stab"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.LEFT_STAB);
            }
            else if (CF2Input.GetButtonDown("Left-Slash-U"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.LEFT_SLASH_U);
            }
            else if (CF2Input.GetButtonDown("Left-Slash-R"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.LEFT_SLASH_R);
            }
            else if (CF2Input.GetButtonDown("Left-Slash-L"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.LEFT_SLASH_L);
            }
            else if (CF2Input.GetButtonDown("Left-Slash-D"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.LEFT_SLASH_D);
            }

            else if (CF2Input.GetButtonDown("Right-Stab"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.RIGHT_STAB);
            }
            else if (CF2Input.GetButtonDown("Right-Slash-U"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.RIGHT_SLASH_U);
            }
            else if (CF2Input.GetButtonDown("Right-Slash-R"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.RIGHT_SLASH_R);
            }
            else if (CF2Input.GetButtonDown("Right-Slash-L"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.RIGHT_SLASH_L);
            }
            else if (CF2Input.GetButtonDown("Right-Slash-D"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.RIGHT_SLASH_D);
            }

            else if (CF2Input.GetButtonDown("Dodge-Right"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.DODGE_RIGHT);
            }
            else if (CF2Input.GetButtonDown("Dodge-Left"))
            {
                this.character.ExecuteAction(SwipeSlasherChara.ActionType.DODGE_LEFT);
            }
        }
        // ------------------
        void Update()
        {
            bool
                invokeNow = false;

            switch (this.eventType)
            {
            case EventType.OnPress:
                invokeNow = CF2Input.GetButtonDown(this.buttonName, ref this.buttonId); break;

            case EventType.OnRelease:
                invokeNow = CF2Input.GetButtonUp(this.buttonName, ref this.buttonId); break;

            case EventType.WhenPressed:
                invokeNow = CF2Input.GetButton(this.buttonName, ref this.buttonId); break;
            }

            if (invokeNow)
            {
                this.buttonEvent.Invoke();
            }
        }