老師我跟你學到這兒,一直報個 解析錯誤,但是我找了N遍了,還是沒找到錯在那兒,求指導
控制臺報錯代碼
Assets/Storyboard.cs(70,1): error CS8025: Parsing error
我代碼一共都沒有70行.
以下是我寫的代碼:
using UnityEngine;
using System.Collections;
public class Storyboard : MonoBehaviour
{
float[]timeArray= new float[4,6,8,10,12];
int index;
bool canClick;
public GameObject particle;
public GameObject bat;
public GameObject face;
public GameObject word;
void Start ()
{
particle.SetActive (false);
bat.SetActive (false);
face.SetActive (false);
word.SetActive (false);
}
// Update is called once per frame
void Update ()
{
if (index < timeArray.Length && Time.realtimeSinceStartup >= timeArray [index]) {
OnTime (index);
index++;
}
if(canClick&&Input.GetMouseButtonUp(0)){
word.SetActive(true);
}
}
void OnTime(int index){
Debug.Log(index);
switch(index)
{
case 0:
{
particle.SetActive(true);
}
break;
case 1:
{
bat.SetActive(true);
}
break;
? ?case 2: {
face.SetActive(true);
}
break;
case 3:
{
face.GetComponent<AudioSource>().Play();
}
break;
case 4:
{
canClick= true;
}
break;
}
}
2015-12-17
?OnTime這個方法應該寫在類里吧
2015-11-23