123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808 |
- using UnityEngine;
- using UnityEngine.UI;
- using System;
- using System.Xml;
- using System.Linq;
- using System.Collections;
- using System.Collections.Generic;
- using Random = UnityEngine.Random;
- public class SignItemLabel
- {
- public static string Lab1 = "Lab1";
- public static string Lab2 = "Lab2";
- public static string Icon1 = "Icon1";
- public static string Icon2 = "Icon2";
- }
- public class Sign
- {
- #region Config
- public int Coin
- {
- get
- {
- if (RoundBuff.Equal(-1))
- {
- return Coin_;
- }
- else
- {
- return (int)(Coin_*RoundBuff*SignManager.SignRound);
- }
- }
- set { Coin_ = value; }
- }
- public int Diamond
- {
- get
- {
- if (RoundBuff.Equal(-1))
- {
- return Diamond_;
- }
- else
- {
- return (int)(Diamond_ * RoundBuff * SignManager.SignRound);
- }
- }
- set { Diamond_ = value; }
- }
- public int Coin_;
- public int Diamond_;
- public float RoundBuff;
- public bool IsLottery;
- public Text Lab1;
- public Text Lab2;
- public Image Icon;
- public Image Mark;
- public Vector2 OriginSize;
- public List<int> FlowerList = new List<int>();
- #endregion
- public Sign(int index, Transform tra, XmlAttributeCollection attribute)
- {
- Dictionary<string, Transform> dic = new Dictionary<string, Transform>();
- Auxiliary.CompileDic(tra, dic);
- Lab1 = dic[SignItemLabel.Lab1].GetComponent<Text>();
- Lab2 = dic[SignItemLabel.Lab2].GetComponent<Text>();
- Icon = dic[SignItemLabel.Icon1].GetComponent<Image>();
- Mark = dic[SignItemLabel.Icon2].GetComponent<Image>();
- OriginSize = Icon.rectTransform.sizeDelta;
- Lab2.text = index.ToString();
- Coin = Auxiliary.StringToInt(attribute[4].Value, 0);
- IsLottery = Auxiliary.StringToBool(attribute[1].Value, false);
- Diamond = Auxiliary.StringToInt(attribute[3].Value, 0);
- FlowerList = Auxiliary.StringToInts(',', attribute[2].Value, new List<int>());
- RoundBuff = Auxiliary.StringToFloat(attribute[5].Value, -1);
- SetUI();
- }
- public void Get()
- {
- if (IsLottery)
- {
- Lottery.EnterAnimation(true);
- return;
- }
- AudioManager.PlayClip(AudioLabel.GetCurrent);
- Mark.SetActive(true);
- ResetSign();
- ResourceManager.SetActive(ObjectLabel.Bb_Get, false);
- ResourceManager.SetActive(ObjectLabel.Bb_Rotate, true);
- ResourceManager.SetActive(ObjectLabel.Bb_Confirm, true);
- if (FlowerList.Valid())
- {
- for (int i = 0; i < FlowerList.Count; i++)
- {
- FlowerInfo flowerInfo = GardenManager.FlowerInfoDic[FlowerList[i]];
- if (flowerInfo.Unlock == false)
- {
- ResourceManager.SetText(ObjectLabel.Bb_InfoLabA, flowerInfo.Name);
- ResourceManager.SetActive(ObjectLabel.Bb_IconA, true);
- ResourceManager.SetSprite(ObjectLabel.Bb_IconA0, flowerInfo.Icon);
-
- ResourceManager.Get<Image>(ObjectLabel.Bb_IconA0).Resize(true, 0.8125f, 0.8125f);
- flowerInfo.Add();
- return;
- }
- }
- }
- if (Diamond > 0)
- {
- ResourceManager.SetText(ObjectLabel.Bb_InfoLabB, Diamond.ToString());
- ResourceManager.SetSprite(ObjectLabel.Bb_IconB, Lib.DiamondSprite);
- ResourceManager.SetActive(ObjectLabel.Bb_IconB, true);
- Manager.AddDiamond(Diamond, StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.Checkin);
- }
- else if (Coin > 0)
- {
- ResourceManager.SetText(ObjectLabel.Bb_InfoLabB, Coin.ToString());
- ResourceManager.SetSprite(ObjectLabel.Bb_IconB, Lib.GoldSprite);
- ResourceManager.SetActive(ObjectLabel.Bb_IconB, true);
- Manager.AddCoin(Coin, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Checkin);
- }
- else
- {
- throw new Exception();
- }
- }
- public void SetUI()
- {
- if (IsLottery)
- {
- Icon.sprite = Lib.PackSprite;
- Icon.Resize(true, 0.3f, 0.3f);
- return;
- }
- if (FlowerList.Valid())
- {
- for (int i = 0; i < FlowerList.Count; i++)
- {
- FlowerInfo flowerInfo = GardenManager.FlowerInfoDic[FlowerList[i]];
- if (flowerInfo.Unlock == false)
- {
- Icon.sprite = flowerInfo.Icon;
- Icon.Resize(true, 0.1875f, 0.1875f);
- return;
- }
- }
- }
-
- if (Diamond > 0)
- {
- Icon.sprite = Lib.DiamondSprite;
- Icon.Resize(false, OriginSize);
- Lab1.text = Diamond.ToString();
- }
- else if (Coin > 0)
- {
- Icon.sprite = Lib.GoldSprite;
- Icon.Resize(false, OriginSize);
- Lab1.text = Coin.ToString();
- }
- }
- private static int MaxSignIndex = 22;
- public static void ResetSign()
- {
- SignManager.SignTime = HttpManager.Time;
- SignManager.SignIndex++;
- if (SignManager.SignIndex == MaxSignIndex)
- {
- SignManager.SignIndex = 1;
- SignManager.SignRound++;
- ResourceManager.Get(ObjectLabel.B_SignIn).GetTweenCG().AddEventOnetime
- (
- EventType.BackwardFinish,
- () =>
- {
- foreach (var kv in SignManager.SignDic)
- {
- kv.Value.SetUI();
- kv.Value.Mark.SetActive(false);
- }
- }
- );
- }
- }
- }
- public class Lottery
- {
- private enum LotteryType
- {
- Coin=1,
- Diamond=2,
- Flower=3,
- Close=4,
- }
- #region Config
- public int PosIndex;
- public int Type;
- public int Value;
- public Text Lab;
- public Image Icon1;
- public Image Icon2;
- public Image Icon3;
- public Button Button;
- public Transform BK;
- public Transform Item;
- public static bool ResetSign = false;
- public static List<int> TempTypeList = new List<int>();
- public static List<int> TempValueList = new List<int>();
- public static List<Lottery> TempLotteryList = new List<Lottery>();
- public static List<int> TypeList = new List<int>();
- public static List<float> RateList = new List<float>();
- public static List<Vector3> PosList = new List<Vector3>();
- public static List<List<int>> LeftBorderDList = new List<List<int>>();
- public static List<List<int>> RightBorderDList = new List<List<int>>();
- #endregion
- public static void Configure(List<XmlAttributeCollection> attributeList)
- {
- PosList.Add(ResourceManager.Get(ObjectLabel.Bc_LotteryItem1).position);
- PosList.Add(ResourceManager.Get(ObjectLabel.Bc_LotteryItem2).position);
- PosList.Add(ResourceManager.Get(ObjectLabel.Bc_LotteryItem3).position);
- for (int i = 0; i < attributeList.Count; i++)
- {
- RateList.Add((float) Auxiliary.FmlParse(attributeList[i][2].Value));
- TypeList.Add((int) Auxiliary.FmlParse(attributeList[i][1].Value));
- List<string> leftBorderStrList = Auxiliary.StringToStrings(',', attributeList[i][3].Value, null);
- List<string> rightBorderStrList = Auxiliary.StringToStrings(',', attributeList[i][4].Value, null);
- List<int> leftBorderList = new List<int>();
- List<int> rightBorderList = new List<int>();
- for (int j = 0; j < leftBorderStrList.Count; j++)
- {
- leftBorderList.Add((int)Auxiliary.FmlParse(leftBorderStrList[j], "l", (Manager.Level+1).ToString()));
- rightBorderList.Add((int)Auxiliary.FmlParse(rightBorderStrList[j], "l", (Manager.Level+1).ToString()));
- }
- LeftBorderDList.Add(leftBorderList);
- RightBorderDList.Add(rightBorderList);
- }
- }
- public static Lottery CreateLottery(int type, int posIndex, Transform lotteryItem)
- {
- Lottery lottery = new Lottery();
- lottery.Type = type;
- lottery.Value = Random.Range(LeftBorderDList[0][0], RightBorderDList[0][0] + 1);
- if (lottery.Type == LotteryType.Flower.GetHashCode())
- {
- #region
- List<int> flowerIDs = new List<int>();
- for (int j = 0; j < LeftBorderDList[type - 1].Count; j++)
- {
- for (int k = LeftBorderDList[type - 1][j]; k < RightBorderDList[type - 1][j] + 1; k++)
- {
- if (!TempValueList.Contains(k))
- {
- flowerIDs.Add(k);
- }
- }
- }
- lottery.Value = Award.SelectAwardFlowerID(flowerIDs);
- TempValueList.Add(lottery.Value);
- #endregion
- }
- else if (lottery.Type == LotteryType.Close.GetHashCode())
- {
- #region
- bool allBought = true;
- for (int j = 0; j < LeftBorderDList[type - 1].Count; j++)
- {
- for (int k = LeftBorderDList[type - 1][j]; k < RightBorderDList[type - 1][j] + 1; k++)
- {
- if (!PlayerManager.CloseItemDic[k].Possess && !TempValueList.Contains(k))
- {
- allBought = false;
- goto exit;
- }
- }
- }
- exit :
- if (allBought)
- {
- int index = Random.Range(0, LeftBorderDList[type - 1].Count);
- lottery.Value = Random.Range(LeftBorderDList[type - 1][index], RightBorderDList[type - 1][index] + 1);
- CloseItem closeItem = PlayerManager.CloseItemDic[lottery.Value];
- lottery.Value = (int) closeItem.BuyAmt/5;
- if (closeItem.BuyCurrent == Current.Coin)
- {
- lottery.Type = LotteryType.Coin.GetHashCode();
- }
- else if (closeItem.BuyCurrent == Current.Diamond)
- {
- lottery.Type = LotteryType.Diamond.GetHashCode();
- }
- }
- else
- {
- int anticrush = 0;
- do
- {
- if (anticrush++ > 10000)
- {
- throw new Exception();
- }
- int index = Random.Range(0, LeftBorderDList[type - 1].Count);
- lottery.Value = Random.Range(LeftBorderDList[type - 1][index], RightBorderDList[type - 1][index] + 1);
- } while (PlayerManager.CloseItemDic[lottery.Value].Possess || TempValueList.Contains(lottery.Value));
- TempValueList.Add(lottery.Value);
- }
- #endregion
- }
- else
- {
- int index = Random.Range(0, LeftBorderDList[type - 1].Count);
- lottery.Value = Random.Range(LeftBorderDList[type - 1][index], RightBorderDList[type - 1][index] + 1);
- }
- lottery.PosIndex = posIndex;
- lottery.Item = lotteryItem;
- lottery.BK = lotteryItem.GetChild(0);
- lottery.Icon1 = lotteryItem.GetChild(1).GetChild(0).GetComponent<Image>();
- lottery.Icon2 = lotteryItem.GetChild(1).GetChild(1).GetComponent<Image>();
- lottery.Icon3 = lotteryItem.GetChild(1).GetChild(2).GetComponent<Image>();
- lottery.Lab = lotteryItem.GetChild(1).GetChild(3).GetComponent<Text>();
- lottery.Button = lotteryItem.GetChild(1).GetChild(4).GetComponent<Button>();
- lottery.BK.SetActive(false);
- if (lottery.Type == LotteryType.Coin.GetHashCode())
- {
- lottery.Icon1.SetActive(false);
- lottery.Icon3.SetActive(false);
- lottery.Icon2.sprite = Lib.GoldSprite;
- lottery.Icon2.Resize(true, 1, 1);
- lottery.Icon2.transform.localPosition = new Vector3(0, 7.5f, 0);
- lottery.Lab.SetActive(true);
- lottery.Lab.text = lottery.Value.ToString();
- }
- else if (lottery.Type == LotteryType.Diamond.GetHashCode())
- {
- lottery.Icon1.SetActive(false);
- lottery.Icon3.SetActive(false);
- lottery.Icon2.sprite = Lib.DiamondSprite;
- lottery.Icon2.Resize(true, 1, 1);
- lottery.Icon2.transform.localPosition = new Vector3(0, 7.5f, 0);
- lottery.Lab.SetActive(true);
- lottery.Lab.text = lottery.Value.ToString();
- }
- else if (lottery.Type == LotteryType.Flower.GetHashCode())
- {
- lottery.Icon1.SetActive(false);
- lottery.Icon3.SetActive(false);
- lottery.Icon2.sprite = GardenManager.FlowerInfoDic[lottery.Value].Icon;
- lottery.Icon2.Resize(true, 0.3125f, 0.3125f);
- lottery.Icon2.transform.localPosition = new Vector3();
- lottery.Lab.SetActive(false);
- }
- else if (lottery.Type == LotteryType.Close.GetHashCode())
- {
- CloseItem closeItem = PlayerManager.CloseItemDic[lottery.Value];
- float newSize = closeItem.PixelSize/closeItem.Sprites[0].rect.width;
- closeItem.SetUpUI(newSize, new Vector2(), lottery.Icon1, lottery.Icon3, lottery.Icon2);
- lottery.Lab.SetActive(false);
- }
- lottery.Button.onClick = new Button.ButtonClickedEvent();
- lottery.Button.onClick.AddListener(() => { OnClick(posIndex); });
- return lottery;
- }
- public static void EnterAnimation(bool resetSign)
- {
- ResetSign = resetSign;
- ResourceManager.Get(ObjectLabel.Bc_Lottery).TweenForCG();
- ResourceManager.Get(ObjectLabel.Ba_Notice0).TweenBacCG();
- float random = Random.Range(0f, 1f);
- for (int i = 0; i < RateList.Count; i++)
- {
- if (random <= RateList.MySum(f => f, i + 1))
- {
- TempTypeList.Add(TypeList[i]);
- TempTypeList.AddRange(TypeList.Random(2, true, false, type => !TempTypeList.Contains(type)));
- break;
- }
- }
- TempLotteryList.Add(CreateLottery(TempTypeList[0], 0, ResourceManager.Get(ObjectLabel.Bc_LotteryItem1)));
- TempLotteryList.Add(CreateLottery(TempTypeList[1], 1, ResourceManager.Get(ObjectLabel.Bc_LotteryItem2)));
- TempLotteryList.Add(CreateLottery(TempTypeList[2], 2, ResourceManager.Get(ObjectLabel.Bc_LotteryItem3)));
- List<Vector3> posList = PosList.Disturb();
- TempLotteryList[0].Item.position = posList[0];
- TempLotteryList[1].Item.position = posList[1];
- TempLotteryList[2].Item.position = posList[2];
- Button button1 = ResourceManager.Get<Button>(ObjectLabel.Bc_LotteryBack1);
- Button button2 = ResourceManager.Get<Button>(ObjectLabel.Bc_LotteryBack2);
- Button button3 = ResourceManager.Get<Button>(ObjectLabel.Bc_LotteryBack3);
- button1.interactable = false;
- button2.interactable = false;
- button3.interactable = false;
- Auxiliary.Instance.DelayCall
- (
- () =>
- {
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem1).Move2D(PosList[1], 0.25f, false, Curve.EaseOutQuad);
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem2).Move2D(PosList[1], 0.25f, false, Curve.EaseOutQuad);
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem3).Move2D(PosList[1], 0.25f, false, Curve.EaseOutQuad);
- },
- 1f
- );
- Auxiliary.Instance.DelayCall
- (
- () =>
- {
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem1).TweenForEuler();
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem2).TweenForEuler();
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem3).TweenForEuler();
- },
- 1.5f
- );
- Auxiliary.Instance.DelayCall
- (
- () =>
- {
- button1.interactable = true;
- button2.interactable = true;
- button3.interactable = true;
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem1).Move2D(PosList[0], 0.25f, false, Curve.EaseOutQuad);
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem2).Move2D(PosList[1], 0.25f, false, Curve.EaseOutQuad);
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem3).Move2D(PosList[2], 0.25f, false, Curve.EaseOutQuad);
- },
- 2f
- );
- Auxiliary.Instance.DelayCall
- (
- () =>
- {
- ResourceManager.Get(ObjectLabel.Bc_Lab).TweenForCG();
- ResourceManager.SetText(ObjectLabel.Bc_Lab, Language.GetStr(LanguageLabel.UI__Bc_Lab));
- },
- 2.5f
- );
- }
- public static void EndAnimation()
- {
- TempTypeList = new List<int>();
- TempValueList = new List<int>();
- TempLotteryList = new List<Lottery>();
- ResourceManager.Get(ObjectLabel.Bc_Lab).TweenBacCG();
- ResourceManager.Get(ObjectLabel.Bc_Confirm).TweenBacCG();
- ResourceManager.Get(ObjectLabel.Ba_Notice0).TweenForCG();
- ResourceManager.Get(ObjectLabel.B_SignIn).TweenBacCG();
- ResourceManager.Get(ObjectLabel.Ba_Notice).TweenBacCG();
- ResourceManager.Get(ObjectLabel.Bb_SignIn).TweenBacCG();
- ResourceManager.Get(ObjectLabel.Bc_Lottery).TweenBacCG();
- AudioManager.PlayClip(AudioLabel.ClickButton);
- }
- public static void OnClick(int index)
- {
- AudioManager.PlayClip(AudioLabel.GetCurrent);
- ResourceManager.Get<Button>(ObjectLabel.Bc_LotteryBack1).interactable = false;
- ResourceManager.Get<Button>(ObjectLabel.Bc_LotteryBack2).interactable = false;
- ResourceManager.Get<Button>(ObjectLabel.Bc_LotteryBack3).interactable = false;
- TempLotteryList[0].Item.TweenBacEuler();
- TempLotteryList[0].BK.SetActive(true);
- TempLotteryList[0].GetAward();
- List<Vector3> posList = new List<Vector3>(PosList);
- posList.Remove(PosList[index]);
- posList = posList.Disturb();
- TempLotteryList[0].Item.position = PosList[index];
- TempLotteryList[1].Item.position = posList[0];
- TempLotteryList[2].Item.position = posList[1];
- Auxiliary.Instance.DelayCall
- (
- () =>
- {
- ResourceManager.Get(ObjectLabel.Bc_Confirm).TweenForCG();
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem1).TweenBacEuler();
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem2).TweenBacEuler();
- ResourceManager.Get(ObjectLabel.Bc_LotteryItem3).TweenBacEuler();
- },
- 1f
- );
- }
- public void GetAward()
- {
- if (ResetSign)
- {
- Sign.ResetSign();
- }
- BK.SetActive(true);
- if (Type == LotteryType.Coin.GetHashCode())
- {
- Manager.AddCoin(Value, StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Checkin);
- ResourceManager.SetText(ObjectLabel.Bc_Lab, Language.GetStr(LanguageLabel.UI__Bc_Lab1) + Language.GetStr(LanguageLabel.Common__Coin) + " " + Value);
- }
- else if (Type == LotteryType.Diamond.GetHashCode())
- {
- Manager.AddDiamond(Value, StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.Checkin);
- ResourceManager.SetText(ObjectLabel.Bc_Lab, Language.GetStr(LanguageLabel.UI__Bc_Lab1) + Language.GetStr(LanguageLabel.Common__Diamond) + " " + Value);
- }
- else if (Type == LotteryType.Flower.GetHashCode())
- {
- GardenManager.FlowerInfoDic[Value].Add();
- ResourceManager.SetText(ObjectLabel.Bc_Lab, Language.GetStr(LanguageLabel.UI__Bc_Lab1) + " " + GardenManager.FlowerInfoDic[Value].Name);
- }
- else if (Type == LotteryType.Close.GetHashCode())
- {
- PlayerManager.CloseItemDic[Value].Unlock();
- PlayerManager.BoughtCloseList.UniqueAdd(Value);
- ResourceManager.SetText(ObjectLabel.Bc_Lab, Language.GetStr(LanguageLabel.UI__Bc_Lab1) + " " + PlayerManager.CloseItemDic[Value].Name);
- }
- }
- }
- public class SignManager : Regist
- {
- #region Config
- public static int SignIndex;
- public static int SignRound;
- public static DateTime SignTime;
- public static Dictionary<int, Sign> SignDic = new Dictionary<int, Sign>();
- #endregion
- public static bool ShowOfflinePanel()
- {
- if (TutorialManager.NewplayerTutorial)
- {
- return false;
- }
- if (ShowOfflineIncomReward())
- {
- return true;
- }
- if (ShowMailReward())
- {
- return true;
- }
- if (ShowSignReward())
- {
- return true;
- }
- //if (ShowNotification())
- //{
- // return true;
- //}
- if (NickNameManager.ShowNickNameSettingPanelFirstTime())
- {
- return false;
- }
- return false;
- }
- public static bool ShowOfflineIncomReward()
- {
- if (Manager.OfflineLock)
- {
- ResourceManager.Get(ObjectLabel.C_Group).TweenBacCG();
- ResourceManager.Get(ObjectLabel.B_SignIn).TweenForCG();
- ResourceManager.Get(ObjectLabel.Ba_Notice).TweenForCG();
- return true;
- }
- return false;
- }
- public static bool ShowMailReward()
- {
- HttpManager.DecodeMailXml(HttpManager.MailXml);
- if (HttpManager.MailRewardList.Count > 0)
- {
- HttpManager.GetMailReward();
- ResourceManager.Get(ObjectLabel.C_Group).TweenBacCG();
- ResourceManager.Get(ObjectLabel.B_SignIn).TweenForCG();
- ResourceManager.Get(ObjectLabel.Bd_Mail0).TweenForCG();
- return true;
- }
- return false;
- }
- public static bool ShowSignReward()
- {
- if (ConfigManager.GetBoolFormConfig(PlayerConfigLabel.QuitFlag) && HttpManager.Connect)
- {
- int daySpan = HttpManager.Time.Day - SignTime.Day;
- int yearSpan = HttpManager.Time.Year - SignTime.Year;
- int monthSpan = HttpManager.Time.Month - SignTime.Month;
- if (daySpan >= 1 || yearSpan >= 1 || monthSpan >= 1)
- {
- ResourceManager.Get(ObjectLabel.B_SignIn).TweenForCG();
- ResourceManager.Get(ObjectLabel.Bb_SignIn).TweenForCG();
- return true;
- }
- }
- return false;
- }
- public static bool ShowNotification()
- {
- if (HttpManager.NotificationIndex > ConfigManager.GetIntFormConfig(PlayerConfigLabel.NotificationIndex) && HttpManager.NotificationReady)
- {
- ResourceManager.Get(ObjectLabel.B_SignIn).TweenBacCG();
- ConfigManager.SaveIntToConfig(PlayerConfigLabel.NotificationIndex, HttpManager.NotificationIndex);
- AnnounceManager.ShowAnnouncePanel();
- return true;
- }
- else
- {
- return false;
- }
- }
- public static void GetSignReward()
- {
- SignDic[SignIndex].Get();
- Manager.SignAmt++;
- }
- public override void SecondInit()
- {
- SignTime = DateTime.Parse(ConfigManager.GetStringFormConfig(PlayerConfigLabel.SignTime));
- SignIndex = ConfigManager.GetIntFormConfig(PlayerConfigLabel.SignIndex);
- SignRound = ConfigManager.GetIntFormConfig(PlayerConfigLabel.SignRound);
- Transform par = ResourceManager.Get(ObjectLabel.Bb_Grid);
- List<XmlAttributeCollection> attributeList = ConfigManager.GetSignConfig();
- for (int i = 0; i < attributeList.Count; i++)
- {
- Transform tra = ResourceManager.Get(ResourceLabel.SignItem, Folder.UI, false, par, false, ObjType.SignItem);
- SignDic.Add(i + 1, new Sign(i + 1, tra, attributeList[i]));
- }
- for (int i = 1; i < SignIndex; i++)
- {
- SignDic[i].Mark.SetActive(true);
- }
- Lottery.Configure(ConfigManager.GetLotteryConfig());
- }
- }
|