15585人加入学习
(100人评价)
通过实例学习:游戏的存档与读档(Unity 2017.2)

制作完成于2018-1-12

价格 免费

 金口难开没看看没开门,吗,吗,吗,吗,吗,m

[展开全文]

①两个迭代器(IEnumerator)交叉调用,完成一个生命周期。

[展开全文]

    /// <summary>
    /// 生成怪物
    /// </summary>
    /// <returns></returns>
    IEnumerator AliveTimer()
    {
        while (true) {
            yield return new WaitForSeconds(Random.Range(1, 2));
            Debug.Log("生成");
            ActiceMoster();

            while (true) {
                Debug.Log("检测");
                if (activeMoster == null) {
                    break;
                }
                aliveTime -= Time.deltaTime;
                if (aliveTime < 0) {
                    Debug.Log("死亡");
                    DeActiceMoster();
                }
                yield return null;
            }

        }
    }

[展开全文]

授课教师

SIKI学院老师

课程特色

图文(1)
下载资料(1)
视频(34)