public void CheckOut(Visitor visitor, int visitorScore) { var visitorInfo = SdbInstance <Sdb.VisitorInfo> .Get(visitor.Info.RaceType.ToString()); var gradeInfo = SpecificSdb <Sdb.HotelGradeInfo> .Get(); int originalGrade = gradeInfo.GetGrade(Score); int originalScore = Score; Score += visitorScore * visitorInfo.VipGrade; int newGrade = gradeInfo.GetGrade(Score); if (originalGrade != newGrade) { if (originalGrade > newGrade) { Score = gradeInfo.Grades[originalGrade - 1].X; } else { OnGradeChanged?.Invoke(newGrade, originalGrade); } } if (newGrade > originalGrade) { Debug.Log("UpGrade!!, new: " + newGrade + ", ori: " + originalGrade + " new score : " + Score + " ori score : " + originalScore); Main_Scene.GradeChangeListener.Instance.OnHotelGradeIncreased(); } OnExpRateChanged?.Invoke(gradeInfo.GetExpRate(Score)); }
private void Start() { OnGradeChanged?.Invoke(GetGrade(), GetGrade()); OnExpRateChanged?.Invoke(GetExpRate()); }