GetDirection() 정적인 개인적인 메소드

Using the keyboard will result in 1 or -1, depending on whether up or down keys have been pressed.
static private GetDirection ( KeyCode, up, KeyCode, down ) : int
up KeyCode,
down KeyCode,
리턴 int
예제 #1
0
    public void ProcessOthers()
    {
        UICamera.currentTouchID = -100;
        UICamera.currentTouch   = UICamera.mController;
        UICamera.inputHasFocus  = (UICamera.mSel != null && UICamera.mSel.GetComponent <UIInput>() != null);
        bool flag  = (this.submitKey0 != KeyCode.None && Input.GetKeyDown(this.submitKey0)) || (this.submitKey1 != KeyCode.None && Input.GetKeyDown(this.submitKey1));
        bool flag2 = (this.submitKey0 != KeyCode.None && Input.GetKeyUp(this.submitKey0)) || (this.submitKey1 != KeyCode.None && Input.GetKeyUp(this.submitKey1));

        if (flag || flag2)
        {
            UICamera.currentTouch.current = UICamera.mSel;
            this.ProcessTouch(flag, flag2);
            UICamera.currentTouch.current = null;
        }
        int num  = 0;
        int num2 = 0;

        if (this.useKeyboard)
        {
            if (UICamera.inputHasFocus)
            {
                num  += UICamera.GetDirection(KeyCode.UpArrow, KeyCode.DownArrow);
                num2 += UICamera.GetDirection(KeyCode.RightArrow, KeyCode.LeftArrow);
            }
            else
            {
                num  += UICamera.GetDirection(KeyCode.W, KeyCode.UpArrow, KeyCode.S, KeyCode.DownArrow);
                num2 += UICamera.GetDirection(KeyCode.D, KeyCode.RightArrow, KeyCode.A, KeyCode.LeftArrow);
            }
        }
        if (this.useController)
        {
            if (!string.IsNullOrEmpty(this.verticalAxisName))
            {
                num += UICamera.GetDirection(this.verticalAxisName);
            }
            if (!string.IsNullOrEmpty(this.horizontalAxisName))
            {
                num2 += UICamera.GetDirection(this.horizontalAxisName);
            }
        }
        if (num != 0)
        {
            UICamera.Notify(UICamera.mSel, "OnKey", (num <= 0) ? KeyCode.DownArrow : KeyCode.UpArrow);
        }
        if (num2 != 0)
        {
            UICamera.Notify(UICamera.mSel, "OnKey", (num2 <= 0) ? KeyCode.LeftArrow : KeyCode.RightArrow);
        }
        if (this.useKeyboard && Input.GetKeyDown(KeyCode.Tab))
        {
            UICamera.Notify(UICamera.mSel, "OnKey", KeyCode.Tab);
        }
        if (this.cancelKey0 != KeyCode.None && Input.GetKeyDown(this.cancelKey0))
        {
            UICamera.Notify(UICamera.mSel, "OnKey", KeyCode.Escape);
        }
        if (this.cancelKey1 != KeyCode.None && Input.GetKeyDown(this.cancelKey1))
        {
            UICamera.Notify(UICamera.mSel, "OnKey", KeyCode.Escape);
        }
        UICamera.currentTouch = null;
    }