예제 #1
0
        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));
        }