예제 #1
0
            public void UpdateEnable(RectCulling rc)
            {
                if (!this.target)
                {
                    this.isEnabled = false;
                    return;
                }

                this.isEnabled = this.target.gameObject.activeSelf;
            }
예제 #2
0
        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);
        }
예제 #3
0
 public CullData(RectCulling rc, RectTransform target)
 {
     this.target = target;
     this.UpdateEnable(rc);
     this.UpdateTransform();
 }
예제 #4
0
        static void OnCreateSampleObject()
        {
            Transform parent = UnityEditor.Selection.activeTransform;

            RectCulling.CreateSampleObject(parent);
        }