unity 加载关卡_unity中加载新关卡函数简单用法

Application.LoadLevel 加载关卡

static function LoadLevel (index : int) : void

Description描述

Loads the level.

加载关卡,也就是加载一个新的场景。

This function loads level by its index. You can see the indices of all levels using the File->Build Settings... menu in Unity. Before you can load a level you have to add it to the list of levels used in the game. Use File->Build Settings... in Unity and add the levels you need to the level list there.

这个函数按照索引加载关卡。在Unity中使用File->Build Settings.....菜单可以看到所有 关卡的索引列表。在你能过加载关卡之前你必须将它添加到游戏使用关卡列表中。在 Unity中使用File->Build Settings.....并添加你需要的关卡到关卡列表中。

// Loads the level with index 0

//加载索引为 0 的关卡

Application.LoadLevel (0);

When loading a new level all game objects that have been loaded before are destroyed. If you want to let an object survive when loading a new level, use Object.DontDestroyOnLoad.

当加载新的关卡时,所有已经加载的游

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值