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(100100, camera.nearClipPlane));
        Gizmos.color = Color.yellow;
        Gizmos.DrawSphere(p, 0.1F);
    }
}
cs


Posted by 시리시안