Пример #1
0
    public void PlayerInput(BUTTON inputButton)
    {
        int used;
        if (playerBars.TryGetValue("Used", out used))
        {
            if (used != 0)
            {
                return;
            }
        }

        ButtonObjectAssoctiate result;
        if (DisplayBarsDict.TryGetValue(inputButton, out result))
        {
            int pressed;
            if (enemyBars.TryGetValue(inputButton.ToString(), out pressed))
            {
                playerBars["Used"] = 1;
                playerBars[inputButton.ToString()] = 1;
                SetColor(inputButton, Color.white);
            }
            else
            {
                playerBars["Used"] = 1;
                playerBars[inputButton.ToString()] = 1;
                result.obj.SetActive(true);
            }
        }
    }
Пример #2
0
        //---------------------------------------------------
        //Description
        //  The interrupt handler funtion
        //---------------------------------------------------
        static void InterruptHandler(uint data1, uint data2, DateTime time)
        {
            //Convert to the BUTTON enumerate value
            BUTTON btn = (BUTTON)data1;

            if (data2 == 0)
            {
                //Pop
                Debug.Print(btn.ToString() + ":Pop");
            }
            else
            {
                //Push
                Debug.Print(btn.ToString() + ":Push");
            }
        }
Пример #3
0
 public static string Get(BUTTON button)
 {
     return(button.ToString().Replace('_', ' '));
 }
Пример #4
0
 // Update is called once per frame
 void Update()
 {
     GrabPunch(eButtonType.ToString());
 }