22 lines
500 B
C#
22 lines
500 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class laserScript : MonoBehaviour {
|
|
public Transform startPoint;
|
|
public Transform endPoint;
|
|
LineRenderer laserLine;
|
|
// Use this for initialization
|
|
void Start () {
|
|
laserLine = GetComponentInChildren<LineRenderer> ();
|
|
laserLine.startWidth = .2f;
|
|
laserLine.endWidth = .2f;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
laserLine.SetPosition (0, startPoint.position);
|
|
laserLine.SetPosition (1, endPoint.position);
|
|
|
|
}
|
|
}
|