私はこの例を見てからしばらくしていますので、うまくいけばそのメソッド名が正しく記憶されていることを覚えておいてください。それには、空間理解から位置を取得するために呼び出しが成功した後に呼び出される「DrawBox」メソッドが含まれています。以下の(と仮定すると、「toPlaceは」空間の理解コールと「モデル」からの結果は、あなたがそこに配置しようとしているモデルが含まれている含まれていて、この呼び出しを置き換え
DrawBox(toPlace, Color.red);
:ボックスを作成する呼び出しは次のようになります):
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を新しい質問として投稿してください。私はあなたにそれをどのように扱ったかの例をたくさん与えることができます。私はスタックオーバフロールールに違反したくないと同じ質問で2つの異なる質問に答える... –