public static void AttachHost(GameObject go, PxPre.UIL.EleHost host, bool destroyOnEscape = false) { HostLayoutOnSizeChange uilosc = go.AddComponent <HostLayoutOnSizeChange>(); uilosc.host = host; uilosc.destroyOnEscape = destroyOnEscape; }
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); } }