Ejemplo n.º 1
0
        public static void InitializeWithScene()
        {
            var settingsGO = GameObject.Find("Settings");

            if (settingsGO == null)
            {
                SceneManager.sceneLoaded += OnSceneLoaded;
                return;
            }
            Settings = settingsGO?.GetComponent <TwoStickSettings>();
            if (!Settings)
            {
                return;
            }

            PlayerLook     = GetLookFromPrototype("PlayerRenderPrototype");
            PlayerShotLook = GetLookFromPrototype("PlayerShotRenderPrototype");
            EnemyShotLook  = GetLookFromPrototype("EnemyShotRenderPrototype");
            EnemyLook      = GetLookFromPrototype("EnemyRenderPrototype");

            EnemySpawnSystem.SetupComponentData(World.Active.GetOrCreateManager <EntityManager>());

            World.Active.GetOrCreateManager <UpdatePlayerHUD>().SetupGameObjects();

            var sceneSwitcher = GameObject.Find("SceneSwitcher");

            if (sceneSwitcher != null)
            {
                NewGame();
            }
        }
Ejemplo n.º 2
0
        public static void InitializeWithScene()
        {
            var settingsGO = GameObject.Find("Settings");

            Settings = settingsGO?.GetComponent <TwoStickSettings>();
            if (!Settings)
            {
                return;
            }

            //PlayerLook = GetLookFromPrototype("PlayerRenderPrototype");
            PlayerShotLook = GetLookFromPrototype("PlayerShotRenderPrototype");
            EnemyShotLook  = GetLookFromPrototype("EnemyShotRenderPrototype");
            //EnemyLook = GetLookFromPrototype("EnemyRenderPrototype");

            var prefab = GetPrefab("Prefabs/PlayerPrefab");

            //PlayerPrefab = GetPrefab("Prefabs/PlayerPrefab");

            EnemySpawnSystem.SetupComponentData(World.Active.GetOrCreateManager <EntityManager>());

            World.Active.GetOrCreateManager <UpdatePlayerHUD>().SetupGameObjects();
        }