unity Instantiate设置父级物体bug

版本号 2018.3.5 2018.4.1

unity Instantiate设置父级物体bugunity Instantiate设置父级物体bug

 

 

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面板下显示是不正常的 并不是实际值

 

上一篇:Fabric 1.4源码分析 - chaincode instantiate


下一篇:Exercise 42 - class and instantiate