示例#1
0
        static void ConvertToTextFX()
        {
            GameObject activeGO   = Selection.activeGameObject;
            Text       uguiText   = activeGO.GetComponent <Text> ();
            TextFxUGUI textfxUGUI = activeGO.GetComponent <TextFxUGUI> ();

            if (textfxUGUI != null)
            {
                return;
            }

            GameObject tempObject = new GameObject("temp");

            textfxUGUI = tempObject.AddComponent <TextFxUGUI>();

            TextFxUGUI.CopyComponent(uguiText, textfxUGUI);

            DestroyImmediate(uguiText);

            TextFxUGUI newUGUIEffect = activeGO.AddComponent <TextFxUGUI> ();

            TextFxUGUI.CopyComponent(textfxUGUI, newUGUIEffect);

            DestroyImmediate(tempObject);

            Debug.Log(activeGO.name + "'s Text component converted into a TextFxUGUI component");
        }
示例#2
0
        new void OnEnable()
        {
            uguiEffect       = (TextFxUGUI)target;
            animationManager = uguiEffect.AnimationManager;

            EditorApplication.update += UpdateManager;

            base.OnEnable();
        }
        static public void AddText(MenuCommand menuCommand)
        {
            GameObject go = CreateUIElementRoot("Text", menuCommand, s_ThickGUIElementSize);

            TextFxUGUI lbl = go.AddComponent <TextFxUGUI>();

            lbl.text = "New Text";
            SetDefaultTextValues(lbl);
        }
示例#4
0
        static GameObject CreateText()
        {
            GameObject go = CreateUIElementRoot(NEW_INSTANCE_NAME, s_ThickElementSize);

            TextFxUGUI lbl = go.AddComponent <TextFxUGUI>();

            lbl.text  = "New Text";
            lbl.color = s_TextColor;

            return(go);
        }