void BuilderGUI()
    {
        //Show buttons to play created animations
        modelAnimator.AnimationSelectionGUI();

        //Show restart button
        if (GUI.Button(new Rect(Screen.width - 71, 0, 70, 35), "Restart"))
        {
            resetBuilder();
        }

        //Show save all button
        if (GUI.Button(new Rect(Screen.width - 71, 36, 70, 35), "Save All"))
        {
            string serializedAnimations = modelAnimator.serializeAnimations();
            modelAnimator.saveAnimations(serializedAnimations);
        }

        //Show undo button, moves NAO back to its last position based on mouse down and up
        if (GUI.Button(new Rect(Screen.width - 141, 0, 70, 35), "Undo"))
        {
            undoMovement();
        }

        //Show undo button, moves NAO back to its last position based on mouse down and up
        if (GUI.Button(new Rect(Screen.width - 141, 36, 70, 35), "Redo"))
        {
            redoMovement();
        }

        //Show fine-tune button, switches to another camera containing the gui to tweak the moves
        if (GUI.Button(new Rect(Screen.width - 70, Screen.height - 35, 70, 35), "Fine-Tune"))
        {
            //populate with movement names
            movementNames = new string[modelAnimator.animations.Count];

            for (int m = 0; m < modelAnimator.animations.Count; ++m)
            {
                movementNames[m] += modelAnimator.animations[m].name;
            }

            //Turn off builder camer, turn on fine-tune camera
            fineTuneCamera.enabled = true;
            builderCamera.enabled  = false;

            isBuilding = false;
        }


        //Show setup window before you begin making the animation
        if (setupAnimation)
        {
            setupWindowRect = GUI.Window(0, setupWindowRect, SetupWindow, "Setup");
        }
        else
        {
            //Show the animation building controls
            animateControlWindowRect = GUI.Window(1, animateControlWindowRect, animationControls, "Controls");
        }
    }
Ejemplo n.º 2
0
 void OnGUI()
 {
     //Show buttons to play created animations
     modelAnimator.AnimationSelectionGUI();
 }