【发布时间】:2015-10-04 05:25:14
【问题描述】:
我有一个对象,当它被销毁时会留下一些东西。
//Spawn object at point
GameObject bonusDrop = (GameObject)Instantiate(bonusItem,target.transform.position, Quaternion.identity);
//Set the transform to the canvas (without this line the position is correct)
bonusDrop.transform.SetParent(canvas.transform);
//object is completely off
- 我想将它设置为画布,因为它打算用作 UI 元素
- 如果我不设置父对象,则对象最终位于正确的位置(但如果我不设置父对象,UI 元素将无法按预期工作)。
- 我希望能得到一些帮助来解决这个问题。我不想这么说,但我觉得解决方案很简单,我无法理解 =(
【问题讨论】: