Exemplo n.º 1
0
        //-----------------------------------------------------------------------------------
        private void PrepareToRestartSimulation()
        {
            SimulationManager.SetBroadcastMode(UN_BROADCAST_MODE.EDITING);

            SimulationManager.EditingBegin();
            SimulationManager.RequestDisplay();

            CarBakeSimulationMenu.CloseIfOpen();
            CarBakeFrameMenu.CloseIfOpen();

            Deinit();
            manager_.PrepareToRestartSimulation();
        }
Exemplo n.º 2
0
        //----------------------------------------------------------------------------------
        private void DrawBakeBar()
        {
            GUIStyle style = new GUIStyle(EditorStyles.miniButton);

            style.alignment = TextAnchor.MiddleLeft;

            EditorGUI.BeginDisabledGroup(player_.IsSimulating);
            if (GUILayout.Button(new GUIContent(" Bake simulation", rec_), style, GUILayout.Width(135f), GUILayout.Height(25f)))
            {
                if (!CarBakeSimulationMenu.IsOpen)
                {
                    CarBakeSimulationMenu bakeSimMenu = ScriptableObject.CreateInstance <CarBakeSimulationMenu>();
                    bakeSimMenu.titleContent = new GUIContent("CaronteFX - Bake Simulation Menu");
                }
                CarBakeSimulationMenu.Instance.ShowUtility();
                CarBakeFrameMenu.CloseIfOpen();
            }

            if (GUILayout.Button(new GUIContent("Bake current frame", rec_), style, GUILayout.Width(135f), GUILayout.Height(25f)))
            {
                if (!CarBakeFrameMenu.IsOpen)
                {
                    CarBakeFrameMenu bakeFrameMenu = ScriptableObject.CreateInstance <CarBakeFrameMenu>();
                    bakeFrameMenu.titleContent = new GUIContent("CaronteFX - Bake Current Frame Menu");
                }
                CarBakeFrameMenu.Instance.ShowUtility();
                CarBakeSimulationMenu.CloseIfOpen();
            }
            EditorGUI.EndDisabledGroup();

            GUILayout.Space(10f);
            if (GUILayout.Button("Change to edit mode", EditorStyles.miniButton, GUILayout.Width(125f), GUILayout.Height(25f)))
            {
                CarPlayerWindow.CloseIfOpen();
            }
            GUILayout.Space(10f);

            DrawProgressBox();
            GUILayout.Space(6f);
        }