资产/line_genertaor.cs(9,5):错误CS0246:找不到类型或名称空间名称“ Line”。您是否缺少装配参考?

时间:2018-07-18 18:37:52

标签: c#

它给错误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);

        }

    }

}

1 个答案:

答案 0 :(得分:0)