示例#1
0
 private void OnGUI()
 {
     if (bootstrap == null)
     {
         if (GameObject.Find("Bootstrap"))
         {
             bootstrap = GameObject.Find("Bootstrap").GetComponent <Bootstrap>();
         }
     }
     if (bootstrap)
     {
         systemsManager = bootstrap.GetSystems();
     }
     if (systemsManager != null)
     {
         if (systemsManager.voxelSystemGroup != null)
         {
             GUILayout.Label("Worlds: " + systemsManager.voxelSystemGroup.worldSpawnSystem.worlds.Count);
             if (systemsManager.voxelSystemGroup.worldSpawnSystem.worlds.Count > 0)
             {
                 // now get map for this
                 // add to UI
                 GUILayout.Label("Chunks: " + systemsManager.voxelSystemGroup.chunkSpawnSystem.chunks.Count);
             }
         }
         else
         {
             GUILayout.Label("systemsManager.voxelSystemGroup is null.");
         }
     }
     else
     {
         GUILayout.Label("Systems Manager is null.");
     }
 }
示例#2
0
 private void OnGUI()
 {
     if (bootstrap == null)
     {
         if (GameObject.Find("Bootstrap"))
         {
             bootstrap = GameObject.Find("Bootstrap").GetComponent <Bootstrap>();
         }
     }
     if (bootstrap)
     {
         systemsManager = bootstrap.GetSystems();
     }
     if (systemsManager != null)
     {
         /*if (systemsManager.characterSpawnSystem != null)
          * {
          *  GUILayout.Label("Characters: " + systemsManager.characterSpawnSystem.characters.Count);
          * }
          * else
          * {
          *  GUILayout.Label("systemsManager.characterSpawnSystem is null.");
          * }*/
     }
     else
     {
         GUILayout.Label("Systems Manager is null.");
     }
 }
示例#3
0
        public void OnGUI()
        {
            if (booty.GetSystems() == null)
            {
                GUI.color = uiColor;
                GUILayout.Label("SystemsManager is null.");
            }
            GUI.color = uiColor2;
            GUILayout.Label(GetFPSText());
            GUI.color = uiColor;
            if (debugGUIType == 1)
            {
                GUILayout.Label("Game [" + ((GameState)(booty.EntityManager.GetComponentData <Game>(booty.game).state)) + "]");
                GUILayout.Label("   > [" + ((GameState)(booty.EntityManager.GetComponentData <Game>(booty.game).newState)) + "]");
                GUILayout.Label("Worlds " + booty.GetSystems().voxelSystemGroup.worldSpawnSystem.worlds.Count);
                GUILayout.Label("Chunks " + booty.GetSystems().voxelSystemGroup.chunkSpawnSystem.chunks.Count);
                //GUILayout.Label("ChunkRenders " + booty.GetSystems().voxelSystemGroup.chunkRenderSystem.chunkRenders.Count);

                GUILayout.Label(" - ");
                GUILayout.Label("Controllers " + booty.GetSystems().playerSystemGroup.playerSpawnSystem.controllers.Count);
                GUILayout.Label("Characters " + booty.GetSystems().characterSystemGroup.characterSpawnSystem.characters.Count);
                GUILayout.Label("- Temp -");
                GUILayout.Label("Bullets " + booty.GetSystems().bulletSystemGroup.bulletSpawnSystem.bullets.Count);
                GUILayout.Label("Popups " + booty.GetSystems().uiSystemGroup.damagePopupSystem.popups.Count);
                GUILayout.Label("Popups " + booty.GetSystems().itemSystemGroup.itemSpawnSystem.items.Count);

                GUILayout.Label("Player Stuff");
                GUILayout.Label("InventoryUIs " + booty.GetSystems().uiSystemGroup.inventoryUISpawnSystem.uis.Count);
                // old stuff
                GUILayout.Label(" - ");
                GUILayout.Label("Turrets " + TurretSpawnerSystem.turrets.Count);
                GUILayout.Label("StatBars " + StatbarSystem.frontBars.Count);
                //GUILayout.Label("Cameras " + CameraSystem.cameras.Count);
            }
            if (debugGUIType == 2)
            {
                GUILayout.Label("Debugging Data [" + booty.data.name + "]");
                GUILayout.Label("Maps " + booty.data.maps.Count);
                GUILayout.Label("Waves " + booty.data.waves.Count);
                GUILayout.Label("Cameras " + booty.data.cameras.Count);
                GUILayout.Label("Characters " + booty.data.characters.Count);
                GUILayout.Label("Turrets " + booty.data.turrets.Count);
                GUILayout.Label("Bullets " + booty.data.bullets.Count);

                GUILayout.Label("Stats " + booty.data.stats.Count);
                GUILayout.Label("Skills " + booty.data.skills.Count);
                GUILayout.Label("Items " + booty.data.items.Count);
                GUILayout.Label("Quests " + 0);// data.quests.Count);
                GUILayout.Label("Dialogues " + booty.data.dialogues.Count);
            }
            if (debugGUIType == 3)
            {
                foreach (var player in booty.GetSystems().playerSystemGroup.playerSpawnSystem.controllers.Values)
                {
                    ShowPlayerUI(player);
                }
                /**/
            }
            if (debugGUIType == 4)
            {
                DebugAIStates();
            }
            //ShowFPS();
        }

        private void ShowPlayerUI(Entity playerCharacterEntity)
        {
            GUILayout.Label("Debugging Player [" + playerCharacterEntity.Index + "]");
            Translation positioner = booty.GetSystems().space.EntityManager.GetComponentData <Translation>(playerCharacterEntity);

            GUILayout.Label("Player at: " + positioner.Value.ToString());
            Targeter targeter = booty.EntityManager.GetComponentData <Targeter>(playerCharacterEntity);

            if (targeter.hasTarget == 0)
            {
                GUILayout.Label("Has no target.");
            }
            else
            {
                GUILayout.Label("Target: " + targeter.nearbyCharacter.character.Index);
            }
            Stats stats = booty.GetSystems().space.EntityManager.GetComponentData <Stats>(playerCharacterEntity);

            GUILayout.Label("Player Attributes Applied: " + stats.attributesApplied.ToString());
            if (stats.stats.Length > 0)
            {
                GUILayout.Label("Level [" + stats.stats[0].value + "]");
            }
            else
            {
                GUILayout.Label("Level [null]");
            }
            if (stats.stats.Length > 1)
            {
                GUILayout.Label("Stat Points [" + stats.stats[1].value + "]");
            }
            else
            {
                GUILayout.Label("Stat Points [null]");
            }
            GUILayout.Label("Health [" + stats.states[0].value + " out of " + stats.states[0].maxValue + "]");
            if (stats.regens.Length > 0)
            {
                GUILayout.Label("HealthRegen [" + stats.regens[0].value + " at rate of " + stats.regens[0].rate + "]");
            }
            else
            {
                GUILayout.Label("HealthRegen [null]");
            }
            if (stats.attributes.Length > 0)
            {
                GUILayout.Label("Strength [" + stats.attributes[0].value + " at rate of " + stats.attributes[0].multiplier
                                + " and bonus value of: " + +stats.attributes[0].previousAdded + "] Added to health.");
            }
            else
            {
                GUILayout.Label("Strength [null]");
            }


            Skills skills = booty.GetSystems().space.EntityManager.GetComponentData <Skills>(playerCharacterEntity);

            GUILayout.Label("Skill Selected [" + skills.selectedSkillIndex + "]");
            EntityManager manager   = booty.GetSystems().space.EntityManager;
            Inventory     inventory = manager.GetComponentData <Inventory>(playerCharacterEntity);

            GUILayout.Label("Displaying Items for unnamed character with max items of [" + inventory.items.Length + "].");

            /*for (int i = 0; i < inventory.items.Length; i++)
             * {
             *  if (inventory.items[i].metaID == 0)
             *  {
             *      //GUILayout.Label("Item [" + i + "] is " + item.name + " x" + inventory.items[i].quantity);
             *  }
             *  else
             *  {
             *      //ItemDatam item = booty.GetSystems().itemSpawnSystem.meta[inventory.items[i].metaID];
             *      //GUILayout.Label("Item [" + i + "] is " + item.name + " x" + inventory.items[i].quantity);
             *  }
             * }*/
        }