Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        var sname = SceneSelector.GetCurrentSceneName();

        if (sname != null)
        {
            var laststage = StageAchievement.GetLastStageSceneName(sname);
            {
                if (laststage != null)
                {
                    foreach (Transform worldstage in transform)
                    {
                        var stageSelectable = worldstage.GetComponentInChildren <StageSelectable>();
                        var stage           = stageSelectable?.stage;
                        if (stage != null)
                        {
                            if (laststage == stage.sceneName)
                            {
                                current = stageSelectable;
                                current?.GetComponent <Selectable>()?.Select();
                                return;
                            }
                        }
                    }
                }
                if (transform.childCount > 0)
                {
                    var stageSelectable = transform.GetChild(0).GetComponentInChildren <StageSelectable>();
                    current = stageSelectable;
                    current?.GetComponent <Selectable>()?.Select();
                }
            }
        }
    }
Example #2
0
    // Start is called before the first frame update
    private void Start()
    {
        var name = SceneSelector.GetCurrentSceneName();

        if (name != null)
        {
            var music = MusicController.Get();
            if (music != null)
            {
                int bgmId    = name.GetHashCode();
                var selector = SceneSelector.Get();
                if (selector != null && selector.CurrentScene is Stage)
                {
                    var id = ((Stage)selector.CurrentScene).bgmId;
                    if (id >= 0)
                    {
                        bgmId = id;
                    }
                }
                ;

                music.ChangeSound(music.PG[(bgmId % music.PG.Length + music.PG.Length) % music.PG.Length]);
            }
        }

        pointManager = GetComponent <PointManager>();
        camType      = CameraType.ShowWorld;

        this.Delay(.1f, () =>
        {
            CameraController.Get().Targetter.SetTarget(GetComponentInChildren <GoalController>().goalTarget);
        });
        StartGame();
    }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        if (SceneSelector.GetCurrentSceneName().Contains("World"))
        {
            var music = MusicController.Get();
            if (music != null)
            {
                music.ChangeSound(music.TitleBGM);
                music.ApplyParamater("Scene", 2f / 2);
            }
        }
        else
        {
            var music = MusicController.Get();
            if (music != null)
            {
                music.ChangeSound(music.TitleBGM);
                music.ApplyParamater("Scene", 1f / 2);
            }
        }

        if (StageSelector.Get() != null && SceneSelector.Get() != null)
        {
            StageSelector.Get().lastWorldMap = SceneSelector.Get().CurrentScene;
        }
        SelectEffect(true);
    }
Example #4
0
    public void OnSelect(BaseEventData eventData)
    {
        var sname = SceneSelector.GetCurrentSceneName();

        if (stage != null && !(sname.Contains("World") && stage.SceneName.Contains("World")))
        {
            StageAchievement.SetLastStage(sname, stage);
        }
        SelectDirector.Get(transform).SetSelected(stage);
        SelectDirector.Get(transform).SetSelected(gameObject);
    }
Example #5
0
 public void BackToTitle()
 {
     if (SceneSelector.GetCurrentSceneName().Contains("World"))
     {
         SceneSelector.Get().LoadScene(new SceneStage("TitleScene"), SceneSelector.SceneChangeType.CHANGE_FADE);
     }
     else
     {
         SceneSelector.Get().LoadScene(new SceneStage("TitleScene"), SceneSelector.SceneChangeType.CHANGE_MOVE);
     }
     SelectEffect(false);
 }
Example #6
0
    public void StartGame(Stage stage)
    {
        Stage sstage = (stage.story != null /* && !StageAchievement.isCreativeMode*/) ? stage.story : stage;

        if (SceneSelector.GetCurrentSceneName().Contains("World"))
        {
            StageSelector.Get().LoadStage(sstage, SceneSelector.SceneChangeType.CHANGE_FADE);
        }
        else
        {
            StageSelector.Get().LoadStage(sstage, SceneSelector.SceneChangeType.CHANGE_MOVE);
        }
        SelectEffect(false);
    }
Example #7
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetButtonDown("Cancel"))
     {
         if (SceneSelector.GetCurrentSceneName().Contains("World"))
         {
             BackToSelect();
         }
         else
         {
             BackToTitle();
         }
     }
 }