zoukankan      html  css  js  c++  java
  • 【unity3d study ---- 麦子学院】---------- unity3d Ngui 插件项目实战 ---------- Scene跳转

    从 LogoPage 跳转到 HomePage

    需要在file下build setting 添加这两个scene

    使用协程实现间隔两秒后跳转scene

    使用的unity引擎版本是5.4.1f

    unity4.x版本 跳转界面应该是 Application.LoadLevel("HomePage");

    脚本代码:

     1 using UnityEngine;
     2 using System.Collections;
     3 using UnityEngine.SceneManagement;
     4 
     5 public class AutoPage : MonoBehaviour {
     6 
     7     // Use this for initialization
     8     void Start () {
     9         StartCoroutine(WaitForSecondToScene(2.0f));
    10     }
    11     
    12     // Update is called once per frame
    13     void Update () {
    14     
    15     }
    16 
    17     /// <summary>
    18     /// 协程等待的执行的语句
    19     /// </summary>
    20     /// <returns>The for second.</returns>
    21     /// <param name="delyTime">Dely time.</param>
    22     IEnumerator WaitForSecondToScene(float delyTime){
    23         // 等待的时间
    24         yield return new WaitForSeconds (delyTime);
    25         // 等待之后执行的语句
    26         SceneManager.LoadScene ("HomePage");
    27     }
    28 }
  • 相关阅读:
    http缓存机制与原理
    BFC与浮动
    05ICMP协议与ARP协议(IP协议中重要协议)
    04IP编址(网络层)
    03以太网帧结构(链路层 IEEE802.3)
    02传输介质简介
    shell 脚本 2
    shell 脚本 1
    shell 中时间 表达
    sed 行编辑器
  • 原文地址:https://www.cnblogs.com/dudu580231/p/6059644.html
Copyright © 2011-2022 走看看