示例#1
0
        public static void AttachHost(GameObject go, PxPre.UIL.EleHost host, bool destroyOnEscape = false)
        {
            HostLayoutOnSizeChange uilosc = go.AddComponent <HostLayoutOnSizeChange>();

            uilosc.host            = host;
            uilosc.destroyOnEscape = destroyOnEscape;
        }
示例#2
0
        public EleHost(RectTransform host, bool autolayout, bool clearPrev = true, string name = "")
            : base(null, new Vector2(-1.0f, -1.0f), name)
        {
            this.rt = host;

            if (clearPrev == true)
            {
                HostLayoutOnSizeChange [] hls =
                    host.gameObject.GetComponents <HostLayoutOnSizeChange>();

                foreach (HostLayoutOnSizeChange hl in hls)
                {
                    GameObject.Destroy(hl);
                }
            }

            if (autolayout == true)
            {
                HostLayoutOnSizeChange.AttachHost(host.gameObject, this);
            }
        }