2015-01-10 48 views

回答

1

我假设你的第一个场景叫做Game
创建一个名为“简介”的新场景。
在这个场景中,添加图像元素,并为其分配一个脚本:

using UnityEngine; 
using System.Collections; 

public class Intro : MonoBehaviour { 


    bool shouldGo = false; 
    float timeout = 2.0f; 

    void Update() { 

     if (shouldGo) { 

      timeout -= Time.deltaTime; 
      if (timeout <= 0.0f) Go(); 
      return; 

     } else { 

      int percentageLoaded = (int)(Application.GetStreamProgressForLevel("Game") * 100.0f); 

     } 

     if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) { 
      if (Application.CanStreamedLevelBeLoaded("Game")) shouldGo = true; 
     } 

     if (Input.GetMouseButtonDown(0)) { 
      if (Application.CanStreamedLevelBeLoaded("Game")) shouldGo = true; 
     } 

    } 


    void Go() { 

     Application.LoadLevel("Game"); 

    } 


} 

然后在Build Settings,添加新的Introduction现场,并通过拖动列表的顶部移动到0位置。

+0

谢谢。下次我会在尝试之前尝试。谢谢! – PanaitStudio

相关问题