그 예제를 살펴본 이후로 시간이 지남에 따라 메서드 이름이 올바르게 기억되기를 바랍니다. 여기에는 공간 인식에서 위치를 가져 오기 위해 호출이 성공한 후에 호출되는 "DrawBox"메서드가 포함되어 있습니다. 공간 이해 호출의 결과를 포함하고 "모델"당신이 거기에 배치하려고하는 모델이 포함
DrawBox(toPlace, Color.red);
다음 (가정 "toPlace"이 전화를 교체 : 상자를 만들어 호출은 다음과 같이 보입니다) :
var rotation = Quaternion.LookRotation(toPlace.Normal, Vector3.up);
// Stay center in the square but move down to the ground
var position = toPlace.Postion - new Vector3(0, RequestedSize.y * .5f, 0);
// instantiate the hologram from a model
GameObject newObject = Instantiate(model, position, rotation) as GameObject;
if (newObject != null)
{
// Set the parent of the new object the GameObject it was placed on
newObject.transform.parent = gameObject.transform;
}
부탁을 들어서 편집 2를 새로운 질문으로 게시하십시오. 나는 당신에게 내가 어떻게 처리했는지에 대한 예제를 줄 수있다. 스택 오버 플로우 규칙을 위반하고 같은 질문에서 두 가지 다른 질문에 답하고 싶지 않다. –