Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                DebugContext.DisableAllViews();
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
 public override bool Enter(ControlContext context, DebugViewContext debug)
 {
     if (base.Enter(context, debug))
     {
         DebugContext.DisableAllViews();
         return true;
     }
         
     return false;
 }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                // Unforgiving.
                Context.Build.ResetBuild();
                return true;
            }

            return false;
        }
Exemplo n.º 6
0
        public override bool Enter(ControlContext context, DebugViewContext debug)
        {
            if (base.Enter(context, debug))
            {
                // Unforgiving.
                Context.Build.ResetBuild();
                return(true);
            }

            return(false);
        }
Exemplo n.º 7
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);
 }
Exemplo n.º 8
0
        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();
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
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;
        }
Exemplo n.º 11
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);
        }
Exemplo n.º 12
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;
        }
Exemplo n.º 13
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);
        }
Exemplo n.º 14
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;
 }