コード例 #1
0
        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));
        }