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.
 
 
 

43 lines
1.1 KiB

using ARLocation;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DistanceTest : MonoBehaviour
{
public Text testText;
public Text distanceText;
// Start is called before the first frame update
public GameObject mainOBJ;
private void Start()
{
}
// Update is called once per frame
void Update()
{
var dis = (mainOBJ.transform.position - this.gameObject.transform.position);
testText.text = "Distance is :" + dis;
if (Vector3.Distance(mainOBJ.transform.position, this.gameObject.transform.position) <= 3)
{
distanceText.text = "now so far" + Vector3.Distance(mainOBJ.transform.position, this.gameObject.transform.position);
}
else
{
distanceText.text = "No is not far";
}
/*if(Vector3.Distance(mainOBJ.transform.position,this.gameObject.transform.position) <= 3)
{
Debug.Log("Near by OBJ");
}
else
{
Debug.Log("So far");
}*/
}
}