Пример #1
0
        private void SetCriticalFailure(string message)
        {
            ExitChildControls();

            // Cleanup, just in case the critical failure effected task
            // management...
            mContext.AbortAllReqests("Critical failure.");

            mOverrideControl = new FailureControl(message);
            mOverrideControl.Enter(mContext, mDebugContext);
        }
Пример #2
0
        private void SetCriticalFailure(string message)
        {
            ExitChildControls();

            // Cleanup, just in case the critical failure effected task 
            // management...
            mContext.AbortAllReqests("Critical failure.");

            mOverrideControl = new FailureControl(message);
            mOverrideControl.Enter(mContext, mDebugContext);
        }
Пример #3
0
        private void PerformStateTransition()
        {
            mContext.Selection.ClearSelection();

            mSelectedControl = 0;  // Will always change during a transition.

            if (mOverrideControl != null)
            {
                // Always get rid of the override control. A new one
                // will be created as needed.
                mOverrideControl.Exit();
                mOverrideControl = null;
            }

            NavmeshBuild build = mContext.Build;  // Note: Caller already checked for null.
            NavmeshBuildState buildState = build.BuildState;

            // No early exits after this point.

            // Debug.Log("Transition: " + buildState);

            switch (buildState)
            {
                case NavmeshBuildState.Inactive:

                    // Needs first time compile of input data.

                    ExitChildControls();

                    if (SetInputControl(true))
                        mSelectedControl = ControlType.Input;

                    break;

                case NavmeshBuildState.InputCompiled:

                    // Let user update config before preparing the build.

                    SetBuildControl(false);

                    if (SetConfigControl(true) && SetInputControl(true))
                        mSelectedControl = ControlType.Config;

                    break;

                case NavmeshBuildState.NeedsRecovery:

                    ExitChildControls();
                    SetCriticalFailure("Internal error: Unexpected loss of input data.");

                    break;

                case NavmeshBuildState.Buildable:

                    if (SetBuildControl(true)
                        && SetConfigControl(true)
                        && SetInputControl(true))
                    {
                        mSelectedControl = ControlType.Build;
                    }

                    break;

                case NavmeshBuildState.Invalid:

                    ExitChildControls();

                    mOverrideControl = new CoreFailureControl();
                    mOverrideControl.Enter(mContext, mDebugContext);

                    break;

                default:

                    SetCriticalFailure("Internal error. Unhandled build state: " + buildState);
                    break;
            }

            // Note: Don't requery the build.  This is the state that was
            // handled.
            mLastBuildState = buildState;

            mDebugContext.NeedsRepaint = true;
        }
Пример #4
0
        private void PerformStateTransition()
        {
            mContext.Selection.ClearSelection();

            mSelectedControl = 0;  // Will always change during a transition.

            if (mOverrideControl != null)
            {
                // Always get rid of the override control. A new one
                // will be created as needed.
                mOverrideControl.Exit();
                mOverrideControl = null;
            }

            NavmeshBuild      build      = mContext.Build; // Note: Caller already checked for null.
            NavmeshBuildState buildState = build.BuildState;

            // No early exits after this point.

            // Debug.Log("Transition: " + buildState);

            switch (buildState)
            {
            case NavmeshBuildState.Inactive:

                // Needs first time compile of input data.

                ExitChildControls();

                if (SetInputControl(true))
                {
                    mSelectedControl = ControlType.Input;
                }

                break;

            case NavmeshBuildState.InputCompiled:

                // Let user update config before preparing the build.

                SetBuildControl(false);

                if (SetConfigControl(true) && SetInputControl(true))
                {
                    mSelectedControl = ControlType.Config;
                }

                break;

            case NavmeshBuildState.NeedsRecovery:

                ExitChildControls();
                SetCriticalFailure("Internal error: Unexpected loss of input data.");

                break;

            case NavmeshBuildState.Buildable:

                if (SetBuildControl(true) &&
                    SetConfigControl(true) &&
                    SetInputControl(true))
                {
                    mSelectedControl = ControlType.Build;
                }

                break;

            case NavmeshBuildState.Invalid:

                ExitChildControls();

                mOverrideControl = new CoreFailureControl();
                mOverrideControl.Enter(mContext, mDebugContext);

                break;

            default:

                SetCriticalFailure("Internal error. Unhandled build state: " + buildState);
                break;
            }

            // Note: Don't requery the build.  This is the state that was
            // handled.
            mLastBuildState = buildState;

            mDebugContext.NeedsRepaint = true;
        }