老师我跟你学到这儿,一直报个 解析错误,但是我找了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;
}
}