unity Instantiate设置父级物体bug
作者:互联网
版本号 2018.3.5 2018.4.1
public class test : MonoBehaviour
{
public Canvas canvas;
void Start()
{
AssetBundle asset = AssetBundle.LoadFromFile("Assets/Scenes/00step.ld");
GameObject startPanel= asset.LoadAsset<GameObject>("StartPanel");
//Instantiate(startPanel);
Instantiate(startPanel, canvas.transform);
startPanel.transform.rotation = Quaternion.Euler(0.0f, 0.0f, 0.0f);
Debug.Log(startPanel.transform.rotation);
// Instantiate(startPanel);
//startPanel.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
//startPanel.transform.eulerAngles = new Vector3(0f, 0f, 0f);
Debug.Log(asset);
}
rect transform 的rotation 在inspector面板下显示是不正常的 并不是实际值
标签:父级,0.0,Instantiate,transform,unity,0f,asset,startPanel 来源: https://www.cnblogs.com/pz904/p/12530774.html