public void AddLove(int n, AddLoveType type) { bool limit = ResourcesManager.instance.GetLoveTypeCount(type) <= 0; if (!limit) { ResourcesManager.instance.AddLove(n, type); } var lovebar = UIManager.instance.ShowUI <UILovePointBar>(UINames.LoveBar); lovebar.Show(); lovebar.AddPoint(n, limit); lovebar.RefreshProcess(); }
public int GetLoveTypeCount(AddLoveType type) { if (type == AddLoveType.Dialogue) { return(mikoConfig.loveConfig.dialogueCount); } if (type == AddLoveType.Idle) { return(mikoConfig.loveConfig.idleCount); } return(mikoConfig.loveConfig.touchCount); }
public void AddLove(int n, AddLoveType type) { mikoConfig.love += n; int Lv = AVGDataManager.instance.GetCurrentLoveLevel(mikoConfig.love); SetLoveCount(type); if (Lv != LoveLevel) { string str = "好感度Level" + Lv + "だにぇ"; if (Lv >= 4) { str += "じゅ~~"; } EventManager.instance.SendEvent((int)EventManager.EventSender.MikoChi, (int)EventManager.EventType.Chat, 1, str); LoveLevel = Lv; } SaveConfigToJsonConfig(); }
public void SetLoveCount(AddLoveType type) { if (type == AddLoveType.Dialogue) { mikoConfig.loveConfig.dialogueCount--; } if (type == AddLoveType.Idle) { mikoConfig.loveConfig.idleCount--; } if (type == AddLoveType.Touch) { mikoConfig.loveConfig.touchCount--; } mikoConfig.loveConfig.lastUpdateDay = DateTime.Now.DayOfYear; mikoConfig.loveConfig.LastUpdateYear = DateTime.Now.Year; // SaveConfigToJsonConfig(); }