Exemplo n.º 1
0
        public void LoadGame(string gameName, GameRunningType grt)
        {
            Debug.Log("Load game" + gameName + " |  editMode: " + grt.ToString());
            Vuforia.VuforiaBehaviour.Instance.enabled = true;
            _currentGC = GameContainer.Load(gameName);
            _currentGameRunningType = grt;
            DefaultTrackableEventHandler[] tehs = GameObject.FindObjectsOfType <DefaultTrackableEventHandler>();
            foreach (var teh in tehs)
            {
                teh.Reload();
            }
            switch (grt)
            {
            case GameRunningType.Edit:
                ScreenSpaceUIManager.Instance.ShowUI(ScreenSpaceUIManager.UIType.Edit);
                break;

            case GameRunningType.Play:
                List <string> snames = new List <string>();
                foreach (var sc in _currentGC.scenes)
                {
                    snames.Add(sc.name);
                }
                foreach (var teh in tehs)
                {
                    if (!snames.Contains(teh.name))
                    {
                        teh.gameObject.SetActive(false);
                    }
                }
                ScreenSpaceUIManager.Instance.ShowUI(ScreenSpaceUIManager.UIType.Player);
                break;
            }
        }