string FormatLog(string item, ScoreManager.ActionTypes aType, float damage) { // string s = actionToStats[aType][rnd.Next(actionToStats[aType].Length)]; // string s = "<color=orange>-{0:C2}</color> | You {1}ed a {2}!\n"; // note font used is not monospaced! // string s = "<color=orange>-{0,6}</color> | *** {1,1} ***\n"; string s = "<color=orange>-{0,4}</color> | *** {1} ***\n"; // return string.Format(s, damage*GameManager.instance.scoreMultiplier, aType.ToString(), item); return(string.Format(s, damage * ScoreManager.instance.scoreMultiplier, item)); }
// void Update() // { // StringBuilder bb = new StringBuilder(); // bb.Append("hello\n<lol>"); // Debug.Log(bb.Length); // Debug.Log(bb.ToString(2, bb.Length-2)); // } public void AddBillLog(string item, ScoreManager.ActionTypes aType, float damage) { // history log first_display = (curLogNum > maxLogNum + 1) ? (first_display + 1) : 0; first_display_idx = (curLogNum > maxLogNum) ? (first_display_idx + billLogs[first_display].Length) : 0; last_display_idx += newLogLength; history.text = historyLogs.ToString(first_display_idx, last_display_idx - first_display_idx); // newest log newLog = FormatLogPopUp(item, aType, damage); newest.text = newLog; newLog = FormatLog(item, aType, damage); // reformat billLogs.Add(newLog); newLogLength = newLog.Length; historyLogs.Append(newLog); StopCoroutine(PopUpText(newest)); StartCoroutine(PopUpText(newest)); curLogNum++; }