它给错误CS)246,因为您缺少程序集引用,所以找不到该行,我猜它们链接了3个脚本,所以我该怎么办,我无法解决该错误
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class line_genertaor : MonoBehaviour {
public GameObject linePrefab;
Line activeLine;
void Update()
{
if (Input.GetMouseButtonDown(0))
{
GameObject lineGo = Instantiate(linePrefab);
activeLine = lineGo.GetComponent<Line>();
}
if (Input.GetMouseButtonUp(0))
{
activeLine = null;
}
if (activeLine != null)
{
Vector2 mousePos = Camera.main.ScreenToWorldPoint (Input.mousePosition);
activeLine.UpdateLine (mousePos);
}
}
}
答案 0 :(得分:0)