24 lines
505 B
C#
24 lines
505 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Line : MonoBehaviour
|
|
{
|
|
public LineRenderer line;
|
|
public Transform startPoint;
|
|
public Transform endPoint;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
line.positionCount = 2;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
line.SetPosition(0, startPoint.position); // 起点
|
|
line.SetPosition(1, endPoint.position);
|
|
}
|
|
}
|