void ISupervisorDebugListener.OnWorldDestroyed(EntitySupervisor world) { // for immediate unregistering this MonoBehaviour from ECS. OnDestroy(); // for delayed destroying GameObject. Destroy(gameObject); }
void OnDestroy() { if (_world != null) { _world.RemoveDebugListener(this); _world = null; } }
public static GameObject Create(EntitySupervisor world, string name = null) { if (world == null) { throw new ArgumentNullException("world"); } var go = new GameObject(name != null ? string.Format("[ECS-WORLD {0}]", name) : "[ECS-WORLD]"); DontDestroyOnLoad(go); go.hideFlags = HideFlags.NotEditable; var observer = go.AddComponent <SupervisorObserver>(); observer._world = world; world.AddDebugListener(observer); return(go); }
void IComponentInspector.OnGUI(string label, object value, EntitySupervisor world, int entityId) { EditorGUILayout.Vector3Field(label, (Vector3)value); }
void IComponentInspector.OnGUI(string label, object value, EntitySupervisor world, int entityId) { EditorGUILayout.Vector3Field(label, ((Quaternion)value).eulerAngles); }