-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEcsWorld.cs
28 lines (26 loc) · 1.25 KB
/
EcsWorld.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// ----------------------------------------------------------------------------
// The MIT License
// Unity integration https://github.com/Leopotam/ecs-unityintegration
// for ECS framework https://github.com/Leopotam/ecs
// Copyright (c) 2017-2020 Leopotam <leopotam@gmail.com>
// ----------------------------------------------------------------------------
using UnityEditor;
using UnityEngine;
namespace Leopotam.Ecs.UnityIntegration.Editor {
[CustomEditor (typeof (EcsWorldObserver))]
sealed class EcsWorldObserverInspector : UnityEditor.Editor {
public override void OnInspectorGUI () {
var observer = (EcsWorldObserver) target;
var stats = observer.GetStats ();
var guiEnabled = GUI.enabled;
GUI.enabled = true;
GUILayout.BeginVertical (GUI.skin.box);
EditorGUILayout.LabelField ("Components", stats.Components.ToString ());
EditorGUILayout.LabelField ("Filters", stats.Filters.ToString ());
EditorGUILayout.LabelField ("Active entities", stats.ActiveEntities.ToString ());
EditorGUILayout.LabelField ("Reserved entities", stats.ReservedEntities.ToString ());
GUILayout.EndVertical ();
GUI.enabled = guiEnabled;
}
}
}