EffectLinePos.cs 606 B

12345678910111213141516171819202122232425
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class EffectLinePos : MonoBehaviour
  5. {
  6. public Transform effectLinePos;
  7. private LineRenderer line;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. line = GetComponent<LineRenderer>();
  12. line.positionCount = effectLinePos.childCount;
  13. for (int i = 0; i < effectLinePos.childCount; i++)
  14. {
  15. line.SetPosition(i, effectLinePos.GetChild(i).position);
  16. }
  17. }
  18. // Update is called once per frame
  19. void Update()
  20. {
  21. }
  22. }