Class mostly used to debug onmobile phone. It prints things on screen.
Inheritance: MonoBehaviour
Ejemplo n.º 1
0
        public static void CreateMenu(int order)
        {
            var menu = new DebugMenu("Profiling", order);

            new DebugMenuToggle(menu, "Show FPS", () => ShowFpsHud, val => ShowFpsHud = val);
            new DebugMenuToggle(menu, "Show Min/Max FPS", () => ShowFpsMinMax, val => ShowFpsMinMax = val);
        }
Ejemplo n.º 2
0
        public GameState(GameInstance game, GraphicsDevice graphicsDevice, ContentManager content) : base(game, graphicsDevice, content)
        {
            _gameContent = new GameContent(content);
            LoadMaps();
            Console.WriteLine(LINE);
            if (_maps.Equals(null) || _maps.Count.Equals(0))
            {
                Console.WriteLine("No maps found, generating maps...");
                GenerateMaps();
                Console.WriteLine(LINE);
                LoadMaps();
                Console.WriteLine(LINE);
            }

            _currentMapIndex = _rndGen.Next(0, _maps.Count - 1);
            _currentMap      = _maps[_currentMapIndex];
            Console.WriteLine($"Loading map: {_currentMapIndex + 1}");

            _camera      = new Camera(graphicsDevice);
            _camera.Zoom = 1.5f;

            LoadPlayer();

            _debugMenu = new DebugMenu(graphicsDevice, _gameContent)
            {
                GameState = this
            };
        }
Ejemplo n.º 3
0
        public bool AddMemory(MemoryInstance memory)
        {
            MemoryInstance recentMemory = isRecentMemory(memory);

            if (recentMemory != null)
            {
                recentMemory.AddIteration();
                //Debug.LogWarning("Iterating memory");
                return(true);
            }
            if (currentMemoryIndex + 1 == shortTermMemory.Length)
            {
                currentMemoryIndex = 0;
            }
            if (currentMemoryIndex < shortTermMemory.Length)
            {
                shortTermMemory[currentMemoryIndex] = memory;
                currentMemoryIndex++;
                if (World.ISDEBUGSCENE)
                {
                    StringBuilder builder = new StringBuilder("I will remember I ");
                    if (memory.invertVerb)
                    {
                        builder.Append(" NOT ");
                    }
                    builder.Append(memory.verb);
                    builder.Append(" " + memory.subject.GetThing().thingName);
                    //Debug.LogWarning(builder.ToString());
                    DebugMenu.AppendLine(builder.ToString());
                }
                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
        private static void DebugDraw()
        {
            if (DebugMenu.GetBoolean("debug.checkBattlerites"))
            {
                var pos = new Vector2(150f, 100f);
                Drawing.DrawString(pos, "Tenacious Demon: " + HasTenaciousDemon, UnityEngine.Color.cyan, ViewSpace.ScreenSpacePixels);
                var pos2 = new Vector2(150f, 120f);
                Drawing.DrawString(pos2, "Nether Blade: " + HasNetherBlade, UnityEngine.Color.cyan, ViewSpace.ScreenSpacePixels);
            }

            if (DebugMenu.GetBoolean("debug.trueERange"))
            {
                var pos = new Vector2(150f, 140f);
                Drawing.DrawString(pos, "True E Range: " + TrueERange, UnityEngine.Color.yellow, ViewSpace.ScreenSpacePixels);
            }

            if (DebugMenu.GetBoolean("debug.ultiStatus"))
            {
                var pos = new Vector2(150f, 160f);
                Drawing.DrawString(pos, "Ulti mode: " + IsInUltimate, UnityEngine.Color.cyan, ViewSpace.ScreenSpacePixels);
            }

            if (DebugMenu.GetBoolean("debug.isCasting"))
            {
                var pos          = new Vector2(150f, 180f);
                var isCasting    = KaanHero.AbilitySystem.IsCasting;
                var isChanneling = KaanHero.IsChanneling;
                Drawing.DrawString(pos, "Is Casting: " + isCasting + " - Is Channeling: " + isChanneling, UnityEngine.Color.yellow, ViewSpace.ScreenSpacePixels);
            }
        }
Ejemplo n.º 5
0
 static Config()
 {
     smiterMenu = EloBuddy.SDK.Menu.MainMenu.AddMenu(MenuName, MenuName.ToLower());
     smiterMenu.AddGroupLabel("Welcome to VodkaGaren");
     smiterMenu.AddLabel("Created by Haker");
     smiterMenu.AddLabel("Feel free to send me any suggestions you might have.");
     smiterMenu.AddGroupLabel("Smite Status");
     _smiteEnabled       = smiterMenu.Add("vSmiteEnabled", new CheckBox("Enabled always"));
     _smiteEnabledToggle = smiterMenu.Add("vSmiteEnabledToggle", new KeyBind("Enabled (Toggle Key)", false, KeyBind.BindTypes.PressToggle, 'K'));
     _smiteEnemies       = smiterMenu.Add("vSmiteEnemies", new CheckBox("KS enemies with Smite"));
     smiterMenu.AddGroupLabel("Monsters to smite");
     smiterMenu.AddLabel("Select monsters you want to smite");
     smiterMenu.Add("vSmiteSRU_Baron", new CheckBox("Baron"));
     smiterMenu.Add("vSmiteSRU_Dragon", new CheckBox("Dragon"));
     smiterMenu.Add("vSmiteSRU_Red", new CheckBox("Red"));
     smiterMenu.Add("vSmiteSRU_Blue", new CheckBox("Blue"));
     smiterMenu.Add("vSmiteSRU_Gromp", new CheckBox("Gromp"));
     smiterMenu.Add("vSmiteSRU_Murkwolf", new CheckBox("Murkwolf"));
     smiterMenu.Add("vSmiteSRU_Krug", new CheckBox("Krug"));
     smiterMenu.Add("vSmiteSRU_Razorbeak", new CheckBox("Razorbeak"));
     smiterMenu.Add("vSmiteSru_Crab", new CheckBox("Crab"));
     smiterMenu.Add("vSmiteSRU_RiftHerald", new CheckBox("Rift Herald", false));
     smiterMenu.AddGroupLabel("Drawing");
     _drawSmiteStatus = smiterMenu.Add("vSmiteDrawSmiteStatus", new CheckBox("Draw Smite Status"));
     _drawSmiteable   = smiterMenu.Add("vSmiteDrawSmiteable", new CheckBox("Draw Smiteable Monsters"));
     _drawRange       = smiterMenu.Add("vSmiteDrawRange", new CheckBox("Draw Smite Range"));
     DebugMenu.Initialize();
 }
Ejemplo n.º 6
0
    protected override void RunItems(DebugMenu caller)
    {
        if (Button("Platformers ... "))
        {
            caller.NavigationStack.Push(new LoadLevelFromListDebugPage("Platformers", Commons.RoomGenerator.RoomParameterBuilder.Rooms.PlatformingRooms));
        }

        if (Button("Puzzles ... "))
        {
            caller.NavigationStack.Push(new LoadLevelFromListDebugPage("Puzzles", Commons.RoomGenerator.RoomParameterBuilder.Rooms.PuzzleRooms));
        }

        if (Button("Eradications ... "))
        {
            caller.NavigationStack.Push(new LoadLevelFromListDebugPage("Eradications", Commons.RoomGenerator.RoomParameterBuilder.Rooms.EradicationRooms));
        }

        if (Button("Shops ... "))
        {
            caller.NavigationStack.Push(new LoadLevelFromListDebugPage("Shops", Commons.RoomGenerator.RoomParameterBuilder.Rooms.ShopRooms));
        }

        if (Button("Respite ... "))
        {
            caller.NavigationStack.Push(new LoadLevelFromListDebugPage("Respite", Commons.RoomGenerator.RoomParameterBuilder.Rooms.RespiteRooms));
        }

        if (Button("Openings ... "))
        {
            caller.NavigationStack.Push(new LoadLevelFromListDebugPage("Openings", Commons.RoomGenerator.RoomParameterBuilder.Rooms.StartingRooms));
        }
    }
Ejemplo n.º 7
0
 protected override void RunItems(DebugMenu caller)
 {
     ReadOnly("-- D E V E L O P E D   B Y --");
     ReadOnly("KASPER RAMSKJELL");
     ReadOnly("Player Movement System Developer");
     ReadOnly("Room Generation System Developer");
     ReadOnly("Weapon System Developer");
     ReadOnly("Hitbox/Hurtbox System Developer");
     ReadOnly("Level Designer");
     ReadOnly("Tileset, Items, Weapon and HUD artist");
     ReadOnly("Soundtrack composer");
     Separator();
     ReadOnly("TORMOD KVITBERG");
     ReadOnly("Enemy Programming");
     ReadOnly("Weapon Designer");
     ReadOnly("Audio System Developer");
     ReadOnly("HUD Programmer");
     ReadOnly("Level Designer");
     ReadOnly("Website Builder");
     Separator();
     ReadOnly("MAIJA ULEBERG");
     ReadOnly("Player, Enemy and Background artist");
     Separator();
     ReadOnly("FREDRIK HAUGEN");
     ReadOnly("Early feedback and insight");
     Separator();
     ReadOnly("-- S P E C I A L   T H A N K S --");
     ReadOnly("OUR PLAYTESTERS");
     ReadOnly("Eivind Kvitberg");
     ReadOnly("Fredrik Ramskjell");
     ReadOnly("Fredrik Haugen");
     ReadOnly("Maija U.");
     ReadOnly("AND YOU!");
 }
Ejemplo n.º 8
0
    protected override void RunItems(DebugMenu caller)
    {
        ReadOnly("- Grounded -");
        //Cycle ground enemies
        foreach (var i in Commons.RoomGenerator.RoomParameterBuilder.GroundEnemies.OrderBy(i => i.Enemy.name))
        {
            //Spawn enemy if button is pressed
            if (Button(i.Enemy.name))
            {
                Commons.InstantiateInCurrentLevel(i.Enemy, CommonExtensions.GetPlayer().transform.position + Vector3.right * 2f);
            }
        }

        Separator();

        ReadOnly("- Flying -");
        //Cycle ground enemies
        foreach (var i in Commons.RoomGenerator.RoomParameterBuilder.AirEnemies.OrderBy(i => i.Enemy.name))
        {
            //Spawn enemy if button is pressed
            if (Button(i.Enemy.name))
            {
                Commons.InstantiateInCurrentLevel(i.Enemy, CommonExtensions.GetPlayer().transform.position + Vector3.right * 2f);
            }
        }
    }
Ejemplo n.º 9
0
 static Config()
 {
     smiterMenu = EloBuddy.SDK.Menu.MainMenu.AddMenu(MenuName, MenuName.ToLower());
     smiterMenu.AddGroupLabel("Welcome to Smite");
     smiterMenu.AddLabel("Created by Haker");
     smiterMenu.AddLabel("Feel free to send me any suggestions you might have.");
     smiterMenu.AddGroupLabel("Smite Status");
     _smiteEnabled            = smiterMenu.Add("vSmiteEnabled", new CheckBox("Enabled always"));
     _smiteEnabledToggle      = smiterMenu.Add("vSmiteEnabledToggle", new KeyBind("Enabled (Toggle Key)", false, KeyBind.BindTypes.PressToggle, 'K'));
     _smiteEnemies            = smiterMenu.Add("vSmiteEnemies", new CheckBox("KS with Smite"));
     _smiteEnemiesChallenging = smiterMenu.Add("vSmiteEnemiesChallenging", new CheckBox("Smite enemies with Challenging Smite on AA"));
     _keepSmiteNumber         = smiterMenu.Add("vSmiteKeepSmiteNumber",
                                               new Slider("Smite enemies only if you have more than {0} charges", 1, 0, 2));
     smiterMenu.AddGroupLabel("Monsters to smite");
     smiterMenu.AddLabel("Select monsters you want to smite");
     smiterMenu.Add("vSmiteSRU_Baron", new CheckBox("Baron Nashor"));
     smiterMenu.Add("vSmiteSRU_Dragon_Elder", new CheckBox("Elder Dragon"));
     smiterMenu.Add("vSmiteSRU_Dragon_Air", new CheckBox("Air Dragon"));
     smiterMenu.Add("vSmiteSRU_Dragon_Earth", new CheckBox("Fire Dragon"));
     smiterMenu.Add("vSmiteSRU_Dragon_Fire", new CheckBox("Earth Dragon"));
     smiterMenu.Add("vSmiteSRU_Dragon_Water", new CheckBox("Water Dragon"));
     smiterMenu.Add("vSmiteSRU_Red", new CheckBox("Red"));
     smiterMenu.Add("vSmiteSRU_Blue", new CheckBox("Blue"));
     smiterMenu.Add("vSmiteSRU_Gromp", new CheckBox("Gromp"));
     smiterMenu.Add("vSmiteSRU_Murkwolf", new CheckBox("Murkwolf"));
     smiterMenu.Add("vSmiteSRU_Krug", new CheckBox("Krug"));
     smiterMenu.Add("vSmiteSRU_Razorbeak", new CheckBox("Razorbeak"));
     smiterMenu.Add("vSmiteSru_Crab", new CheckBox("Crab"));
     smiterMenu.Add("vSmiteSRU_RiftHerald", new CheckBox("Rift Herald"));
     smiterMenu.AddGroupLabel("Drawing");
     _drawSmiteStatus = smiterMenu.Add("vSmiteDrawSmiteStatus", new CheckBox("Draw Smite Status"));
     _drawSmiteable   = smiterMenu.Add("vSmiteDrawSmiteable", new CheckBox("Draw Smiteable Monsters"));
     _drawRange       = smiterMenu.Add("vSmiteDrawRange", new CheckBox("Draw Smite Range"));
     DebugMenu.Initialize();
 }
Ejemplo n.º 10
0
    protected override void RunItems(DebugMenu caller)
    {
        if (Button("Levels and Health ..."))
        {
            caller.NavigationStack.Push(new LevelsDebugPage());
        }

        if (Button("Give Weapon ..."))
        {
            caller.NavigationStack.Push(new GiveWeaponDebugPage());
        }

        if (Button("Give Powerup ..."))
        {
            caller.NavigationStack.Push(new GivePowerUpDebugPage());
        }

        Separator();

        if (Button("Give $$$"))
        {
            Commons.Inventory.Currency += 50;
        }

        if (Button("Give General Key"))
        {
            Commons.Inventory.GeneralKeys++;
        }

        if (Button("Give Puzzle Key"))
        {
            Commons.Inventory.PuzzleKeys++;
        }
    }
Ejemplo n.º 11
0
        protected override void Draw(GameTime gameTime)
        {
            Profiler.Start("Game Draw");
            GraphicsDevice.SetRenderTarget(null);
            GraphicsDevice.Viewport = Viewport;
            GraphicsDevice.Clear(Color.CornflowerBlue);
            Scene?.Draw(_spriteBatch, gameTime);
            Profiler.Stop("Game Draw");
            _spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, null);
            string  text     = string.Format("FPS: {0}", Math.Floor(1 / gameTime.ElapsedGameTime.TotalSeconds));
            Vector2 textSize = Font.MeasureString(text);

            _spriteBatch.DrawString(Font, text, new Vector2((Viewport.Width - textSize.X - 3), 5), Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 1);
            _spriteBatch.DrawString(Font, text, new Vector2((Viewport.Width - textSize.X - 4), 4), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
//#if DEBUG
//            text = string.Format("Game\n  Draw Count: {0}\n  Texture Count: {1}\n  Sprite Count: {2}\n  Primitive Count: {3}\n  Target Count: {4}\n\nWorld Bake\n  Draw Count: {5}\n  Texture Count: {6}\n  Sprite Count: {7}\n  Primitive Count: {8}\n  Target Count: {9}", GraphicsDevice.Metrics.DrawCount, GraphicsDevice.Metrics.TextureCount, GraphicsDevice.Metrics.SpriteCount, GraphicsDevice.Metrics.PrimitiveCount, GraphicsDevice.Metrics.TargetCount, WorldBakeDrawCount, WorldBakeTextureCount, WorldBakeSpriteCount, WorldBakePrimitiveCount, WorldBakeTargetCount);
//            _spriteBatch.DrawString(Font, text, new Vector2(5, 5), Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 1);
//            _spriteBatch.DrawString(Font, text, new Vector2(4, 4), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
//#endif
            _spriteBatch.End();
            if (DebugMenu.Groups["D2D"].Items["Profiler"].SelectedOption?.Text == "On")
            {
                Profiler.Draw(_spriteBatch, Font, Viewport.Width, Viewport.Height);
            }
            if (DebugDraw)
            {
                _spriteBatch.Begin();
                DebugMenu.Draw(_spriteBatch, Font, new Vector2(8), 200);
                _spriteBatch.End();
            }
            base.Draw(gameTime);
        }
Ejemplo n.º 12
0
    //! pageを開く
    public void OpenPage(DebugMenu page)
    {
        SetVisiblePageOverEqual(page.NestLevel_);

        // 自分を表示する
        page.ScrollView_.gameObject.SetActive(true);
    }
Ejemplo n.º 13
0
        public override bool Run()
        {
            try
            {
                List <InteractionObjectPair> interactions = DebugMenu.GetInteractions(Actor, Target, Hit);
                if (interactions == null)
                {
                    return(false);
                }

                for (int i = interactions.Count - 1; i >= 0; i--)
                {
                    if (!DebugEnabler.Settings.mInteractions.ContainsKey(interactions[i].InteractionDefinition.GetType()))
                    {
                        interactions.RemoveAt(i);
                    }
                }

                if (interactions.Count == 0)
                {
                    Common.Notify(Common.Localize("HotKeys:Failure"));
                    return(true);
                }

                InteractionDefinitionOptionList.Perform(Actor, Hit, interactions);
                return(true);
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
    public void Initialize(DebugMenu menu, byte id, string categoryName)
    {
        _menu = menu;
        _ID   = id;

        textElement.text = categoryName;
    }
Ejemplo n.º 15
0
    protected override void RunItems(DebugMenu caller)
    {
        //Cycle each room effect
        foreach (RoomEffects i in typeof(RoomEffects).GetEnumValues())
        {
            //... except None
            if (i == RoomEffects.None)
            {
                continue;
            }

            //Create a toggle for the effect
            if (Toggle(i.ToString(), Commons.CurrentRoomEffects.HasFlag(i)))
            {
                //If the effect is active, disable it
                if (Commons.CurrentRoomEffects.HasFlag(i))
                {
                    Commons.RoomGenerator.CurrentRoomConfig.Effect &= ~i;
                }

                //If the effect is inactive, enable it
                else if (!Commons.CurrentRoomEffects.HasFlag(i))
                {
                    Commons.RoomGenerator.CurrentRoomConfig.Effect |= i;
                }

                //Reinitialize room effects
                Commons.RoomEffectController.OnRoomStart(Commons.RoomGenerator.CurrentRoomConfig);
            }
        }
    }
Ejemplo n.º 16
0
 public bool AddThingToInventory(Thing thing)
 {
     if (!DEBUGSCENE)
     {
         DebugMenu.AppendDebugLine(thingName + " has picked up " + thing.thingName, this);
     }
     return(inventory.addThing(thing));
 }
Ejemplo n.º 17
0
 private static void DebugUpdate()
 {
     if (DebugMenu.GetBoolean("debug.updateBattlerites"))
     {
         GetBattlerites();
         DebugMenu.SetBoolean("debug.updateBattlerites", false);
     }
 }
    private void Start()
    {
        variables = DebugMenu.Instance;

        setFields();

        this.enabled = false;
    }
    public override void OnInspectorGUI()
    {
        DebugMenu debugMenu = (DebugMenu)target;

        if (GUILayout.Button("Build Oil Extractor"))
        {
            debugMenu.BuildOilExtractor();
        }
        if (GUILayout.Button("Setup Miami Route"))
        {
            debugMenu.SetupTradeRoute("Miami");
        }
        if (GUILayout.Button("Setup Tampa Route"))
        {
            debugMenu.SetupTradeRoute("Tampa");
        }
        if (GUILayout.Button("Setup Pensacola Route"))
        {
            debugMenu.SetupTradeRoute("Pensacola");
        }
        if (GUILayout.Button("Setup New Orleans Route"))
        {
            debugMenu.SetupTradeRoute("New Orleans");
        }
        if (GUILayout.Button("Setup Houston Route"))
        {
            debugMenu.SetupTradeRoute("Houston");
        }
        if (GUILayout.Button("Setup Matamoros Route"))
        {
            debugMenu.SetupTradeRoute("Matamoros");
        }
        if (GUILayout.Button("Setup Heroica Veracruz Route"))
        {
            debugMenu.SetupTradeRoute("Heroica Veracruz");
        }
        if (GUILayout.Button("Setup Merida Route"))
        {
            debugMenu.SetupTradeRoute("Merida");
        }
        oilSlickLevel = (OilSlickLevel)EditorGUILayout.EnumPopup("Oil Slick Level to Unlock:", oilSlickLevel);
        if (GUILayout.Button("Unlock"))
        {
            debugMenu.UnlockOilSlickLevel(oilSlickLevel);
        }
        if (GUILayout.Button("Trigger End Game"))
        {
            debugMenu.TriggerEndGame();
        }
        if (GUILayout.Button("Trigger Game Win"))
        {
            debugMenu.TriggerGameWin();
        }
        if (GUILayout.Button("Trigger Game Lose"))
        {
            debugMenu.TriggerGameLose();
        }
    }
Ejemplo n.º 20
0
    // Use this for initialization
    void Awake()
    {
        rb = GetComponent <Rigidbody2D>();

        steeringWheel = GameObject.Find("SteeringWheel");

        debug        = GameObject.Find("DebugCanvas").GetComponent <DebugMenu>();
        currentState = new RollingState();
    }
Ejemplo n.º 21
0
 private void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
         SceneManager.sceneLoaded   -= OnSceneLoad;
         SceneManager.sceneUnloaded -= OnSceneUnloaded;
     }
 }
Ejemplo n.º 22
0
    //----------------------------------------------以下DebugMenuからの登録用------------------------------------------//
    //! pageを登録する
    public void RegisterPage(DebugMenu menu)
    {
        var level = menu.NestLevel_;
        if (PageTable_.ContainsKey(level) == false)
            PageTable_.Add(level, new HashSet<RectTransform>());

        PageTable_[level].Add(menu.ScrollView_);
        menu.ScrollView_.transform.SetParent(transform, false);
    }
Ejemplo n.º 23
0
 // Use this for initialization
 public void Init(string a_Name, DebugMenu a_DebugMenu, DebugButtonType a_DebugButtonType, Method a_Method)
 {
     m_Name            = a_Name;
     m_ButtonText.text = a_Name;
     m_DebugMenu       = a_DebugMenu;
     m_DebugbuttonType = a_DebugButtonType;
     m_Method          = a_Method;
     m_ReferenceToButton.onClick.AddListener(() => m_Method());
 }
Ejemplo n.º 24
0
    private void OnEnable()
    {
        debugMenu = GameObject.Find("Game Manager").GetComponent <DebugMenu>();
        animator  = GetComponent <Animator>();

        UpdateStep();

        DebugMenu.OnStepChange += UpdateStep;
    }
Ejemplo n.º 25
0
    /// <summary>
    /// Runs the debug page and returns the associated strings to draw
    /// </summary>
    /// <param name="caller"></param>
    /// <param name="click"></param>
    /// <returns></returns>
    public List <string> Run(DebugMenu caller, bool click)
    {
        _currentRunOutput   = new List <string>();
        _currentRunIndex    = -1;
        _currentRunClicking = click;

        RunItems(caller);

        return(_currentRunOutput);
    }
Ejemplo n.º 26
0
 static Config()
 {
     Menu = MainMenu.AddMenu(MenuName, MenuName.ToLower());
     Menu.AddGroupLabel("DrGaren");
     Menu.AddLabel("Doctor");
     Menu.AddLabel("Good Luck.");
     ModesMenu.Initialize();
     MiscMenu.Initialize();
     DrawingMenu.Initialize();
     DebugMenu.Initialize();
 }
Ejemplo n.º 27
0
 public Debugger(
     IPathfinder pathfinder,
     IMainMenu menu,
     IAbilityManager abilityManager,
     IActionManager actionManager)
 {
     this.pathfinder     = (Pathfinder)pathfinder;
     this.settings       = menu.Debug;
     this.abilityManager = abilityManager;
     this.actionManager  = actionManager;
 }
Ejemplo n.º 28
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 29
0
 static Config()
 {
     Menu = MainMenu.AddMenu(MenuName, MenuName.ToLower());
     Menu.AddGroupLabel("Welcome to VodkaGaren");
     Menu.AddLabel("Created by Haker");
     Menu.AddLabel("Feel free to send me any suggestions you might have.");
     ModesMenu.Initialize();
     MiscMenu.Initialize();
     DrawingMenu.Initialize();
     DebugMenu.Initialize();
 }
Ejemplo n.º 30
0
 protected override void RunItems(DebugMenu caller)
 {
     //Cycle each weapon of the current parameter builder
     foreach (WeaponTemplate i in Commons.RoomGenerator.RoomParameterBuilder.WeaponTemplates)
     {
         if (Button(i.name))
         {
             //If a weapon is selected, give that weapon to the player
             Commons.Inventory.WeaponSlots[Commons.Inventory.SelectedWeaponSlot] = i.CreateWeaponInstance();
         }
     }
 }
Ejemplo n.º 31
0
 void Awake()
 {
     if (_Instance == null)
     {
         _Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 32
0
 static Config()
 {
     Menu = MainMenu.AddMenu(MenuName, MenuName.ToLower());
     Menu.AddGroupLabel("Doctor XinZhao");
     Menu.AddLabel("Halo!");
     Menu.AddLabel("Good Luck.");
     ModesMenu.Initialize();
     ManaManagerMenu.Initialize();
     MiscMenu.Initialize();
     DrawingMenu.Initialize();
     DebugMenu.Initialize();
 }
Ejemplo n.º 33
0
 public DebugMenu()
     : base()
 {
     Instance = this;
 }
Ejemplo n.º 34
0
    // SetupDebugMenu
    public static void SetupDebugMenu( SpriteBatch spriteBatch )
    {
        if ( spriteBatch == null )
            spriteBatch = new SpriteBatch( Game.GraphicsDevice );

        Texture2D texture = Content.Load< Texture2D >( "Debug\\Debug_Menu" );
        SpriteFont font = Content.Load< SpriteFont >( "Debug\\Debug_Font" );

        DebugMenu = new DebugMenu( spriteBatch, texture, font );
    }
Ejemplo n.º 35
0
 public void InitAsMenu(string name, Action func, DebugMenu parent)
 {
     Init(name, func, parent);
     var pageTag = transform.FindChild("PageTag");
     pageTag.gameObject.SetActive(false);
 }
Ejemplo n.º 36
0
 void Init(string name, Action func, DebugMenu parent)
 {
     Name_     = name;
     Function_ = func;
     Parent_   = parent;
     NestLevel_ = Parent_ != null ? Parent_.NestLevel_ + 1 : 0;
 }
Ejemplo n.º 37
0
    public void InitAsPage(string name, DebugViewer viewer, DebugMenu parent)
    {
        Init(name, OpenPage, parent);

        viewer_ = viewer;

        // スクロールビューの生成
        ScrollView_ = Instantiate(viewer_.ScrollViewPrefab) as RectTransform;
        ScrollView_.gameObject.SetActive(false);

        // 位置の設定
        ScrollView_.localPosition = new Vector3(NestLevel_ * ScrollView_.rect.width + ScrollView_.localPosition.x, 0);

        // 最初にviewrに登録しておく
        {
            viewer_.RegisterPage(this);
        }

        // 動的にスクロールページを生成する必要があるかもしれないので
        // メニューのリストを保持しておく
        {
            menuList_ = new List<Menu>();
        }
    }
Ejemplo n.º 38
0
    void Awake()
    {
        PageTable_ = new Dictionary<int, HashSet<RectTransform>>();
        root_ = Instantiate(NodePrefab) as DebugMenu;
        root_.InitAsPage("root", this, null);
        root_.gameObject.SetActive(false);          //rootはボタンを押すわけではないのでfalseにしておく
        root_.transform.SetParent(transform, false);

        InitPages();
    }