This commit is contained in:
CortexCore
2023-10-04 16:50:27 +08:00
parent 947e52e748
commit 5cd094ed9a
263 changed files with 144068 additions and 66 deletions

View File

@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Lightbug.CharacterControllerPro.Demo
{
[RequireComponent(typeof(LineRenderer))]
public class LineRendererUtility : MonoBehaviour
{
public Transform target = null;
LineRenderer lineRenderer = null;
void Awake()
{
lineRenderer = GetComponent<LineRenderer>();
}
void Update()
{
if (target == null)
return;
lineRenderer.positionCount = 2;
lineRenderer.SetPositions(
new Vector3[] {
transform.position,
target.position
}
);
}
}
}