Esempio n. 1
0
        protected virtual EcsEntity CreateEntity()
        {
                        #if DEBUG
            startup = GetStartup();
            if (!startup)
            {
                throw new Exception($"There is no {nameof(BaseStartup)} on parents!");
            }
            else if (!startup.worldIsAlive)
            {
                throw new Exception($"{startup.GetType().Name} is not init!");
            }
            else if (!entityValue.IsNull())
            {
                throw new Exception("Entity already created!");
            }
                        #endif

            var newEntity = startup.world.NewEntityWith(out UnityObject unityObject, out NewHybridEntityEvent _);
            unityObject.gameObject = gameObject;
            return(newEntity);
        }
Esempio n. 2
0
 private void Awake()
 {
     startup = GetStartup();
 }