1
This commit is contained in:
34
Assets/Artists/Scripts/Props/Prop_Lase.cs
Normal file
34
Assets/Artists/Scripts/Props/Prop_Lase.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITFALL.Props
|
||||
{
|
||||
public class Prop_Laser : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private int distance = 256;
|
||||
[SerializeField] private LineRenderer lineRenderer;
|
||||
[SerializeField] private LayerMask layerMask;
|
||||
|
||||
private Transform Transform;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Transform = transform;
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if(Physics.Raycast(Transform.position,Transform.forward,out var hit,distance,layerMask))
|
||||
{
|
||||
//lineRenderer.SetPosition(1,Vector3.Distance(Transform.position,hit.point) * Vector3.forward);
|
||||
}
|
||||
else
|
||||
{
|
||||
//lineRenderer.SetPosition(1,Transform.forward * distance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user