エラーの場所を確認中
エラーの原因があるはずだが不明。
恐らく凡ミスなので、慣れても付きまとうタイプの間違い。。
エラー内容
Assets/Scripts/GameManager.cs(21,10): error CS1547: Keyword `void' cannot be used in this context
Assets/Scripts/GameManager.cs(21,23): error CS1525: Unexpected symbol `('
記述内容
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour {
private const int MAX_ORB = 10; //オーブの最大数
public GameObject orbPrefab;
public GameObject canvasGame;
void Start(){
for (int i = 0; i < MAX_ORB; i++) {
CreateOrb();
}
}
void Update(){
public void CreateOrb(){
GameObject orb = (GameObject)Instantiate(orbPrefab);
orb.transform.SetParlent(canvasGame.transform,false);
orb.transform.localPosition = new Vector3(
UnityEngine.Random.Range(-300.0f,300.0f),
UnityEngine.Random.Range(-140.0f,-500.0f),0f);
}
}
}