3.App -> Logo

개발 일지/Move Cube 2020. 8. 17. 15:41

1.App

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
public class SceneApp : MonoBehaviour
{
    public void Start()
    {
        DontDestroyOnLoad(this);
 
        var dataManager = DataManager.GetInstance();
        dataManager.LoadStageData();
 
        GameSceneManager.GetInstance().LoadScene(2);
    }
}
 
cs


2.Logo
로고 페이드 인아웃 구현.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
 
public class SceneLogo : MonoBehaviour
{
    public Image imgLogo;
 
    public void Init(string name = ""int prefabId = 0)
    {
        StartCoroutine(this.FadeInOut());
    }
 
    public IEnumerator FadeInOut()
    {
        var color = this.imgLogo.color;
        float alpha = color.a;
        while (true)
        {
            alpha += 0.016f;
            color.a = alpha;
            this.imgLogo.color = color;
 
            if (alpha >= 1)
            {
                alpha = 1;
                break;
            }
            yield return null;
        }
 
        yield return new WaitForSeconds(1.5f);
 
        while (true)
        {
            alpha -= 0.016f;
            color.a = alpha;
            this.imgLogo.color = color;
 
            if (alpha <= 0)
            {
                alpha = 0;
                break;
            }
            yield return null;
        }
 
        GameSceneManager.GetInstance().LoadScene(3);
    }
}
 
cs


Title에서 Stage 선택, 더 복잡한 프로젝트 구성시 FadeInOut은 매니져로 이동.

'개발 일지 > Move Cube' 카테고리의 다른 글

6.Google Play Beta.ver//구글 플레이 베타버전 업로드  (0) 2020.08.17
5.Stage, Cube, CubeMove  (0) 2020.08.17
4.Title/StageSelect  (0) 2020.08.17
2.Unity Info관리  (0) 2020.08.17
1.Unity GameSceneManager  (0) 2020.08.17
: