public void AddOneItem(SignInInfo info) { if (this.RewardSignInPrefab == null) { this.RewardSignInPrefab = Res.LoadGUI("GUI/RewardSignIn"); } GameObject gameObject = Tools.InstantiateGUIPrefab(this.RewardSignInPrefab); GameUITools.AddChild(this.mRewardTable.gameObject, gameObject); gameObject.AddComponent<UIDragScrollView>().scrollView = this.mRewardScrollView; SignInRewardItem signInRewardItem = gameObject.AddComponent<SignInRewardItem>(); signInRewardItem.InitItem(this, info); }
public void InitItem(GUISignIn baseScene, SignInInfo info) { this.baseScene = baseScene; this.signInInfo = info; this.dark = GameUITools.FindUISprite("dark", base.gameObject); this.sprite = GameUITools.FindUISprite("Sprite", base.gameObject); this.stamp = GameUITools.FindUISprite("stamp", base.gameObject); this.flare = GameUITools.FindGameObject("flare", base.gameObject); UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject); UISprite uISprite = GameUITools.FindUISprite("Tag", base.gameObject); UILabel uILabel2 = GameUITools.FindUILabel("Tag/vipLevel", base.gameObject); UILabel uILabel3 = GameUITools.FindUILabel("times", base.gameObject); GameObject gameObject = GameUITools.FindGameObject("slot", base.gameObject); if (info.RewardType == 3 || info.RewardType == 4) { uILabel.text = Singleton<StringManager>.Instance.GetString("signInRewardNum", new object[] { this.signInInfo.RewardValue2 }); } else { uILabel.text = Singleton<StringManager>.Instance.GetString("signInRewardNum", new object[] { this.signInInfo.RewardValue1 }); } uILabel3.text = this.signInInfo.ID.ToString(); if (this.signInInfo.VipLevel > 0) { uILabel2.text = Singleton<StringManager>.Instance.GetString("signInVipLevel", new object[] { this.signInInfo.VipLevel }); uISprite.gameObject.SetActive(true); } GameObject gameObject2 = GameUITools.CreateReward(this.signInInfo.RewardType, this.signInInfo.RewardValue1, this.signInInfo.RewardValue2, gameObject.transform, false, false, 36f, -7f, -2000f, 20f, 13f, 7f, 0); if (gameObject2 == null) { global::Debug.LogError(new object[] { string.Format("Sign In Reward Init Error , rewardItem is null , {0}", this.signInInfo.ID) }); return; } this.InitSubReward(gameObject2); this.RefreshItem(); }
public static void SignInEvent(SignInInfo info, int flag) { if (!GameAnalytics.IsValide()) { return; } if (info == null) { return; } if (info.RewardType == 2 && info.RewardValue1 > 0) { GameAnalytics.OnReward((double)(info.RewardValue1 * ((flag != 3) ? 1 : 2)), GameAnalytics.VirtualCurrencyReward.SignIn); } }