9 public override void OnAfterInit()
11 Msg.TalkHomeMemeber(
"layerGacha");
17 base.InvokeRepeating(
"RandomAnime", 2f, 2f);
21 private void RandomAnime()
23 this.randomAnimes.RandomItem<DOTweenAnimation>().DORestart();
27 public void OnClickGoldGacha(
int num)
29 this.PlayGacha(
true, num);
33 public void OnClickSilverGacha(
int num)
35 this.PlayGacha(
false, num);
39 public void PlayGacha(
bool gold,
int num)
42 if (
ELayer.player.dailyGacha && !gold && num == 1)
44 ELayer.player.dailyGacha =
false;
48 thing =
ELayer.pc.things.Find(
"gacha_coin", gold ?
"gold" :
"silver");
49 if (thing ==
null || thing.Num < num)
54 thing.ModNum(-num,
true);
58 d.windows[0].setting.textCaption =
"confirm".lang();
59 d.note.AddPrefab(
"Media/Graphics/Image/IllustGacha");
62 for (
int i = 0; i < num; i++)
104 int rarity = item.Source.rarity;
105 if (rarity == 4 || rarity == 5)
109 d.note.AddText(
null, item.Name(1),
ELayer.Colors.GetRarityColor(rarity,
false));
114 d.note.AddText(
"dailyGacha".lang() +
" 1 > 0", FontColor.DontChange);
118 d.note.AddText(
string.Concat(
new string[]
122 (thing.Num + num).ToString(),
125 }), FontColor.DontChange);
128 d.windows[0].Find(
"GachaAnime",
false).SetActive(
true);
129 d.list.AddButton(
null, Lang.Get(
"ok"), delegate
134 ELayer.Sound.Play(
"gacha");
135 TweenUtil.Delay(0.5f, delegate
137 ELayer.Sound.Play(lose ?
"gacha_lose" :
"gacha_win");
143 Msg.TalkHomeMemeber(
"ding_other");
149 public void RefreshCoin()
151 this.goFree.SetActive(
ELayer.player.dailyGacha);
152 this.listCoin.Clear();
153 BaseList baseList = this.listCoin;
163 baseList.callbacks = callback;
164 this.listCoin.Refresh(
false);
168 public void OnClickBuyCoin()
174 public override void OnKill()
183 public static GameObject slot;
186 public GameObject goFree;
195 public Color colorSR;
198 public Color colorSSR;
201 public Color colorLE;
204 public DOTweenAnimation[] randomAnimes;
210 public UIList listCoin;