void SetItem(PictruePage_Item item, PictruePage_ItemData data) { item.data = data; item.name = data.picRow.TryGet <string>("id", "none-id"); if (item.name == "1") { pic1 = item; } switch (data.status) { case PicturePage_ItemStatus.Locked: item.IsShowPuzzleMask = true; item.IsShowUnlockLayer = true; item.IsShowPice = false; var unlockGold = data.picRow.Get <int>("cost"); var unlockButotnText = unlockGold + "金币解锁"; item.UnlockButtonText = unlockButotnText; break; case PicturePage_ItemStatus.Unlocked: { item.IsShowPuzzleMask = true; item.IsShowUnlockLayer = false; var picId = data.picRow.Get <int>("id"); var info = PlayerStatus.TryGetUncompleteOfPicId(picId); if (info != null) { var sliceCount = StaticDataLite.GetCell <int>("pice_slice", info.sliceId.ToString(), "count"); item.PiceCount = sliceCount; item.IsShowPice = true; } else { item.IsShowPice = false; } break; } case PicturePage_ItemStatus.Complete: { item.IsShowPuzzleMask = false; item.IsShowUnlockLayer = false; item.IsShowPice = true; var picId = data.picRow.Get <int>("id"); var info = PlayerStatus.GetCompleteInfoOfPicId(picId); if (info != null) { var sliceCount = StaticDataLite.GetCell <int>("pice_slice", info.sliceId.ToString(), "count"); item.PiceCount = sliceCount; } break; } } item.LabelText = data.picRow.Get <string>("name"); var file = data.picRow.Get <string>("file"); var sprite = PicLibrary.LoadContentSprite(file); item.Sprite = sprite; }
public static bool IsPictureUnlocked(string id) { var defaultUnlocked = StaticDataLite.GetCell <bool>("pic", id, "unlock"); var unlock = PlayerPrefs.GetInt("levelstorage.unlock." + id, 0); return(defaultUnlocked || unlock == 1); }
public static void EnterCore(int picId, int sliceId) { // save status lastPicId = picId; lastSliceId = sliceId; // hide bg and show core page UIEngine.HideFlaoting <BackgroundFloating>(); UIEngineHelper.WateAdmissionComplete(() => { UIEngine.Forward <CorePage>(); }); // load picture which player select var picFile = StaticDataLite.GetCell <string>("pic", picId.ToString(), "file"); var contentSprite = PicLibrary.LoadContentSprite(picFile); // load slice info var piceSize = StaticDataLite.GetCell <int>("pice_slice", sliceId.ToString(), "cell_size"); // test code // piceSize = 400; // start core game Puzzle.Instance.StartPuzzle(contentSprite, piceSize); // when compelte Puzzle.Instance.Complete += OnCoreGameCompelte; //LocalNotification.SendNotification(1, 5000, "Title", "Long message text", new Color32(0xff, 0x44, 0x44, 255)); }
public static string Get(string key) { var language = StaticDataLite.GetCell <string>("msglist", key, "cn"); if (language == null) { return(key); } return(language); }
public override void OnParamChanged() { this.p = param as PicturePageParam; if (p.pageType == PicturePageType.Uncomplete) { this.text_title.text = "未完成"; this.text_des.text = "共 " + PlayerStatus.uncompletePuzzle.Count + " 张"; } else if (p.pageType == PicturePageType.Pictype) { var pictype = p.picTypeId; var name = StaticDataLite.GetCell <string>("pictype", pictype, "display_name"); var des = StaticDataLite.GetCell <string>("pictype", pictype, "des"); this.text_title.text = name; this.text_des.text = des; } else if (p.pageType == PicturePageType.Complete) { this.text_title.text = "已完成"; this.text_des.text = "共 " + PlayerStatus.completeDic.Count + " 张"; } }
string GetTitleOfDay(int day) { return(StaticDataLite.GetCell <string>("sign", day.ToString(), "title")); }
int GetGoldOfDay(int day) { return(StaticDataLite.GetCell <int>("sign", day.ToString(), "gold")); }