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
27 lines
879 B
using ARLocation;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ArrowControl : MonoBehaviour
|
|
{
|
|
public GameObject arrowPostion;
|
|
public Camera myPosition;
|
|
public GameObject arrowColor;
|
|
public Material[] arrowMaterial;
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
if (Vector3.Distance(arrowPostion.transform.position,Camera.main.transform.position) >= 10f) //화살의 위치와 카메라의 위치
|
|
{
|
|
arrowPostion.GetComponent<MoveAlongPath>().PlaybackSettings.Speed = 0f;
|
|
arrowColor.GetComponent<MeshRenderer>().material = arrowMaterial[1];
|
|
}
|
|
else
|
|
{
|
|
arrowPostion.GetComponent<MoveAlongPath>().PlaybackSettings.Speed = 3f;
|
|
arrowColor.GetComponent<MeshRenderer>().material = arrowMaterial[0];
|
|
|
|
}
|
|
}
|
|
}
|