冒牌高手
2015-11-08 18:47
控制台报错代码
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;
}
}
OnTime这个方法应该写在类里吧
你的编译器这里不报错吗?
Unity3D-万圣前夜之惊声尖笑
43952 学习 · 26 问题
相似问题