Unity_Transform.GetSiblingIndex()
来源:互联网 发布:女生网络名称大全 编辑:程序博客网 时间:2024/05/16 10:16
GetSiblingIndex获取对象在Hierarchy面板的索引值(可以用于动态修改UGUI中UI的显示效果)
using UnityEngine;using System.Collections;using System;public class Path : MonoBehaviour { public GameObject A; public GameObject B; // Use this for initialization void Start () { int AIndex = A.transform.GetSiblingIndex(); int BIndex = B.transform.GetSiblingIndex(); Debug.Log(AIndex+"A"); Debug.Log(BIndex); A.transform.SetSiblingIndex(BIndex); B.transform.SetSiblingIndex(AIndex); B.transform.parent = A.transform; //Object.FindObjectOfType(Type type); } // Update is called once per frame void Update () { }}
using UnityEngine.UI;using UnityEngine;using System.Collections;using System;public class Path : MonoBehaviour { public Button A; public Button B; // Use this for initialization void Start () { int AIndex = A.transform.GetSiblingIndex(); int BIndex = B.transform.GetSiblingIndex(); Debug.Log(AIndex+"A"); Debug.Log(BIndex); A.transform.SetSiblingIndex(BIndex); B.transform.SetSiblingIndex(AIndex); B.transform.parent = A.transform; //Object.FindObjectOfType(Type type); } // Update is called once per frame void Update () { }}
阅读全文
0 0
- Unity_Transform.GetSiblingIndex()
- Unity_Transform组件_006
- 配置wamp server3.0.6让局域网用户都可以访问你的服务器
- groovy代码动态加载运行实战
- Raid5数据恢复原理_两块盘离线数据恢复方法
- RTPSession流媒体编程
- markdown转html
- Unity_Transform.GetSiblingIndex()
- 文章标题
- Guava字符串处理Joiner、Splitter
- spring cloud搭建eureka+zuul+hystrix+config
- C++文件读写详解(ofstream,ifstream,fstream)
- Android 7.0调用第三方库出现加载失败的问题
- Android之RecycleView
- Matplolib教程及查询
- 使用jquery刷新iframe