Exemple #1
0
    public GameObject CreateStageButton(SceneNameHolder scene, int index)
    {
        GameObject o = Instantiate(m_stageButton);

        o.GetComponent <StageButton> ().StageIndex = (SceneLoader.Scenes)index;
        o.GetComponentInChildren <Text> ().text    = scene.stageName;
        SetStarNumber(o, scene);
        o.transform.SetParent(m_selectStageBoard.transform);
        o.transform.localPosition = _stageButtonPos;
        o.transform.localScale    = Vector3.one;
        _stageButtonPos.x        += 210;
        return(o);
    }
Exemple #2
0
    private IEnumerator LoadTargetScene(SceneNameHolder holder)
    {
        _status = Status.Loading;
        if (string.IsNullOrEmpty(holder.own))
        {
            _status = Status.None;
            yield break;
        }
        _loadOperation = SceneManager.LoadSceneAsync(holder.own);
        yield return(_loadOperation);

        _status = Status.Complete;
    }
Exemple #3
0
    private IEnumerator LoadTargetScene(SceneNameHolder sceneName)
    {
        this.status = Status.Loading;

        if (string.IsNullOrEmpty(sceneName.own))
        {
            this.status = Status.None;
            yield break;
        }

        this.loadOperation = Application.LoadLevelAsync(sceneName.own);
        yield return(this.loadOperation);

        this.status = Status.Complete;
    }
Exemple #4
0
    private IEnumerator LoadLoadingScene(SceneNameHolder holder)
    {
        if (string.IsNullOrEmpty(holder.loading))
        {
            yield break;
        }
        _status        = Status.Prepare;
        _loadOperation = holder.isAdditiveLoading ? SceneManager.LoadSceneAsync(holder.loading, LoadSceneMode.Additive) : SceneManager.LoadSceneAsync(holder.loading, LoadSceneMode.Single);
        yield return(_loadOperation);

        while (_status == Status.Prepare)
        {
            yield return(null);
        }
    }
Exemple #5
0
    private IEnumerator LoadLoadingScene(SceneNameHolder sceneName)
    {
        if (string.IsNullOrEmpty(sceneName.loading))
        {
            yield break;
        }

        this.status = Status.Prepare;

        this.loadOperation = sceneName.isAdditiveLoading ? Application.LoadLevelAdditiveAsync(sceneName.loading) : Application.LoadLevelAsync(sceneName.loading);

        yield return(this.loadOperation);

        while (this.status == Status.Prepare)
        {
            yield return(null);
        }
    }
Exemple #6
0
    public void SetStarNumber(GameObject o, SceneNameHolder scene)
    {
        RawImage[] stars;
        stars = o.GetComponentsInChildren <RawImage> ();
        int starNumber = scene.handStarNumber;

        for (int i = 0; i < 5; i++)
        {
            if (starNumber > i)
            {
                stars [i].texture = m_starFilled;
            }
            else
            {
                stars [i].texture = m_starUnfilled;
            }
        }
        starNumber = scene.footStarNumber;
        for (int i = 5; i < 10; i++)
        {
            if (starNumber + 5 > i)
            {
                stars [i].texture = m_starFilled;
            }
            else
            {
                stars [i].texture = m_starUnfilled;
            }
        }
        starNumber = scene.coordinationStarNumber;
        for (int i = 10; i < 15; i++)
        {
            if (starNumber + 10 > i)
            {
                stars [i].texture = m_starFilled;
            }
            else
            {
                stars [i].texture = m_starUnfilled;
            }
        }
    }
Exemple #7
0
    private IEnumerator AsyncLoadScene(SceneNameHolder sceneName)
    {
        yield return(StartCoroutine(this.LoadLoadingScene(sceneName)));

        yield return(StartCoroutine(this.LoadTargetScene(sceneName)));
    }
Exemple #8
0
    private IEnumerator AsyncLoadScene(SceneNameHolder holder)
    {
        yield return(StartCoroutine(LoadLoadingScene(holder)));

        yield return(StartCoroutine(LoadTargetScene(holder)));
    }