コード例 #1
0
ファイル: Game.cs プロジェクト: Beca-99/JS-ApocalipsisZombie
        protected void Start()
        {
            started = true;
            GameState.OnGameResume();
            uAdventureRaycaster = FindObjectOfType <uAdventureRaycaster>();
            if (!uAdventureRaycaster)
            {
                Debug.LogError("No uAdventureRaycaster was found in the scene!");
            }
            else
            {
                // When clicks are out, i capture them
                uAdventureRaycaster.Base = this.gameObject;
            }

            transitionManager = GetComponent <TransitionManager>();
            if (!transitionManager)
            {
                Debug.LogError("No TransitionManager was found in the scene!");
            }

            RunTarget(forceScene ? scene_name : GameState.CurrentTarget);
            gameExtensions.ForEach(g => g.OnAfterGameLoad());
            uAdventureInputModule.LookingForTarget = null;

            TimerController.Instance.Timers = GameState.GetTimers();
            TimerController.Instance.Run();
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: Victorma/arbustos-go
        private IEnumerator StartGame(LoadingScreen loadScreen)
        {
            Debug.Log("[START GAME] GameState Restart...");
            GameState.Restart();
            started = true;
            Debug.Log("[START GAME] Game Resuming...");
            if (GameState.Data.isRestoreAfterOpen())
            {
                GameState.OnGameResume();
            }
            Debug.Log("[START GAME] After Game Load...");
            foreach (var g in PriorityAttribute.OrderExtensionsByMethod("OnAfterGameLoad", gameExtensions))
            {
                yield return(StartCoroutine(g.OnAfterGameLoad()));
            }
            uAdventureRaycaster = FindObjectOfType <uAdventureRaycaster>();
            if (!uAdventureRaycaster)
            {
                Debug.LogError("No uAdventureRaycaster was found in the scene!");
            }
            else
            {
                // When clicks are out, i capture them
                uAdventureRaycaster.Base = this.gameObject;
            }
            if (!TransitionManager)
            {
                Debug.LogError("No TransitionManager was found in the scene!");
            }

            Debug.Log("[START GAME] Running Target...");
            RunTarget(forceScene ? scene_name : GameState.CurrentTarget);
            yield return(new WaitUntil(() => !waitingRunTarget));

            Debug.Log("[START GAME] Game Ready...");
            foreach (var g in PriorityAttribute.OrderExtensionsByMethod("OnGameReady", gameExtensions))
            {
                yield return(StartCoroutine(g.OnGameReady()));
            }
            uAdventureInputModule.LookingForTarget = null;

            TimerController.Instance.Timers = GameState.GetTimers();
            TimerController.Instance.Run();
            Debug.Log("[START GAME] Done! (Waiting for target to be ready)");
            loadScreen.Close();
        }
コード例 #3
0
ファイル: Game.cs プロジェクト: dotlive/uAdventure
        protected void Start()
        {
            uAdventureRaycaster = FindObjectOfType <uAdventureRaycaster>();
            if (!uAdventureRaycaster)
            {
                Debug.LogError("No uAdventureRaycaster was found in the scene!");
            }
            else
            {
                // When clicks are out, i capture them
                uAdventureRaycaster.Base = this.gameObject;
            }

            transitionManager = GetComponent <TransitionManager>();
            if (!transitionManager)
            {
                Debug.LogError("No TransitionManager was found in the scene!");
            }

            RunTarget(forceScene ? scene_name : GameState.InitialChapterTarget.getId());

            TimerController.Instance.Timers = GameState.GetTimers();
            TimerController.Instance.Run();
        }
 protected override void Awake()
 {
     base.Awake();
     Disabled = false;
     Instance = this;
 }