This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using UnityEditor; | |
using UnityEditor.Localization; | |
using UnityEditor.SceneManagement; | |
using UnityEngine; | |
using UnityEngine.Localization.Tables; | |
using Object = UnityEngine.Object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using TMPro; | |
using UnityEditor; | |
using UnityEngine.Localization.PropertyVariants; | |
using UnityEngine.Localization.PropertyVariants.TrackedObjects; | |
using UnityEngine.Localization.PropertyVariants.TrackedProperties; | |
public class AutoLinkTMP | |
{ | |
[MenuItem("CONTEXT/TextMeshProUGUI/Localize (With Localized Properties)")] | |
static void LocalizeTMProText(MenuCommand command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Localization; | |
using UnityEngine.VFX; | |
using UnityEngine.VFX.Utility; | |
[VFXBinder("Localization/Texture Binder")] | |
public class LocalizedTextureBinder : VFXBinderBase | |
{ | |
[SerializeField] | |
LocalizedTexture m_Texture; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int GetSizeOfObject(object obj, StringBuilder sb = null, int indent = 0, bool details = true) | |
{ | |
if (sb == null) | |
{ | |
sb = new StringBuilder(); | |
sb.AppendLine("|Name |Type |Size(b)|"); | |
sb.AppendLine("|--- |--- |--- |"); | |
} | |
if (indent == 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
using UnityEngine.Localization; | |
using UnityEngine.Localization.PropertyVariants; | |
using UnityEngine.Localization.PropertyVariants.TrackedObjects; | |
using UnityEngine.Localization.PropertyVariants.TrackedProperties; | |
using UnityEngine.ResourceManagement.AsyncOperations; | |
using Object = UnityEngine.Object; | |
[Serializable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
public class SerializeType : ScriptableObject, ISerializationCallbackReceiver | |
{ | |
[SerializeField] string m_TypeString; | |
public Type MyType { get; set; } | |
public void OnBeforeSerialize() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void ClearAll() | |
{ | |
var collection = LocalizationEditorSettings.GetAssetTableCollection("My Assets"); | |
foreach(var table in collection.AssetTables) | |
{ | |
foreach(var tableEntry in table.Values) | |
{ | |
// Remove the asset from Addressables | |
if (!string.IsNullOrEmpty(tableEntry.Guid)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PatchTableContents : MonoBehaviour | |
{ | |
public IEnumerator Start() | |
{ | |
// Load the table. | |
var table = LocalizationSettings.StringDatabase.GetTableAsync("My Table"); | |
yield return table; | |
// Prevent the table from being unloaded and the changes lost. | |
Addressables.ResourceManager.Acquire(table); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.AddressableAssets; | |
using UnityEngine.Localization; | |
using UnityEngine.ResourceManagement.AsyncOperations; | |
public class PreloadSelectedTables : MonoBehaviour | |
{ | |
public List<LocalizedStringTable> tablesToPreload = new List<LocalizedStringTable>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
using UnityEngine.Localization.Settings; | |
using UnityEngine.SceneManagement; | |
[InitializeOnLoad] | |
public static class EditorBootScene | |
{ | |
static EditorBootScene() | |
{ |