Exemplo n.º 1
0
 public void OnDestroy()
 {
     if (_system != null)
     {
         _system.Destroy();
         _system = null;
     }
 }
Exemplo n.º 2
0
        public static GameObject Create(EcsSystem ecsSystem, string name = null)
        {
            if (ecsSystem == null)
            {
                throw new ArgumentException("EcsSystem");
            }
            var go = new GameObject(name != null ? string.Format("[EcsSystem{0}]", name) : "[EcsSystem]");

            DontDestroyOnLoad(go);
            go.hideFlags = HideFlags.NotEditable;
            var observer = go.AddComponent <EcsSystemObserver>();

            observer._system = ecsSystem;

            return(go);
        }