Esempio n. 1
0
        public void OnEnable()
        {
            Debug.Log("create gameentity : " + new System.Diagnostics.StackTrace().ToString());
            #if UNITY_EDITOR
            if (World.Active == null)
            {
                // * OnDisable (Serialize monobehaviours in temporary backup)
                // * unload domain
                // * load new domain
                // * OnEnable (Deserialize monobehaviours in temporary backup)
                // * mark entered playmode / load scene
                // * OnDisable / OnDestroy
                // * OnEnable (Loading object from scene...)
                if (EditorApplication.isPlayingOrWillChangePlaymode)
                {
                    // We are just gonna ignore this enter playmode reload.
                    // Can't see a situation where it would be useful to create something inbetween.
                    // But we really need to solve this at the root. The execution order is kind if crazy.
                    if (!EditorApplication.isPlaying)
                    {
                        return;
                    }

//                    Debug.LogError("Loading GameObjectEntity in Playmode but there is no active World");
                    return;
                }
                else
                {
#if UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP
                    return;
#else
                    DefaultWorldInitialization.Initialize("Editor World", true);
#endif
                }
            }
            #endif

            EntityManager = World.Active.GetOrCreateManager <EntityManager>();
            Entity        = AddToEntityManager(EntityManager, gameObject);
        }
Esempio n. 2
0
 static void Initialize()
 {
     DefaultWorldInitialization.Initialize("Default World", false);
     GameObjectSceneUtility.AddGameObjectSceneReferences();
 }
Esempio n. 3
0
 static void Initialize()
 {
     DefaultWorldInitialization.Initialize();
 }
 static void Initialize()
 {
     DefaultWorldInitialization.Initialize("Default World", false);
 }