public static void AddTypewriterText(MenuCommand menuCommand)
        {
            // Replicates the creation of a Unity Text component and copy all the properties but m_Script
            // into the TypewriterText component
            GameObject       go             = DialogEditorUtils.MenuOptions_AddText(menuCommand);
            Text             comp           = go.GetComponent <Text>();
            SerializedObject compSerialized = new SerializedObject(comp);

            DestroyImmediate(comp);
            comp = go.AddComponent <TypewriterText>();
            SerializedObject   newCompSerialized = new SerializedObject(comp);
            SerializedProperty prop = compSerialized.GetIterator();

            while (prop.NextVisible(true))
            {
                if (!prop.name.Equals("m_Script"))
                {
                    newCompSerialized.CopyFromSerializedProperty(prop);
                    Debug.Log(prop.propertyPath + " " + prop.name);
                }
            }
            newCompSerialized.ApplyModifiedProperties();
        }
Beispiel #2
0
 public static ConversationAsset CreateAsset()
 {
     return(DialogEditorUtils.CreateAssetInSelectedDirectory <ConversationAsset>());
 }
Beispiel #3
0
 public static void AddConversationTrigger()
 {
     DialogEditorUtils.CreateGameObjectWithComponent <ConversationTrigger>();
 }