void OnTextOverlay(TextOverlay overlayInstance) { if (UI.DisableTextOverlay()) { return; } Text txt = GetUnusedTextOverlay(); txt.text = overlayInstance.msg; if (overlayInstance.useColor) { txt.color = overlayInstance.color; } else { txt.color = new Color(1f, 150 / 255f, 0, 1f); } Vector3 screenPos = mainCam.WorldToScreenPoint(overlayInstance.pos); txt.transform.localPosition = screenPos; txt.gameObject.SetActive(true); StartCoroutine(TextOverlayRoutine(txt)); }
void NewTextOverlay(TextOverlay overlayInstance) { if (!UIMainControl.EnableTextOverlay()) { return; } Text txt = GetUnusedTextOverlay(); txt.text = overlayInstance.msg; if (overlayInstance.useColor) { txt.color = overlayInstance.color; } else { txt.color = defaultColor; } txt.fontSize = (int)Mathf.Round(defaultFontSize * overlayInstance.scale); txt.transform.localPosition = GetScreenPos(overlayInstance.pos); txt.gameObject.SetActive(true); StartCoroutine(TextOverlayRoutine(overlayInstance.pos, txt)); }
void OnTextOverlay(TextOverlay overlayInstance){ if(UI.DisableTextOverlay()) return; Text txt=GetUnusedTextOverlay(); txt.text=overlayInstance.msg; if(overlayInstance.useColor) txt.color=overlayInstance.color; else txt.color=new Color(1f, 150/255f, 0, 1f); Vector3 screenPos = mainCam.WorldToScreenPoint(overlayInstance.pos); txt.transform.localPosition=screenPos/UI.GetScaleFactor(); txt.gameObject.SetActive(true); StartCoroutine(TextOverlayRoutine(txt)); }