Unity3 Blue Print 오타 교정.63P 64P

Unity3 Blue Print 오타 교정.

63페이지 마지막 줄에
"RayCast 부분을 다음과 같이 수정 하자" 에서
64 페이지.
첫번째 코드

if(Input.GetButtonDown("Click1"))
{
ray1 = Camera.main.ScreenPointToRay(Input.mousePosition); //Ray to Camera Screen posiont attach to mouse position.

if(Physics.Raycast(ray,hit,Mathf.Infinity)) //static function Raycast (origin : Vector3, direction : Vector3, distance : float = Mathf.Infinity, layerMask : int = kDefaultRaycastLayers) : boolean
{
print("CLick1 Down OK in Block");
if(!matchOne)
{
RevealCardOne ();
}
else
{
RevealCardTwo ();
}

인데 지역변수 이름이 ray1 인데 if 문 안에 ray 로 되있음.

둘중에 하나 고쳐야 함.

교정 후 코드.
if(Input.GetButtonDown("Click1"))
{
ray = Camera.main.ScreenPointToRay(Input.mousePosition); //Ray to Camera Screen posiont attach to mouse position.
if(Physics.Raycast(ray,hit,Mathf.Infinity)) //static function Raycast (origin : Vector3, direction : Vector3, distance : float = Mathf.Infinity, layerMask : int = kDefaultRaycastLayers) : boolean
{ print("CLick1 Down OK in Block");
if(!matchOne)
{
RevealCardOne ();
}
else
{
RevealCardTwo ();
}


Game Developer Leegoon copyright all right reserved since 2010.

Comments