public void UpdateEnable(RectCulling rc) { if (!this.target) { this.isEnabled = false; return; } this.isEnabled = this.target.gameObject.activeSelf; }
public static RectCulling CreateSampleObject(Transform parent) { RectCulling component = UIExtension.CreateUIObject <RectCulling>("RectCulling", parent, Vector3.zero, new Vector2(100, 100)); component.cullRectTrans = component.GetComponent <RectTransform>(); component.list = new List <CullData>(); var imgVisibled = UIExtension.CreateUIObject <Image>("Visibled", component.CachedTransform, new Vector3(0, 0), new Vector2(30, 30)); component.list.Add(new CullData(component, imgVisibled.rectTransform)); var imgInvisibled = UIExtension.CreateUIObject <Image>("Invisibled", component.CachedTransform, new Vector3(-150, 0), new Vector2(30, 30)); component.list.Add(new CullData(component, imgInvisibled.rectTransform)); component.EditorSetting(); component.LateUpdate(); return(component); }
public CullData(RectCulling rc, RectTransform target) { this.target = target; this.UpdateEnable(rc); this.UpdateTransform(); }
static void OnCreateSampleObject() { Transform parent = UnityEditor.Selection.activeTransform; RectCulling.CreateSampleObject(parent); }