예제 #1
0
        public override void Init()
        {
            MenuHandler.Instance.RegisterMenu(this, true);

            EmptyInputCallback inputIndexUpCallback   = new EmptyInputCallback(f_inputIndexUp, () => ChangeIndex(true));
            EmptyInputCallback inputIndexDownCallback = new EmptyInputCallback(f_inputIndexUp, () => ChangeIndex(false));

            EmptyInputCallback inputInterpretCursorCallback = new EmptyInputCallback(f_inputInterpretCursor, InterpretCursor);

            //EmptyInputCallback inputExecuteCallback = new EmptyInputCallback(f_inputExecute, () => ExecuteMenuItem(m_activeMenuItem.Children[m_focusedIndex]));

            //VectorInputCallback inputPointingCallback = new VectorInputCallback(f_inputPointing, DetermineRadialSelection);

            EmptyInputCallback[]  boolInputCallbacks   = { inputIndexUpCallback, inputIndexDownCallback, inputInterpretCursorCallback };
            AxisInputCallback[]   axisInputCallbacks   = { };
            VectorInputCallback[] vectorInputCallbacks = { };

            m_activeInputHandler = new InputHandler(
                boolInputCallbacks,
                axisInputCallbacks,
                vectorInputCallbacks
                );

            // Those two lines are essentially the same, but to stick to the new guide, the Execute is called
            f_startMenuItem.CreateMenuItem(null).Execute(this);
            //Show(f_startMenuItem.CreateMenuItem(null));
        }
예제 #2
0
        private void OnValidate()
        {
            Debug.Log("Created Dummy");

            EmptyInputCallback[] emptyInputCallbacks = new EmptyInputCallback[f_openMenuData.Length];

            for (int i = 0; i < f_openMenuData.Length; ++i)
            {
                OpenMenuData omd = f_openMenuData[i];
                emptyInputCallbacks[i] = new EmptyInputCallback(omd.OpenCombinations, () => OpenMenu(omd.Menu));
            }

            m_activeInputHandler = new InputHandler(
                emptyInputCallbacks,
                new AxisInputCallback[0],
                new VectorInputCallback[0]
                );
        }