unity学习笔记【场景加载】

来源:互联网 发布:spearman相关系数 知乎 编辑:程序博客网 时间:2024/05/15 23:52
开始加载:
protected override void Start(){    base.Start();    if(Application.loadedLevelName != "Login" && !Application.isLoadingLevel)    {        IEnumerator load = Load();        this.StartCoroutine(load);    }}

加载过程:

private IEnumerator Load(){    asyn = Application.LoadLevelAsync("Login");    asyn.allowSceneActivtion = true;    yield return async;    print("over");}

 

知识点:

1. 协程 StartCoroutine的理解;

2. yield return,IEnumerator的理解;

0 0
原创粉丝点击