zoukankan      html  css  js  c++  java
  • 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面板下显示是不正常的 并不是实际值

  • 相关阅读:
    Static了解和复习继承。
    复习篇1.对象和封装
    第一章笔记
    A + B Problem II
    Number Sequence
    Fibonacci Again
    8615 快乐
    8635 气球
    大牛之路II
    8617 阶乘数字和
  • 原文地址:https://www.cnblogs.com/pz904/p/12530774.html
Copyright © 2011-2022 走看看