protected override void OnFreshView() { if (!string.IsNullOrEmpty(BackGroundName) && !BackGroundName.Equals(Data)) { Data = BackGroundName; if (BackGround != null) { Destroy(BackGround.gameObject); } var bgPrefab = ResourceManager.LoadAsset(App.GameKey, string.Format("{0}/{1}", BackGroundSource, BackGroundName), BackGroundName); if (bgPrefab == null) { return; } var go = GameObjectUtile.Instantiate(bgPrefab, transform); BackGround = go.GetComponent <YxBaseWidgetAdapter>(); } if (BackGround == null) { return; } if (BgType == YxBackgroundType.Enwrap) { StartCheckEnwrap(BackGround); } else { BackGround.SetAnchor(Widget.gameObject, 0, 0, 0, 0); } }
protected override void OnFreshView() { base.OnFreshView(); if (Widget != null) { Widget.SetAnchor(transform.parent.gameObject, 0, 0, 0, 0); } FreshLabelStyle(); }