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(); }
public static ConversationAsset CreateAsset() { return(DialogEditorUtils.CreateAssetInSelectedDirectory <ConversationAsset>()); }
public static void AddConversationTrigger() { DialogEditorUtils.CreateGameObjectWithComponent <ConversationTrigger>(); }