protected virtual void Start() { if (Object.op_Equality((Object)this.UIObject, (Object)null) && !string.IsNullOrEmpty(this.UIObjectID)) { GameObject gameObject = GameObjectID.FindGameObject(this.UIObjectID); if (Object.op_Inequality((Object)gameObject, (Object)null)) { this.UIObject = (RectTransform)gameObject.GetComponent <RectTransform>(); } } if (Object.op_Equality((Object)this.mCanvas, (Object)null) && Object.op_Inequality((Object)this.UIObject, (Object)null)) { this.mCanvas = (Canvas)((Component)this.UIObject).GetComponentInParent <Canvas>(); } if (Object.op_Inequality((Object)this.mCanvas, (Object)null) && Object.op_Equality((Object)this.UIObject, (Object)null)) { this.UIObject = new GameObject(((Object)((Component)this).get_gameObject()).get_name(), new System.Type[1] { typeof(RectTransform) }).get_transform() as RectTransform; ((Transform)this.UIObject).SetParent(((Component)this.mCanvas).get_transform(), false); } CameraHook.AddPreCullEventListener(new CameraHook.PreCullEvent(this.PreCull)); }
private void OnEnable() { CameraHook.AddPreCullEventListener(new CameraHook.PreCullEvent(this.PreCull)); }