示例#1
0
        //-------------------------------------------------------------------------
        // Unity API
        //-------------------------------------------------------------------------
        protected override void Awake()
        {
            base.Awake();
            player = FindObjectOfType <PlayerCharacter>();
            mouse  = GetComponentInChildren <Mouse>(true);

            resets  = ResetManager.Instance;
            sounds  = AudioManager.Instance;
            dialogs = DialogManager.Instance;

            Physics2D.gravity = new Vector2(0, -gravity);

            string currentSpawn = TransitionManager.GetCurrentSpawnName();

            if (currentSpawn == null || currentSpawn == "")
            {
                if (initialSpawn == null)
                {
                    if (player != null)
                    {
                        TransitionManager.RegisterSpawn("SCENE_START", GameObject.FindGameObjectWithTag("Player").transform.position, true);
                        TransitionManager.SetCurrentSpawn("SCENE_START");
                    }
                }
                else
                {
                    TransitionManager.SetCurrentSpawn(initialSpawn.name);
                }
            }

            // Set the current scene in the transition manager;
            // Set vsync to monitor refresh rate.
            if (!initialized)
            {
                QualitySettings.vSyncCount = 1;
                TransitionManager.SetCurrentScene(SceneManager.GetActiveScene().name);
                initialized = true;
            }

            Journey.SetNarrator(QuestSettings.Narrator);
            Journey.SetQuest(QuestSettings.MainQuest);
            Journey.Begin();
        }
示例#2
0
 public override void Handle(GraphEngine graphEngine)
 {
     Journey.Step();
 }