WolfLineRender.cs 515 B

123456789101112131415161718192021
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /**狼到终点的引导线绘制,调试用的,配合WolfActGrid */
  5. public class WolfLineRender : MonoBehaviour
  6. {
  7. LineRenderer lineRenderer;
  8. void Awake() {
  9. lineRenderer = GetComponent<LineRenderer>();
  10. }
  11. void Update() {
  12. Vector3 src = transform.position;
  13. lineRenderer.SetPosition(0, src);
  14. }
  15. public void SetDestination(Vector3 des) {
  16. lineRenderer.SetPosition(1, des);
  17. }
  18. }