コード例 #1
0
ファイル: MiniInputCompile.cs プロジェクト: zhu1987/critterai
        public MiniInputCompile(ControlContext context)
        {
            mContext = context;

            NavmeshBuild build = context.Build;

            if (!build)
            {
                FinalizeOnFail("The control context's build does not exist.", true);
                return;
            }

            InputBuildOption options = InputBuildOption.ThreadSafeOnly;

            options |= (build.AutoCleanGeometry ? InputBuildOption.AutoCleanGeometry : 0);

            mBuilder = InputBuilder.Create(build.SceneQuery
                                           , build.GetInputProcessors()
                                           , options);

            if (mBuilder == null)
            {
                FinalizeOnFail("Could not create input builder.", true);
                return;
            }

            mState = State.Builder;
        }
コード例 #2
0
        public MiniInputCompile(ControlContext context) 
        {
            mContext = context;

            NavmeshBuild build = context.Build;

            if (!build)
            {
                FinalizeOnFail("The control context's build does not exist.", true);
                return;
            }

            InputBuildOption options = InputBuildOption.ThreadSafeOnly;
            options |= (build.AutoCleanGeometry ? InputBuildOption.AutoCleanGeometry : 0);

            mBuilder = InputBuilder.Create(build.SceneQuery
                , build.GetInputProcessors()
                , options);

            if (mBuilder == null)
            {
                FinalizeOnFail("Could not create input builder.", true);
                return;
            }

            mState = State.Builder;
        }
コード例 #3
0
ファイル: ControlUtil.cs プロジェクト: BibleUs/critterai
        public static bool OnGUIStandardButtons(ControlContext context
            , DebugViewContext debugContext
            , bool resetAllowed)
        {
            NavmeshBuild build = context.Build;

            if (!build)
                return false;

            TileBuildData tdata = build.BuildData;

            GUILayout.FlexibleSpace();

            // Note: It is assumed that you should't get any debug display options unless
            // you can reset the build.  So they are inside this condition.
            if (resetAllowed)
            {
                if (build.BuildState == NavmeshBuildState.Buildable || build.HasInputData)
                    // One or more debug display options are allowed.
                    GUILayout.Label("Show");

                // Always call these.
                debugContext.OnGUIMeshDisplayOptions();
                debugContext.OnGUIDebugExtras();

                GUILayout.Space(MarginSize);

                GUIStyle style = (tdata != null && tdata.NeedsBakingCount() == 0)
                    ? ControlUtil.HighlightedButton : GUI.skin.button;

                return OnGUIResetButton(context, debugContext, style);
            }

            return false;
        }
コード例 #4
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                DebugContext.DisableAllViews();
                return(true);
            }

            return(false);
        }
コード例 #5
0
ファイル: FailureControl.cs プロジェクト: BibleUs/critterai
 public override bool Enter(ControlContext context, DebugViewContext debug)
 {
     if (base.Enter(context, debug))
     {
         DebugContext.DisableAllViews();
         return true;
     }
         
     return false;
 }
コード例 #6
0
ファイル: BuildController.cs プロジェクト: BibleUs/critterai
        public BuildController(NavmeshBuild build, BuildTaskProcessor manager)
        {
            if (!build || manager == null)
                throw new System.ArgumentNullException();

            mContext = new ControlContext(build, manager);
            mDebugContext = new DebugViewContext(build, mContext.Selection);

            mInputCon = new InputCompileControl();
            mConfigCon = new NMGenConfigControl();
        }
コード例 #7
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                // Unforgiving.
                Context.Build.ResetBuild();
                return true;
            }

            return false;
        }
コード例 #8
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                // Unforgiving.
                Context.Build.ResetBuild();
                return(true);
            }

            return(false);
        }
コード例 #9
0
 public static bool OnGUIResetButton(ControlContext context, DebugViewContext debug, GUIStyle style)
 {
     if (GUILayout.Button("Exit Build", style))
     {
         context.AbortAllReqests("User requested build reset.");
         context.Build.ResetBuild();  // Abort requests first!
         debug.NeedsRepaint = true;
         return(true);
     }
     GUILayout.Space(MarginSize);
     return(false);
 }
コード例 #10
0
ファイル: BuildController.cs プロジェクト: zhu1987/critterai
        public BuildController(NavmeshBuild build, BuildTaskProcessor manager)
        {
            if (!build || manager == null)
            {
                throw new System.ArgumentNullException();
            }

            mContext      = new ControlContext(build, manager);
            mDebugContext = new DebugViewContext(build, mContext.Selection);

            mInputCon  = new InputCompileControl();
            mConfigCon = new NMGenConfigControl();
        }
コード例 #11
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                NavmeshBuild build = context.Build;

                if (build.TileSetDefinition != null || build.Config.TileSize > 0)
                {
                    Debug.LogError(typeof(SingleTileBuildControl) + ": The build is tiled.", build);
                    return(false);
                }

                return(true);
            }
            return(false);
        }
コード例 #12
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                NavmeshBuild build = context.Build;

                if (build.TileSetDefinition != null || build.Config.TileSize > 0)
                {
                    Debug.LogError(typeof(SingleTileBuildControl) + ": The build is tiled.", build);
                    return false;
                }

                return true;
            }
            return false;
        }
コード例 #13
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                NavmeshBuild build = context.Build;

                if (build.TileSetDefinition == null)
                {
                    Debug.LogError(typeof(MultiTileBuildControl)
                                   + ": Build data has not been initialized, or not a tiled build.");
                    return(false);
                }

                return(true);
            }
            return(false);
        }
コード例 #14
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                NavmeshBuild build = context.Build;

                if (build.TileSetDefinition == null)
                {
                    Debug.LogError(typeof(MultiTileBuildControl) 
                        + ": Build data has not been initialized, or not a tiled build.");
                    return false;
                }

                return true;
            }
            return false;
        }
コード例 #15
0
        public static bool OnGUIStandardButtons(ControlContext context
                                                , DebugViewContext debugContext
                                                , bool resetAllowed)
        {
            NavmeshBuild build = context.Build;

            if (!build)
            {
                return(false);
            }

            TileBuildData tdata = build.BuildData;

            GUILayout.FlexibleSpace();

            // Note: It is assumed that you should't get any debug display options unless
            // you can reset the build.  So they are inside this condition.
            if (resetAllowed)
            {
                if (build.BuildState == NavmeshBuildState.Buildable || build.HasInputData)
                {
                    // One or more debug display options are allowed.
                    GUILayout.Label("Show");
                }

                // Always call these.
                debugContext.OnGUIMeshDisplayOptions();
                debugContext.OnGUIDebugExtras();

                GUILayout.Space(MarginSize);

                GUIStyle style = (tdata != null && tdata.NeedsBakingCount() == 0)
                    ? ControlUtil.HighlightedButton : GUI.skin.button;

                return(OnGUIResetButton(context, debugContext, style));
            }

            return(false);
        }
コード例 #16
0
ファイル: ControlUtil.cs プロジェクト: BibleUs/critterai
 public static bool OnGUIResetButton(ControlContext context, DebugViewContext debug, GUIStyle style)
 {
     if (GUILayout.Button("Exit Build", style))
     {
         context.AbortAllReqests("User requested build reset.");
         context.Build.ResetBuild();  // Abort requests first!
         debug.NeedsRepaint = true;
         return true;
     }
     GUILayout.Space(MarginSize);
     return false;
 }