Example #1
0
        public IRunnerChapterTarget RunTarget(string scene_id, int transition_time = 0, TransitionType transition_type = 0, Interactuable notifyObject = null, bool trace = true)
        {
            Debug.Log("Run target: " + scene_id);
            GUIManager.Instance.ShowHand(false);
            MenuMB.Instance.hide(true);

            IChapterTarget target = GameState.GetChapterTarget(scene_id);

            var transition = new Transition();

            transition.setTime(transition_time);
            transition.setType(transition_type);
            transitionManager.PrepareTransition(transition);

            if (runnerTarget != null && runnerTarget.Data == target && scene_id == GameState.CurrentTarget)
            {
                runnerTarget.RenderScene();
            }
            else
            {
                if (runnerTarget != null)
                {
                    runnerTarget.Destroy();
                }

                // Here we connect with the IChapterTargetFactory and create an IRunnerChapterTarget

                runnerTarget            = RunnerChapterTargetFactory.Instance.Instantiate(target);
                runnerTarget.Data       = target;
                GameState.CurrentTarget = target.getId();
            }

            if (trace && OnTargetChanged != null)
            {
                OnTargetChanged(target);
            }

            waitingRunTarget = true;
            if (notifyObject != null)
            {
                executeStack.Push(new KeyValuePair <Interactuable, ExecutionEvent>(notifyObject, null));
            }
            uAdventureRaycaster.Instance.Override = this.gameObject;

            return(runnerTarget);
        }
Example #2
0
        public IRunnerChapterTarget RunTarget(string scene_id, int transition_time = 0, int transition_type = 0)
        {
            MenuMB.Instance.hide(true);
            if (runnerTarget != null)
            {
                runnerTarget.Destroy(transition_time / 1000f);
            }

            // Here we connect with the IChapterTargetFactory and create an IRunnerChapterTarget
            IChapterTarget target = GameState.getChapterTarget(scene_id);

            runnerTarget = RunnerChapterTargetFactory.Instance.Instantiate(target);

            runnerTarget.Data = target;

            trackSceneChange(target);

            GameState.CurrentTarget = target.getId();

            return(runnerTarget);
        }