Exemple #1
0
        public override void OnInspectorGUI()
        {
            var target = this.target as ME.ECS.Debug.EntityDebugComponent;

            if (target.world != null && target.world.isActive == true)
            {
                var currentEntity = GUILayoutExt.DrawEntitySelection(target.world, in target.entity, checkAlive: true, drawSelectButton: false);
                if (currentEntity.IsAlive() == true)
                {
                    if (EntityDebugComponentEditor.worldEditors.TryGetValue(target.world, out var worldEditor) == false)
                    {
                        worldEditor       = new WorldsViewerEditor.WorldEditor();
                        worldEditor.world = target.world;
                        EntityDebugComponentEditor.worldEditors.Add(target.world, worldEditor);
                    }

                    WorldsViewerEditor.DrawEntity(target.entity, worldEditor, worldEditor.GetEntitiesStorage(), worldEditor.GetStructComponentsStorage(), worldEditor.GetComponentsStorage(), worldEditor.GetModules());
                    this.Repaint();
                }
            }
            else
            {
                if (Worlds.currentWorld == null)
                {
                    GUILayout.Label("No running worlds found", EditorStyles.centeredGreyMiniLabel);
                }
                else
                {
                    GUILayoutExt.DrawAddEntityMenu(target);
                }
            }
        }