public static void ExportPresets(List <ScreenshotResolution> resolutions) { foreach (ScreenshotResolution res in resolutions) { string name = res.m_ResolutionName == "" ? res.m_Width.ToString() + "x" + res.m_Height.ToString() : res.m_ResolutionName; ScreenshotResolutionAsset preset = ScriptableObjectUtils.CreateAsset <ScreenshotResolutionAsset> (name, "Presets/Custom"); preset.m_Resolution = new ScreenshotResolution(res); EditorUtility.SetDirty(preset); } AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }
public static void CreateAsset() { ProjectWindowUtil.ShowCreatedAsset(ScriptableObjectUtils.CreateAsset <PresetCollectionAsset> ("Custom collection", "Presets/Collections")); }
public static void CreateAsset() { ScriptableObjectUtils.CreateAsset <PuzzleSister.VoiceSuite>(); }
public static void CreateAsset() { ProjectWindowUtil.ShowCreatedAsset(ScriptableObjectUtils.CreateAsset <ScreenshotResolutionAsset> ("Custom preset", "Presets/Custom")); }
public static void CreateAsset() { ScriptableObjectUtils.CreateAsset <DialogBase>(); }
public static void CreateAsset() { ProjectWindowUtil.ShowCreatedAsset(ScriptableObjectUtils.CreateAsset <PopularityPresetAsset> ("Custom popularity", "Presets/Popularity")); }
public static ScriptableObject CreateInstance() { return(ScriptableObjectUtils.CreateAsset <TutorialCallbacks>(DefaultFileName)); }
public override void OnInspectorGUI() { EditorGUILayout.Separator(); if (m_IDs == null) { SimpleLocalizationLanguagesAsset[] l = Resources.LoadAll <SimpleLocalizationLanguagesAsset> (""); if (l.Length > 0) { m_IDs = l [0]; } else { m_IDs = ScriptableObjectUtils.CreateAsset <SimpleLocalizationLanguagesAsset> ("LocalizationLanguages"); } } if (m_IDs == null) { return; } SimpleTextLocalizer obj = (SimpleTextLocalizer)target; // Default text if (SimpleLocalizationLanguagesAsset.m_CurrentLanguageID == "" && obj.GetComponent <Text> ().text != obj.m_OriginalText) { obj.Save(); } EditorGUILayout.LabelField("Default (" + m_IDs.m_DefaultLanguage + "): " + obj.m_OriginalText); // Localizations if (m_IDs.m_Languages.Count == 0) { EditorGUILayout.HelpBox("Languages list is empty. Please add languages in the global localization settings.", MessageType.Warning); } foreach (string id in m_IDs.m_Languages) { // Init localization value if needed if (!obj.m_Localisations.ContainsKey(id)) { obj.m_Localisations [id] = ""; EditorUtility.SetDirty(obj); } // Localization edit field EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(id, GUILayout.MaxWidth(50)); string newLoc = EditorGUILayout.TextField(obj.m_Localisations [id]); EditorGUILayout.EndHorizontal(); // Set new localization if needed if (newLoc != obj.m_Localisations [id]) { obj.m_Localisations [id] = newLoc; EditorUtility.SetDirty(obj); } } // Global LanguagesDrawer.DrawGUI(m_IDs); }