("Line");
for (int i = 0; i < 4; i++)
{
lines.Add((GameObject.Instantiate(prefabLine) as GameObject).GetComponent());
}
GameObject _cubes = GameObject.Find("Cubes");
for (int i = 0; i < _cubes.transform.childCount; i++)
{
cubes.Add(_cubes.transform.GetChild(i).gameObject);
}
}
public void Update()
{
//按下
if (Input.GetMouseButtonDown(0))
{
foreach (LineRenderer line in lines)
line.renderer.enabled = true;
mBtnDownPos = Helper.GetMouseWorldPos(new Plane(Vector3.up, Vector3.zero));
lines[0].SetPosition(0, mBtnDownPos);
lines[3].SetPosition(0, mBtnDownPos);
}
//持续
if (Input.GetMouseButton(0))
{
Vector3 mouseWorldPos = Helper.GetMouseW