r2mods/ilspy_dump/ror2_csproj/RoR2/LaserPointer.cs

26 lines
503 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2;
[RequireComponent(typeof(LineRenderer))]
public class LaserPointer : MonoBehaviour
{
public float laserDistance;
private LineRenderer line;
private void Start()
{
line = GetComponent<LineRenderer>();
}
private void Update()
{
if (Physics.Raycast(base.transform.position, base.transform.forward, out var hitInfo, laserDistance, LayerIndex.world.mask))
{
line.SetPosition(0, base.transform.position);
line.SetPosition(1, hitInfo.point);
}
}
}