Пример #1
0
        static public void MenuCreateTotalPackage()
        {
            UnityEngine.EventSystems.EventSystem
                sys = CreateEventSystem("CF2-Event-System", CreationMode.AskIfPresent, null);

            InputRig
                rig = TouchControlWizardUtils.CreateRig("CF2-Rig");

            Canvas
                canvas = TouchControlWizardUtils.CreateCanvas(rig, "CF2-Canvas");

            TouchControlWizardUtils.CreatePanel(rig, canvas, "CF2-Panel", new Rect(0, 0, 1, 1));

            GamepadManager
                gm = CreateGamepadManager(true, CreationMode.AskIfPresent, null);


            string undoLabel = "Create CF2 Total Package";

            if (sys != null)
            {
                Undo.RegisterCreatedObjectUndo(sys.gameObject, undoLabel);
            }
            if (gm != null)
            {
                Undo.RegisterCreatedObjectUndo(gm.gameObject, undoLabel);
            }

            Undo.RegisterCreatedObjectUndo(rig.gameObject, undoLabel);

            Selection.activeObject = rig;

            UnityInputManagerToRigDialog.ShowDialog(rig);
        }
Пример #2
0
        static public void MenuCreateInputRigWithPanel()
        {
            InputRig rig = TouchControlWizardUtils.CreateRig("CF2-Rig");

            Canvas canvas = TouchControlWizardUtils.CreateCanvas(rig, "CF2-Canvas");

            TouchControlWizardUtils.CreatePanel(rig, canvas, "CF2-Panel", new Rect(0, 0, 1, 1));

            Undo.RegisterCreatedObjectUndo(rig.gameObject, "Create CF2 Rig with Panel");

            Selection.activeObject = rig;

            UnityInputManagerToRigDialog.ShowDialog(rig);
        }