Пример #1
0
    private void Start()
    {
        canvas        = GameObject.Find(ResourceNames.canvas);
        curtainObject = Instantiate(Resources.Load <GameObject>(ResourceNames.curtainImage));
        curtainObject.transform.SetParent(canvas.transform, false);

        if (!SoundWareHouse.Instance.bgmGame.isPlaying)
        {
            SoundWareHouse.Instance.StopAllBGM();
            SoundWareHouse.Instance.bgmGame.Play();
        }

        stageData = StageManager.LoadData(stageIndex);
        var stageObject = new GameObject()
        {
            name = "stage"
        };

        stageController = stageObject.AddComponent <StageController>();
        stageController.curtainObject = curtainObject;
        stageController.Build(stageData);
    }