[游戏开发-学习笔记]菜鸟慢慢飞(13)- NGUI-代码设置锚点

有时候,可能会需要后台设置gameobject的锚点

 

        UIPanel uipanel = this.gameObject.GetComponent<UIPanel>();
        uipanel.SetAnchor(GameObject.Find("UI Root"));
        uipanel.leftAnchor.absolute 0;
        uipanel.rightAnchor.absolute 0;
        uipanel.topAnchor.absolute 0;
        uipanel.bottomAnchor.absolute 0; 

 

posted on 2017-04-10 14:29  虎鲨  阅读(250)  评论(0编辑  收藏  举报

导航