2016. 2. 22. 16:50
출처 : http://docs.unity3d.com/ScriptReference/Camera.ScreenToWorldPoint.html
1 2 3 4 5 6 7 8 9 10 11 12 | // Draw a yellow sphere in the scene view at the position // on the near plane of the selected camera that is // 100 pixels from lower-left. using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void OnDrawGizmosSelected() { Camera camera = GetComponent<Camera>(); Vector3 p = camera.ScreenToWorldPoint(new Vector3(100, 100, camera.nearClipPlane)); Gizmos.color = Color.yellow; Gizmos.DrawSphere(p, 0.1F); } } | cs |
'프로그래밍 > Unity3D' 카테고리의 다른 글
[Unity3D] 함수레퍼런스 : GetComponentInChildren (0) | 2016.02.25 |
---|---|
[Unity3D] 부드러운 움직임, 회전 하기 (0) | 2016.02.23 |
[Unity3D] RectTransform width height 변경하기. (1) | 2016.02.22 |
[Unity3D] 안드로이드 빌드시 해상도 깨짐 현상 (0) | 2016.02.22 |
[Unity3D] 사운드 플레이를 위한 매니저 (0) | 2016.02.22 |