screen space 에 있는 ui를 월드 오브젝트 (target), 쪽에 움직이고 싶을때
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ScreenSpaceToWorldPosition : MonoBehaviour
{
public Transform Target;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.position = Camera.main.WorldToScreenPoint(new Vector3(Target.position.x, Target.position.y, Camera.main.nearClipPlane));
}
IEnumerator thread_positionUpdate()
{
}
}
댓글 없음:
댓글 쓰기