public static void Log(IBattleLogMessage message) { if (instance == null || message.GetMessageBody().Trim().Length == 0) { return; } GameObject newLog = Instantiate(instance.logMessage, instance.transform); newLog.GetComponent <LogHandler>().Init(message); instance.StartCoroutine(ScrollToBottom()); }
public void Init(IBattleLogMessage message) { logText = GetComponentInChildren <Text>(); logText.color = message.GetDefaultColor(); logText.text = message.GetMessageBody(); }