Exemple #1
0
 public void Reset()
 {
     currentNode = startNode;
     if (DebugMode)
     {
         Debug.Log("Menu reset, now at startNode.");
     }
     manipulator.AssignJob(JOB.TRACK);
     rebuildMenu(currentNode.ChildNodes);
 }
Exemple #2
0
    void Start()
    {
        controller  = GetComponent <MenuController>();
        manipulator = GetComponent <ManipulationController>();
        clipManager = GetComponent <ClipManager>();

        callbacks = new Dictionary <string, Action>()
        {
            { CALLBACK.STANDBY, () => {
                  manipulator.AssignJob(JOB.STANDBY);
              } },
            { CALLBACK.ROTATE_JOINT, () => {
                  manipulator.AssignJob(JOB.ROTATE);
              } },
            { CALLBACK.OPEN_ADDITIONAL, () => {
                  controller.ShowAdditionalMenu(true);
              } },
            { CALLBACK.CLOSE_ADDITIONAL, () => {
                  controller.ShowAdditionalMenu(false);
                  Reset();
              } },
            { CALLBACK.DISCARD_CHANGES, () => {
                  clipManager.Undo(0);
                  Reset();
              } },
            { CALLBACK.SAVE_CHANGES, () => {
                  clipManager.SaveRotation(manipulator.HighlightedJoint);
                  Reset();
              } },
            { CALLBACK.UNDO, () => {
                  clipManager.Undo(1);
                  Reset();
              } },
        };

        startNode = new MenuNode("Start", null, new Dictionary <string, MenuNode>()
        {
            { OPTION.UP, new MenuNode("Undo the last change.", CALLBACK.UNDO, null) },
            { OPTION.MIDDLE, new MenuNode("Open additional actions menu.", CALLBACK.OPEN_ADDITIONAL, new Dictionary <string, MenuNode>()
                {
                    { OPTION.MIDDLE, new MenuNode("Gaze at a button to execute action.", null, null) },
                    { OPTION.DOWN, new MenuNode("Exit additional actions menu.", CALLBACK.CLOSE_ADDITIONAL, null) }
                }) },
            { OPTION.DOWN, new MenuNode("Touch the joint you wish to animate.", null, new Dictionary <string, MenuNode>()
                {
                    { OPTION.UP, new MenuNode("Do you want to work with this joint?.", null, null) },
                    { OPTION.MIDDLE, new MenuNode("Rotate selected joint.", CALLBACK.ROTATE_JOINT, new Dictionary <string, MenuNode>()
                        {
                            { OPTION.UP, new MenuNode("Discard changes.", CALLBACK.STANDBY, new Dictionary <string, MenuNode>()
                                {
                                    { OPTION.UP, new MenuNode("Are you sure about that?", null, null) },
                                    { OPTION.MIDDLE, new MenuNode("Yes, discard the changes.", CALLBACK.DISCARD_CHANGES, null) },
                                    { OPTION.DOWN, new MenuNode("I changed my mind, save the changes.", CALLBACK.SAVE_CHANGES, null) }
                                }) },
                            { OPTION.MIDDLE, new MenuNode("Adjust joint rotation to your liking.", null, null) },
                            { OPTION.DOWN, new MenuNode("Save changes.", CALLBACK.SAVE_CHANGES, null) }
                        }) }
                }) }
        });

        Reset();
    }