SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
879 B

4 years ago
  1. using ARLocation;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class ArrowControl : MonoBehaviour
  6. {
  7. public GameObject arrowPostion;
  8. public Camera myPosition;
  9. public GameObject arrowColor;
  10. public Material[] arrowMaterial;
  11. private void FixedUpdate()
  12. {
  13. if (Vector3.Distance(arrowPostion.transform.position,Camera.main.transform.position) >= 10f) //화살의 위치와 카메라의 위치
  14. {
  15. arrowPostion.GetComponent<MoveAlongPath>().PlaybackSettings.Speed = 0f;
  16. arrowColor.GetComponent<MeshRenderer>().material = arrowMaterial[1];
  17. }
  18. else
  19. {
  20. arrowPostion.GetComponent<MoveAlongPath>().PlaybackSettings.Speed = 3f;
  21. arrowColor.GetComponent<MeshRenderer>().material = arrowMaterial[0];
  22. }
  23. }
  24. }