using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using Unity.Profiling; using UnityEngine; using UnityEngine.Serialization; using UnityEngine.TextCore.LowLevel; [assembly: InternalsVisibleTo("UnityEngine.XRModule")] [assembly: InternalsVisibleTo("UnityEngine.VRModule")] [assembly: InternalsVisibleTo("UnityEngine.WindModule")] [assembly: InternalsVisibleTo("UnityEngine.SwitchModule")] [assembly: InternalsVisibleTo("UnityEngine.XboxOneModule")] [assembly: InternalsVisibleTo("UnityEngine.PS4Module")] [assembly: InternalsVisibleTo("UnityEngine.PS4VRModule")] [assembly: InternalsVisibleTo("UnityEngine.PS5Module")] [assembly: InternalsVisibleTo("UnityEngine.PS5VRModule")] [assembly: InternalsVisibleTo("UnityEngine.Networking")] [assembly: InternalsVisibleTo("UnityEngine.Cloud")] [assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")] [assembly: InternalsVisibleTo("Unity.Analytics")] [assembly: InternalsVisibleTo("UnityEngine.Analytics")] [assembly: InternalsVisibleTo("UnityEngine.VirtualTexturingModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsCommon")] [assembly: InternalsVisibleTo("UnityEngine.Purchasing")] [assembly: InternalsVisibleTo("UnityEngine.TestRunner")] [assembly: InternalsVisibleTo("Unity.Automation")] [assembly: InternalsVisibleTo("Unity.Burst")] [assembly: InternalsVisibleTo("Unity.Burst.Editor")] [assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")] [assembly: InternalsVisibleTo("Unity.IntegrationTests")] [assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")] [assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")] [assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")] [assembly: InternalsVisibleTo("Unity.RuntimeTests")] [assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")] [assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")] [assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")] [assembly: InternalsVisibleTo("UnityEngine.Advertisements")] [assembly: InternalsVisibleTo("UnityEngine.VideoModule")] [assembly: InternalsVisibleTo("UnityEngine.VFXModule")] [assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")] [assembly: InternalsVisibleTo("UnityEngine.InputLegacyModule")] [assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")] [assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")] [assembly: InternalsVisibleTo("UnityEngine.NVIDIAModule")] [assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")] [assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")] [assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")] [assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")] [assembly: InternalsVisibleTo("UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule")] [assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")] [assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")] [assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")] [assembly: InternalsVisibleTo("UnityEngine.StreamingModule")] [assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")] [assembly: InternalsVisibleTo("UnityEngine.SubsystemsModule")] [assembly: InternalsVisibleTo("UnityEngine.TerrainModule")] [assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityCurlModule")] [assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")] [assembly: InternalsVisibleTo("UnityEngine.UNETModule")] [assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")] [assembly: InternalsVisibleTo("UnityEngine.UIElementsNativeModule")] [assembly: InternalsVisibleTo("UnityEngine.UIModule")] [assembly: InternalsVisibleTo("UnityEngine.TilemapModule")] [assembly: InternalsVisibleTo("UnityEngine.TextCoreTextEngineModule")] [assembly: InternalsVisibleTo("UnityEngine.TextCoreFontEngineModule")] [assembly: InternalsVisibleTo("UnityEngine.UmbraModule")] [assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")] [assembly: InternalsVisibleTo("Unity.Timeline")] [assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")] [assembly: InternalsVisibleTo("Unity.Subsystem.Registration")] [assembly: UnityEngineModuleAssembly] [assembly: InternalsVisibleTo("Unity.TextMeshPro")] [assembly: InternalsVisibleTo("Unity.FontEngine")] [assembly: InternalsVisibleTo("Unity.TextCore.FontEngine")] [assembly: InternalsVisibleTo("Unity.TextCore.FontEngine.Tools")] [assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")] [assembly: InternalsVisibleTo("UnityEngine.TextCoreTextModule")] [assembly: InternalsVisibleTo("UnityEngine.TextCore.Tools")] [assembly: InternalsVisibleTo("Unity.TextMeshPro.Tests")] [assembly: InternalsVisibleTo("Unity.TextCore.Tests")] [assembly: InternalsVisibleTo("Unity.FontEngine.Tests")] [assembly: InternalsVisibleTo("Unity.UIElements.Tests")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")] [assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")] [assembly: InternalsVisibleTo("GoogleAR.UnityNative")] [assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")] [assembly: InternalsVisibleTo("Unity.2D.Sprite.Editor")] [assembly: InternalsVisibleTo("Unity.2D.Sprite.EditorTests")] [assembly: InternalsVisibleTo("Unity.UI.Builder.Editor")] [assembly: InternalsVisibleTo("UnityEditor.UIBuilderModule")] [assembly: InternalsVisibleTo("Unity.UI.Builder.EditorTests")] [assembly: InternalsVisibleTo("Unity.UIElements")] [assembly: InternalsVisibleTo("UnityEngine.UIElementsGameObjectsModule")] [assembly: InternalsVisibleTo("Unity.UIElements.Editor")] [assembly: InternalsVisibleTo("Unity.UIElements.PlayModeTests")] [assembly: InternalsVisibleTo("Unity.UIElements.EditorTests")] [assembly: InternalsVisibleTo("UnityEngine.UI")] [assembly: InternalsVisibleTo("Unity.Networking.Transport")] [assembly: InternalsVisibleTo("Unity.ucg.QoS")] [assembly: InternalsVisibleTo("Unity.Services.QoS")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")] [assembly: InternalsVisibleTo("Assembly-CSharp-testable")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")] [assembly: InternalsVisibleTo("Unity.Core")] [assembly: InternalsVisibleTo("Unity.Runtime")] [assembly: InternalsVisibleTo("Unity.Collections")] [assembly: InternalsVisibleTo("Unity.Entities.Tests")] [assembly: InternalsVisibleTo("Unity.Entities")] [assembly: InternalsVisibleTo("Unity.Logging")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")] [assembly: InternalsVisibleTo("UnityEngine.GridModule")] [assembly: InternalsVisibleTo("UnityEngine.GIModule")] [assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: InternalsVisibleTo("UnityEngine")] [assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")] [assembly: InternalsVisibleTo("UnityEngine.CoreModule")] [assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")] [assembly: InternalsVisibleTo("UnityEngine.AIModule")] [assembly: InternalsVisibleTo("UnityEngine.AndroidJNIModule")] [assembly: InternalsVisibleTo("UnityEngine.AnimationModule")] [assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")] [assembly: InternalsVisibleTo("UnityEngine.InputModule")] [assembly: InternalsVisibleTo("UnityEngine.ARModule")] [assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")] [assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")] [assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")] [assembly: InternalsVisibleTo("UnityEngine.DSPGraphModule")] [assembly: InternalsVisibleTo("UnityEngine.DirectorModule")] [assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")] [assembly: InternalsVisibleTo("UnityEngine.TLSModule")] [assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")] [assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")] [assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")] [assembly: InternalsVisibleTo("UnityEngine.ClothModule")] [assembly: InternalsVisibleTo("UnityEngine.AudioModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsCommonModule")] [assembly: InternalsVisibleTo("Unity.UIElements.Text")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace UnityEngine.TextCore.Text; [Serializable] public class Character : TextElement { public Character() { m_ElementType = TextElementType.Character; base.scale = 1f; } public Character(uint unicode, Glyph glyph) { m_ElementType = TextElementType.Character; base.unicode = unicode; base.textAsset = null; base.glyph = glyph; base.glyphIndex = glyph.index; base.scale = 1f; } public Character(uint unicode, FontAsset fontAsset, Glyph glyph) { m_ElementType = TextElementType.Character; base.unicode = unicode; base.textAsset = fontAsset; base.glyph = glyph; base.glyphIndex = glyph.index; base.scale = 1f; } internal Character(uint unicode, uint glyphIndex) { m_ElementType = TextElementType.Character; base.unicode = unicode; base.textAsset = null; base.glyph = null; base.glyphIndex = glyphIndex; base.scale = 1f; } } internal static class ColorUtilities { internal static bool CompareColors(Color32 a, Color32 b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; } internal static bool CompareColorsRgb(Color32 a, Color32 b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) return a.r == b.r && a.g == b.g && a.b == b.b; } internal static bool CompareColors(Color a, Color b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) return Mathf.Approximately(a.r, b.r) && Mathf.Approximately(a.g, b.g) && Mathf.Approximately(a.b, b.b) && Mathf.Approximately(a.a, b.a); } internal static bool CompareColorsRgb(Color a, Color b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) return Mathf.Approximately(a.r, b.r) && Mathf.Approximately(a.g, b.g) && Mathf.Approximately(a.b, b.b); } internal static Color32 MultiplyColors(Color32 c1, Color32 c2) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) byte b = (byte)((float)(int)c1.r / 255f * ((float)(int)c2.r / 255f) * 255f); byte b2 = (byte)((float)(int)c1.g / 255f * ((float)(int)c2.g / 255f) * 255f); byte b3 = (byte)((float)(int)c1.b / 255f * ((float)(int)c2.b / 255f) * 255f); byte b4 = (byte)((float)(int)c1.a / 255f * ((float)(int)c2.a / 255f) * 255f); return new Color32(b, b2, b3, b4); } } public class FastAction { private LinkedList delegates = new LinkedList(); private Dictionary> lookup = new Dictionary>(); public void Add(Action rhs) { if (!lookup.ContainsKey(rhs)) { lookup[rhs] = delegates.AddLast(rhs); } } public void Remove(Action rhs) { if (lookup.TryGetValue(rhs, out var value)) { lookup.Remove(rhs); delegates.Remove(value); } } public void Call() { for (LinkedListNode linkedListNode = delegates.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { linkedListNode.Value(); } } } public class FastAction { private LinkedList> delegates = new LinkedList>(); private Dictionary, LinkedListNode>> lookup = new Dictionary, LinkedListNode>>(); public void Add(Action rhs) { if (!lookup.ContainsKey(rhs)) { lookup[rhs] = delegates.AddLast(rhs); } } public void Remove(Action rhs) { if (lookup.TryGetValue(rhs, out var value)) { lookup.Remove(rhs); delegates.Remove(value); } } public void Call(A a) { for (LinkedListNode> linkedListNode = delegates.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { linkedListNode.Value(a); } } } public class FastAction { private LinkedList> delegates = new LinkedList>(); private Dictionary, LinkedListNode>> lookup = new Dictionary, LinkedListNode>>(); public void Add(Action rhs) { if (!lookup.ContainsKey(rhs)) { lookup[rhs] = delegates.AddLast(rhs); } } public void Remove(Action rhs) { if (lookup.TryGetValue(rhs, out var value)) { lookup.Remove(rhs); delegates.Remove(value); } } public void Call(A a, B b) { for (LinkedListNode> linkedListNode = delegates.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { linkedListNode.Value(a, b); } } } public class FastAction { private LinkedList> delegates = new LinkedList>(); private Dictionary, LinkedListNode>> lookup = new Dictionary, LinkedListNode>>(); public void Add(Action rhs) { if (!lookup.ContainsKey(rhs)) { lookup[rhs] = delegates.AddLast(rhs); } } public void Remove(Action rhs) { if (lookup.TryGetValue(rhs, out var value)) { lookup.Remove(rhs); delegates.Remove(value); } } public void Call(A a, B b, C c) { for (LinkedListNode> linkedListNode = delegates.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { linkedListNode.Value(a, b, c); } } } public enum TextFontWeight { Thin = 100, ExtraLight = 200, Light = 300, Regular = 400, Medium = 500, SemiBold = 600, Bold = 700, Heavy = 800, Black = 900 } [Serializable] public struct FontWeightPair { public FontAsset regularTypeface; public FontAsset italicTypeface; } [Serializable] public struct FontAssetCreationEditorSettings { public string sourceFontFileGUID; public int faceIndex; public int pointSizeSamplingMode; public int pointSize; public int padding; public int packingMode; public int atlasWidth; public int atlasHeight; public int characterSetSelectionMode; public string characterSequence; public string referencedFontAssetGUID; public string referencedTextAssetGUID; public int fontStyle; public float fontStyleModifier; public int renderMode; public bool includeFontFeatures; internal FontAssetCreationEditorSettings(string sourceFontFileGUID, int pointSize, int pointSizeSamplingMode, int padding, int packingMode, int atlasWidth, int atlasHeight, int characterSelectionMode, string characterSet, int renderMode) { this.sourceFontFileGUID = sourceFontFileGUID; faceIndex = 0; this.pointSize = pointSize; this.pointSizeSamplingMode = pointSizeSamplingMode; this.padding = padding; this.packingMode = packingMode; this.atlasWidth = atlasWidth; this.atlasHeight = atlasHeight; characterSequence = characterSet; characterSetSelectionMode = characterSelectionMode; this.renderMode = renderMode; referencedFontAssetGUID = string.Empty; referencedTextAssetGUID = string.Empty; fontStyle = 0; fontStyleModifier = 0f; includeFontFeatures = false; } } public enum AtlasPopulationMode { Static, Dynamic, DynamicOS } [Serializable] [ExcludeFromPreset] public class FontAsset : TextAsset { [SerializeField] internal string m_SourceFontFileGUID; [SerializeField] private Font m_SourceFontFile; [SerializeField] private AtlasPopulationMode m_AtlasPopulationMode; [SerializeField] internal bool InternalDynamicOS; [SerializeField] internal FaceInfo m_FaceInfo; private int m_FamilyNameHashCode; private int m_StyleNameHashCode; [SerializeField] private FontWeightPair[] m_FontWeightTable = new FontWeightPair[10]; [SerializeField] internal List m_GlyphTable = new List(); internal Dictionary m_GlyphLookupDictionary; [SerializeField] internal List m_CharacterTable = new List(); internal Dictionary m_CharacterLookupDictionary; internal Texture2D m_AtlasTexture; [SerializeField] internal Texture2D[] m_AtlasTextures; [SerializeField] internal int m_AtlasTextureIndex; [SerializeField] private bool m_IsMultiAtlasTexturesEnabled; [SerializeField] private bool m_ClearDynamicDataOnBuild; [SerializeField] internal int m_AtlasWidth; [SerializeField] internal int m_AtlasHeight; [SerializeField] internal int m_AtlasPadding; [SerializeField] internal GlyphRenderMode m_AtlasRenderMode; [SerializeField] private List m_UsedGlyphRects; [SerializeField] private List m_FreeGlyphRects; [SerializeField] internal FontFeatureTable m_FontFeatureTable = new FontFeatureTable(); [SerializeField] internal List m_FallbackFontAssetTable; [SerializeField] internal FontAssetCreationEditorSettings m_fontAssetCreationEditorSettings; [FormerlySerializedAs("normalStyle")] [SerializeField] internal float m_RegularStyleWeight = 0f; [FormerlySerializedAs("normalSpacingOffset")] [SerializeField] internal float m_RegularStyleSpacing = 0f; [SerializeField] [FormerlySerializedAs("boldStyle")] internal float m_BoldStyleWeight = 0.75f; [SerializeField] [FormerlySerializedAs("boldSpacing")] internal float m_BoldStyleSpacing = 7f; [SerializeField] [FormerlySerializedAs("italicStyle")] internal byte m_ItalicStyleSlant = 35; [FormerlySerializedAs("tabSize")] [SerializeField] internal byte m_TabMultiple = 10; internal bool IsFontAssetLookupTablesDirty; private static ProfilerMarker k_ReadFontAssetDefinitionMarker = new ProfilerMarker("FontAsset.ReadFontAssetDefinition"); private static ProfilerMarker k_AddSynthesizedCharactersMarker = new ProfilerMarker("FontAsset.AddSynthesizedCharacters"); private static ProfilerMarker k_TryAddCharacterMarker = new ProfilerMarker("FontAsset.TryAddCharacter"); private static ProfilerMarker k_TryAddCharactersMarker = new ProfilerMarker("FontAsset.TryAddCharacters"); private static ProfilerMarker k_UpdateGlyphAdjustmentRecordsMarker = new ProfilerMarker("FontAsset.UpdateGlyphAdjustmentRecords"); private static ProfilerMarker k_ClearFontAssetDataMarker = new ProfilerMarker("FontAsset.ClearFontAssetData"); private static ProfilerMarker k_UpdateFontAssetDataMarker = new ProfilerMarker("FontAsset.UpdateFontAssetData"); private static string s_DefaultMaterialSuffix = " Atlas Material"; private static HashSet k_SearchedFontAssetLookup; private static List k_FontAssets_FontFeaturesUpdateQueue = new List(); private static HashSet k_FontAssets_FontFeaturesUpdateQueueLookup = new HashSet(); private static List k_FontAssets_AtlasTexturesUpdateQueue = new List(); private static HashSet k_FontAssets_AtlasTexturesUpdateQueueLookup = new HashSet(); private List m_GlyphsToRender = new List(); private List m_GlyphsRendered = new List(); private List m_GlyphIndexList = new List(); private List m_GlyphIndexListNewlyAdded = new List(); internal List m_GlyphsToAdd = new List(); internal HashSet m_GlyphsToAddLookup = new HashSet(); internal List m_CharactersToAdd = new List(); internal HashSet m_CharactersToAddLookup = new HashSet(); internal List s_MissingCharacterList = new List(); internal HashSet m_MissingUnicodesFromFontFile = new HashSet(); internal static uint[] k_GlyphIndexArray; public Font sourceFontFile { get { return m_SourceFontFile; } internal set { m_SourceFontFile = value; } } public AtlasPopulationMode atlasPopulationMode { get { return m_AtlasPopulationMode; } set { m_AtlasPopulationMode = value; } } public FaceInfo faceInfo { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return m_FaceInfo; } set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) m_FaceInfo = value; } } internal int familyNameHashCode { get { if (m_FamilyNameHashCode == 0) { m_FamilyNameHashCode = TextUtilities.GetHashCodeCaseInSensitive(((FaceInfo)(ref m_FaceInfo)).familyName); } return m_FamilyNameHashCode; } set { m_FamilyNameHashCode = value; } } internal int styleNameHashCode { get { if (m_StyleNameHashCode == 0) { m_StyleNameHashCode = TextUtilities.GetHashCodeCaseInSensitive(((FaceInfo)(ref m_FaceInfo)).styleName); } return m_StyleNameHashCode; } set { m_StyleNameHashCode = value; } } public FontWeightPair[] fontWeightTable { get { return m_FontWeightTable; } internal set { m_FontWeightTable = value; } } public List glyphTable { get { return m_GlyphTable; } internal set { m_GlyphTable = value; } } public Dictionary glyphLookupTable { get { if (m_GlyphLookupDictionary == null) { ReadFontAssetDefinition(); } return m_GlyphLookupDictionary; } } public List characterTable { get { return m_CharacterTable; } internal set { m_CharacterTable = value; } } public Dictionary characterLookupTable { get { if (m_CharacterLookupDictionary == null) { ReadFontAssetDefinition(); } return m_CharacterLookupDictionary; } } public Texture2D atlasTexture { get { if ((Object)(object)m_AtlasTexture == (Object)null) { m_AtlasTexture = atlasTextures[0]; } return m_AtlasTexture; } } public Texture2D[] atlasTextures { get { if (m_AtlasTextures == null) { } return m_AtlasTextures; } set { m_AtlasTextures = value; } } public int atlasTextureCount => m_AtlasTextureIndex + 1; public bool isMultiAtlasTexturesEnabled { get { return m_IsMultiAtlasTexturesEnabled; } set { m_IsMultiAtlasTexturesEnabled = value; } } internal bool clearDynamicDataOnBuild { get { return m_ClearDynamicDataOnBuild; } set { m_ClearDynamicDataOnBuild = value; } } public int atlasWidth { get { return m_AtlasWidth; } internal set { m_AtlasWidth = value; } } public int atlasHeight { get { return m_AtlasHeight; } internal set { m_AtlasHeight = value; } } public int atlasPadding { get { return m_AtlasPadding; } internal set { m_AtlasPadding = value; } } public GlyphRenderMode atlasRenderMode { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return m_AtlasRenderMode; } internal set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) m_AtlasRenderMode = value; } } internal List usedGlyphRects { get { return m_UsedGlyphRects; } set { m_UsedGlyphRects = value; } } internal List freeGlyphRects { get { return m_FreeGlyphRects; } set { m_FreeGlyphRects = value; } } public FontFeatureTable fontFeatureTable { get { return m_FontFeatureTable; } internal set { m_FontFeatureTable = value; } } public List fallbackFontAssetTable { get { return m_FallbackFontAssetTable; } set { m_FallbackFontAssetTable = value; } } public FontAssetCreationEditorSettings fontAssetCreationEditorSettings { get { return m_fontAssetCreationEditorSettings; } set { m_fontAssetCreationEditorSettings = value; } } public float regularStyleWeight { get { return m_RegularStyleWeight; } set { m_RegularStyleWeight = value; } } public float regularStyleSpacing { get { return m_RegularStyleSpacing; } set { m_RegularStyleSpacing = value; } } public float boldStyleWeight { get { return m_BoldStyleWeight; } set { m_BoldStyleWeight = value; } } public float boldStyleSpacing { get { return m_BoldStyleSpacing; } set { m_BoldStyleSpacing = value; } } public byte italicStyleSlant { get { return m_ItalicStyleSlant; } set { m_ItalicStyleSlant = value; } } public byte tabMultiple { get { return m_TabMultiple; } set { m_TabMultiple = value; } } public static FontAsset CreateFontAsset(string familyName, string styleName, int pointSize = 90) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) FontReference val = default(FontReference); if (FontEngine.TryGetSystemFontReference(familyName, styleName, ref val)) { return CreateFontAsset(val.filePath, val.faceIndex, pointSize, 9, (GlyphRenderMode)4165, 1024, 1024); } Debug.Log((object)("Unable to find a font file with the specified Family Name [" + familyName + "] and Style [" + styleName + "].")); return null; } private static FontAsset CreateFontAsset(string fontFilePath, int faceIndex, int samplingPointSize, int atlasPadding, GlyphRenderMode renderMode, int atlasWidth, int atlasHeight, AtlasPopulationMode atlasPopulationMode = AtlasPopulationMode.DynamicOS, bool enableMultiAtlasSupport = true) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_002d: Unknown result type (might be due to invalid IL or missing references) if ((int)FontEngine.LoadFontFace(fontFilePath, samplingPointSize, faceIndex) > 0) { Debug.Log((object)("Unable to load font face for [" + fontFilePath + "].")); return null; } return CreateFontAssetInstance(null, atlasPadding, renderMode, atlasWidth, atlasHeight, atlasPopulationMode, enableMultiAtlasSupport); } public static FontAsset CreateFontAsset(Font font) { return CreateFontAsset(font, 90, 9, (GlyphRenderMode)4165, 1024, 1024); } public static FontAsset CreateFontAsset(Font font, int samplingPointSize, int atlasPadding, GlyphRenderMode renderMode, int atlasWidth, int atlasHeight, AtlasPopulationMode atlasPopulationMode = AtlasPopulationMode.Dynamic, bool enableMultiAtlasSupport = true) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return CreateFontAsset(font, 0, samplingPointSize, atlasPadding, renderMode, atlasWidth, atlasHeight, atlasPopulationMode, enableMultiAtlasSupport); } private static FontAsset CreateFontAsset(Font font, int faceIndex, int samplingPointSize, int atlasPadding, GlyphRenderMode renderMode, int atlasWidth, int atlasHeight, AtlasPopulationMode atlasPopulationMode = AtlasPopulationMode.Dynamic, bool enableMultiAtlasSupport = true) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_005c: Unknown result type (might be due to invalid IL or missing references) if ((int)FontEngine.LoadFontFace(font, samplingPointSize, faceIndex) > 0) { if (((Object)font).name == "Arial") { return CreateFontAsset("Arial", "Regular"); } Debug.LogWarning((object)("Unable to load font face for [" + ((Object)font).name + "]. Make sure \"Include Font Data\" is enabled in the Font Import Settings."), (Object)(object)font); return null; } return CreateFontAssetInstance(font, atlasPadding, renderMode, atlasWidth, atlasHeight, atlasPopulationMode, enableMultiAtlasSupport); } private static FontAsset CreateFontAssetInstance(Font font, int atlasPadding, GlyphRenderMode renderMode, int atlasWidth, int atlasHeight, AtlasPopulationMode atlasPopulationMode, bool enableMultiAtlasSupport) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Invalid comparison between Unknown and I4 //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_0168: Unknown result type (might be due to invalid IL or missing references) FontAsset fontAsset = ScriptableObject.CreateInstance(); fontAsset.m_Version = "1.1.0"; fontAsset.faceInfo = FontEngine.GetFaceInfo(); if (atlasPopulationMode == AtlasPopulationMode.Dynamic) { fontAsset.sourceFontFile = font; } fontAsset.atlasPopulationMode = atlasPopulationMode; fontAsset.atlasWidth = atlasWidth; fontAsset.atlasHeight = atlasHeight; fontAsset.atlasPadding = atlasPadding; fontAsset.atlasRenderMode = renderMode; fontAsset.atlasTextures = (Texture2D[])(object)new Texture2D[1]; Texture2D val = new Texture2D(0, 0, (TextureFormat)1, false); fontAsset.atlasTextures[0] = val; fontAsset.isMultiAtlasTexturesEnabled = enableMultiAtlasSupport; int num; if ((renderMode & 0x10) == 16) { num = 0; Material val2 = new Material(TextShaderUtilities.ShaderRef_MobileBitmap); val2.SetTexture(TextShaderUtilities.ID_MainTex, (Texture)(object)val); val2.SetFloat(TextShaderUtilities.ID_TextureWidth, (float)atlasWidth); val2.SetFloat(TextShaderUtilities.ID_TextureHeight, (float)atlasHeight); fontAsset.material = val2; } else { num = 1; Material val3 = new Material(TextShaderUtilities.ShaderRef_MobileSDF); val3.SetTexture(TextShaderUtilities.ID_MainTex, (Texture)(object)val); val3.SetFloat(TextShaderUtilities.ID_TextureWidth, (float)atlasWidth); val3.SetFloat(TextShaderUtilities.ID_TextureHeight, (float)atlasHeight); val3.SetFloat(TextShaderUtilities.ID_GradientScale, (float)(atlasPadding + num)); val3.SetFloat(TextShaderUtilities.ID_WeightNormal, fontAsset.regularStyleWeight); val3.SetFloat(TextShaderUtilities.ID_WeightBold, fontAsset.boldStyleWeight); fontAsset.material = val3; } fontAsset.freeGlyphRects = new List(8) { new GlyphRect(0, 0, atlasWidth - num, atlasHeight - num) }; fontAsset.usedGlyphRects = new List(8); fontAsset.ReadFontAssetDefinition(); return fontAsset; } private void Awake() { } private void OnDestroy() { DestroyAtlasTextures(); Object.DestroyImmediate((Object)(object)m_Material); } public void ReadFontAssetDefinition() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) InitializeDictionaryLookupTables(); AddSynthesizedCharactersAndFaceMetrics(); GlyphMetrics metrics; if (((FaceInfo)(ref m_FaceInfo)).capLine == 0f && m_CharacterLookupDictionary.ContainsKey(88u)) { uint glyphIndex = m_CharacterLookupDictionary[88u].glyphIndex; ref FaceInfo reference = ref m_FaceInfo; metrics = m_GlyphLookupDictionary[glyphIndex].metrics; ((FaceInfo)(ref reference)).capLine = ((GlyphMetrics)(ref metrics)).horizontalBearingY; } if (((FaceInfo)(ref m_FaceInfo)).meanLine == 0f && m_CharacterLookupDictionary.ContainsKey(120u)) { uint glyphIndex2 = m_CharacterLookupDictionary[120u].glyphIndex; ref FaceInfo reference2 = ref m_FaceInfo; metrics = m_GlyphLookupDictionary[glyphIndex2].metrics; ((FaceInfo)(ref reference2)).meanLine = ((GlyphMetrics)(ref metrics)).horizontalBearingY; } if (((FaceInfo)(ref m_FaceInfo)).scale == 0f) { ((FaceInfo)(ref m_FaceInfo)).scale = 1f; } if (((FaceInfo)(ref m_FaceInfo)).strikethroughOffset == 0f) { ((FaceInfo)(ref m_FaceInfo)).strikethroughOffset = ((FaceInfo)(ref m_FaceInfo)).capLine / 2.5f; } if (m_AtlasPadding == 0 && base.material.HasProperty(TextShaderUtilities.ID_GradientScale)) { m_AtlasPadding = (int)base.material.GetFloat(TextShaderUtilities.ID_GradientScale) - 1; } base.hashCode = TextUtilities.GetHashCodeCaseInSensitive(((Object)this).name); familyNameHashCode = TextUtilities.GetHashCodeCaseInSensitive(((FaceInfo)(ref m_FaceInfo)).familyName); styleNameHashCode = TextUtilities.GetHashCodeCaseInSensitive(((FaceInfo)(ref m_FaceInfo)).styleName); base.materialHashCode = TextUtilities.GetHashCodeCaseInSensitive(((Object)this).name + s_DefaultMaterialSuffix); TextResourceManager.AddFontAsset(this); IsFontAssetLookupTablesDirty = false; } internal void InitializeDictionaryLookupTables() { InitializeGlyphLookupDictionary(); InitializeCharacterLookupDictionary(); InitializeGlyphPaidAdjustmentRecordsLookupDictionary(); } internal void InitializeGlyphLookupDictionary() { if (m_GlyphLookupDictionary == null) { m_GlyphLookupDictionary = new Dictionary(); } else { m_GlyphLookupDictionary.Clear(); } if (m_GlyphIndexList == null) { m_GlyphIndexList = new List(); } else { m_GlyphIndexList.Clear(); } if (m_GlyphIndexListNewlyAdded == null) { m_GlyphIndexListNewlyAdded = new List(); } else { m_GlyphIndexListNewlyAdded.Clear(); } int count = m_GlyphTable.Count; for (int i = 0; i < count; i++) { Glyph val = m_GlyphTable[i]; uint index = val.index; if (!m_GlyphLookupDictionary.ContainsKey(index)) { m_GlyphLookupDictionary.Add(index, val); m_GlyphIndexList.Add(index); } } } internal void InitializeCharacterLookupDictionary() { if (m_CharacterLookupDictionary == null) { m_CharacterLookupDictionary = new Dictionary(); } else { m_CharacterLookupDictionary.Clear(); } for (int i = 0; i < m_CharacterTable.Count; i++) { Character character = m_CharacterTable[i]; uint unicode = character.unicode; uint glyphIndex = character.glyphIndex; if (!m_CharacterLookupDictionary.ContainsKey(unicode)) { m_CharacterLookupDictionary.Add(unicode, character); character.textAsset = this; character.glyph = m_GlyphLookupDictionary[glyphIndex]; } } } internal void InitializeGlyphPaidAdjustmentRecordsLookupDictionary() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup == null) { m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup = new Dictionary(); } else { m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.Clear(); } List glyphPairAdjustmentRecords = m_FontFeatureTable.m_GlyphPairAdjustmentRecords; if (glyphPairAdjustmentRecords == null) { return; } for (int i = 0; i < glyphPairAdjustmentRecords.Count; i++) { GlyphPairAdjustmentRecord value = glyphPairAdjustmentRecords[i]; GlyphAdjustmentRecord val = ((GlyphPairAdjustmentRecord)(ref value)).secondAdjustmentRecord; uint num = ((GlyphAdjustmentRecord)(ref val)).glyphIndex << 16; val = ((GlyphPairAdjustmentRecord)(ref value)).firstAdjustmentRecord; uint key = num | ((GlyphAdjustmentRecord)(ref val)).glyphIndex; if (!m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.ContainsKey(key)) { m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.Add(key, value); } } } internal void AddSynthesizedCharactersAndFaceMetrics() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 bool flag = false; if (m_AtlasPopulationMode == AtlasPopulationMode.Dynamic || m_AtlasPopulationMode == AtlasPopulationMode.DynamicOS) { flag = (int)LoadFontFace() == 0; if (!flag && !InternalDynamicOS) { Debug.LogWarning((object)("Unable to load font face for [" + ((Object)this).name + "] font asset."), (Object)(object)this); } } AddSynthesizedCharacter(3u, flag, addImmediately: true); AddSynthesizedCharacter(9u, flag, addImmediately: true); AddSynthesizedCharacter(10u, flag); AddSynthesizedCharacter(11u, flag); AddSynthesizedCharacter(13u, flag); AddSynthesizedCharacter(1564u, flag); AddSynthesizedCharacter(8203u, flag); AddSynthesizedCharacter(8206u, flag); AddSynthesizedCharacter(8207u, flag); AddSynthesizedCharacter(8232u, flag); AddSynthesizedCharacter(8233u, flag); AddSynthesizedCharacter(8288u, flag); } private void AddSynthesizedCharacter(uint unicode, bool isFontFaceLoaded, bool addImmediately = false) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (m_CharacterLookupDictionary.ContainsKey(unicode)) { return; } if (isFontFaceLoaded && FontEngine.GetGlyphIndex(unicode) != 0) { if (addImmediately) { GlyphLoadFlags val = (GlyphLoadFlags)(((m_AtlasRenderMode & 4) == 4) ? 10 : 8); Glyph glyph = default(Glyph); if (FontEngine.TryGetGlyphWithUnicodeValue(unicode, val, ref glyph)) { m_CharacterLookupDictionary.Add(unicode, new Character(unicode, this, glyph)); } } } else { Glyph glyph = new Glyph(0u, new GlyphMetrics(0f, 0f, 0f, 0f, 0f), GlyphRect.zero, 1f, 0); m_CharacterLookupDictionary.Add(unicode, new Character(unicode, this, glyph)); } } internal void AddCharacterToLookupCache(uint unicode, Character character) { m_CharacterLookupDictionary.Add(unicode, character); } private FontEngineError LoadFontFace() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (m_AtlasPopulationMode == AtlasPopulationMode.Dynamic) { return FontEngine.LoadFontFace(m_SourceFontFile, ((FaceInfo)(ref m_FaceInfo)).pointSize, ((FaceInfo)(ref m_FaceInfo)).faceIndex); } return FontEngine.LoadFontFace(((FaceInfo)(ref m_FaceInfo)).familyName, ((FaceInfo)(ref m_FaceInfo)).styleName, ((FaceInfo)(ref m_FaceInfo)).pointSize); } internal void SortCharacterTable() { if (m_CharacterTable != null && m_CharacterTable.Count > 0) { m_CharacterTable = m_CharacterTable.OrderBy((Character c) => c.unicode).ToList(); } } internal void SortGlyphTable() { if (m_GlyphTable != null && m_GlyphTable.Count > 0) { m_GlyphTable = m_GlyphTable.OrderBy((Glyph c) => c.index).ToList(); } } internal void SortFontFeatureTable() { m_FontFeatureTable.SortGlyphPairAdjustmentRecords(); } internal void SortAllTables() { SortGlyphTable(); SortCharacterTable(); SortFontFeatureTable(); } public bool HasCharacter(int character) { if (m_CharacterLookupDictionary == null) { return false; } return m_CharacterLookupDictionary.ContainsKey((uint)character); } public bool HasCharacter(char character, bool searchFallbacks = false, bool tryAddCharacter = false) { if (m_CharacterLookupDictionary == null) { ReadFontAssetDefinition(); if (m_CharacterLookupDictionary == null) { return false; } } if (m_CharacterLookupDictionary.ContainsKey(character)) { return true; } if (tryAddCharacter && (m_AtlasPopulationMode == AtlasPopulationMode.Dynamic || m_AtlasPopulationMode == AtlasPopulationMode.DynamicOS) && TryAddCharacterInternal(character, out var _)) { return true; } if (searchFallbacks) { if (k_SearchedFontAssetLookup == null) { k_SearchedFontAssetLookup = new HashSet(); } else { k_SearchedFontAssetLookup.Clear(); } k_SearchedFontAssetLookup.Add(((Object)this).GetInstanceID()); if (fallbackFontAssetTable != null && fallbackFontAssetTable.Count > 0) { for (int i = 0; i < fallbackFontAssetTable.Count && (Object)(object)fallbackFontAssetTable[i] != (Object)null; i++) { FontAsset fontAsset = fallbackFontAssetTable[i]; int item = ((Object)fontAsset).GetInstanceID(); if (k_SearchedFontAssetLookup.Add(item) && fontAsset.HasCharacter_Internal(character, searchFallbacks: true, tryAddCharacter)) { return true; } } } } return false; } private bool HasCharacter_Internal(uint character, bool searchFallbacks = false, bool tryAddCharacter = false) { if (m_CharacterLookupDictionary == null) { ReadFontAssetDefinition(); if (m_CharacterLookupDictionary == null) { return false; } } if (m_CharacterLookupDictionary.ContainsKey(character)) { return true; } if (tryAddCharacter && (atlasPopulationMode == AtlasPopulationMode.Dynamic || m_AtlasPopulationMode == AtlasPopulationMode.DynamicOS) && TryAddCharacterInternal(character, out var _)) { return true; } if (searchFallbacks) { if (fallbackFontAssetTable == null || fallbackFontAssetTable.Count == 0) { return false; } for (int i = 0; i < fallbackFontAssetTable.Count && (Object)(object)fallbackFontAssetTable[i] != (Object)null; i++) { FontAsset fontAsset = fallbackFontAssetTable[i]; int item = ((Object)fontAsset).GetInstanceID(); if (k_SearchedFontAssetLookup.Add(item) && fontAsset.HasCharacter_Internal(character, searchFallbacks: true, tryAddCharacter)) { return true; } } } return false; } public bool HasCharacters(string text, out List missingCharacters) { if (m_CharacterLookupDictionary == null) { missingCharacters = null; return false; } missingCharacters = new List(); for (int i = 0; i < text.Length; i++) { if (!m_CharacterLookupDictionary.ContainsKey(text[i])) { missingCharacters.Add(text[i]); } } if (missingCharacters.Count == 0) { return true; } return false; } public bool HasCharacters(string text, out uint[] missingCharacters, bool searchFallbacks = false, bool tryAddCharacter = false) { missingCharacters = null; if (m_CharacterLookupDictionary == null) { ReadFontAssetDefinition(); if (m_CharacterLookupDictionary == null) { return false; } } s_MissingCharacterList.Clear(); for (int i = 0; i < text.Length; i++) { bool flag = true; uint num = text[i]; if (m_CharacterLookupDictionary.ContainsKey(num) || (tryAddCharacter && (atlasPopulationMode == AtlasPopulationMode.Dynamic || m_AtlasPopulationMode == AtlasPopulationMode.DynamicOS) && TryAddCharacterInternal(num, out var _))) { continue; } if (searchFallbacks) { if (k_SearchedFontAssetLookup == null) { k_SearchedFontAssetLookup = new HashSet(); } else { k_SearchedFontAssetLookup.Clear(); } k_SearchedFontAssetLookup.Add(((Object)this).GetInstanceID()); if (fallbackFontAssetTable != null && fallbackFontAssetTable.Count > 0) { for (int j = 0; j < fallbackFontAssetTable.Count && (Object)(object)fallbackFontAssetTable[j] != (Object)null; j++) { FontAsset fontAsset = fallbackFontAssetTable[j]; int item = ((Object)fontAsset).GetInstanceID(); if (k_SearchedFontAssetLookup.Add(item) && fontAsset.HasCharacter_Internal(num, searchFallbacks: true, tryAddCharacter)) { flag = false; break; } } } } if (flag) { s_MissingCharacterList.Add(num); } } if (s_MissingCharacterList.Count > 0) { missingCharacters = s_MissingCharacterList.ToArray(); return false; } return true; } public bool HasCharacters(string text) { if (m_CharacterLookupDictionary == null) { return false; } for (int i = 0; i < text.Length; i++) { if (!m_CharacterLookupDictionary.ContainsKey(text[i])) { return false; } } return true; } public static string GetCharacters(FontAsset fontAsset) { string text = string.Empty; for (int i = 0; i < fontAsset.characterTable.Count; i++) { text += (char)fontAsset.characterTable[i].unicode; } return text; } public static int[] GetCharactersArray(FontAsset fontAsset) { int[] array = new int[fontAsset.characterTable.Count]; for (int i = 0; i < fontAsset.characterTable.Count; i++) { array[i] = (int)fontAsset.characterTable[i].unicode; } return array; } internal uint GetGlyphIndex(uint unicode) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (m_CharacterLookupDictionary.ContainsKey(unicode)) { return m_CharacterLookupDictionary[unicode].glyphIndex; } return ((int)LoadFontFace() == 0) ? FontEngine.GetGlyphIndex(unicode) : 0u; } internal static void RegisterFontAssetForFontFeatureUpdate(FontAsset fontAsset) { int item = fontAsset.instanceID; if (k_FontAssets_FontFeaturesUpdateQueueLookup.Add(item)) { k_FontAssets_FontFeaturesUpdateQueue.Add(fontAsset); } } internal static void UpdateFontFeaturesForFontAssetsInQueue() { int count = k_FontAssets_FontFeaturesUpdateQueue.Count; for (int i = 0; i < count; i++) { k_FontAssets_FontFeaturesUpdateQueue[i].UpdateGlyphAdjustmentRecords(); } if (count > 0) { k_FontAssets_FontFeaturesUpdateQueue.Clear(); k_FontAssets_FontFeaturesUpdateQueueLookup.Clear(); } } internal static void RegisterAtlasTextureForApply(Texture2D texture) { int item = ((Object)texture).GetInstanceID(); if (k_FontAssets_AtlasTexturesUpdateQueueLookup.Add(item)) { k_FontAssets_AtlasTexturesUpdateQueue.Add(texture); } } internal static void UpdateAtlasTexturesInQueue() { int count = k_FontAssets_AtlasTexturesUpdateQueueLookup.Count; for (int i = 0; i < count; i++) { k_FontAssets_AtlasTexturesUpdateQueue[i].Apply(false, false); } if (count > 0) { k_FontAssets_AtlasTexturesUpdateQueue.Clear(); k_FontAssets_AtlasTexturesUpdateQueueLookup.Clear(); } } internal static void UpdateFontAssetInUpdateQueue() { UpdateAtlasTexturesInQueue(); UpdateFontFeaturesForFontAssetsInQueue(); } public bool TryAddCharacters(uint[] unicodes, bool includeFontFeatures = false) { uint[] missingUnicodes; return TryAddCharacters(unicodes, out missingUnicodes, includeFontFeatures); } public bool TryAddCharacters(uint[] unicodes, out uint[] missingUnicodes, bool includeFontFeatures = false) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Invalid comparison between Unknown and I4 //IL_02e3: Unknown result type (might be due to invalid IL or missing references) if (unicodes == null || unicodes.Length == 0 || m_AtlasPopulationMode == AtlasPopulationMode.Static) { if (m_AtlasPopulationMode == AtlasPopulationMode.Static) { Debug.LogWarning((object)("Unable to add characters to font asset [" + ((Object)this).name + "] because its AtlasPopulationMode is set to Static."), (Object)(object)this); } else { Debug.LogWarning((object)("Unable to add characters to font asset [" + ((Object)this).name + "] because the provided Unicode list is Null or Empty."), (Object)(object)this); } missingUnicodes = null; return false; } if ((int)LoadFontFace() > 0) { missingUnicodes = unicodes.ToArray(); return false; } if (m_CharacterLookupDictionary == null || m_GlyphLookupDictionary == null) { ReadFontAssetDefinition(); } m_GlyphsToAdd.Clear(); m_GlyphsToAddLookup.Clear(); m_CharactersToAdd.Clear(); m_CharactersToAddLookup.Clear(); s_MissingCharacterList.Clear(); bool flag = false; int num = unicodes.Length; for (int i = 0; i < num; i++) { uint num2 = unicodes[i]; if (m_CharacterLookupDictionary.ContainsKey(num2)) { continue; } uint glyphIndex = FontEngine.GetGlyphIndex(num2); if (glyphIndex == 0) { switch (num2) { case 160u: glyphIndex = FontEngine.GetGlyphIndex(32u); break; case 173u: case 8209u: glyphIndex = FontEngine.GetGlyphIndex(45u); break; } if (glyphIndex == 0) { s_MissingCharacterList.Add(num2); flag = true; continue; } } Character character = new Character(num2, glyphIndex); if (m_GlyphLookupDictionary.ContainsKey(glyphIndex)) { character.glyph = m_GlyphLookupDictionary[glyphIndex]; character.textAsset = this; m_CharacterTable.Add(character); m_CharacterLookupDictionary.Add(num2, character); continue; } if (m_GlyphsToAddLookup.Add(glyphIndex)) { m_GlyphsToAdd.Add(glyphIndex); } if (m_CharactersToAddLookup.Add(num2)) { m_CharactersToAdd.Add(character); } } if (m_GlyphsToAdd.Count == 0) { missingUnicodes = unicodes; return false; } if (((Texture)m_AtlasTextures[m_AtlasTextureIndex]).width == 0 || ((Texture)m_AtlasTextures[m_AtlasTextureIndex]).height == 0) { m_AtlasTextures[m_AtlasTextureIndex].Reinitialize(m_AtlasWidth, m_AtlasHeight); FontEngine.ResetAtlasTexture(m_AtlasTextures[m_AtlasTextureIndex]); } Glyph[] array = default(Glyph[]); bool flag2 = FontEngine.TryAddGlyphsToTexture(m_GlyphsToAdd, m_AtlasPadding, (GlyphPackingMode)0, m_FreeGlyphRects, m_UsedGlyphRects, m_AtlasRenderMode, m_AtlasTextures[m_AtlasTextureIndex], ref array); for (int j = 0; j < array.Length && array[j] != null; j++) { Glyph val = array[j]; uint index = val.index; val.atlasIndex = m_AtlasTextureIndex; m_GlyphTable.Add(val); m_GlyphLookupDictionary.Add(index, val); m_GlyphIndexListNewlyAdded.Add(index); m_GlyphIndexList.Add(index); } m_GlyphsToAdd.Clear(); for (int k = 0; k < m_CharactersToAdd.Count; k++) { Character character2 = m_CharactersToAdd[k]; if (!m_GlyphLookupDictionary.TryGetValue(character2.glyphIndex, out var value)) { m_GlyphsToAdd.Add(character2.glyphIndex); continue; } character2.glyph = value; character2.textAsset = this; m_CharacterTable.Add(character2); m_CharacterLookupDictionary.Add(character2.unicode, character2); m_CharactersToAdd.RemoveAt(k); k--; } if (m_IsMultiAtlasTexturesEnabled && !flag2) { while (!flag2) { flag2 = TryAddGlyphsToNewAtlasTexture(); } } if (includeFontFeatures) { UpdateGlyphAdjustmentRecords(); } for (int l = 0; l < m_CharactersToAdd.Count; l++) { Character character3 = m_CharactersToAdd[l]; s_MissingCharacterList.Add(character3.unicode); } missingUnicodes = null; if (s_MissingCharacterList.Count > 0) { missingUnicodes = s_MissingCharacterList.ToArray(); } return flag2 && !flag; } public bool TryAddCharacters(string characters, bool includeFontFeatures = false) { string missingCharacters; return TryAddCharacters(characters, out missingCharacters, includeFontFeatures); } public bool TryAddCharacters(string characters, out string missingCharacters, bool includeFontFeatures = false) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_02e8: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(characters) || m_AtlasPopulationMode == AtlasPopulationMode.Static) { if (m_AtlasPopulationMode == AtlasPopulationMode.Static) { Debug.LogWarning((object)("Unable to add characters to font asset [" + ((Object)this).name + "] because its AtlasPopulationMode is set to Static."), (Object)(object)this); } else { Debug.LogWarning((object)("Unable to add characters to font asset [" + ((Object)this).name + "] because the provided character list is Null or Empty."), (Object)(object)this); } missingCharacters = characters; return false; } if ((int)LoadFontFace() > 0) { missingCharacters = characters; return false; } if (m_CharacterLookupDictionary == null || m_GlyphLookupDictionary == null) { ReadFontAssetDefinition(); } m_GlyphsToAdd.Clear(); m_GlyphsToAddLookup.Clear(); m_CharactersToAdd.Clear(); m_CharactersToAddLookup.Clear(); s_MissingCharacterList.Clear(); bool flag = false; int length = characters.Length; for (int i = 0; i < length; i++) { uint num = characters[i]; if (m_CharacterLookupDictionary.ContainsKey(num)) { continue; } uint glyphIndex = FontEngine.GetGlyphIndex(num); if (glyphIndex == 0) { switch (num) { case 160u: glyphIndex = FontEngine.GetGlyphIndex(32u); break; case 173u: case 8209u: glyphIndex = FontEngine.GetGlyphIndex(45u); break; } if (glyphIndex == 0) { s_MissingCharacterList.Add(num); flag = true; continue; } } Character character = new Character(num, glyphIndex); if (m_GlyphLookupDictionary.ContainsKey(glyphIndex)) { character.glyph = m_GlyphLookupDictionary[glyphIndex]; character.textAsset = this; m_CharacterTable.Add(character); m_CharacterLookupDictionary.Add(num, character); continue; } if (m_GlyphsToAddLookup.Add(glyphIndex)) { m_GlyphsToAdd.Add(glyphIndex); } if (m_CharactersToAddLookup.Add(num)) { m_CharactersToAdd.Add(character); } } if (m_GlyphsToAdd.Count == 0) { missingCharacters = characters; return false; } if (((Texture)m_AtlasTextures[m_AtlasTextureIndex]).width == 0 || ((Texture)m_AtlasTextures[m_AtlasTextureIndex]).height == 0) { m_AtlasTextures[m_AtlasTextureIndex].Reinitialize(m_AtlasWidth, m_AtlasHeight); FontEngine.ResetAtlasTexture(m_AtlasTextures[m_AtlasTextureIndex]); } Glyph[] array = default(Glyph[]); bool flag2 = FontEngine.TryAddGlyphsToTexture(m_GlyphsToAdd, m_AtlasPadding, (GlyphPackingMode)0, m_FreeGlyphRects, m_UsedGlyphRects, m_AtlasRenderMode, m_AtlasTextures[m_AtlasTextureIndex], ref array); for (int j = 0; j < array.Length && array[j] != null; j++) { Glyph val = array[j]; uint index = val.index; val.atlasIndex = m_AtlasTextureIndex; m_GlyphTable.Add(val); m_GlyphLookupDictionary.Add(index, val); m_GlyphIndexListNewlyAdded.Add(index); m_GlyphIndexList.Add(index); } m_GlyphsToAdd.Clear(); for (int k = 0; k < m_CharactersToAdd.Count; k++) { Character character2 = m_CharactersToAdd[k]; if (!m_GlyphLookupDictionary.TryGetValue(character2.glyphIndex, out var value)) { m_GlyphsToAdd.Add(character2.glyphIndex); continue; } character2.glyph = value; character2.textAsset = this; m_CharacterTable.Add(character2); m_CharacterLookupDictionary.Add(character2.unicode, character2); m_CharactersToAdd.RemoveAt(k); k--; } if (m_IsMultiAtlasTexturesEnabled && !flag2) { while (!flag2) { flag2 = TryAddGlyphsToNewAtlasTexture(); } } if (includeFontFeatures) { UpdateGlyphAdjustmentRecords(); } missingCharacters = string.Empty; for (int l = 0; l < m_CharactersToAdd.Count; l++) { Character character3 = m_CharactersToAdd[l]; s_MissingCharacterList.Add(character3.unicode); } if (s_MissingCharacterList.Count > 0) { missingCharacters = s_MissingCharacterList.UintToString(); } return flag2 && !flag; } internal bool TryAddCharacterInternal(uint unicode, out Character character, bool shouldGetFontFeatures = false) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) character = null; if (m_MissingUnicodesFromFontFile.Contains(unicode)) { return false; } if ((int)LoadFontFace() > 0) { return false; } uint glyphIndex = FontEngine.GetGlyphIndex(unicode); if (glyphIndex == 0) { switch (unicode) { case 160u: glyphIndex = FontEngine.GetGlyphIndex(32u); break; case 173u: case 8209u: glyphIndex = FontEngine.GetGlyphIndex(45u); break; } if (glyphIndex == 0) { m_MissingUnicodesFromFontFile.Add(unicode); return false; } } if (m_GlyphLookupDictionary.ContainsKey(glyphIndex)) { character = new Character(unicode, this, m_GlyphLookupDictionary[glyphIndex]); m_CharacterTable.Add(character); m_CharacterLookupDictionary.Add(unicode, character); return true; } Glyph val = null; if (!((Texture)m_AtlasTextures[m_AtlasTextureIndex]).isReadable) { Debug.LogWarning((object)("Unable to add the requested character to font asset [" + ((Object)this).name + "]'s atlas texture. Please make the texture [" + ((Object)m_AtlasTextures[m_AtlasTextureIndex]).name + "] readable."), (Object)(object)m_AtlasTextures[m_AtlasTextureIndex]); return false; } if (((Texture)m_AtlasTextures[m_AtlasTextureIndex]).width == 0 || ((Texture)m_AtlasTextures[m_AtlasTextureIndex]).height == 0) { m_AtlasTextures[m_AtlasTextureIndex].Reinitialize(m_AtlasWidth, m_AtlasHeight); FontEngine.ResetAtlasTexture(m_AtlasTextures[m_AtlasTextureIndex]); } FontEngine.SetTextureUploadMode(false); if (FontEngine.TryAddGlyphToTexture(glyphIndex, m_AtlasPadding, (GlyphPackingMode)0, m_FreeGlyphRects, m_UsedGlyphRects, m_AtlasRenderMode, m_AtlasTextures[m_AtlasTextureIndex], ref val)) { val.atlasIndex = m_AtlasTextureIndex; m_GlyphTable.Add(val); m_GlyphLookupDictionary.Add(glyphIndex, val); character = new Character(unicode, this, val); m_CharacterTable.Add(character); m_CharacterLookupDictionary.Add(unicode, character); m_GlyphIndexList.Add(glyphIndex); m_GlyphIndexListNewlyAdded.Add(glyphIndex); if (shouldGetFontFeatures) { RegisterFontAssetForFontFeatureUpdate(this); } RegisterAtlasTextureForApply(m_AtlasTextures[m_AtlasTextureIndex]); FontEngine.SetTextureUploadMode(true); return true; } if (m_IsMultiAtlasTexturesEnabled) { SetupNewAtlasTexture(); if (FontEngine.TryAddGlyphToTexture(glyphIndex, m_AtlasPadding, (GlyphPackingMode)0, m_FreeGlyphRects, m_UsedGlyphRects, m_AtlasRenderMode, m_AtlasTextures[m_AtlasTextureIndex], ref val)) { val.atlasIndex = m_AtlasTextureIndex; m_GlyphTable.Add(val); m_GlyphLookupDictionary.Add(glyphIndex, val); character = new Character(unicode, this, val); m_CharacterTable.Add(character); m_CharacterLookupDictionary.Add(unicode, character); m_GlyphIndexList.Add(glyphIndex); m_GlyphIndexListNewlyAdded.Add(glyphIndex); if (shouldGetFontFeatures) { RegisterFontAssetForFontFeatureUpdate(this); } RegisterAtlasTextureForApply(m_AtlasTextures[m_AtlasTextureIndex]); FontEngine.SetTextureUploadMode(true); return true; } } return false; } internal bool TryGetCharacter_and_QueueRenderToTexture(uint unicode, out Character character, bool shouldGetFontFeatures = false) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Invalid comparison between Unknown and I4 //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) character = null; if (m_MissingUnicodesFromFontFile.Contains(unicode)) { return false; } if ((int)LoadFontFace() > 0) { return false; } uint glyphIndex = FontEngine.GetGlyphIndex(unicode); if (glyphIndex == 0) { switch (unicode) { case 160u: glyphIndex = FontEngine.GetGlyphIndex(32u); break; case 173u: case 8209u: glyphIndex = FontEngine.GetGlyphIndex(45u); break; } if (glyphIndex == 0) { m_MissingUnicodesFromFontFile.Add(unicode); return false; } } if (m_GlyphLookupDictionary.ContainsKey(glyphIndex)) { character = new Character(unicode, this, m_GlyphLookupDictionary[glyphIndex]); m_CharacterTable.Add(character); m_CharacterLookupDictionary.Add(unicode, character); return true; } GlyphLoadFlags val = (GlyphLoadFlags)(((4 & m_AtlasRenderMode) == 4) ? 10 : 8); Glyph val2 = null; if (FontEngine.TryGetGlyphWithIndexValue(glyphIndex, val, ref val2)) { m_GlyphTable.Add(val2); m_GlyphLookupDictionary.Add(glyphIndex, val2); character = new Character(unicode, this, val2); m_CharacterTable.Add(character); m_CharacterLookupDictionary.Add(unicode, character); m_GlyphIndexList.Add(glyphIndex); m_GlyphIndexListNewlyAdded.Add(glyphIndex); if (shouldGetFontFeatures) { RegisterFontAssetForFontFeatureUpdate(this); } m_GlyphsToRender.Add(val2); return true; } return false; } internal void TryAddGlyphsToAtlasTextures() { } private bool TryAddGlyphsToNewAtlasTexture() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) SetupNewAtlasTexture(); Glyph[] array = default(Glyph[]); bool result = FontEngine.TryAddGlyphsToTexture(m_GlyphsToAdd, m_AtlasPadding, (GlyphPackingMode)0, m_FreeGlyphRects, m_UsedGlyphRects, m_AtlasRenderMode, m_AtlasTextures[m_AtlasTextureIndex], ref array); for (int i = 0; i < array.Length && array[i] != null; i++) { Glyph val = array[i]; uint index = val.index; val.atlasIndex = m_AtlasTextureIndex; m_GlyphTable.Add(val); m_GlyphLookupDictionary.Add(index, val); m_GlyphIndexListNewlyAdded.Add(index); m_GlyphIndexList.Add(index); } m_GlyphsToAdd.Clear(); for (int j = 0; j < m_CharactersToAdd.Count; j++) { Character character = m_CharactersToAdd[j]; if (!m_GlyphLookupDictionary.TryGetValue(character.glyphIndex, out var value)) { m_GlyphsToAdd.Add(character.glyphIndex); continue; } character.glyph = value; character.textAsset = this; m_CharacterTable.Add(character); m_CharacterLookupDictionary.Add(character.unicode, character); m_CharactersToAdd.RemoveAt(j); j--; } return result; } private void SetupNewAtlasTexture() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Invalid comparison between Unknown and I4 //IL_00a2: Unknown result type (might be due to invalid IL or missing references) m_AtlasTextureIndex++; if (m_AtlasTextures.Length == m_AtlasTextureIndex) { Array.Resize(ref m_AtlasTextures, m_AtlasTextures.Length * 2); } m_AtlasTextures[m_AtlasTextureIndex] = new Texture2D(m_AtlasWidth, m_AtlasHeight, (TextureFormat)1, false); FontEngine.ResetAtlasTexture(m_AtlasTextures[m_AtlasTextureIndex]); int num = (((m_AtlasRenderMode & 0x10) != 16) ? 1 : 0); m_FreeGlyphRects.Clear(); m_FreeGlyphRects.Add(new GlyphRect(0, 0, m_AtlasWidth - num, m_AtlasHeight - num)); m_UsedGlyphRects.Clear(); } internal void UpdateAtlasTexture() { if (m_GlyphsToRender.Count != 0) { if (((Texture)m_AtlasTextures[m_AtlasTextureIndex]).width == 0 || ((Texture)m_AtlasTextures[m_AtlasTextureIndex]).height == 0) { m_AtlasTextures[m_AtlasTextureIndex].Reinitialize(m_AtlasWidth, m_AtlasHeight); FontEngine.ResetAtlasTexture(m_AtlasTextures[m_AtlasTextureIndex]); } m_AtlasTextures[m_AtlasTextureIndex].Apply(false, false); } } internal void UpdateGlyphAdjustmentRecords() { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) int num = default(int); GlyphPairAdjustmentRecord[] glyphPairAdjustmentRecords = FontEngine.GetGlyphPairAdjustmentRecords(m_GlyphIndexList, ref num); m_GlyphIndexListNewlyAdded.Clear(); if (glyphPairAdjustmentRecords == null || glyphPairAdjustmentRecords.Length == 0) { return; } if (m_FontFeatureTable == null) { m_FontFeatureTable = new FontFeatureTable(); } for (int i = 0; i < glyphPairAdjustmentRecords.Length; i++) { GlyphAdjustmentRecord val = ((GlyphPairAdjustmentRecord)(ref glyphPairAdjustmentRecords[i])).firstAdjustmentRecord; if (((GlyphAdjustmentRecord)(ref val)).glyphIndex != 0) { val = ((GlyphPairAdjustmentRecord)(ref glyphPairAdjustmentRecords[i])).secondAdjustmentRecord; uint num2 = ((GlyphAdjustmentRecord)(ref val)).glyphIndex << 16; val = ((GlyphPairAdjustmentRecord)(ref glyphPairAdjustmentRecords[i])).firstAdjustmentRecord; uint key = num2 | ((GlyphAdjustmentRecord)(ref val)).glyphIndex; if (!m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.ContainsKey(key)) { GlyphPairAdjustmentRecord val2 = glyphPairAdjustmentRecords[i]; m_FontFeatureTable.m_GlyphPairAdjustmentRecords.Add(val2); m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.Add(key, val2); } continue; } break; } } internal void UpdateGlyphAdjustmentRecords(uint[] glyphIndexes) { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) GlyphPairAdjustmentRecord[] glyphPairAdjustmentTable = FontEngine.GetGlyphPairAdjustmentTable(glyphIndexes); if (glyphPairAdjustmentTable == null || glyphPairAdjustmentTable.Length == 0) { return; } if (m_FontFeatureTable == null) { m_FontFeatureTable = new FontFeatureTable(); } for (int i = 0; i < glyphPairAdjustmentTable.Length; i++) { GlyphAdjustmentRecord val = ((GlyphPairAdjustmentRecord)(ref glyphPairAdjustmentTable[i])).firstAdjustmentRecord; if (((GlyphAdjustmentRecord)(ref val)).glyphIndex != 0) { val = ((GlyphPairAdjustmentRecord)(ref glyphPairAdjustmentTable[i])).secondAdjustmentRecord; uint num = ((GlyphAdjustmentRecord)(ref val)).glyphIndex << 16; val = ((GlyphPairAdjustmentRecord)(ref glyphPairAdjustmentTable[i])).firstAdjustmentRecord; uint key = num | ((GlyphAdjustmentRecord)(ref val)).glyphIndex; if (!m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.ContainsKey(key)) { GlyphPairAdjustmentRecord val2 = glyphPairAdjustmentTable[i]; m_FontFeatureTable.m_GlyphPairAdjustmentRecords.Add(val2); m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.Add(key, val2); } continue; } break; } } internal void UpdateGlyphAdjustmentRecords(List glyphIndexes) { } internal void UpdateGlyphAdjustmentRecords(List newGlyphIndexes, List allGlyphIndexes) { } private void CopyListDataToArray(List srcList, ref T[] dstArray) { int count = srcList.Count; if (dstArray == null) { dstArray = new T[count]; } else { Array.Resize(ref dstArray, count); } for (int i = 0; i < count; i++) { dstArray[i] = srcList[i]; } } public void ClearFontAssetData(bool setAtlasSizeToZero = false) { ClearFontAssetTables(); ClearAtlasTextures(setAtlasSizeToZero); ReadFontAssetDefinition(); } internal void ClearFontAssetDataInternal() { ClearFontAssetTables(); ClearAtlasTextures(setAtlasSizeToZero: true); } internal void UpdateFontAssetData() { uint[] array = new uint[m_CharacterTable.Count]; for (int i = 0; i < m_CharacterTable.Count; i++) { array[i] = m_CharacterTable[i].unicode; } ClearFontAssetTables(); ClearAtlasTextures(setAtlasSizeToZero: true); ReadFontAssetDefinition(); if (array.Length != 0) { TryAddCharacters(array, includeFontFeatures: true); } } internal void ClearFontAssetTables() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (m_GlyphTable != null) { m_GlyphTable.Clear(); } if (m_CharacterTable != null) { m_CharacterTable.Clear(); } if (m_UsedGlyphRects != null) { m_UsedGlyphRects.Clear(); } if (m_FreeGlyphRects != null) { int num = (((m_AtlasRenderMode & 0x10) != 16) ? 1 : 0); m_FreeGlyphRects.Clear(); m_FreeGlyphRects.Add(new GlyphRect(0, 0, m_AtlasWidth - num, m_AtlasHeight - num)); } if (m_GlyphsToRender != null) { m_GlyphsToRender.Clear(); } if (m_GlyphsRendered != null) { m_GlyphsRendered.Clear(); } if (m_FontFeatureTable != null && m_FontFeatureTable.m_GlyphPairAdjustmentRecords != null) { m_FontFeatureTable.glyphPairAdjustmentRecords.Clear(); } } internal void ClearAtlasTextures(bool setAtlasSizeToZero = false) { m_AtlasTextureIndex = 0; if (m_AtlasTextures == null) { return; } Texture2D val = null; for (int i = 1; i < m_AtlasTextures.Length; i++) { val = m_AtlasTextures[i]; if (!((Object)(object)val == (Object)null)) { Object.DestroyImmediate((Object)(object)val, true); } } Array.Resize(ref m_AtlasTextures, 1); val = (m_AtlasTexture = m_AtlasTextures[0]); if (!((Texture)val).isReadable) { } if (setAtlasSizeToZero) { val.Reinitialize(0, 0, (TextureFormat)1, false); } else if (((Texture)val).width != m_AtlasWidth || ((Texture)val).height != m_AtlasHeight) { val.Reinitialize(m_AtlasWidth, m_AtlasHeight, (TextureFormat)1, false); } FontEngine.ResetAtlasTexture(val); val.Apply(); } private void DestroyAtlasTextures() { if (m_AtlasTextures == null) { return; } for (int i = 0; i < m_AtlasTextures.Length; i++) { Texture2D val = m_AtlasTextures[i]; if ((Object)(object)val != (Object)null) { Object.DestroyImmediate((Object)(object)val); } } } } internal static class FontAssetUtilities { private static HashSet k_SearchedAssets; internal static Character GetCharacterFromFontAsset(uint unicode, FontAsset sourceFontAsset, bool includeFallbacks, FontStyles fontStyle, TextFontWeight fontWeight, out bool isAlternativeTypeface) { if (includeFallbacks) { if (k_SearchedAssets == null) { k_SearchedAssets = new HashSet(); } else { k_SearchedAssets.Clear(); } } return GetCharacterFromFontAsset_Internal(unicode, sourceFontAsset, includeFallbacks, fontStyle, fontWeight, out isAlternativeTypeface); } private static Character GetCharacterFromFontAsset_Internal(uint unicode, FontAsset sourceFontAsset, bool includeFallbacks, FontStyles fontStyle, TextFontWeight fontWeight, out bool isAlternativeTypeface) { isAlternativeTypeface = false; Character value = null; bool flag = (fontStyle & FontStyles.Italic) == FontStyles.Italic; if (flag || fontWeight != TextFontWeight.Regular) { FontWeightPair[] fontWeightTable = sourceFontAsset.fontWeightTable; int num = 4; switch (fontWeight) { case TextFontWeight.Thin: num = 1; break; case TextFontWeight.ExtraLight: num = 2; break; case TextFontWeight.Light: num = 3; break; case TextFontWeight.Regular: num = 4; break; case TextFontWeight.Medium: num = 5; break; case TextFontWeight.SemiBold: num = 6; break; case TextFontWeight.Bold: num = 7; break; case TextFontWeight.Heavy: num = 8; break; case TextFontWeight.Black: num = 9; break; } FontAsset fontAsset = (flag ? fontWeightTable[num].italicTypeface : fontWeightTable[num].regularTypeface); if ((Object)(object)fontAsset != (Object)null) { if (fontAsset.characterLookupTable.TryGetValue(unicode, out value)) { isAlternativeTypeface = true; return value; } if ((fontAsset.atlasPopulationMode == AtlasPopulationMode.Dynamic || fontAsset.atlasPopulationMode == AtlasPopulationMode.DynamicOS) && fontAsset.TryAddCharacterInternal(unicode, out value)) { isAlternativeTypeface = true; return value; } } } if (sourceFontAsset.characterLookupTable.TryGetValue(unicode, out value)) { return value; } if ((sourceFontAsset.atlasPopulationMode == AtlasPopulationMode.Dynamic || sourceFontAsset.atlasPopulationMode == AtlasPopulationMode.DynamicOS) && sourceFontAsset.TryAddCharacterInternal(unicode, out value)) { return value; } if (value == null && includeFallbacks && sourceFontAsset.fallbackFontAssetTable != null) { List fallbackFontAssetTable = sourceFontAsset.fallbackFontAssetTable; int count = fallbackFontAssetTable.Count; if (count == 0) { return null; } for (int i = 0; i < count; i++) { FontAsset fontAsset2 = fallbackFontAssetTable[i]; if ((Object)(object)fontAsset2 == (Object)null) { continue; } int instanceID = fontAsset2.instanceID; if (k_SearchedAssets.Add(instanceID)) { value = GetCharacterFromFontAsset_Internal(unicode, fontAsset2, includeFallbacks: true, fontStyle, fontWeight, out isAlternativeTypeface); if (value != null) { return value; } } } } return null; } public static Character GetCharacterFromFontAssets(uint unicode, FontAsset sourceFontAsset, List fontAssets, bool includeFallbacks, FontStyles fontStyle, TextFontWeight fontWeight, out bool isAlternativeTypeface) { isAlternativeTypeface = false; if (fontAssets == null || fontAssets.Count == 0) { return null; } if (includeFallbacks) { if (k_SearchedAssets == null) { k_SearchedAssets = new HashSet(); } else { k_SearchedAssets.Clear(); } } int count = fontAssets.Count; for (int i = 0; i < count; i++) { FontAsset fontAsset = fontAssets[i]; if (!((Object)(object)fontAsset == (Object)null)) { Character characterFromFontAsset_Internal = GetCharacterFromFontAsset_Internal(unicode, fontAsset, includeFallbacks, fontStyle, fontWeight, out isAlternativeTypeface); if (characterFromFontAsset_Internal != null) { return characterFromFontAsset_Internal; } } } return null; } public static SpriteCharacter GetSpriteCharacterFromSpriteAsset(uint unicode, SpriteAsset spriteAsset, bool includeFallbacks) { if ((Object)(object)spriteAsset == (Object)null) { return null; } if (spriteAsset.spriteCharacterLookupTable.TryGetValue(unicode, out var value)) { return value; } if (includeFallbacks) { if (k_SearchedAssets == null) { k_SearchedAssets = new HashSet(); } else { k_SearchedAssets.Clear(); } k_SearchedAssets.Add(spriteAsset.instanceID); List fallbackSpriteAssets = spriteAsset.fallbackSpriteAssets; if (fallbackSpriteAssets != null && fallbackSpriteAssets.Count > 0) { int count = fallbackSpriteAssets.Count; for (int i = 0; i < count; i++) { SpriteAsset spriteAsset2 = fallbackSpriteAssets[i]; if ((Object)(object)spriteAsset2 == (Object)null) { continue; } int instanceID = spriteAsset2.instanceID; if (k_SearchedAssets.Add(instanceID)) { value = GetSpriteCharacterFromSpriteAsset_Internal(unicode, spriteAsset2, includeFallbacks: true); if (value != null) { return value; } } } } } return null; } private static SpriteCharacter GetSpriteCharacterFromSpriteAsset_Internal(uint unicode, SpriteAsset spriteAsset, bool includeFallbacks) { if (spriteAsset.spriteCharacterLookupTable.TryGetValue(unicode, out var value)) { return value; } if (includeFallbacks) { List fallbackSpriteAssets = spriteAsset.fallbackSpriteAssets; if (fallbackSpriteAssets != null && fallbackSpriteAssets.Count > 0) { int count = fallbackSpriteAssets.Count; for (int i = 0; i < count; i++) { SpriteAsset spriteAsset2 = fallbackSpriteAssets[i]; if ((Object)(object)spriteAsset2 == (Object)null) { continue; } int instanceID = spriteAsset2.instanceID; if (k_SearchedAssets.Add(instanceID)) { value = GetSpriteCharacterFromSpriteAsset_Internal(unicode, spriteAsset2, includeFallbacks: true); if (value != null) { return value; } } } } } return null; } } [Serializable] public class FontFeatureTable { [SerializeField] internal List m_GlyphPairAdjustmentRecords; internal Dictionary m_GlyphPairAdjustmentRecordLookup; internal List glyphPairAdjustmentRecords { get { return m_GlyphPairAdjustmentRecords; } set { m_GlyphPairAdjustmentRecords = value; } } public FontFeatureTable() { m_GlyphPairAdjustmentRecords = new List(); m_GlyphPairAdjustmentRecordLookup = new Dictionary(); } public void SortGlyphPairAdjustmentRecords() { if (m_GlyphPairAdjustmentRecords.Count > 0) { m_GlyphPairAdjustmentRecords = m_GlyphPairAdjustmentRecords.OrderBy(delegate(GlyphPairAdjustmentRecord s) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) GlyphAdjustmentRecord firstAdjustmentRecord = ((GlyphPairAdjustmentRecord)(ref s)).firstAdjustmentRecord; return ((GlyphAdjustmentRecord)(ref firstAdjustmentRecord)).glyphIndex; }).ThenBy(delegate(GlyphPairAdjustmentRecord s) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) GlyphAdjustmentRecord secondAdjustmentRecord = ((GlyphPairAdjustmentRecord)(ref s)).secondAdjustmentRecord; return ((GlyphAdjustmentRecord)(ref secondAdjustmentRecord)).glyphIndex; }).ToList(); } } } internal struct Extents { public Vector2 min; public Vector2 max; public Extents(Vector2 min, Vector2 max) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) this.min = min; this.max = max; } public override string ToString() { return "Min (" + min.x.ToString("f2") + ", " + min.y.ToString("f2") + ") Max (" + max.x.ToString("f2") + ", " + max.y.ToString("f2") + ")"; } } internal struct LineInfo { internal int controlCharacterCount; public int characterCount; public int visibleCharacterCount; public int spaceCount; public int visibleSpaceCount; public int wordCount; public int firstCharacterIndex; public int firstVisibleCharacterIndex; public int lastCharacterIndex; public int lastVisibleCharacterIndex; public float length; public float lineHeight; public float ascender; public float baseline; public float descender; public float maxAdvance; public float width; public float marginLeft; public float marginRight; public TextAlignment alignment; public Extents lineExtents; } internal struct LinkInfo { public int hashCode; public int linkIdFirstCharacterIndex; public int linkIdLength; public int linkTextfirstCharacterIndex; public int linkTextLength; internal char[] linkId; internal void SetLinkId(char[] text, int startIndex, int length) { if (linkId == null || linkId.Length < length) { linkId = new char[length]; } for (int i = 0; i < length; i++) { linkId[i] = text[startIndex + i]; } } public string GetLinkText(TextInfo textInfo) { string text = string.Empty; for (int i = linkTextfirstCharacterIndex; i < linkTextfirstCharacterIndex + linkTextLength; i++) { text += textInfo.textElementInfo[i].character; } return text; } public string GetLinkId() { return new string(linkId, 0, linkIdLength); } } internal static class MaterialManager { private static Dictionary s_FallbackMaterials = new Dictionary(); public static Material GetFallbackMaterial(Material sourceMaterial, Material targetMaterial) { //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown int instanceID = ((Object)sourceMaterial).GetInstanceID(); Texture texture = targetMaterial.GetTexture(TextShaderUtilities.ID_MainTex); int instanceID2 = ((Object)texture).GetInstanceID(); long key = ((long)instanceID << 32) | (uint)instanceID2; if (s_FallbackMaterials.TryGetValue(key, out var value)) { return value; } if (sourceMaterial.HasProperty(TextShaderUtilities.ID_GradientScale) && targetMaterial.HasProperty(TextShaderUtilities.ID_GradientScale)) { value = new Material(sourceMaterial); ((Object)value).hideFlags = (HideFlags)61; value.SetTexture(TextShaderUtilities.ID_MainTex, texture); value.SetFloat(TextShaderUtilities.ID_GradientScale, targetMaterial.GetFloat(TextShaderUtilities.ID_GradientScale)); value.SetFloat(TextShaderUtilities.ID_TextureWidth, targetMaterial.GetFloat(TextShaderUtilities.ID_TextureWidth)); value.SetFloat(TextShaderUtilities.ID_TextureHeight, targetMaterial.GetFloat(TextShaderUtilities.ID_TextureHeight)); value.SetFloat(TextShaderUtilities.ID_WeightNormal, targetMaterial.GetFloat(TextShaderUtilities.ID_WeightNormal)); value.SetFloat(TextShaderUtilities.ID_WeightBold, targetMaterial.GetFloat(TextShaderUtilities.ID_WeightBold)); } else { value = new Material(targetMaterial); } s_FallbackMaterials.Add(key, value); return value; } public static Material GetFallbackMaterial(FontAsset fontAsset, Material sourceMaterial, int atlasIndex) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown int instanceID = ((Object)sourceMaterial).GetInstanceID(); Texture val = (Texture)(object)fontAsset.atlasTextures[atlasIndex]; int instanceID2 = ((Object)val).GetInstanceID(); long key = ((long)instanceID << 32) | (uint)instanceID2; if (s_FallbackMaterials.TryGetValue(key, out var value)) { return value; } Material val2 = new Material(sourceMaterial); val2.SetTexture(TextShaderUtilities.ID_MainTex, val); ((Object)val2).hideFlags = (HideFlags)61; s_FallbackMaterials.Add(key, val2); return val2; } } internal struct MaterialReference { public int index; public FontAsset fontAsset; public SpriteAsset spriteAsset; public Material material; public bool isDefaultMaterial; public bool isFallbackMaterial; public Material fallbackMaterial; public float padding; public int referenceCount; public MaterialReference(int index, FontAsset fontAsset, SpriteAsset spriteAsset, Material material, float padding) { this.index = index; this.fontAsset = fontAsset; this.spriteAsset = spriteAsset; this.material = material; isDefaultMaterial = ((Object)material).GetInstanceID() == ((Object)fontAsset.material).GetInstanceID(); isFallbackMaterial = false; fallbackMaterial = null; this.padding = padding; referenceCount = 0; } public static bool Contains(MaterialReference[] materialReferences, FontAsset fontAsset) { int instanceID = ((Object)fontAsset).GetInstanceID(); for (int i = 0; i < materialReferences.Length && (Object)(object)materialReferences[i].fontAsset != (Object)null; i++) { if (((Object)materialReferences[i].fontAsset).GetInstanceID() == instanceID) { return true; } } return false; } public static int AddMaterialReference(Material material, FontAsset fontAsset, ref MaterialReference[] materialReferences, Dictionary materialReferenceIndexLookup) { int instanceID = ((Object)material).GetInstanceID(); if (materialReferenceIndexLookup.TryGetValue(instanceID, out var value)) { return value; } value = (materialReferenceIndexLookup[instanceID] = materialReferenceIndexLookup.Count); if (value >= materialReferences.Length) { Array.Resize(ref materialReferences, Mathf.NextPowerOfTwo(value + 1)); } materialReferences[value].index = value; materialReferences[value].fontAsset = fontAsset; materialReferences[value].spriteAsset = null; materialReferences[value].material = material; materialReferences[value].isDefaultMaterial = instanceID == ((Object)fontAsset.material).GetInstanceID(); materialReferences[value].referenceCount = 0; return value; } public static int AddMaterialReference(Material material, SpriteAsset spriteAsset, ref MaterialReference[] materialReferences, Dictionary materialReferenceIndexLookup) { int instanceID = ((Object)material).GetInstanceID(); if (materialReferenceIndexLookup.TryGetValue(instanceID, out var value)) { return value; } value = (materialReferenceIndexLookup[instanceID] = materialReferenceIndexLookup.Count); if (value >= materialReferences.Length) { Array.Resize(ref materialReferences, Mathf.NextPowerOfTwo(value + 1)); } materialReferences[value].index = value; materialReferences[value].fontAsset = materialReferences[0].fontAsset; materialReferences[value].spriteAsset = spriteAsset; materialReferences[value].material = material; materialReferences[value].isDefaultMaterial = true; materialReferences[value].referenceCount = 0; return value; } } internal class MaterialReferenceManager { private static MaterialReferenceManager s_Instance; private Dictionary m_FontMaterialReferenceLookup = new Dictionary(); private Dictionary m_FontAssetReferenceLookup = new Dictionary(); private Dictionary m_SpriteAssetReferenceLookup = new Dictionary(); private Dictionary m_ColorGradientReferenceLookup = new Dictionary(); public static MaterialReferenceManager instance { get { if (s_Instance == null) { s_Instance = new MaterialReferenceManager(); } return s_Instance; } } public static void AddFontAsset(FontAsset fontAsset) { instance.AddFontAssetInternal(fontAsset); } private void AddFontAssetInternal(FontAsset fontAsset) { if (!m_FontAssetReferenceLookup.ContainsKey(fontAsset.hashCode)) { m_FontAssetReferenceLookup.Add(fontAsset.hashCode, fontAsset); m_FontMaterialReferenceLookup.Add(fontAsset.materialHashCode, fontAsset.material); } } public static void AddSpriteAsset(SpriteAsset spriteAsset) { instance.AddSpriteAssetInternal(spriteAsset); } private void AddSpriteAssetInternal(SpriteAsset spriteAsset) { if (!m_SpriteAssetReferenceLookup.ContainsKey(spriteAsset.hashCode)) { m_SpriteAssetReferenceLookup.Add(spriteAsset.hashCode, spriteAsset); m_FontMaterialReferenceLookup.Add(spriteAsset.hashCode, spriteAsset.material); } } public static void AddSpriteAsset(int hashCode, SpriteAsset spriteAsset) { instance.AddSpriteAssetInternal(hashCode, spriteAsset); } private void AddSpriteAssetInternal(int hashCode, SpriteAsset spriteAsset) { if (!m_SpriteAssetReferenceLookup.ContainsKey(hashCode)) { m_SpriteAssetReferenceLookup.Add(hashCode, spriteAsset); m_FontMaterialReferenceLookup.Add(hashCode, spriteAsset.material); } } public static void AddFontMaterial(int hashCode, Material material) { instance.AddFontMaterialInternal(hashCode, material); } private void AddFontMaterialInternal(int hashCode, Material material) { m_FontMaterialReferenceLookup.Add(hashCode, material); } public static void AddColorGradientPreset(int hashCode, TextColorGradient spriteAsset) { instance.AddColorGradientPreset_Internal(hashCode, spriteAsset); } private void AddColorGradientPreset_Internal(int hashCode, TextColorGradient spriteAsset) { if (!m_ColorGradientReferenceLookup.ContainsKey(hashCode)) { m_ColorGradientReferenceLookup.Add(hashCode, spriteAsset); } } public bool Contains(FontAsset font) { return m_FontAssetReferenceLookup.ContainsKey(font.hashCode); } public bool Contains(SpriteAsset sprite) { return m_FontAssetReferenceLookup.ContainsKey(sprite.hashCode); } public static bool TryGetFontAsset(int hashCode, out FontAsset fontAsset) { return instance.TryGetFontAssetInternal(hashCode, out fontAsset); } private bool TryGetFontAssetInternal(int hashCode, out FontAsset fontAsset) { fontAsset = null; return m_FontAssetReferenceLookup.TryGetValue(hashCode, out fontAsset); } public static bool TryGetSpriteAsset(int hashCode, out SpriteAsset spriteAsset) { return instance.TryGetSpriteAssetInternal(hashCode, out spriteAsset); } private bool TryGetSpriteAssetInternal(int hashCode, out SpriteAsset spriteAsset) { spriteAsset = null; return m_SpriteAssetReferenceLookup.TryGetValue(hashCode, out spriteAsset); } public static bool TryGetColorGradientPreset(int hashCode, out TextColorGradient gradientPreset) { return instance.TryGetColorGradientPresetInternal(hashCode, out gradientPreset); } private bool TryGetColorGradientPresetInternal(int hashCode, out TextColorGradient gradientPreset) { gradientPreset = null; return m_ColorGradientReferenceLookup.TryGetValue(hashCode, out gradientPreset); } public static bool TryGetMaterial(int hashCode, out Material material) { return instance.TryGetMaterialInternal(hashCode, out material); } private bool TryGetMaterialInternal(int hashCode, out Material material) { material = null; return m_FontMaterialReferenceLookup.TryGetValue(hashCode, out material); } } internal enum VertexSortingOrder { Normal, Reverse } internal struct MeshInfo { private static readonly Color32 k_DefaultColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); public int vertexCount; public Vector3[] vertices; public Vector2[] uvs0; public Vector2[] uvs2; public Color32[] colors32; public int[] triangles; public Material material; public MeshInfo(int size) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) material = null; size = Mathf.Min(size, 16383); int num = size * 4; int num2 = size * 6; vertexCount = 0; vertices = (Vector3[])(object)new Vector3[num]; uvs0 = (Vector2[])(object)new Vector2[num]; uvs2 = (Vector2[])(object)new Vector2[num]; colors32 = (Color32[])(object)new Color32[num]; triangles = new int[num2]; int num3 = 0; int num4 = 0; while (num4 / 4 < size) { for (int i = 0; i < 4; i++) { vertices[num4 + i] = Vector3.zero; uvs0[num4 + i] = Vector2.zero; uvs2[num4 + i] = Vector2.zero; colors32[num4 + i] = k_DefaultColor; } triangles[num3] = num4; triangles[num3 + 1] = num4 + 1; triangles[num3 + 2] = num4 + 2; triangles[num3 + 3] = num4 + 2; triangles[num3 + 4] = num4 + 3; triangles[num3 + 5] = num4; num4 += 4; num3 += 6; } } internal void ResizeMeshInfo(int size) { size = Mathf.Min(size, 16383); int newSize = size * 4; int newSize2 = size * 6; int num = vertices.Length / 4; Array.Resize(ref vertices, newSize); Array.Resize(ref uvs0, newSize); Array.Resize(ref uvs2, newSize); Array.Resize(ref colors32, newSize); Array.Resize(ref triangles, newSize2); for (int i = num; i < size; i++) { int num2 = i * 4; int num3 = i * 6; triangles[num3] = num2; triangles[1 + num3] = 1 + num2; triangles[2 + num3] = 2 + num2; triangles[3 + num3] = 2 + num2; triangles[4 + num3] = 3 + num2; triangles[5 + num3] = num2; } } internal void Clear(bool uploadChanges) { if (vertices != null) { Array.Clear(vertices, 0, vertices.Length); vertexCount = 0; } } internal void ClearUnusedVertices() { int num = vertices.Length - vertexCount; if (num > 0) { Array.Clear(vertices, vertexCount, num); } } internal void ClearUnusedVertices(int startIndex) { int num = vertices.Length - startIndex; if (num > 0) { Array.Clear(vertices, startIndex, num); } } internal void SortGeometry(VertexSortingOrder order) { if (order == VertexSortingOrder.Normal || order != VertexSortingOrder.Reverse) { return; } int num = vertexCount / 4; for (int i = 0; i < num; i++) { int num2 = i * 4; int num3 = (num - i - 1) * 4; if (num2 < num3) { SwapVertexData(num2, num3); } } } internal void SwapVertexData(int src, int dst) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) Vector3 val = vertices[dst]; vertices[dst] = vertices[src]; vertices[src] = val; val = vertices[dst + 1]; vertices[dst + 1] = vertices[src + 1]; vertices[src + 1] = val; val = vertices[dst + 2]; vertices[dst + 2] = vertices[src + 2]; vertices[src + 2] = val; val = vertices[dst + 3]; vertices[dst + 3] = vertices[src + 3]; vertices[src + 3] = val; Vector2 val2 = uvs0[dst]; uvs0[dst] = uvs0[src]; uvs0[src] = val2; val2 = uvs0[dst + 1]; uvs0[dst + 1] = uvs0[src + 1]; uvs0[src + 1] = val2; val2 = uvs0[dst + 2]; uvs0[dst + 2] = uvs0[src + 2]; uvs0[src + 2] = val2; val2 = uvs0[dst + 3]; uvs0[dst + 3] = uvs0[src + 3]; uvs0[src + 3] = val2; val2 = uvs2[dst]; uvs2[dst] = uvs2[src]; uvs2[src] = val2; val2 = uvs2[dst + 1]; uvs2[dst + 1] = uvs2[src + 1]; uvs2[src + 1] = val2; val2 = uvs2[dst + 2]; uvs2[dst + 2] = uvs2[src + 2]; uvs2[src + 2] = val2; val2 = uvs2[dst + 3]; uvs2[dst + 3] = uvs2[src + 3]; uvs2[src + 3] = val2; Color32 val3 = colors32[dst]; colors32[dst] = colors32[src]; colors32[src] = val3; val3 = colors32[dst + 1]; colors32[dst + 1] = colors32[src + 1]; colors32[src + 1] = val3; val3 = colors32[dst + 2]; colors32[dst + 2] = colors32[src + 2]; colors32[src + 2] = val3; val3 = colors32[dst + 3]; colors32[dst + 3] = colors32[src + 3]; colors32[src + 3] = val3; } } [ExcludeFromPreset] public class SpriteAsset : TextAsset { internal Dictionary m_NameLookup; internal Dictionary m_GlyphIndexLookup; [SerializeField] internal FaceInfo m_FaceInfo; [FormerlySerializedAs("spriteSheet")] [SerializeField] internal Texture m_SpriteAtlasTexture; [SerializeField] private List m_SpriteCharacterTable = new List(); internal Dictionary m_SpriteCharacterLookup; [SerializeField] private List m_SpriteGlyphTable = new List(); internal Dictionary m_SpriteGlyphLookup; [SerializeField] public List fallbackSpriteAssets; internal bool m_IsSpriteAssetLookupTablesDirty = false; private static HashSet k_searchedSpriteAssets; public FaceInfo faceInfo { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return m_FaceInfo; } internal set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) m_FaceInfo = value; } } public Texture spriteSheet { get { return m_SpriteAtlasTexture; } internal set { m_SpriteAtlasTexture = value; } } public List spriteCharacterTable { get { if (m_GlyphIndexLookup == null) { UpdateLookupTables(); } return m_SpriteCharacterTable; } internal set { m_SpriteCharacterTable = value; } } public Dictionary spriteCharacterLookupTable { get { if (m_SpriteCharacterLookup == null) { UpdateLookupTables(); } return m_SpriteCharacterLookup; } internal set { m_SpriteCharacterLookup = value; } } public List spriteGlyphTable { get { return m_SpriteGlyphTable; } internal set { m_SpriteGlyphTable = value; } } private void Awake() { } public void UpdateLookupTables() { if (m_GlyphIndexLookup == null) { m_GlyphIndexLookup = new Dictionary(); } else { m_GlyphIndexLookup.Clear(); } if (m_SpriteGlyphLookup == null) { m_SpriteGlyphLookup = new Dictionary(); } else { m_SpriteGlyphLookup.Clear(); } for (int i = 0; i < m_SpriteGlyphTable.Count; i++) { SpriteGlyph spriteGlyph = m_SpriteGlyphTable[i]; uint index = ((Glyph)spriteGlyph).index; if (!m_GlyphIndexLookup.ContainsKey(index)) { m_GlyphIndexLookup.Add(index, i); } if (!m_SpriteGlyphLookup.ContainsKey(index)) { m_SpriteGlyphLookup.Add(index, spriteGlyph); } } if (m_NameLookup == null) { m_NameLookup = new Dictionary(); } else { m_NameLookup.Clear(); } if (m_SpriteCharacterLookup == null) { m_SpriteCharacterLookup = new Dictionary(); } else { m_SpriteCharacterLookup.Clear(); } for (int j = 0; j < m_SpriteCharacterTable.Count; j++) { SpriteCharacter spriteCharacter = m_SpriteCharacterTable[j]; if (spriteCharacter == null) { continue; } uint glyphIndex = spriteCharacter.glyphIndex; if (m_SpriteGlyphLookup.ContainsKey(glyphIndex)) { spriteCharacter.glyph = (Glyph)(object)m_SpriteGlyphLookup[glyphIndex]; spriteCharacter.textAsset = this; int hashCodeCaseInSensitive = TextUtilities.GetHashCodeCaseInSensitive(m_SpriteCharacterTable[j].name); if (!m_NameLookup.ContainsKey(hashCodeCaseInSensitive)) { m_NameLookup.Add(hashCodeCaseInSensitive, j); } uint unicode = m_SpriteCharacterTable[j].unicode; if (unicode != 65534 && !m_SpriteCharacterLookup.ContainsKey(unicode)) { m_SpriteCharacterLookup.Add(unicode, spriteCharacter); } } } m_IsSpriteAssetLookupTablesDirty = false; } public int GetSpriteIndexFromHashcode(int hashCode) { if (m_NameLookup == null) { UpdateLookupTables(); } if (m_NameLookup.TryGetValue(hashCode, out var value)) { return value; } return -1; } public int GetSpriteIndexFromUnicode(uint unicode) { if (m_SpriteCharacterLookup == null) { UpdateLookupTables(); } if (m_SpriteCharacterLookup.TryGetValue(unicode, out var value)) { return (int)value.glyphIndex; } return -1; } public int GetSpriteIndexFromName(string name) { if (m_NameLookup == null) { UpdateLookupTables(); } int hashCodeCaseInSensitive = TextUtilities.GetHashCodeCaseInSensitive(name); return GetSpriteIndexFromHashcode(hashCodeCaseInSensitive); } public static SpriteAsset SearchForSpriteByUnicode(SpriteAsset spriteAsset, uint unicode, bool includeFallbacks, out int spriteIndex) { if ((Object)(object)spriteAsset == (Object)null) { spriteIndex = -1; return null; } spriteIndex = spriteAsset.GetSpriteIndexFromUnicode(unicode); if (spriteIndex != -1) { return spriteAsset; } if (k_searchedSpriteAssets == null) { k_searchedSpriteAssets = new HashSet(); } else { k_searchedSpriteAssets.Clear(); } int item = ((Object)spriteAsset).GetInstanceID(); k_searchedSpriteAssets.Add(item); if (includeFallbacks && spriteAsset.fallbackSpriteAssets != null && spriteAsset.fallbackSpriteAssets.Count > 0) { return SearchForSpriteByUnicodeInternal(spriteAsset.fallbackSpriteAssets, unicode, includeFallbacks: true, out spriteIndex); } spriteIndex = -1; return null; } private static SpriteAsset SearchForSpriteByUnicodeInternal(List spriteAssets, uint unicode, bool includeFallbacks, out int spriteIndex) { for (int i = 0; i < spriteAssets.Count; i++) { SpriteAsset spriteAsset = spriteAssets[i]; if ((Object)(object)spriteAsset == (Object)null) { continue; } int item = ((Object)spriteAsset).GetInstanceID(); if (k_searchedSpriteAssets.Add(item)) { spriteAsset = SearchForSpriteByUnicodeInternal(spriteAsset, unicode, includeFallbacks, out spriteIndex); if ((Object)(object)spriteAsset != (Object)null) { return spriteAsset; } } } spriteIndex = -1; return null; } private static SpriteAsset SearchForSpriteByUnicodeInternal(SpriteAsset spriteAsset, uint unicode, bool includeFallbacks, out int spriteIndex) { spriteIndex = spriteAsset.GetSpriteIndexFromUnicode(unicode); if (spriteIndex != -1) { return spriteAsset; } if (includeFallbacks && spriteAsset.fallbackSpriteAssets != null && spriteAsset.fallbackSpriteAssets.Count > 0) { return SearchForSpriteByUnicodeInternal(spriteAsset.fallbackSpriteAssets, unicode, includeFallbacks: true, out spriteIndex); } spriteIndex = -1; return null; } public static SpriteAsset SearchForSpriteByHashCode(SpriteAsset spriteAsset, int hashCode, bool includeFallbacks, out int spriteIndex, TextSettings textSettings = null) { if ((Object)(object)spriteAsset == (Object)null) { spriteIndex = -1; return null; } spriteIndex = spriteAsset.GetSpriteIndexFromHashcode(hashCode); if (spriteIndex != -1) { return spriteAsset; } if (k_searchedSpriteAssets == null) { k_searchedSpriteAssets = new HashSet(); } else { k_searchedSpriteAssets.Clear(); } int item = spriteAsset.instanceID; k_searchedSpriteAssets.Add(item); if (includeFallbacks && spriteAsset.fallbackSpriteAssets != null && spriteAsset.fallbackSpriteAssets.Count > 0) { SpriteAsset result = SearchForSpriteByHashCodeInternal(spriteAsset.fallbackSpriteAssets, hashCode, searchFallbacks: true, out spriteIndex); if (spriteIndex != -1) { return result; } } if ((Object)(object)textSettings == (Object)null) { spriteIndex = -1; return null; } if (includeFallbacks && (Object)(object)textSettings.defaultSpriteAsset != (Object)null) { SpriteAsset result = SearchForSpriteByHashCodeInternal(textSettings.defaultSpriteAsset, hashCode, searchFallbacks: true, out spriteIndex); if (spriteIndex != -1) { return result; } } k_searchedSpriteAssets.Clear(); uint missingSpriteCharacterUnicode = textSettings.missingSpriteCharacterUnicode; spriteIndex = spriteAsset.GetSpriteIndexFromUnicode(missingSpriteCharacterUnicode); if (spriteIndex != -1) { return spriteAsset; } k_searchedSpriteAssets.Add(item); if (includeFallbacks && spriteAsset.fallbackSpriteAssets != null && spriteAsset.fallbackSpriteAssets.Count > 0) { SpriteAsset result = SearchForSpriteByUnicodeInternal(spriteAsset.fallbackSpriteAssets, missingSpriteCharacterUnicode, includeFallbacks: true, out spriteIndex); if (spriteIndex != -1) { return result; } } if (includeFallbacks && (Object)(object)textSettings.defaultSpriteAsset != (Object)null) { SpriteAsset result = SearchForSpriteByUnicodeInternal(textSettings.defaultSpriteAsset, missingSpriteCharacterUnicode, includeFallbacks: true, out spriteIndex); if (spriteIndex != -1) { return result; } } spriteIndex = -1; return null; } private static SpriteAsset SearchForSpriteByHashCodeInternal(List spriteAssets, int hashCode, bool searchFallbacks, out int spriteIndex) { for (int i = 0; i < spriteAssets.Count; i++) { SpriteAsset spriteAsset = spriteAssets[i]; if ((Object)(object)spriteAsset == (Object)null) { continue; } int item = spriteAsset.instanceID; if (k_searchedSpriteAssets.Add(item)) { spriteAsset = SearchForSpriteByHashCodeInternal(spriteAsset, hashCode, searchFallbacks, out spriteIndex); if ((Object)(object)spriteAsset != (Object)null) { return spriteAsset; } } } spriteIndex = -1; return null; } private static SpriteAsset SearchForSpriteByHashCodeInternal(SpriteAsset spriteAsset, int hashCode, bool searchFallbacks, out int spriteIndex) { spriteIndex = spriteAsset.GetSpriteIndexFromHashcode(hashCode); if (spriteIndex != -1) { return spriteAsset; } if (searchFallbacks && spriteAsset.fallbackSpriteAssets != null && spriteAsset.fallbackSpriteAssets.Count > 0) { return SearchForSpriteByHashCodeInternal(spriteAsset.fallbackSpriteAssets, hashCode, searchFallbacks: true, out spriteIndex); } spriteIndex = -1; return null; } public void SortGlyphTable() { if (m_SpriteGlyphTable != null && m_SpriteGlyphTable.Count != 0) { m_SpriteGlyphTable = m_SpriteGlyphTable.OrderBy((SpriteGlyph item) => ((Glyph)item).index).ToList(); } } internal void SortCharacterTable() { if (m_SpriteCharacterTable != null && m_SpriteCharacterTable.Count > 0) { m_SpriteCharacterTable = m_SpriteCharacterTable.OrderBy((SpriteCharacter c) => c.unicode).ToList(); } } internal void SortGlyphAndCharacterTables() { SortGlyphTable(); SortCharacterTable(); } } [Serializable] public class SpriteCharacter : TextElement { [SerializeField] private string m_Name; [SerializeField] private int m_HashCode; public string name { get { return m_Name; } set { if (!(value == m_Name)) { m_Name = value; m_HashCode = TextUtilities.GetHashCodeCaseSensitive(m_Name); } } } public int hashCode => m_HashCode; public SpriteCharacter() { m_ElementType = TextElementType.Sprite; } public SpriteCharacter(uint unicode, SpriteGlyph glyph) { m_ElementType = TextElementType.Sprite; base.unicode = unicode; base.glyphIndex = ((Glyph)glyph).index; base.glyph = (Glyph)(object)glyph; base.scale = 1f; } public SpriteCharacter(uint unicode, SpriteAsset spriteAsset, SpriteGlyph glyph) { m_ElementType = TextElementType.Sprite; base.unicode = unicode; base.textAsset = spriteAsset; base.glyph = (Glyph)(object)glyph; base.glyphIndex = ((Glyph)glyph).index; base.scale = 1f; } } [Serializable] public class SpriteGlyph : Glyph { public Sprite sprite; public SpriteGlyph() { } public SpriteGlyph(uint index, GlyphMetrics metrics, GlyphRect glyphRect, float scale, int atlasIndex) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) ((Glyph)this).index = index; ((Glyph)this).metrics = metrics; ((Glyph)this).glyphRect = glyphRect; ((Glyph)this).scale = scale; ((Glyph)this).atlasIndex = atlasIndex; } public SpriteGlyph(uint index, GlyphMetrics metrics, GlyphRect glyphRect, float scale, int atlasIndex, Sprite sprite) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) ((Glyph)this).index = index; ((Glyph)this).metrics = metrics; ((Glyph)this).glyphRect = glyphRect; ((Glyph)this).scale = scale; ((Glyph)this).atlasIndex = atlasIndex; this.sprite = sprite; } } [Serializable] [ExcludeFromObjectFactory] public abstract class TextAsset : ScriptableObject { [SerializeField] internal string m_Version; internal int m_InstanceID; internal int m_HashCode; [FormerlySerializedAs("material")] [SerializeField] internal Material m_Material; internal int m_MaterialHashCode; public string version { get { return m_Version; } internal set { m_Version = value; } } public int instanceID { get { if (m_InstanceID == 0) { m_InstanceID = ((Object)this).GetInstanceID(); } return m_InstanceID; } } public int hashCode { get { if (m_HashCode == 0) { m_HashCode = TextUtilities.GetHashCodeCaseInSensitive(((Object)this).name); } return m_HashCode; } set { m_HashCode = value; } } public Material material { get { return m_Material; } set { m_Material = value; } } public int materialHashCode { get { if (m_MaterialHashCode == 0) { if ((Object)(object)m_Material == (Object)null) { return 0; } m_MaterialHashCode = TextUtilities.GetHashCodeCaseInSensitive(((Object)m_Material).name); } return m_MaterialHashCode; } set { m_MaterialHashCode = value; } } } public enum ColorGradientMode { Single, HorizontalGradient, VerticalGradient, FourCornersGradient } [Serializable] [ExcludeFromObjectFactory] [ExcludeFromPreset] public class TextColorGradient : ScriptableObject { public ColorGradientMode colorMode = ColorGradientMode.FourCornersGradient; public Color topLeft; public Color topRight; public Color bottomLeft; public Color bottomRight; private const ColorGradientMode k_DefaultColorMode = ColorGradientMode.FourCornersGradient; private static readonly Color k_DefaultColor = Color.white; public TextColorGradient() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) colorMode = ColorGradientMode.FourCornersGradient; topLeft = k_DefaultColor; topRight = k_DefaultColor; bottomLeft = k_DefaultColor; bottomRight = k_DefaultColor; } public TextColorGradient(Color color) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) colorMode = ColorGradientMode.FourCornersGradient; topLeft = color; topRight = color; bottomLeft = color; bottomRight = color; } public TextColorGradient(Color color0, Color color1, Color color2, Color color3) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) colorMode = ColorGradientMode.FourCornersGradient; topLeft = color0; topRight = color1; bottomLeft = color2; bottomRight = color3; } } public enum TextElementType : byte { Character = 1, Sprite } [Serializable] public abstract class TextElement { [SerializeField] protected TextElementType m_ElementType; [SerializeField] internal uint m_Unicode; internal TextAsset m_TextAsset; internal Glyph m_Glyph; [SerializeField] internal uint m_GlyphIndex; [SerializeField] internal float m_Scale; public TextElementType elementType => m_ElementType; public uint unicode { get { return m_Unicode; } set { m_Unicode = value; } } public TextAsset textAsset { get { return m_TextAsset; } set { m_TextAsset = value; } } public Glyph glyph { get { return m_Glyph; } set { m_Glyph = value; } } public uint glyphIndex { get { return m_GlyphIndex; } set { m_GlyphIndex = value; } } public float scale { get { return m_Scale; } set { m_Scale = value; } } } internal struct TextVertex { public Vector3 position; public Vector2 uv; public Vector2 uv2; public Vector2 uv4; public Color32 color; } internal struct TextElementInfo { public char character; public int index; public TextElementType elementType; public TextElement textElement; public FontAsset fontAsset; public SpriteAsset spriteAsset; public int spriteIndex; public Material material; public int materialReferenceIndex; public bool isUsingAlternateTypeface; public float pointSize; public int lineNumber; public int pageNumber; public int vertexIndex; public TextVertex vertexTopLeft; public TextVertex vertexBottomLeft; public TextVertex vertexTopRight; public TextVertex vertexBottomRight; public Vector3 topLeft; public Vector3 bottomLeft; public Vector3 topRight; public Vector3 bottomRight; public float origin; public float ascender; public float baseLine; public float descender; public float xAdvance; public float aspectRatio; public float scale; public Color32 color; public Color32 underlineColor; public Color32 strikethroughColor; public Color32 highlightColor; public FontStyles style; public bool isVisible; } public static class TextEventManager { public static readonly FastAction MATERIAL_PROPERTY_EVENT = new FastAction(); public static readonly FastAction FONT_PROPERTY_EVENT = new FastAction(); public static readonly FastAction SPRITE_ASSET_PROPERTY_EVENT = new FastAction(); public static readonly FastAction TEXTMESHPRO_PROPERTY_EVENT = new FastAction(); public static readonly FastAction DRAG_AND_DROP_MATERIAL_EVENT = new FastAction(); public static readonly FastAction TEXT_STYLE_PROPERTY_EVENT = new FastAction(); public static readonly FastAction COLOR_GRADIENT_PROPERTY_EVENT = new FastAction(); public static readonly FastAction TMP_SETTINGS_PROPERTY_EVENT = new FastAction(); public static readonly FastAction RESOURCE_LOAD_EVENT = new FastAction(); public static readonly FastAction TEXTMESHPRO_UGUI_PROPERTY_EVENT = new FastAction(); public static readonly FastAction OnPreRenderObject_Event = new FastAction(); public static readonly FastAction TEXT_CHANGED_EVENT = new FastAction(); public static void ON_PRE_RENDER_OBJECT_CHANGED() { OnPreRenderObject_Event.Call(); } public static void ON_MATERIAL_PROPERTY_CHANGED(bool isChanged, Material mat) { MATERIAL_PROPERTY_EVENT.Call(isChanged, mat); } public static void ON_FONT_PROPERTY_CHANGED(bool isChanged, Object font) { FONT_PROPERTY_EVENT.Call(isChanged, font); } public static void ON_SPRITE_ASSET_PROPERTY_CHANGED(bool isChanged, Object obj) { SPRITE_ASSET_PROPERTY_EVENT.Call(isChanged, obj); } public static void ON_TEXTMESHPRO_PROPERTY_CHANGED(bool isChanged, Object obj) { TEXTMESHPRO_PROPERTY_EVENT.Call(isChanged, obj); } public static void ON_DRAG_AND_DROP_MATERIAL_CHANGED(GameObject sender, Material currentMaterial, Material newMaterial) { DRAG_AND_DROP_MATERIAL_EVENT.Call(sender, currentMaterial, newMaterial); } public static void ON_TEXT_STYLE_PROPERTY_CHANGED(bool isChanged) { TEXT_STYLE_PROPERTY_EVENT.Call(isChanged); } public static void ON_COLOR_GRADIENT_PROPERTY_CHANGED(Object gradient) { COLOR_GRADIENT_PROPERTY_EVENT.Call(gradient); } public static void ON_TEXT_CHANGED(Object obj) { TEXT_CHANGED_EVENT.Call(obj); } public static void ON_TMP_SETTINGS_CHANGED() { TMP_SETTINGS_PROPERTY_EVENT.Call(); } public static void ON_RESOURCES_LOADED() { RESOURCE_LOAD_EVENT.Call(); } public static void ON_TEXTMESHPRO_UGUI_PROPERTY_CHANGED(bool isChanged, Object obj) { TEXTMESHPRO_UGUI_PROPERTY_EVENT.Call(isChanged, obj); } } internal enum TextOverflowMode { Overflow, Ellipsis, Masking, Truncate, ScrollRect, Page, Linked } internal enum TextureMapping { Character, Line, Paragraph, MatchAspect } internal class TextGenerationSettings : IEquatable { public string text; public Rect screenRect; public Vector4 margins; public float scale = 1f; public FontAsset fontAsset; public Material material; public SpriteAsset spriteAsset; public TextStyleSheet styleSheet; public FontStyles fontStyle = FontStyles.Normal; public TextSettings textSettings; public TextAlignment textAlignment = TextAlignment.TopLeft; public TextOverflowMode overflowMode = TextOverflowMode.Overflow; public bool wordWrap = false; public float wordWrappingRatio; public Color color = Color.white; public TextColorGradient fontColorGradient; public bool tintSprites; public bool overrideRichTextColors; public float fontSize = 18f; public bool autoSize; public float fontSizeMin; public float fontSizeMax; public bool enableKerning = true; public bool richText; public bool isRightToLeft; public bool extraPadding; public bool parseControlCharacters = true; public float characterSpacing; public float wordSpacing; public float lineSpacing; public float paragraphSpacing; public float lineSpacingMax; public int maxVisibleCharacters = 99999; public int maxVisibleWords = 99999; public int maxVisibleLines = 99999; public int firstVisibleCharacter = 0; public bool useMaxVisibleDescender; public TextFontWeight fontWeight = TextFontWeight.Regular; public int pageToDisplay = 1; public TextureMapping horizontalMapping = TextureMapping.Character; public TextureMapping verticalMapping = TextureMapping.Character; public float uvLineOffset; public VertexSortingOrder geometrySortingOrder = VertexSortingOrder.Normal; public bool inverseYAxis; public float charWidthMaxAdj; public bool Equals(TextGenerationSettings other) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) if ((object)other == null) { return false; } if ((object)this == other) { return true; } return text == other.text && ((Rect)(ref screenRect)).Equals(other.screenRect) && ((Vector4)(ref margins)).Equals(other.margins) && scale.Equals(other.scale) && object.Equals(fontAsset, other.fontAsset) && object.Equals(material, other.material) && object.Equals(spriteAsset, other.spriteAsset) && object.Equals(styleSheet, other.styleSheet) && fontStyle == other.fontStyle && object.Equals(textSettings, other.textSettings) && textAlignment == other.textAlignment && overflowMode == other.overflowMode && wordWrap == other.wordWrap && wordWrappingRatio.Equals(other.wordWrappingRatio) && ((Color)(ref color)).Equals(other.color) && object.Equals(fontColorGradient, other.fontColorGradient) && tintSprites == other.tintSprites && overrideRichTextColors == other.overrideRichTextColors && fontSize.Equals(other.fontSize) && autoSize == other.autoSize && fontSizeMin.Equals(other.fontSizeMin) && fontSizeMax.Equals(other.fontSizeMax) && enableKerning == other.enableKerning && richText == other.richText && isRightToLeft == other.isRightToLeft && extraPadding == other.extraPadding && parseControlCharacters == other.parseControlCharacters && characterSpacing.Equals(other.characterSpacing) && wordSpacing.Equals(other.wordSpacing) && lineSpacing.Equals(other.lineSpacing) && paragraphSpacing.Equals(other.paragraphSpacing) && lineSpacingMax.Equals(other.lineSpacingMax) && maxVisibleCharacters == other.maxVisibleCharacters && maxVisibleWords == other.maxVisibleWords && maxVisibleLines == other.maxVisibleLines && firstVisibleCharacter == other.firstVisibleCharacter && useMaxVisibleDescender == other.useMaxVisibleDescender && fontWeight == other.fontWeight && pageToDisplay == other.pageToDisplay && horizontalMapping == other.horizontalMapping && verticalMapping == other.verticalMapping && uvLineOffset.Equals(other.uvLineOffset) && geometrySortingOrder == other.geometrySortingOrder && inverseYAxis == other.inverseYAxis && charWidthMaxAdj.Equals(other.charWidthMaxAdj); } public override bool Equals(object obj) { if (obj == null) { return false; } if (this == obj) { return true; } if ((object)obj.GetType() != GetType()) { return false; } return Equals((TextGenerationSettings)obj); } public override int GetHashCode() { int num = ((text != null) ? text.GetHashCode() : 0); num = (num * 397) ^ ((object)Unsafe.As(ref screenRect)/*cast due to .constrained prefix*/).GetHashCode(); num = (num * 397) ^ ((object)Unsafe.As(ref margins)/*cast due to .constrained prefix*/).GetHashCode(); num = (num * 397) ^ scale.GetHashCode(); num = (num * 397) ^ (((Object)(object)fontAsset != (Object)null) ? ((object)fontAsset).GetHashCode() : 0); num = (num * 397) ^ (((Object)(object)material != (Object)null) ? ((object)material).GetHashCode() : 0); num = (num * 397) ^ (((Object)(object)spriteAsset != (Object)null) ? ((object)spriteAsset).GetHashCode() : 0); num = (num * 397) ^ (int)fontStyle; num = (num * 397) ^ (((Object)(object)textSettings != (Object)null) ? ((object)textSettings).GetHashCode() : 0); num = (num * 397) ^ (int)textAlignment; num = (num * 397) ^ (int)overflowMode; num = (num * 397) ^ wordWrap.GetHashCode(); num = (num * 397) ^ wordWrappingRatio.GetHashCode(); num = (num * 397) ^ ((object)Unsafe.As(ref color)/*cast due to .constrained prefix*/).GetHashCode(); num = (num * 397) ^ (((Object)(object)fontColorGradient != (Object)null) ? ((object)fontColorGradient).GetHashCode() : 0); num = (num * 397) ^ tintSprites.GetHashCode(); num = (num * 397) ^ overrideRichTextColors.GetHashCode(); num = (num * 397) ^ fontSize.GetHashCode(); num = (num * 397) ^ autoSize.GetHashCode(); num = (num * 397) ^ fontSizeMin.GetHashCode(); num = (num * 397) ^ fontSizeMax.GetHashCode(); num = (num * 397) ^ enableKerning.GetHashCode(); num = (num * 397) ^ richText.GetHashCode(); num = (num * 397) ^ isRightToLeft.GetHashCode(); num = (num * 397) ^ extraPadding.GetHashCode(); num = (num * 397) ^ parseControlCharacters.GetHashCode(); num = (num * 397) ^ characterSpacing.GetHashCode(); num = (num * 397) ^ wordSpacing.GetHashCode(); num = (num * 397) ^ lineSpacing.GetHashCode(); num = (num * 397) ^ paragraphSpacing.GetHashCode(); num = (num * 397) ^ lineSpacingMax.GetHashCode(); num = (num * 397) ^ maxVisibleCharacters; num = (num * 397) ^ maxVisibleWords; num = (num * 397) ^ maxVisibleLines; num = (num * 397) ^ firstVisibleCharacter; num = (num * 397) ^ useMaxVisibleDescender.GetHashCode(); num = (num * 397) ^ (int)fontWeight; num = (num * 397) ^ pageToDisplay; num = (num * 397) ^ (int)horizontalMapping; num = (num * 397) ^ (int)verticalMapping; num = (num * 397) ^ uvLineOffset.GetHashCode(); num = (num * 397) ^ (int)geometrySortingOrder; num = (num * 397) ^ inverseYAxis.GetHashCode(); return (num * 397) ^ charWidthMaxAdj.GetHashCode(); } public static bool operator ==(TextGenerationSettings left, TextGenerationSettings right) { return object.Equals(left, right); } public static bool operator !=(TextGenerationSettings left, TextGenerationSettings right) { return !object.Equals(left, right); } public override string ToString() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) return string.Format("{0}: {1}\n {2}: {3}\n {4}: {5}\n {6}: {7}\n {8}: {9}\n {10}: {11}\n {12}: {13}\n {14}: {15}\n {16}: {17}\n {18}: {19}\n {20}: {21}\n {22}: {23}\n {24}: {25}\n {26}: {27}\n {28}: {29}\n {30}: {31}\n {32}: {33}\n {34}: {35}\n {36}: {37}\n {38}: {39}\n {40}: {41}\n {42}: {43}\n {44}: {45}\n {46}: {47}\n {48}: {49}\n {50}: {51}\n {52}: {53}\n {54}: {55}\n {56}: {57}\n {58}: {59}\n {60}: {61}\n {62}: {63}\n {64}: {65}\n {66}: {67}\n {68}: {69}\n {70}: {71}\n {72}: {73}\n {74}: {75}\n {76}: {77}\n {78}: {79}\n {80}: {81}\n {82}: {83}\n {84}: {85}\n {86}: {87}\n {88}: {89}", "text", text, "screenRect", screenRect, "margins", margins, "scale", scale, "fontAsset", fontAsset, "material", material, "spriteAsset", spriteAsset, "styleSheet", styleSheet, "fontStyle", fontStyle, "textSettings", textSettings, "textAlignment", textAlignment, "overflowMode", overflowMode, "wordWrap", wordWrap, "wordWrappingRatio", wordWrappingRatio, "color", color, "fontColorGradient", fontColorGradient, "tintSprites", tintSprites, "overrideRichTextColors", overrideRichTextColors, "fontSize", fontSize, "autoSize", autoSize, "fontSizeMin", fontSizeMin, "fontSizeMax", fontSizeMax, "enableKerning", enableKerning, "richText", richText, "isRightToLeft", isRightToLeft, "extraPadding", extraPadding, "parseControlCharacters", parseControlCharacters, "characterSpacing", characterSpacing, "wordSpacing", wordSpacing, "lineSpacing", lineSpacing, "paragraphSpacing", paragraphSpacing, "lineSpacingMax", lineSpacingMax, "maxVisibleCharacters", maxVisibleCharacters, "maxVisibleWords", maxVisibleWords, "maxVisibleLines", maxVisibleLines, "firstVisibleCharacter", firstVisibleCharacter, "useMaxVisibleDescender", useMaxVisibleDescender, "fontWeight", fontWeight, "pageToDisplay", pageToDisplay, "horizontalMapping", horizontalMapping, "verticalMapping", verticalMapping, "uvLineOffset", uvLineOffset, "geometrySortingOrder", geometrySortingOrder, "inverseYAxis", inverseYAxis, "charWidthMaxAdj", charWidthMaxAdj); } } internal class TextGenerator { protected struct SpecialCharacter { public Character character; public FontAsset fontAsset; public Material material; public int materialIndex; public SpecialCharacter(Character character, int materialIndex) { this.character = character; fontAsset = character.textAsset as FontAsset; material = (((Object)(object)fontAsset != (Object)null) ? fontAsset.material : null); this.materialIndex = materialIndex; } } private const int k_Tab = 9; private const int k_LineFeed = 10; private const int k_CarriageReturn = 13; private const int k_Space = 32; private const int k_DoubleQuotes = 34; private const int k_NumberSign = 35; private const int k_PercentSign = 37; private const int k_SingleQuote = 39; private const int k_Plus = 43; private const int k_Minus = 45; private const int k_Period = 46; private const int k_LesserThan = 60; private const int k_Equal = 61; private const int k_GreaterThan = 62; private const int k_Underline = 95; private const int k_NoBreakSpace = 160; private const int k_SoftHyphen = 173; private const int k_HyphenMinus = 45; private const int k_FigureSpace = 8199; private const int k_Hyphen = 8208; private const int k_NonBreakingHyphen = 8209; private const int k_ZeroWidthSpace = 8203; private const int k_NarrowNoBreakSpace = 8239; private const int k_WordJoiner = 8288; private const int k_HorizontalEllipsis = 8230; private const int k_RightSingleQuote = 8217; private const int k_Square = 9633; private const int k_HangulJamoStart = 4352; private const int k_HangulJamoEnd = 4607; private const int k_CjkStart = 11904; private const int k_CjkEnd = 40959; private const int k_HangulJameExtendedStart = 43360; private const int k_HangulJameExtendedEnd = 43391; private const int k_HangulSyllablesStart = 44032; private const int k_HangulSyllablesEnd = 55295; private const int k_CjkIdeographsStart = 63744; private const int k_CjkIdeographsEnd = 64255; private const int k_CjkFormsStart = 65072; private const int k_CjkFormsEnd = 65103; private const int k_CjkHalfwidthStart = 65280; private const int k_CjkHalfwidthEnd = 65519; private const int k_VerticesMax = 16383; private const int k_SpritesStart = 57344; private const float k_FloatUnset = -32767f; private const int k_MaxCharacters = 8; private static TextGenerator s_TextGenerator; private Vector3[] m_RectTransformCorners = (Vector3[])(object)new Vector3[4]; private float m_MarginWidth; private float m_MarginHeight; private int[] m_CharBuffer = new int[8]; private float m_PreferredWidth; private float m_PreferredHeight; private FontAsset m_CurrentFontAsset; private Material m_CurrentMaterial; private int m_CurrentMaterialIndex; private TextProcessingStack m_MaterialReferenceStack = new TextProcessingStack(new MaterialReference[16]); private float m_Padding; private SpriteAsset m_CurrentSpriteAsset; private int m_TotalCharacterCount; private float m_FontScale; private float m_FontSize; private float m_FontScaleMultiplier; private float m_CurrentFontSize; private TextProcessingStack m_SizeStack = new TextProcessingStack(16); private FontStyles m_FontStyleInternal = FontStyles.Normal; private FontStyleStack m_FontStyleStack; private TextFontWeight m_FontWeightInternal = TextFontWeight.Regular; private TextProcessingStack m_FontWeightStack = new TextProcessingStack(8); private TextAlignment m_LineJustification; private TextProcessingStack m_LineJustificationStack = new TextProcessingStack(16); private float m_BaselineOffset; private TextProcessingStack m_BaselineOffsetStack = new TextProcessingStack(new float[16]); private Color32 m_FontColor32; private Color32 m_HtmlColor; private Color32 m_UnderlineColor; private Color32 m_StrikethroughColor; private TextProcessingStack m_ColorStack = new TextProcessingStack((Color32[])(object)new Color32[16]); private TextProcessingStack m_UnderlineColorStack = new TextProcessingStack((Color32[])(object)new Color32[16]); private TextProcessingStack m_StrikethroughColorStack = new TextProcessingStack((Color32[])(object)new Color32[16]); private TextProcessingStack m_HighlightColorStack = new TextProcessingStack((Color32[])(object)new Color32[16]); private TextColorGradient m_ColorGradientPreset; private TextProcessingStack m_ColorGradientStack = new TextProcessingStack(new TextColorGradient[16]); private TextProcessingStack m_ActionStack = new TextProcessingStack(new int[16]); private bool m_IsFxMatrixSet; private float m_LineOffset; private float m_LineHeight; private float m_CSpacing; private float m_MonoSpacing; private float m_XAdvance; private float m_TagLineIndent; private float m_TagIndent; private TextProcessingStack m_IndentStack = new TextProcessingStack(new float[16]); private bool m_TagNoParsing; private int m_CharacterCount; private int m_FirstCharacterOfLine; private int m_LastCharacterOfLine; private int m_FirstVisibleCharacterOfLine; private int m_LastVisibleCharacterOfLine; private float m_MaxLineAscender; private float m_MaxLineDescender; private int m_LineNumber; private int m_LineVisibleCharacterCount; private int m_FirstOverflowCharacterIndex; private int m_PageNumber; private float m_MarginLeft; private float m_MarginRight; private float m_Width; private Extents m_MeshExtents; private float m_MaxCapHeight; private float m_MaxAscender; private float m_MaxDescender; private bool m_IsNewPage; private bool m_IsNonBreakingSpace; private WordWrapState m_SavedWordWrapState; private WordWrapState m_SavedLineState; private int m_LoopCountA; private TextElementType m_TextElementType; private bool m_IsParsingText; private int m_SpriteIndex; private Color32 m_SpriteColor; private TextElement m_CachedTextElement; private Color32 m_HighlightColor; private float m_CharWidthAdjDelta; private Matrix4x4 m_FxMatrix; private float m_MaxFontSize; private float m_MinFontSize; private bool m_IsCharacterWrappingEnabled; private float m_StartOfLineAscender; private float m_LineSpacingDelta; private bool m_IsMaskingEnabled; private MaterialReference[] m_MaterialReferences = new MaterialReference[8]; private int m_SpriteCount = 0; private TextProcessingStack m_StyleStack = new TextProcessingStack(new int[16]); private int m_SpriteAnimationId; private uint[] m_InternalTextParsingBuffer = new uint[256]; private RichTextTagAttribute[] m_Attributes = new RichTextTagAttribute[8]; private XmlTagAttribute[] m_XmlAttribute = new XmlTagAttribute[8]; private char[] m_RichTextTag = new char[128]; private Dictionary m_MaterialReferenceIndexLookup = new Dictionary(); private bool m_IsCalculatingPreferredValues; private SpriteAsset m_DefaultSpriteAsset; private bool m_TintSprite; protected SpecialCharacter m_Ellipsis; protected SpecialCharacter m_Underline; private bool m_IsUsingBold; private bool m_IsSdfShader; private TextElementInfo[] m_InternalTextElementInfo; private int m_RecursiveCount; private static TextGenerator GetTextGenerator() { if (s_TextGenerator == null) { s_TextGenerator = new TextGenerator(); } return s_TextGenerator; } public static void GenerateText(TextGenerationSettings settings, TextInfo textInfo) { if ((Object)(object)settings.fontAsset == (Object)null || settings.fontAsset.characterLookupTable == null) { Debug.LogWarning((object)"Can't Generate Mesh, No Font Asset has been assigned."); return; } if (textInfo == null) { Debug.LogError((object)"Null TextInfo provided to TextGenerator. Cannot update its content."); return; } TextGenerator textGenerator = GetTextGenerator(); textGenerator.Prepare(settings, textInfo); FontAsset.UpdateFontAssetInUpdateQueue(); textGenerator.GenerateTextMesh(settings, textInfo); } public static Vector2 GetCursorPosition(TextGenerationSettings settings, int index) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)settings.fontAsset == (Object)null || settings.fontAsset.characterLookupTable == null) { Debug.LogWarning((object)"Can't Generate Mesh, No Font Asset has been assigned."); return Vector2.zero; } TextInfo textInfo = new TextInfo(); GenerateText(settings, textInfo); return GetCursorPosition(textInfo, settings.screenRect, index); } public static Vector2 GetCursorPosition(TextInfo textInfo, Rect screenRect, int index, bool inverseYAxis = true) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) Vector2 position = ((Rect)(ref screenRect)).position; if (textInfo.characterCount == 0) { return position; } TextElementInfo textElementInfo = textInfo.textElementInfo[textInfo.characterCount - 1]; LineInfo lineInfo = textInfo.lineInfo[textElementInfo.lineNumber]; float num = lineInfo.lineHeight - (lineInfo.ascender - lineInfo.descender); if (index >= textInfo.characterCount) { return position + (inverseYAxis ? new Vector2(textElementInfo.xAdvance, ((Rect)(ref screenRect)).height - lineInfo.ascender - num) : new Vector2(textElementInfo.xAdvance, lineInfo.descender)); } textElementInfo = textInfo.textElementInfo[index]; lineInfo = textInfo.lineInfo[textElementInfo.lineNumber]; num = lineInfo.lineHeight - (lineInfo.ascender - lineInfo.descender); return position + (inverseYAxis ? new Vector2(textElementInfo.origin, ((Rect)(ref screenRect)).height - lineInfo.ascender - num) : new Vector2(textElementInfo.origin, lineInfo.descender)); } public static float GetPreferredWidth(TextGenerationSettings settings, TextInfo textInfo) { if ((Object)(object)settings.fontAsset == (Object)null || settings.fontAsset.characterLookupTable == null) { Debug.LogWarning((object)"Can't Generate Mesh, No Font Asset has been assigned."); return 0f; } TextGenerator textGenerator = GetTextGenerator(); textGenerator.Prepare(settings, textInfo); return textGenerator.GetPreferredWidthInternal(settings, textInfo); } public static float GetPreferredHeight(TextGenerationSettings settings, TextInfo textInfo) { if ((Object)(object)settings.fontAsset == (Object)null || settings.fontAsset.characterLookupTable == null) { Debug.LogWarning((object)"Can't Generate Mesh, No Font Asset has been assigned."); return 0f; } TextGenerator textGenerator = GetTextGenerator(); textGenerator.Prepare(settings, textInfo); return textGenerator.GetPreferredHeightInternal(settings, textInfo); } public static Vector2 GetPreferredValues(TextGenerationSettings settings, TextInfo textInfo) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)settings.fontAsset == (Object)null || settings.fontAsset.characterLookupTable == null) { Debug.LogWarning((object)"Can't Generate Mesh, No Font Asset has been assigned."); return Vector2.zero; } TextGenerator textGenerator = GetTextGenerator(); textGenerator.Prepare(settings, textInfo); return textGenerator.GetPreferredValuesInternal(settings, textInfo); } private void Prepare(TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) m_Padding = 6f; m_IsMaskingEnabled = false; GetSpecialCharacters(generationSettings); ComputeMarginSize(generationSettings.screenRect, generationSettings.margins); TextGeneratorUtilities.StringToCharArray(generationSettings.text, ref m_CharBuffer, ref m_StyleStack, generationSettings); SetArraySizes(m_CharBuffer, generationSettings, textInfo); if (generationSettings.autoSize) { m_FontSize = Mathf.Clamp(generationSettings.fontSize, generationSettings.fontSizeMin, generationSettings.fontSizeMax); } else { m_FontSize = generationSettings.fontSize; } m_MaxFontSize = generationSettings.fontSizeMax; m_MinFontSize = generationSettings.fontSizeMin; m_LineSpacingDelta = 0f; m_CharWidthAdjDelta = 0f; m_IsCharacterWrappingEnabled = false; } private void GenerateTextMesh(TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_33cb: Unknown result type (might be due to invalid IL or missing references) //IL_33d0: Unknown result type (might be due to invalid IL or missing references) //IL_3868: Unknown result type (might be due to invalid IL or missing references) //IL_3870: Unknown result type (might be due to invalid IL or missing references) //IL_3875: Unknown result type (might be due to invalid IL or missing references) //IL_387f: Unknown result type (might be due to invalid IL or missing references) //IL_3889: Unknown result type (might be due to invalid IL or missing references) //IL_389b: Unknown result type (might be due to invalid IL or missing references) //IL_38a0: Unknown result type (might be due to invalid IL or missing references) //IL_38a5: Unknown result type (might be due to invalid IL or missing references) //IL_09c2: Unknown result type (might be due to invalid IL or missing references) //IL_09c7: Unknown result type (might be due to invalid IL or missing references) //IL_09de: Unknown result type (might be due to invalid IL or missing references) //IL_09e3: Unknown result type (might be due to invalid IL or missing references) //IL_09fa: Unknown result type (might be due to invalid IL or missing references) //IL_09ff: Unknown result type (might be due to invalid IL or missing references) //IL_0a16: Unknown result type (might be due to invalid IL or missing references) //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a56: Unknown result type (might be due to invalid IL or missing references) //IL_08c4: Unknown result type (might be due to invalid IL or missing references) //IL_08c9: Unknown result type (might be due to invalid IL or missing references) //IL_08da: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Unknown result type (might be due to invalid IL or missing references) //IL_06ff: Unknown result type (might be due to invalid IL or missing references) //IL_0704: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_392b: Unknown result type (might be due to invalid IL or missing references) //IL_3933: Unknown result type (might be due to invalid IL or missing references) //IL_3938: Unknown result type (might be due to invalid IL or missing references) //IL_3942: Unknown result type (might be due to invalid IL or missing references) //IL_394c: Unknown result type (might be due to invalid IL or missing references) //IL_395f: Unknown result type (might be due to invalid IL or missing references) //IL_3967: Unknown result type (might be due to invalid IL or missing references) //IL_397b: Unknown result type (might be due to invalid IL or missing references) //IL_3980: Unknown result type (might be due to invalid IL or missing references) //IL_3985: Unknown result type (might be due to invalid IL or missing references) //IL_38af: Unknown result type (might be due to invalid IL or missing references) //IL_38b7: Unknown result type (might be due to invalid IL or missing references) //IL_38bc: Unknown result type (might be due to invalid IL or missing references) //IL_38c6: Unknown result type (might be due to invalid IL or missing references) //IL_38d0: Unknown result type (might be due to invalid IL or missing references) //IL_38ed: Unknown result type (might be due to invalid IL or missing references) //IL_3906: Unknown result type (might be due to invalid IL or missing references) //IL_391a: Unknown result type (might be due to invalid IL or missing references) //IL_391f: Unknown result type (might be due to invalid IL or missing references) //IL_3924: Unknown result type (might be due to invalid IL or missing references) //IL_3989: Unknown result type (might be due to invalid IL or missing references) //IL_398e: Unknown result type (might be due to invalid IL or missing references) //IL_39a2: Unknown result type (might be due to invalid IL or missing references) //IL_39a7: Unknown result type (might be due to invalid IL or missing references) //IL_39ac: Unknown result type (might be due to invalid IL or missing references) //IL_39ae: Unknown result type (might be due to invalid IL or missing references) //IL_39b3: Unknown result type (might be due to invalid IL or missing references) //IL_39b8: Unknown result type (might be due to invalid IL or missing references) //IL_368f: Unknown result type (might be due to invalid IL or missing references) //IL_3699: Unknown result type (might be due to invalid IL or missing references) //IL_36b9: Unknown result type (might be due to invalid IL or missing references) //IL_36c6: Unknown result type (might be due to invalid IL or missing references) //IL_36cb: Unknown result type (might be due to invalid IL or missing references) //IL_36d0: Unknown result type (might be due to invalid IL or missing references) //IL_3653: Unknown result type (might be due to invalid IL or missing references) //IL_365d: Unknown result type (might be due to invalid IL or missing references) //IL_3671: Unknown result type (might be due to invalid IL or missing references) //IL_367e: Unknown result type (might be due to invalid IL or missing references) //IL_3683: Unknown result type (might be due to invalid IL or missing references) //IL_3688: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_381d: Unknown result type (might be due to invalid IL or missing references) //IL_3827: Unknown result type (might be due to invalid IL or missing references) //IL_3847: Unknown result type (might be due to invalid IL or missing references) //IL_3854: Unknown result type (might be due to invalid IL or missing references) //IL_3859: Unknown result type (might be due to invalid IL or missing references) //IL_385e: Unknown result type (might be due to invalid IL or missing references) //IL_37e5: Unknown result type (might be due to invalid IL or missing references) //IL_37ef: Unknown result type (might be due to invalid IL or missing references) //IL_37ff: Unknown result type (might be due to invalid IL or missing references) //IL_380c: Unknown result type (might be due to invalid IL or missing references) //IL_3811: Unknown result type (might be due to invalid IL or missing references) //IL_3816: Unknown result type (might be due to invalid IL or missing references) //IL_3750: Unknown result type (might be due to invalid IL or missing references) //IL_3758: Unknown result type (might be due to invalid IL or missing references) //IL_375d: Unknown result type (might be due to invalid IL or missing references) //IL_3767: Unknown result type (might be due to invalid IL or missing references) //IL_3771: Unknown result type (might be due to invalid IL or missing references) //IL_3790: Unknown result type (might be due to invalid IL or missing references) //IL_37ab: Unknown result type (might be due to invalid IL or missing references) //IL_37bf: Unknown result type (might be due to invalid IL or missing references) //IL_37c4: Unknown result type (might be due to invalid IL or missing references) //IL_37c9: Unknown result type (might be due to invalid IL or missing references) //IL_36ec: Unknown result type (might be due to invalid IL or missing references) //IL_36f4: Unknown result type (might be due to invalid IL or missing references) //IL_36f9: Unknown result type (might be due to invalid IL or missing references) //IL_3703: Unknown result type (might be due to invalid IL or missing references) //IL_370d: Unknown result type (might be due to invalid IL or missing references) //IL_3720: Unknown result type (might be due to invalid IL or missing references) //IL_372b: Unknown result type (might be due to invalid IL or missing references) //IL_373f: Unknown result type (might be due to invalid IL or missing references) //IL_3744: Unknown result type (might be due to invalid IL or missing references) //IL_3749: Unknown result type (might be due to invalid IL or missing references) //IL_0b8a: Unknown result type (might be due to invalid IL or missing references) //IL_0b8f: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c3d: Unknown result type (might be due to invalid IL or missing references) //IL_0c57: Unknown result type (might be due to invalid IL or missing references) //IL_0c5c: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0ae3: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0aec: Unknown result type (might be due to invalid IL or missing references) //IL_0b4c: Unknown result type (might be due to invalid IL or missing references) //IL_0b50: Unknown result type (might be due to invalid IL or missing references) //IL_0b55: Unknown result type (might be due to invalid IL or missing references) //IL_0b59: Unknown result type (might be due to invalid IL or missing references) //IL_0b5e: Unknown result type (might be due to invalid IL or missing references) //IL_0b63: Unknown result type (might be due to invalid IL or missing references) //IL_3db8: Unknown result type (might be due to invalid IL or missing references) //IL_3dc9: Unknown result type (might be due to invalid IL or missing references) //IL_41e9: Unknown result type (might be due to invalid IL or missing references) //IL_41eb: Unknown result type (might be due to invalid IL or missing references) //IL_41ed: Unknown result type (might be due to invalid IL or missing references) //IL_41f2: Unknown result type (might be due to invalid IL or missing references) //IL_558f: Unknown result type (might be due to invalid IL or missing references) //IL_5594: Unknown result type (might be due to invalid IL or missing references) //IL_5596: Unknown result type (might be due to invalid IL or missing references) //IL_559b: Unknown result type (might be due to invalid IL or missing references) //IL_55c4: Unknown result type (might be due to invalid IL or missing references) //IL_55c9: Unknown result type (might be due to invalid IL or missing references) //IL_55cb: Unknown result type (might be due to invalid IL or missing references) //IL_55d0: Unknown result type (might be due to invalid IL or missing references) //IL_55f9: Unknown result type (might be due to invalid IL or missing references) //IL_55fe: Unknown result type (might be due to invalid IL or missing references) //IL_5600: Unknown result type (might be due to invalid IL or missing references) //IL_5605: Unknown result type (might be due to invalid IL or missing references) //IL_562e: Unknown result type (might be due to invalid IL or missing references) //IL_5633: Unknown result type (might be due to invalid IL or missing references) //IL_5635: Unknown result type (might be due to invalid IL or missing references) //IL_563a: Unknown result type (might be due to invalid IL or missing references) //IL_5653: Unknown result type (might be due to invalid IL or missing references) //IL_5670: Unknown result type (might be due to invalid IL or missing references) //IL_568d: Unknown result type (might be due to invalid IL or missing references) //IL_56aa: Unknown result type (might be due to invalid IL or missing references) //IL_56c7: Unknown result type (might be due to invalid IL or missing references) //IL_0db4: Unknown result type (might be due to invalid IL or missing references) //IL_0db9: Unknown result type (might be due to invalid IL or missing references) //IL_0dd6: Unknown result type (might be due to invalid IL or missing references) //IL_0ddb: Unknown result type (might be due to invalid IL or missing references) //IL_0dfa: Unknown result type (might be due to invalid IL or missing references) //IL_0dff: Unknown result type (might be due to invalid IL or missing references) //IL_0e39: Unknown result type (might be due to invalid IL or missing references) //IL_0e3e: Unknown result type (might be due to invalid IL or missing references) //IL_0e75: Unknown result type (might be due to invalid IL or missing references) //IL_0e83: Unknown result type (might be due to invalid IL or missing references) //IL_0e95: Unknown result type (might be due to invalid IL or missing references) //IL_0e9a: Unknown result type (might be due to invalid IL or missing references) //IL_0ec1: Unknown result type (might be due to invalid IL or missing references) //IL_0ed3: Unknown result type (might be due to invalid IL or missing references) //IL_0ed8: Unknown result type (might be due to invalid IL or missing references) //IL_0f09: Unknown result type (might be due to invalid IL or missing references) //IL_0f23: Unknown result type (might be due to invalid IL or missing references) //IL_0f31: Unknown result type (might be due to invalid IL or missing references) //IL_46fc: Unknown result type (might be due to invalid IL or missing references) //IL_476e: Unknown result type (might be due to invalid IL or missing references) //IL_47e0: Unknown result type (might be due to invalid IL or missing references) //IL_4852: Unknown result type (might be due to invalid IL or missing references) //IL_452f: Unknown result type (might be due to invalid IL or missing references) //IL_45a1: Unknown result type (might be due to invalid IL or missing references) //IL_4613: Unknown result type (might be due to invalid IL or missing references) //IL_4685: Unknown result type (might be due to invalid IL or missing references) //IL_4387: Unknown result type (might be due to invalid IL or missing references) //IL_4398: Unknown result type (might be due to invalid IL or missing references) //IL_43a8: Unknown result type (might be due to invalid IL or missing references) //IL_43f1: Unknown result type (might be due to invalid IL or missing references) //IL_4402: Unknown result type (might be due to invalid IL or missing references) //IL_4412: Unknown result type (might be due to invalid IL or missing references) //IL_445b: Unknown result type (might be due to invalid IL or missing references) //IL_446c: Unknown result type (might be due to invalid IL or missing references) //IL_447c: Unknown result type (might be due to invalid IL or missing references) //IL_44c5: Unknown result type (might be due to invalid IL or missing references) //IL_44d6: Unknown result type (might be due to invalid IL or missing references) //IL_44e6: Unknown result type (might be due to invalid IL or missing references) //IL_4980: Unknown result type (might be due to invalid IL or missing references) //IL_4991: Unknown result type (might be due to invalid IL or missing references) //IL_49a1: Unknown result type (might be due to invalid IL or missing references) //IL_49ea: Unknown result type (might be due to invalid IL or missing references) //IL_49fb: Unknown result type (might be due to invalid IL or missing references) //IL_4a0b: Unknown result type (might be due to invalid IL or missing references) //IL_5726: Unknown result type (might be due to invalid IL or missing references) //IL_5743: Unknown result type (might be due to invalid IL or missing references) //IL_5760: Unknown result type (might be due to invalid IL or missing references) //IL_57b4: Unknown result type (might be due to invalid IL or missing references) //IL_57b9: Unknown result type (might be due to invalid IL or missing references) //IL_5809: Unknown result type (might be due to invalid IL or missing references) //IL_580e: Unknown result type (might be due to invalid IL or missing references) //IL_0f91: Unknown result type (might be due to invalid IL or missing references) //IL_0f96: Unknown result type (might be due to invalid IL or missing references) //IL_0fc5: Unknown result type (might be due to invalid IL or missing references) //IL_0fca: Unknown result type (might be due to invalid IL or missing references) //IL_0fde: Unknown result type (might be due to invalid IL or missing references) //IL_0fe3: Unknown result type (might be due to invalid IL or missing references) //IL_1004: Unknown result type (might be due to invalid IL or missing references) //IL_1006: Unknown result type (might be due to invalid IL or missing references) //IL_1008: Unknown result type (might be due to invalid IL or missing references) //IL_100d: Unknown result type (might be due to invalid IL or missing references) //IL_100f: Unknown result type (might be due to invalid IL or missing references) //IL_1011: Unknown result type (might be due to invalid IL or missing references) //IL_1013: Unknown result type (might be due to invalid IL or missing references) //IL_1018: Unknown result type (might be due to invalid IL or missing references) //IL_101a: Unknown result type (might be due to invalid IL or missing references) //IL_101c: Unknown result type (might be due to invalid IL or missing references) //IL_101e: Unknown result type (might be due to invalid IL or missing references) //IL_1023: Unknown result type (might be due to invalid IL or missing references) //IL_1025: Unknown result type (might be due to invalid IL or missing references) //IL_1027: Unknown result type (might be due to invalid IL or missing references) //IL_1029: Unknown result type (might be due to invalid IL or missing references) //IL_102e: Unknown result type (might be due to invalid IL or missing references) //IL_5846: Unknown result type (might be due to invalid IL or missing references) //IL_5863: Unknown result type (might be due to invalid IL or missing references) //IL_5880: Unknown result type (might be due to invalid IL or missing references) //IL_58d4: Unknown result type (might be due to invalid IL or missing references) //IL_58d9: Unknown result type (might be due to invalid IL or missing references) //IL_5929: Unknown result type (might be due to invalid IL or missing references) //IL_592e: Unknown result type (might be due to invalid IL or missing references) //IL_10dc: Unknown result type (might be due to invalid IL or missing references) //IL_10de: Unknown result type (might be due to invalid IL or missing references) //IL_10f4: Unknown result type (might be due to invalid IL or missing references) //IL_10f6: Unknown result type (might be due to invalid IL or missing references) //IL_110c: Unknown result type (might be due to invalid IL or missing references) //IL_110e: Unknown result type (might be due to invalid IL or missing references) //IL_1124: Unknown result type (might be due to invalid IL or missing references) //IL_1126: Unknown result type (might be due to invalid IL or missing references) //IL_117e: Unknown result type (might be due to invalid IL or missing references) //IL_1185: Unknown result type (might be due to invalid IL or missing references) //IL_118d: Unknown result type (might be due to invalid IL or missing references) //IL_1194: Unknown result type (might be due to invalid IL or missing references) //IL_11a8: Unknown result type (might be due to invalid IL or missing references) //IL_11ad: Unknown result type (might be due to invalid IL or missing references) //IL_1041: Unknown result type (might be due to invalid IL or missing references) //IL_1043: Unknown result type (might be due to invalid IL or missing references) //IL_1045: Unknown result type (might be due to invalid IL or missing references) //IL_104f: Unknown result type (might be due to invalid IL or missing references) //IL_1054: Unknown result type (might be due to invalid IL or missing references) //IL_105c: Unknown result type (might be due to invalid IL or missing references) //IL_105e: Unknown result type (might be due to invalid IL or missing references) //IL_1060: Unknown result type (might be due to invalid IL or missing references) //IL_1065: Unknown result type (might be due to invalid IL or missing references) //IL_106a: Unknown result type (might be due to invalid IL or missing references) //IL_106c: Unknown result type (might be due to invalid IL or missing references) //IL_1071: Unknown result type (might be due to invalid IL or missing references) //IL_1079: Unknown result type (might be due to invalid IL or missing references) //IL_107b: Unknown result type (might be due to invalid IL or missing references) //IL_107d: Unknown result type (might be due to invalid IL or missing references) //IL_1082: Unknown result type (might be due to invalid IL or missing references) //IL_1087: Unknown result type (might be due to invalid IL or missing references) //IL_1089: Unknown result type (might be due to invalid IL or missing references) //IL_108e: Unknown result type (might be due to invalid IL or missing references) //IL_1096: Unknown result type (might be due to invalid IL or missing references) //IL_1098: Unknown result type (might be due to invalid IL or missing references) //IL_109a: Unknown result type (might be due to invalid IL or missing references) //IL_109f: Unknown result type (might be due to invalid IL or missing references) //IL_10a4: Unknown result type (might be due to invalid IL or missing references) //IL_10a6: Unknown result type (might be due to invalid IL or missing references) //IL_10ab: Unknown result type (might be due to invalid IL or missing references) //IL_10b3: Unknown result type (might be due to invalid IL or missing references) //IL_10b5: Unknown result type (might be due to invalid IL or missing references) //IL_10b7: Unknown result type (might be due to invalid IL or missing references) //IL_10bc: Unknown result type (might be due to invalid IL or missing references) //IL_10c1: Unknown result type (might be due to invalid IL or missing references) //IL_10c3: Unknown result type (might be due to invalid IL or missing references) //IL_10c8: Unknown result type (might be due to invalid IL or missing references) //IL_52cf: Unknown result type (might be due to invalid IL or missing references) //IL_52d4: Unknown result type (might be due to invalid IL or missing references) //IL_52d6: Unknown result type (might be due to invalid IL or missing references) //IL_52db: Unknown result type (might be due to invalid IL or missing references) //IL_5305: Unknown result type (might be due to invalid IL or missing references) //IL_530a: Unknown result type (might be due to invalid IL or missing references) //IL_530c: Unknown result type (might be due to invalid IL or missing references) //IL_5311: Unknown result type (might be due to invalid IL or missing references) //IL_533b: Unknown result type (might be due to invalid IL or missing references) //IL_5340: Unknown result type (might be due to invalid IL or missing references) //IL_5342: Unknown result type (might be due to invalid IL or missing references) //IL_5347: Unknown result type (might be due to invalid IL or missing references) //IL_5371: Unknown result type (might be due to invalid IL or missing references) //IL_5376: Unknown result type (might be due to invalid IL or missing references) //IL_5378: Unknown result type (might be due to invalid IL or missing references) //IL_537d: Unknown result type (might be due to invalid IL or missing references) //IL_1224: Unknown result type (might be due to invalid IL or missing references) //IL_1229: Unknown result type (might be due to invalid IL or missing references) //IL_54c0: Unknown result type (might be due to invalid IL or missing references) //IL_54c5: Unknown result type (might be due to invalid IL or missing references) //IL_54d8: Unknown result type (might be due to invalid IL or missing references) //IL_54dd: Unknown result type (might be due to invalid IL or missing references) //IL_54f0: Unknown result type (might be due to invalid IL or missing references) //IL_54f5: Unknown result type (might be due to invalid IL or missing references) //IL_5508: Unknown result type (might be due to invalid IL or missing references) //IL_550d: Unknown result type (might be due to invalid IL or missing references) //IL_53fb: Unknown result type (might be due to invalid IL or missing references) //IL_5400: Unknown result type (might be due to invalid IL or missing references) //IL_5402: Unknown result type (might be due to invalid IL or missing references) //IL_5407: Unknown result type (might be due to invalid IL or missing references) //IL_5431: Unknown result type (might be due to invalid IL or missing references) //IL_5436: Unknown result type (might be due to invalid IL or missing references) //IL_5438: Unknown result type (might be due to invalid IL or missing references) //IL_543d: Unknown result type (might be due to invalid IL or missing references) //IL_5467: Unknown result type (might be due to invalid IL or missing references) //IL_546c: Unknown result type (might be due to invalid IL or missing references) //IL_546e: Unknown result type (might be due to invalid IL or missing references) //IL_5473: Unknown result type (might be due to invalid IL or missing references) //IL_549d: Unknown result type (might be due to invalid IL or missing references) //IL_54a2: Unknown result type (might be due to invalid IL or missing references) //IL_54a4: Unknown result type (might be due to invalid IL or missing references) //IL_54a9: Unknown result type (might be due to invalid IL or missing references) //IL_6157: Unknown result type (might be due to invalid IL or missing references) //IL_6159: Unknown result type (might be due to invalid IL or missing references) //IL_6165: Unknown result type (might be due to invalid IL or missing references) //IL_619c: Unknown result type (might be due to invalid IL or missing references) //IL_61a1: Unknown result type (might be due to invalid IL or missing references) //IL_670b: Unknown result type (might be due to invalid IL or missing references) //IL_670d: Unknown result type (might be due to invalid IL or missing references) //IL_6719: Unknown result type (might be due to invalid IL or missing references) //IL_12e3: Unknown result type (might be due to invalid IL or missing references) //IL_12e8: Unknown result type (might be due to invalid IL or missing references) //IL_6b11: Unknown result type (might be due to invalid IL or missing references) //IL_6b13: Unknown result type (might be due to invalid IL or missing references) //IL_6b17: Unknown result type (might be due to invalid IL or missing references) //IL_5d41: Unknown result type (might be due to invalid IL or missing references) //IL_5d46: Unknown result type (might be due to invalid IL or missing references) //IL_1325: Unknown result type (might be due to invalid IL or missing references) //IL_132a: Unknown result type (might be due to invalid IL or missing references) //IL_635a: Unknown result type (might be due to invalid IL or missing references) //IL_635c: Unknown result type (might be due to invalid IL or missing references) //IL_6368: Unknown result type (might be due to invalid IL or missing references) //IL_62df: Unknown result type (might be due to invalid IL or missing references) //IL_62e4: Unknown result type (might be due to invalid IL or missing references) //IL_1398: Unknown result type (might be due to invalid IL or missing references) //IL_139d: Unknown result type (might be due to invalid IL or missing references) //IL_4162: Unknown result type (might be due to invalid IL or missing references) //IL_4183: Unknown result type (might be due to invalid IL or missing references) //IL_4188: Unknown result type (might be due to invalid IL or missing references) //IL_418d: Unknown result type (might be due to invalid IL or missing references) //IL_4133: Unknown result type (might be due to invalid IL or missing references) //IL_4154: Unknown result type (might be due to invalid IL or missing references) //IL_4159: Unknown result type (might be due to invalid IL or missing references) //IL_415e: Unknown result type (might be due to invalid IL or missing references) //IL_40e5: Unknown result type (might be due to invalid IL or missing references) //IL_410c: Unknown result type (might be due to invalid IL or missing references) //IL_4111: Unknown result type (might be due to invalid IL or missing references) //IL_4116: Unknown result type (might be due to invalid IL or missing references) //IL_40b0: Unknown result type (might be due to invalid IL or missing references) //IL_40d7: Unknown result type (might be due to invalid IL or missing references) //IL_40dc: Unknown result type (might be due to invalid IL or missing references) //IL_40e1: Unknown result type (might be due to invalid IL or missing references) //IL_5e90: Unknown result type (might be due to invalid IL or missing references) //IL_5e92: Unknown result type (might be due to invalid IL or missing references) //IL_5e9e: Unknown result type (might be due to invalid IL or missing references) //IL_6877: Unknown result type (might be due to invalid IL or missing references) //IL_687c: Unknown result type (might be due to invalid IL or missing references) //IL_6889: Unknown result type (might be due to invalid IL or missing references) //IL_688b: Unknown result type (might be due to invalid IL or missing references) //IL_5e2b: Unknown result type (might be due to invalid IL or missing references) //IL_5e30: Unknown result type (might be due to invalid IL or missing references) //IL_68ad: Unknown result type (might be due to invalid IL or missing references) //IL_68d9: Unknown result type (might be due to invalid IL or missing references) //IL_68fe: Unknown result type (might be due to invalid IL or missing references) //IL_6922: Unknown result type (might be due to invalid IL or missing references) //IL_6924: Unknown result type (might be due to invalid IL or missing references) //IL_6928: Unknown result type (might be due to invalid IL or missing references) //IL_6935: Unknown result type (might be due to invalid IL or missing references) //IL_6937: Unknown result type (might be due to invalid IL or missing references) //IL_697b: Unknown result type (might be due to invalid IL or missing references) //IL_6980: Unknown result type (might be due to invalid IL or missing references) //IL_69a7: Unknown result type (might be due to invalid IL or missing references) //IL_69d1: Unknown result type (might be due to invalid IL or missing references) //IL_69f6: Unknown result type (might be due to invalid IL or missing references) //IL_6a20: Unknown result type (might be due to invalid IL or missing references) //IL_6828: Unknown result type (might be due to invalid IL or missing references) //IL_682d: Unknown result type (might be due to invalid IL or missing references) //IL_6832: Unknown result type (might be due to invalid IL or missing references) //IL_6834: Unknown result type (might be due to invalid IL or missing references) //IL_6839: Unknown result type (might be due to invalid IL or missing references) //IL_683e: Unknown result type (might be due to invalid IL or missing references) //IL_684d: Unknown result type (might be due to invalid IL or missing references) //IL_6852: Unknown result type (might be due to invalid IL or missing references) //IL_6a68: Unknown result type (might be due to invalid IL or missing references) //IL_6a6a: Unknown result type (might be due to invalid IL or missing references) //IL_6a6e: Unknown result type (might be due to invalid IL or missing references) //IL_64ac: Unknown result type (might be due to invalid IL or missing references) //IL_6454: Unknown result type (might be due to invalid IL or missing references) //IL_6456: Unknown result type (might be due to invalid IL or missing references) //IL_6462: Unknown result type (might be due to invalid IL or missing references) //IL_6031: Unknown result type (might be due to invalid IL or missing references) //IL_6033: Unknown result type (might be due to invalid IL or missing references) //IL_603f: Unknown result type (might be due to invalid IL or missing references) //IL_14ec: Unknown result type (might be due to invalid IL or missing references) //IL_14f1: Unknown result type (might be due to invalid IL or missing references) //IL_6ab1: Unknown result type (might be due to invalid IL or missing references) //IL_6ab3: Unknown result type (might be due to invalid IL or missing references) //IL_6ab7: Unknown result type (might be due to invalid IL or missing references) //IL_657f: Unknown result type (might be due to invalid IL or missing references) //IL_6581: Unknown result type (might be due to invalid IL or missing references) //IL_658d: Unknown result type (might be due to invalid IL or missing references) //IL_5fa5: Unknown result type (might be due to invalid IL or missing references) //IL_5fa7: Unknown result type (might be due to invalid IL or missing references) //IL_5fb3: Unknown result type (might be due to invalid IL or missing references) //IL_661d: Unknown result type (might be due to invalid IL or missing references) //IL_661f: Unknown result type (might be due to invalid IL or missing references) //IL_662b: Unknown result type (might be due to invalid IL or missing references) //IL_606d: Unknown result type (might be due to invalid IL or missing references) //IL_607e: Unknown result type (might be due to invalid IL or missing references) //IL_60da: Unknown result type (might be due to invalid IL or missing references) //IL_60dc: Unknown result type (might be due to invalid IL or missing references) //IL_60e8: Unknown result type (might be due to invalid IL or missing references) //IL_6ae7: Unknown result type (might be due to invalid IL or missing references) //IL_6ae9: Unknown result type (might be due to invalid IL or missing references) //IL_6aed: Unknown result type (might be due to invalid IL or missing references) //IL_669a: Unknown result type (might be due to invalid IL or missing references) //IL_669c: Unknown result type (might be due to invalid IL or missing references) //IL_66a8: Unknown result type (might be due to invalid IL or missing references) //IL_261c: Unknown result type (might be due to invalid IL or missing references) //IL_2621: Unknown result type (might be due to invalid IL or missing references) //IL_1f38: Unknown result type (might be due to invalid IL or missing references) //IL_1f3d: Unknown result type (might be due to invalid IL or missing references) //IL_1f2e: Unknown result type (might be due to invalid IL or missing references) //IL_1f33: Unknown result type (might be due to invalid IL or missing references) //IL_2743: Unknown result type (might be due to invalid IL or missing references) //IL_2748: Unknown result type (might be due to invalid IL or missing references) //IL_1f53: Unknown result type (might be due to invalid IL or missing references) //IL_1f71: Unknown result type (might be due to invalid IL or missing references) //IL_195c: Unknown result type (might be due to invalid IL or missing references) //IL_1961: Unknown result type (might be due to invalid IL or missing references) //IL_1999: Unknown result type (might be due to invalid IL or missing references) //IL_199e: Unknown result type (might be due to invalid IL or missing references) //IL_2a7d: Unknown result type (might be due to invalid IL or missing references) //IL_2a82: Unknown result type (might be due to invalid IL or missing references) //IL_2aba: Unknown result type (might be due to invalid IL or missing references) //IL_2abf: Unknown result type (might be due to invalid IL or missing references) if (textInfo == null) { return; } textInfo.Clear(); if (m_CharBuffer == null || m_CharBuffer.Length == 0 || m_CharBuffer[0] == 0) { ClearMesh(updateMesh: true, textInfo); m_PreferredWidth = 0f; m_PreferredHeight = 0f; return; } m_CurrentFontAsset = generationSettings.fontAsset; m_CurrentMaterial = generationSettings.material; m_CurrentMaterialIndex = 0; m_MaterialReferenceStack.SetDefault(new MaterialReference(m_CurrentMaterialIndex, m_CurrentFontAsset, null, m_CurrentMaterial, m_Padding)); m_CurrentSpriteAsset = generationSettings.spriteAsset; int totalCharacterCount = m_TotalCharacterCount; float fontSize = m_FontSize; FaceInfo faceInfo = generationSettings.fontAsset.faceInfo; float num = fontSize / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = generationSettings.fontAsset.faceInfo; float num2 = (m_FontScale = num * ((FaceInfo)(ref faceInfo)).scale); float num3 = num2; m_FontScaleMultiplier = 1f; m_CurrentFontSize = m_FontSize; m_SizeStack.SetDefault(m_CurrentFontSize); m_FontStyleInternal = generationSettings.fontStyle; m_FontWeightInternal = (((m_FontStyleInternal & FontStyles.Bold) == FontStyles.Bold) ? TextFontWeight.Bold : generationSettings.fontWeight); m_FontWeightStack.SetDefault(m_FontWeightInternal); m_FontStyleStack.Clear(); m_LineJustification = generationSettings.textAlignment; m_LineJustificationStack.SetDefault(m_LineJustification); float num4 = 0f; float num5 = 1f; m_BaselineOffset = 0f; m_BaselineOffsetStack.Clear(); bool flag = false; Vector3 zero = Vector3.zero; bool flag2 = false; Vector3 zero2 = Vector3.zero; bool flag3 = false; Vector3 val = Vector3.zero; Vector3 val2 = Vector3.zero; m_FontColor32 = Color32.op_Implicit(generationSettings.color); m_HtmlColor = m_FontColor32; m_UnderlineColor = m_HtmlColor; m_StrikethroughColor = m_HtmlColor; m_ColorStack.SetDefault(m_HtmlColor); m_UnderlineColorStack.SetDefault(m_HtmlColor); m_StrikethroughColorStack.SetDefault(m_HtmlColor); m_HighlightColorStack.SetDefault(m_HtmlColor); m_ColorGradientPreset = null; m_ColorGradientStack.SetDefault(null); m_ActionStack.Clear(); m_IsFxMatrixSet = false; m_LineOffset = 0f; m_LineHeight = -32767f; faceInfo = m_CurrentFontAsset.faceInfo; float lineHeight = ((FaceInfo)(ref faceInfo)).lineHeight; faceInfo = m_CurrentFontAsset.faceInfo; float ascentLine = ((FaceInfo)(ref faceInfo)).ascentLine; faceInfo = m_CurrentFontAsset.faceInfo; float num6 = lineHeight - (ascentLine - ((FaceInfo)(ref faceInfo)).descentLine); m_CSpacing = 0f; m_MonoSpacing = 0f; m_XAdvance = 0f; m_TagLineIndent = 0f; m_TagIndent = 0f; m_IndentStack.SetDefault(0f); m_TagNoParsing = false; m_CharacterCount = 0; m_FirstCharacterOfLine = 0; m_LastCharacterOfLine = 0; m_FirstVisibleCharacterOfLine = 0; m_LastVisibleCharacterOfLine = 0; m_MaxLineAscender = -32767f; m_MaxLineDescender = 32767f; m_LineNumber = 0; m_LineVisibleCharacterCount = 0; bool flag4 = true; m_FirstOverflowCharacterIndex = -1; m_PageNumber = 0; int num7 = Mathf.Clamp(generationSettings.pageToDisplay - 1, 0, textInfo.pageInfo.Length - 1); int num8 = 0; int num9 = 0; Vector4 margins = generationSettings.margins; float marginWidth = m_MarginWidth; float marginHeight = m_MarginHeight; m_MarginLeft = 0f; m_MarginRight = 0f; m_Width = -1f; float num10 = marginWidth + 0.0001f - m_MarginLeft - m_MarginRight; m_MeshExtents.min = TextGeneratorUtilities.largePositiveVector2; m_MeshExtents.max = TextGeneratorUtilities.largeNegativeVector2; TextSettings textSettings = generationSettings.textSettings; textInfo.ClearLineInfo(); m_MaxCapHeight = 0f; m_MaxAscender = 0f; m_MaxDescender = 0f; float num11 = 0f; float num12 = 0f; bool flag5 = false; m_IsNewPage = false; bool flag6 = true; m_IsNonBreakingSpace = false; bool flag7 = false; bool flag8 = false; int num13 = 0; SaveWordWrappingState(ref m_SavedWordWrapState, -1, -1, textInfo); SaveWordWrappingState(ref m_SavedLineState, -1, -1, textInfo); m_LoopCountA++; Vector3 val6 = default(Vector3); Vector3 val7 = default(Vector3); Vector3 val8 = default(Vector3); Vector3 val9 = default(Vector3); Vector3 val10 = default(Vector3); Vector3 val11 = default(Vector3); for (int i = 0; i < m_CharBuffer.Length && m_CharBuffer[i] != 0; i++) { int num14 = m_CharBuffer[i]; if (generationSettings.richText && num14 == 60) { m_IsParsingText = true; m_TextElementType = TextElementType.Character; if (ValidateHtmlTag(m_CharBuffer, i + 1, out var endIndex, generationSettings, textInfo)) { i = endIndex; if (m_TextElementType == TextElementType.Character) { continue; } } } else { m_TextElementType = textInfo.textElementInfo[m_CharacterCount].elementType; m_CurrentMaterialIndex = textInfo.textElementInfo[m_CharacterCount].materialReferenceIndex; m_CurrentFontAsset = textInfo.textElementInfo[m_CharacterCount].fontAsset; } int currentMaterialIndex = m_CurrentMaterialIndex; bool isUsingAlternateTypeface = textInfo.textElementInfo[m_CharacterCount].isUsingAlternateTypeface; m_IsParsingText = false; if (m_CharacterCount < generationSettings.firstVisibleCharacter) { textInfo.textElementInfo[m_CharacterCount].isVisible = false; textInfo.textElementInfo[m_CharacterCount].character = '\u200b'; m_CharacterCount++; continue; } float num15 = 1f; if (m_TextElementType == TextElementType.Character) { if ((m_FontStyleInternal & FontStyles.UpperCase) == FontStyles.UpperCase) { if (char.IsLower((char)num14)) { num14 = char.ToUpper((char)num14); } } else if ((m_FontStyleInternal & FontStyles.LowerCase) == FontStyles.LowerCase) { if (char.IsUpper((char)num14)) { num14 = char.ToLower((char)num14); } } else if ((m_FontStyleInternal & FontStyles.SmallCaps) == FontStyles.SmallCaps && char.IsLower((char)num14)) { num15 = 0.8f; num14 = char.ToUpper((char)num14); } } GlyphMetrics metrics; if (m_TextElementType == TextElementType.Sprite) { SpriteCharacter spriteCharacter = (SpriteCharacter)textInfo.textElementInfo[m_CharacterCount].textElement; m_CurrentSpriteAsset = spriteCharacter.textAsset as SpriteAsset; m_SpriteIndex = (int)spriteCharacter.glyphIndex; if (spriteCharacter == null) { continue; } if (num14 == 60) { num14 = 57344 + m_SpriteIndex; } else { m_SpriteColor = Color32.op_Implicit(Color.white); } float currentFontSize = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num16 = currentFontSize / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; float num17 = num16 * ((FaceInfo)(ref faceInfo)).scale; faceInfo = m_CurrentFontAsset.faceInfo; float ascentLine2 = ((FaceInfo)(ref faceInfo)).ascentLine; metrics = spriteCharacter.glyph.metrics; num3 = ascentLine2 / ((GlyphMetrics)(ref metrics)).height * spriteCharacter.scale * num17 * generationSettings.scale; m_CachedTextElement = spriteCharacter; textInfo.textElementInfo[m_CharacterCount].elementType = TextElementType.Sprite; textInfo.textElementInfo[m_CharacterCount].scale = num17; textInfo.textElementInfo[m_CharacterCount].spriteAsset = m_CurrentSpriteAsset; textInfo.textElementInfo[m_CharacterCount].fontAsset = m_CurrentFontAsset; textInfo.textElementInfo[m_CharacterCount].materialReferenceIndex = m_CurrentMaterialIndex; m_CurrentMaterialIndex = currentMaterialIndex; num4 = 0f; } else if (m_TextElementType == TextElementType.Character) { m_CachedTextElement = textInfo.textElementInfo[m_CharacterCount].textElement; if (m_CachedTextElement == null) { continue; } m_CurrentFontAsset = textInfo.textElementInfo[m_CharacterCount].fontAsset; m_CurrentMaterial = textInfo.textElementInfo[m_CharacterCount].material; m_CurrentMaterialIndex = textInfo.textElementInfo[m_CharacterCount].materialReferenceIndex; float num18 = m_CurrentFontSize * num15; faceInfo = m_CurrentFontAsset.faceInfo; float num19 = num18 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num19 * ((FaceInfo)(ref faceInfo)).scale; num3 = m_FontScale * m_FontScaleMultiplier * m_CachedTextElement.scale * generationSettings.scale; textInfo.textElementInfo[m_CharacterCount].elementType = TextElementType.Character; textInfo.textElementInfo[m_CharacterCount].scale = num3; num4 = ((m_CurrentMaterialIndex == 0) ? m_Padding : GetPaddingForMaterial(m_CurrentMaterial, generationSettings.extraPadding)); } float num20 = num3; if (num14 == 173) { num3 = 0f; } textInfo.textElementInfo[m_CharacterCount].character = (char)num14; textInfo.textElementInfo[m_CharacterCount].pointSize = m_CurrentFontSize; textInfo.textElementInfo[m_CharacterCount].color = m_HtmlColor; textInfo.textElementInfo[m_CharacterCount].underlineColor = m_UnderlineColor; textInfo.textElementInfo[m_CharacterCount].strikethroughColor = m_StrikethroughColor; textInfo.textElementInfo[m_CharacterCount].highlightColor = m_HighlightColor; textInfo.textElementInfo[m_CharacterCount].style = m_FontStyleInternal; textInfo.textElementInfo[m_CharacterCount].index = i; GlyphValueRecord val3 = default(GlyphValueRecord); float characterSpacing = generationSettings.characterSpacing; if (generationSettings.enableKerning) { uint glyphIndex = m_CachedTextElement.glyphIndex; GlyphPairAdjustmentRecord value; GlyphAdjustmentRecord val4; if (m_CharacterCount < totalCharacterCount - 1) { uint glyphIndex2 = textInfo.textElementInfo[m_CharacterCount + 1].textElement.glyphIndex; uint key = (glyphIndex2 << 16) | glyphIndex; if (m_CurrentFontAsset.m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.TryGetValue(key, out value)) { val4 = ((GlyphPairAdjustmentRecord)(ref value)).firstAdjustmentRecord; val3 = ((GlyphAdjustmentRecord)(ref val4)).glyphValueRecord; } } if (m_CharacterCount >= 1) { uint glyphIndex3 = textInfo.textElementInfo[m_CharacterCount - 1].textElement.glyphIndex; uint key2 = (glyphIndex << 16) | glyphIndex3; if (m_CurrentFontAsset.m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.TryGetValue(key2, out value)) { GlyphValueRecord val5 = val3; val4 = ((GlyphPairAdjustmentRecord)(ref value)).secondAdjustmentRecord; val3 = val5 + ((GlyphAdjustmentRecord)(ref val4)).glyphValueRecord; } } } if (generationSettings.isRightToLeft) { float xAdvance = m_XAdvance; metrics = m_CachedTextElement.glyph.metrics; m_XAdvance = xAdvance - ((((GlyphMetrics)(ref metrics)).horizontalAdvance * num5 + generationSettings.characterSpacing + generationSettings.wordSpacing + m_CurrentFontAsset.regularStyleSpacing) * num3 + m_CSpacing) * (1f - m_CharWidthAdjDelta); if (char.IsWhiteSpace((char)num14) || num14 == 8203) { m_XAdvance -= generationSettings.wordSpacing * num3; } } float num21 = 0f; if (m_MonoSpacing != 0f) { float num22 = m_MonoSpacing / 2f; metrics = m_CachedTextElement.glyph.metrics; float num23 = ((GlyphMetrics)(ref metrics)).width / 2f; metrics = m_CachedTextElement.glyph.metrics; num21 = (num22 - (num23 + ((GlyphMetrics)(ref metrics)).horizontalBearingX) * num3) * (1f - m_CharWidthAdjDelta); m_XAdvance += num21; } float num25; if (m_TextElementType == TextElementType.Character && !isUsingAlternateTypeface && (m_FontStyleInternal & FontStyles.Bold) == FontStyles.Bold) { if (m_CurrentMaterial.HasProperty(TextShaderUtilities.ID_GradientScale)) { float num24 = m_CurrentMaterial.GetFloat(TextShaderUtilities.ID_GradientScale); num25 = m_CurrentFontAsset.boldStyleWeight / 4f * num24 * m_CurrentMaterial.GetFloat(TextShaderUtilities.ID_ScaleRatio_A); if (num25 + num4 > num24) { num4 = num24 - num25; } } else { num25 = 0f; } num5 = 1f + m_CurrentFontAsset.boldStyleSpacing * 0.01f; } else { if (m_CurrentMaterial.HasProperty(TextShaderUtilities.ID_GradientScale)) { float num26 = m_CurrentMaterial.GetFloat(TextShaderUtilities.ID_GradientScale); num25 = m_CurrentFontAsset.regularStyleWeight / 4f * num26 * m_CurrentMaterial.GetFloat(TextShaderUtilities.ID_ScaleRatio_A); if (num25 + num4 > num26) { num4 = num26 - num25; } } else { num25 = 0f; } num5 = 1f; } faceInfo = m_CurrentFontAsset.faceInfo; float num27 = ((FaceInfo)(ref faceInfo)).baseline * m_FontScale * m_FontScaleMultiplier; faceInfo = m_CurrentFontAsset.faceInfo; float num28 = num27 * ((FaceInfo)(ref faceInfo)).scale; float xAdvance2 = m_XAdvance; metrics = m_CachedTextElement.glyph.metrics; val6.x = xAdvance2 + (((GlyphMetrics)(ref metrics)).horizontalBearingX - num4 - num25 + ((GlyphValueRecord)(ref val3)).xPlacement) * num3 * (1f - m_CharWidthAdjDelta); metrics = m_CachedTextElement.glyph.metrics; val6.y = num28 + (((GlyphMetrics)(ref metrics)).horizontalBearingY + num4 + ((GlyphValueRecord)(ref val3)).yPlacement) * num3 - m_LineOffset + m_BaselineOffset; val6.z = 0f; val7.x = val6.x; float y = val6.y; metrics = m_CachedTextElement.glyph.metrics; val7.y = y - (((GlyphMetrics)(ref metrics)).height + num4 * 2f) * num3; val7.z = 0f; float x = val7.x; metrics = m_CachedTextElement.glyph.metrics; val8.x = x + (((GlyphMetrics)(ref metrics)).width + num4 * 2f + num25 * 2f) * num3 * (1f - m_CharWidthAdjDelta); val8.y = val6.y; val8.z = 0f; val9.x = val8.x; val9.y = val7.y; val9.z = 0f; if (m_TextElementType == TextElementType.Character && !isUsingAlternateTypeface && (m_FontStyleInternal & FontStyles.Italic) == FontStyles.Italic) { float num29 = (float)(int)m_CurrentFontAsset.italicStyleSlant * 0.01f; metrics = m_CachedTextElement.glyph.metrics; ((Vector3)(ref val10))..ctor(num29 * ((((GlyphMetrics)(ref metrics)).horizontalBearingY + num4 + num25) * num3), 0f, 0f); metrics = m_CachedTextElement.glyph.metrics; float horizontalBearingY = ((GlyphMetrics)(ref metrics)).horizontalBearingY; metrics = m_CachedTextElement.glyph.metrics; ((Vector3)(ref val11))..ctor(num29 * ((horizontalBearingY - ((GlyphMetrics)(ref metrics)).height - num4 - num25) * num3), 0f, 0f); val6 += val10; val7 += val11; val8 += val10; val9 += val11; } if (m_IsFxMatrixSet) { Vector3 val12 = (val8 + val7) / 2f; val6 = ((Matrix4x4)(ref m_FxMatrix)).MultiplyPoint3x4(val6 - val12) + val12; val7 = ((Matrix4x4)(ref m_FxMatrix)).MultiplyPoint3x4(val7 - val12) + val12; val8 = ((Matrix4x4)(ref m_FxMatrix)).MultiplyPoint3x4(val8 - val12) + val12; val9 = ((Matrix4x4)(ref m_FxMatrix)).MultiplyPoint3x4(val9 - val12) + val12; } textInfo.textElementInfo[m_CharacterCount].bottomLeft = val7; textInfo.textElementInfo[m_CharacterCount].topLeft = val6; textInfo.textElementInfo[m_CharacterCount].topRight = val8; textInfo.textElementInfo[m_CharacterCount].bottomRight = val9; textInfo.textElementInfo[m_CharacterCount].origin = m_XAdvance; textInfo.textElementInfo[m_CharacterCount].baseLine = num28 - m_LineOffset + m_BaselineOffset; textInfo.textElementInfo[m_CharacterCount].aspectRatio = (val8.x - val7.x) / (val6.y - val7.y); faceInfo = m_CurrentFontAsset.faceInfo; float num30 = ((FaceInfo)(ref faceInfo)).ascentLine * ((m_TextElementType == TextElementType.Character) ? (num3 / num15) : textInfo.textElementInfo[m_CharacterCount].scale) + m_BaselineOffset; textInfo.textElementInfo[m_CharacterCount].ascender = num30 - m_LineOffset; m_MaxLineAscender = ((num30 > m_MaxLineAscender) ? num30 : m_MaxLineAscender); faceInfo = m_CurrentFontAsset.faceInfo; float num31 = ((FaceInfo)(ref faceInfo)).descentLine * ((m_TextElementType == TextElementType.Character) ? (num3 / num15) : textInfo.textElementInfo[m_CharacterCount].scale) + m_BaselineOffset; float num32 = (textInfo.textElementInfo[m_CharacterCount].descender = num31 - m_LineOffset); m_MaxLineDescender = ((num31 < m_MaxLineDescender) ? num31 : m_MaxLineDescender); if ((m_FontStyleInternal & FontStyles.Subscript) == FontStyles.Subscript || (m_FontStyleInternal & FontStyles.Superscript) == FontStyles.Superscript) { float num33 = num30 - m_BaselineOffset; faceInfo = m_CurrentFontAsset.faceInfo; float num34 = num33 / ((FaceInfo)(ref faceInfo)).subscriptSize; num30 = m_MaxLineAscender; m_MaxLineAscender = ((num34 > m_MaxLineAscender) ? num34 : m_MaxLineAscender); float num35 = num31 - m_BaselineOffset; faceInfo = m_CurrentFontAsset.faceInfo; float num36 = num35 / ((FaceInfo)(ref faceInfo)).subscriptSize; num31 = m_MaxLineDescender; m_MaxLineDescender = ((num36 < m_MaxLineDescender) ? num36 : m_MaxLineDescender); } if (m_LineNumber == 0 || m_IsNewPage) { m_MaxAscender = ((m_MaxAscender > num30) ? m_MaxAscender : num30); float maxCapHeight = m_MaxCapHeight; faceInfo = m_CurrentFontAsset.faceInfo; m_MaxCapHeight = Mathf.Max(maxCapHeight, ((FaceInfo)(ref faceInfo)).capLine * num3 / num15); } if (m_LineOffset == 0f) { num11 = ((num11 > num30) ? num11 : num30); } textInfo.textElementInfo[m_CharacterCount].isVisible = false; if (num14 == 9 || num14 == 160 || num14 == 8199 || (!char.IsWhiteSpace((char)num14) && num14 != 8203) || m_TextElementType == TextElementType.Sprite) { textInfo.textElementInfo[m_CharacterCount].isVisible = true; num10 = ((m_Width != -1f) ? Mathf.Min(marginWidth + 0.0001f - m_MarginLeft - m_MarginRight, m_Width) : (marginWidth + 0.0001f - m_MarginLeft - m_MarginRight)); textInfo.lineInfo[m_LineNumber].marginLeft = m_MarginLeft; bool flag9 = (m_LineJustification & (TextAlignment)16) == (TextAlignment)16 || (m_LineJustification & (TextAlignment)8) == (TextAlignment)8; float num37 = Mathf.Abs(m_XAdvance); float num38; if (generationSettings.isRightToLeft) { num38 = 0f; } else { metrics = m_CachedTextElement.glyph.metrics; num38 = ((GlyphMetrics)(ref metrics)).horizontalAdvance; } float num39 = num37 + num38 * (1f - m_CharWidthAdjDelta) * ((num14 != 173) ? num3 : num20); if (num39 > num10 * (flag9 ? 1.05f : 1f)) { num9 = m_CharacterCount - 1; if (generationSettings.wordWrap && m_CharacterCount != m_FirstCharacterOfLine) { if (num13 == m_SavedWordWrapState.previousWordBreak || flag6) { if (generationSettings.autoSize && m_FontSize > generationSettings.fontSizeMin) { if (m_CharWidthAdjDelta < generationSettings.charWidthMaxAdj / 100f) { m_LoopCountA = 0; m_CharWidthAdjDelta += 0.01f; GenerateTextMesh(generationSettings, textInfo); return; } m_MaxFontSize = m_FontSize; m_FontSize -= Mathf.Max((m_FontSize - m_MinFontSize) / 2f, 0.05f); m_FontSize = (float)(int)(Mathf.Max(m_FontSize, generationSettings.fontSizeMin) * 20f + 0.5f) / 20f; if (m_LoopCountA <= 20) { GenerateTextMesh(generationSettings, textInfo); } return; } if (!m_IsCharacterWrappingEnabled) { if (!flag7) { flag7 = true; } else { m_IsCharacterWrappingEnabled = true; } } else { flag8 = true; } } i = RestoreWordWrappingState(ref m_SavedWordWrapState, textInfo); num13 = i; if (m_CharBuffer[i] == 173) { m_CharBuffer[i] = 45; GenerateTextMesh(generationSettings, textInfo); return; } if (m_LineNumber > 0 && !TextGeneratorUtilities.Approximately(m_MaxLineAscender, m_StartOfLineAscender) && m_LineHeight == -32767f && !m_IsNewPage) { float num40 = m_MaxLineAscender - m_StartOfLineAscender; TextGeneratorUtilities.AdjustLineOffset(m_FirstCharacterOfLine, m_CharacterCount, num40, textInfo); m_LineOffset += num40; m_SavedWordWrapState.lineOffset = m_LineOffset; m_SavedWordWrapState.previousLineAscender = m_MaxLineAscender; } m_IsNewPage = false; float num41 = m_MaxLineAscender - m_LineOffset; float num42 = m_MaxLineDescender - m_LineOffset; m_MaxDescender = ((m_MaxDescender < num42) ? m_MaxDescender : num42); if (!flag5) { num12 = m_MaxDescender; } if (generationSettings.useMaxVisibleDescender && (m_CharacterCount >= generationSettings.maxVisibleCharacters || m_LineNumber >= generationSettings.maxVisibleLines)) { flag5 = true; } textInfo.lineInfo[m_LineNumber].firstCharacterIndex = m_FirstCharacterOfLine; textInfo.lineInfo[m_LineNumber].firstVisibleCharacterIndex = (m_FirstVisibleCharacterOfLine = ((m_FirstCharacterOfLine > m_FirstVisibleCharacterOfLine) ? m_FirstCharacterOfLine : m_FirstVisibleCharacterOfLine)); textInfo.lineInfo[m_LineNumber].lastCharacterIndex = (m_LastCharacterOfLine = ((m_CharacterCount - 1 > 0) ? (m_CharacterCount - 1) : 0)); textInfo.lineInfo[m_LineNumber].lastVisibleCharacterIndex = (m_LastVisibleCharacterOfLine = ((m_LastVisibleCharacterOfLine < m_FirstVisibleCharacterOfLine) ? m_FirstVisibleCharacterOfLine : m_LastVisibleCharacterOfLine)); textInfo.lineInfo[m_LineNumber].characterCount = textInfo.lineInfo[m_LineNumber].lastCharacterIndex - textInfo.lineInfo[m_LineNumber].firstCharacterIndex + 1; textInfo.lineInfo[m_LineNumber].visibleCharacterCount = m_LineVisibleCharacterCount; textInfo.lineInfo[m_LineNumber].lineExtents.min = new Vector2(textInfo.textElementInfo[m_FirstVisibleCharacterOfLine].bottomLeft.x, num42); textInfo.lineInfo[m_LineNumber].lineExtents.max = new Vector2(textInfo.textElementInfo[m_LastVisibleCharacterOfLine].topRight.x, num41); textInfo.lineInfo[m_LineNumber].length = textInfo.lineInfo[m_LineNumber].lineExtents.max.x; textInfo.lineInfo[m_LineNumber].width = num10; textInfo.lineInfo[m_LineNumber].maxAdvance = textInfo.textElementInfo[m_LastVisibleCharacterOfLine].xAdvance - (generationSettings.characterSpacing + m_CurrentFontAsset.regularStyleSpacing) * num3 - m_CSpacing; textInfo.lineInfo[m_LineNumber].baseline = 0f - m_LineOffset; textInfo.lineInfo[m_LineNumber].ascender = num41; textInfo.lineInfo[m_LineNumber].descender = num42; textInfo.lineInfo[m_LineNumber].lineHeight = num41 - num42 + num6 * num2; m_FirstCharacterOfLine = m_CharacterCount; m_LineVisibleCharacterCount = 0; SaveWordWrappingState(ref m_SavedLineState, i, m_CharacterCount - 1, textInfo); m_LineNumber++; flag4 = true; flag6 = true; if (m_LineNumber >= textInfo.lineInfo.Length) { TextGeneratorUtilities.ResizeLineExtents(m_LineNumber, textInfo); } if (m_LineHeight == -32767f) { float num43 = textInfo.textElementInfo[m_CharacterCount].ascender - textInfo.textElementInfo[m_CharacterCount].baseLine; float num44 = 0f - m_MaxLineDescender + num43 + (num6 + generationSettings.lineSpacing + m_LineSpacingDelta) * num2; m_LineOffset += num44; m_StartOfLineAscender = num43; } else { m_LineOffset += m_LineHeight + generationSettings.lineSpacing * num2; } m_MaxLineAscender = -32767f; m_MaxLineDescender = 32767f; m_XAdvance = 0f + m_TagIndent; continue; } if (generationSettings.autoSize && m_FontSize > generationSettings.fontSizeMin) { if (m_CharWidthAdjDelta < generationSettings.charWidthMaxAdj / 100f) { m_LoopCountA = 0; m_CharWidthAdjDelta += 0.01f; GenerateTextMesh(generationSettings, textInfo); return; } m_MaxFontSize = m_FontSize; m_FontSize -= Mathf.Max((m_FontSize - m_MinFontSize) / 2f, 0.05f); m_FontSize = (float)(int)(Mathf.Max(m_FontSize, generationSettings.fontSizeMin) * 20f + 0.5f) / 20f; if (m_LoopCountA <= 20) { GenerateTextMesh(generationSettings, textInfo); } return; } switch (generationSettings.overflowMode) { case TextOverflowMode.Overflow: if (m_IsMaskingEnabled) { DisableMasking(); } break; case TextOverflowMode.Ellipsis: if (m_IsMaskingEnabled) { DisableMasking(); } if (m_CharacterCount < 1) { textInfo.textElementInfo[m_CharacterCount].isVisible = false; break; } m_CharBuffer[i - 1] = 8230; m_CharBuffer[i] = 0; if (m_Ellipsis.character != null) { textInfo.textElementInfo[num9].character = '…'; textInfo.textElementInfo[num9].textElement = m_Ellipsis.character; textInfo.textElementInfo[num9].fontAsset = m_MaterialReferences[0].fontAsset; textInfo.textElementInfo[num9].material = m_MaterialReferences[0].material; textInfo.textElementInfo[num9].materialReferenceIndex = 0; } else { Debug.LogWarning((object)("Unable to use Ellipsis character since it wasn't found in the current Font Asset [" + ((Object)generationSettings.fontAsset).name + "]. Consider regenerating this font asset to include the Ellipsis character (u+2026).")); } m_TotalCharacterCount = num9 + 1; GenerateTextMesh(generationSettings, textInfo); return; case TextOverflowMode.Masking: if (!m_IsMaskingEnabled) { EnableMasking(); } break; case TextOverflowMode.ScrollRect: if (!m_IsMaskingEnabled) { EnableMasking(); } break; case TextOverflowMode.Truncate: if (m_IsMaskingEnabled) { DisableMasking(); } textInfo.textElementInfo[m_CharacterCount].isVisible = false; break; } } if (num14 == 9 || num14 == 160 || num14 == 8199) { textInfo.textElementInfo[m_CharacterCount].isVisible = false; m_LastVisibleCharacterOfLine = m_CharacterCount; textInfo.lineInfo[m_LineNumber].spaceCount++; TextInfo textInfo2 = textInfo; textInfo2.spaceCount++; } else { Color32 vertexColor = ((!generationSettings.overrideRichTextColors) ? m_HtmlColor : m_FontColor32); if (m_TextElementType == TextElementType.Character) { SaveGlyphVertexInfo(num4, num25, vertexColor, generationSettings, textInfo); } else if (m_TextElementType == TextElementType.Sprite) { SaveSpriteVertexInfo(vertexColor, generationSettings, textInfo); } } if (textInfo.textElementInfo[m_CharacterCount].isVisible && num14 != 173) { if (flag4) { flag4 = false; m_FirstVisibleCharacterOfLine = m_CharacterCount; } m_LineVisibleCharacterCount++; m_LastVisibleCharacterOfLine = m_CharacterCount; } } else if ((num14 == 10 || char.IsSeparator((char)num14)) && num14 != 173 && num14 != 8203 && num14 != 8288) { textInfo.lineInfo[m_LineNumber].spaceCount++; TextInfo textInfo2 = textInfo; textInfo2.spaceCount++; if (num14 == 160) { textInfo.lineInfo[m_LineNumber].controlCharacterCount = 1; } } if (m_LineNumber > 0 && !TextGeneratorUtilities.Approximately(m_MaxLineAscender, m_StartOfLineAscender) && m_LineHeight == -32767f && !m_IsNewPage) { float num45 = m_MaxLineAscender - m_StartOfLineAscender; TextGeneratorUtilities.AdjustLineOffset(m_FirstCharacterOfLine, m_CharacterCount, num45, textInfo); num32 -= num45; m_LineOffset += num45; m_StartOfLineAscender += num45; m_SavedWordWrapState.lineOffset = m_LineOffset; m_SavedWordWrapState.previousLineAscender = m_StartOfLineAscender; } textInfo.textElementInfo[m_CharacterCount].lineNumber = m_LineNumber; textInfo.textElementInfo[m_CharacterCount].pageNumber = m_PageNumber; if ((num14 != 10 && num14 != 13 && num14 != 8230) || textInfo.lineInfo[m_LineNumber].characterCount == 1) { textInfo.lineInfo[m_LineNumber].alignment = m_LineJustification; } if (m_MaxAscender - num32 > marginHeight + 0.0001f) { if (generationSettings.autoSize && m_LineSpacingDelta > generationSettings.lineSpacingMax && m_LineNumber > 0) { m_LoopCountA = 0; m_LineSpacingDelta -= 1f; GenerateTextMesh(generationSettings, textInfo); return; } if (generationSettings.autoSize && m_FontSize > generationSettings.fontSizeMin) { m_MaxFontSize = m_FontSize; m_FontSize -= Mathf.Max((m_FontSize - m_MinFontSize) / 2f, 0.05f); m_FontSize = (float)(int)(Mathf.Max(m_FontSize, generationSettings.fontSizeMin) * 20f + 0.5f) / 20f; if (m_LoopCountA <= 20) { GenerateTextMesh(generationSettings, textInfo); } return; } if (m_FirstOverflowCharacterIndex == -1) { m_FirstOverflowCharacterIndex = m_CharacterCount; } switch (generationSettings.overflowMode) { case TextOverflowMode.Overflow: if (m_IsMaskingEnabled) { DisableMasking(); } break; case TextOverflowMode.Ellipsis: if (m_IsMaskingEnabled) { DisableMasking(); } if (m_LineNumber > 0) { m_CharBuffer[textInfo.textElementInfo[num9].index] = 8230; m_CharBuffer[textInfo.textElementInfo[num9].index + 1] = 0; if (m_Ellipsis.character != null) { textInfo.textElementInfo[num9].character = '…'; textInfo.textElementInfo[num9].textElement = m_Ellipsis.character; textInfo.textElementInfo[num9].fontAsset = m_MaterialReferences[0].fontAsset; textInfo.textElementInfo[num9].material = m_MaterialReferences[0].material; textInfo.textElementInfo[num9].materialReferenceIndex = 0; } else { Debug.LogWarning((object)("Unable to use Ellipsis character since it wasn't found in the current Font Asset [" + ((Object)generationSettings.fontAsset).name + "]. Consider regenerating this font asset to include the Ellipsis character (u+2026).")); } m_TotalCharacterCount = num9 + 1; GenerateTextMesh(generationSettings, textInfo); return; } break; case TextOverflowMode.Masking: if (!m_IsMaskingEnabled) { EnableMasking(); } break; case TextOverflowMode.ScrollRect: if (!m_IsMaskingEnabled) { EnableMasking(); } break; case TextOverflowMode.Truncate: if (m_IsMaskingEnabled) { DisableMasking(); } if (m_LineNumber > 0) { m_CharBuffer[textInfo.textElementInfo[num9].index + 1] = 0; m_TotalCharacterCount = num9 + 1; GenerateTextMesh(generationSettings, textInfo); } else { ClearMesh(updateMesh: false, textInfo); } return; case TextOverflowMode.Page: if (m_IsMaskingEnabled) { DisableMasking(); } if (num14 == 13 || num14 == 10) { break; } if (i == 0) { return; } if (num8 == i) { m_CharBuffer[i] = 0; } num8 = i; i = RestoreWordWrappingState(ref m_SavedLineState, textInfo); m_IsNewPage = true; m_XAdvance = 0f + m_TagIndent; m_LineOffset = 0f; m_MaxAscender = 0f; num11 = 0f; m_LineNumber++; m_PageNumber++; continue; case TextOverflowMode.Linked: if (m_LineNumber > 0) { m_CharBuffer[i] = 0; m_TotalCharacterCount = m_CharacterCount; GenerateTextMesh(generationSettings, textInfo); } else { ClearMesh(updateMesh: true, textInfo); } return; } } if (num14 == 9) { faceInfo = m_CurrentFontAsset.faceInfo; float num46 = ((FaceInfo)(ref faceInfo)).tabWidth * (float)(int)m_CurrentFontAsset.tabMultiple * num3; float num47 = Mathf.Ceil(m_XAdvance / num46) * num46; m_XAdvance = ((num47 > m_XAdvance) ? num47 : (m_XAdvance + num46)); } else if (m_MonoSpacing != 0f) { m_XAdvance += (m_MonoSpacing - num21 + (generationSettings.characterSpacing + m_CurrentFontAsset.regularStyleSpacing) * num3 + m_CSpacing) * (1f - m_CharWidthAdjDelta); if (char.IsWhiteSpace((char)num14) || num14 == 8203) { m_XAdvance += generationSettings.wordSpacing * num3; } } else if (!generationSettings.isRightToLeft) { float num48 = 1f; if (m_IsFxMatrixSet) { num48 = m_FxMatrix.m00; } float xAdvance3 = m_XAdvance; metrics = m_CachedTextElement.glyph.metrics; m_XAdvance = xAdvance3 + ((((GlyphMetrics)(ref metrics)).horizontalAdvance * num48 * num5 + generationSettings.characterSpacing + m_CurrentFontAsset.regularStyleSpacing + ((GlyphValueRecord)(ref val3)).xAdvance) * num3 + m_CSpacing) * (1f - m_CharWidthAdjDelta); if (char.IsWhiteSpace((char)num14) || num14 == 8203) { m_XAdvance += generationSettings.wordSpacing * num3; } } else { m_XAdvance -= ((GlyphValueRecord)(ref val3)).xAdvance * num3; } textInfo.textElementInfo[m_CharacterCount].xAdvance = m_XAdvance; if (num14 == 13) { m_XAdvance = 0f + m_TagIndent; } if (num14 == 10 || m_CharacterCount == totalCharacterCount - 1) { if (m_LineNumber > 0 && !TextGeneratorUtilities.Approximately(m_MaxLineAscender, m_StartOfLineAscender) && m_LineHeight == -32767f && !m_IsNewPage) { float num49 = m_MaxLineAscender - m_StartOfLineAscender; TextGeneratorUtilities.AdjustLineOffset(m_FirstCharacterOfLine, m_CharacterCount, num49, textInfo); m_LineOffset += num49; } m_IsNewPage = false; float num50 = m_MaxLineAscender - m_LineOffset; float num51 = m_MaxLineDescender - m_LineOffset; m_MaxDescender = ((m_MaxDescender < num51) ? m_MaxDescender : num51); if (!flag5) { num12 = m_MaxDescender; } if (generationSettings.useMaxVisibleDescender && (m_CharacterCount >= generationSettings.maxVisibleCharacters || m_LineNumber >= generationSettings.maxVisibleLines)) { flag5 = true; } textInfo.lineInfo[m_LineNumber].firstCharacterIndex = m_FirstCharacterOfLine; textInfo.lineInfo[m_LineNumber].firstVisibleCharacterIndex = (m_FirstVisibleCharacterOfLine = ((m_FirstCharacterOfLine > m_FirstVisibleCharacterOfLine) ? m_FirstCharacterOfLine : m_FirstVisibleCharacterOfLine)); textInfo.lineInfo[m_LineNumber].lastCharacterIndex = (m_LastCharacterOfLine = m_CharacterCount); textInfo.lineInfo[m_LineNumber].lastVisibleCharacterIndex = (m_LastVisibleCharacterOfLine = ((m_LastVisibleCharacterOfLine < m_FirstVisibleCharacterOfLine) ? m_FirstVisibleCharacterOfLine : m_LastVisibleCharacterOfLine)); textInfo.lineInfo[m_LineNumber].characterCount = textInfo.lineInfo[m_LineNumber].lastCharacterIndex - textInfo.lineInfo[m_LineNumber].firstCharacterIndex + 1; textInfo.lineInfo[m_LineNumber].visibleCharacterCount = m_LineVisibleCharacterCount; textInfo.lineInfo[m_LineNumber].lineExtents.min = new Vector2(textInfo.textElementInfo[m_FirstVisibleCharacterOfLine].bottomLeft.x, num51); textInfo.lineInfo[m_LineNumber].lineExtents.max = new Vector2(textInfo.textElementInfo[m_LastVisibleCharacterOfLine].topRight.x, num50); textInfo.lineInfo[m_LineNumber].length = textInfo.lineInfo[m_LineNumber].lineExtents.max.x - num4 * num3; textInfo.lineInfo[m_LineNumber].width = num10; if (textInfo.lineInfo[m_LineNumber].characterCount == 1) { textInfo.lineInfo[m_LineNumber].alignment = m_LineJustification; } if (textInfo.textElementInfo[m_LastVisibleCharacterOfLine].isVisible) { textInfo.lineInfo[m_LineNumber].maxAdvance = textInfo.textElementInfo[m_LastVisibleCharacterOfLine].xAdvance - (generationSettings.characterSpacing + m_CurrentFontAsset.regularStyleSpacing) * num3 - m_CSpacing; } else { textInfo.lineInfo[m_LineNumber].maxAdvance = textInfo.textElementInfo[m_LastCharacterOfLine].xAdvance - (generationSettings.characterSpacing + m_CurrentFontAsset.regularStyleSpacing) * num3 - m_CSpacing; } textInfo.lineInfo[m_LineNumber].baseline = 0f - m_LineOffset; textInfo.lineInfo[m_LineNumber].ascender = num50; textInfo.lineInfo[m_LineNumber].descender = num51; textInfo.lineInfo[m_LineNumber].lineHeight = num50 - num51 + num6 * num2; m_FirstCharacterOfLine = m_CharacterCount + 1; m_LineVisibleCharacterCount = 0; if (num14 == 10) { SaveWordWrappingState(ref m_SavedLineState, i, m_CharacterCount, textInfo); SaveWordWrappingState(ref m_SavedWordWrapState, i, m_CharacterCount, textInfo); m_LineNumber++; flag4 = true; flag7 = false; flag6 = true; if (m_LineNumber >= textInfo.lineInfo.Length) { TextGeneratorUtilities.ResizeLineExtents(m_LineNumber, textInfo); } if (m_LineHeight == -32767f) { float num44 = 0f - m_MaxLineDescender + num30 + (num6 + generationSettings.lineSpacing + generationSettings.paragraphSpacing + m_LineSpacingDelta) * num2; m_LineOffset += num44; } else { m_LineOffset += m_LineHeight + (generationSettings.lineSpacing + generationSettings.paragraphSpacing) * num2; } m_MaxLineAscender = -32767f; m_MaxLineDescender = 32767f; m_StartOfLineAscender = num30; m_XAdvance = 0f + m_TagLineIndent + m_TagIndent; num9 = m_CharacterCount - 1; m_CharacterCount++; continue; } } if (textInfo.textElementInfo[m_CharacterCount].isVisible) { m_MeshExtents.min.x = Mathf.Min(m_MeshExtents.min.x, textInfo.textElementInfo[m_CharacterCount].bottomLeft.x); m_MeshExtents.min.y = Mathf.Min(m_MeshExtents.min.y, textInfo.textElementInfo[m_CharacterCount].bottomLeft.y); m_MeshExtents.max.x = Mathf.Max(m_MeshExtents.max.x, textInfo.textElementInfo[m_CharacterCount].topRight.x); m_MeshExtents.max.y = Mathf.Max(m_MeshExtents.max.y, textInfo.textElementInfo[m_CharacterCount].topRight.y); } if (generationSettings.overflowMode == TextOverflowMode.Page && num14 != 13 && num14 != 10) { if (m_PageNumber + 1 > textInfo.pageInfo.Length) { TextInfo.Resize(ref textInfo.pageInfo, m_PageNumber + 1, isBlockAllocated: true); } textInfo.pageInfo[m_PageNumber].ascender = num11; textInfo.pageInfo[m_PageNumber].descender = ((num31 < textInfo.pageInfo[m_PageNumber].descender) ? num31 : textInfo.pageInfo[m_PageNumber].descender); if (m_PageNumber == 0 && m_CharacterCount == 0) { textInfo.pageInfo[m_PageNumber].firstCharacterIndex = m_CharacterCount; } else if (m_CharacterCount > 0 && m_PageNumber != textInfo.textElementInfo[m_CharacterCount - 1].pageNumber) { textInfo.pageInfo[m_PageNumber - 1].lastCharacterIndex = m_CharacterCount - 1; textInfo.pageInfo[m_PageNumber].firstCharacterIndex = m_CharacterCount; } else if (m_CharacterCount == totalCharacterCount - 1) { textInfo.pageInfo[m_PageNumber].lastCharacterIndex = m_CharacterCount; } } if (generationSettings.wordWrap || generationSettings.overflowMode == TextOverflowMode.Truncate || generationSettings.overflowMode == TextOverflowMode.Ellipsis) { if ((char.IsWhiteSpace((char)num14) || num14 == 8203 || num14 == 45 || num14 == 173) && (!m_IsNonBreakingSpace || flag7) && num14 != 160 && num14 != 8199 && num14 != 8209 && num14 != 8239 && num14 != 8288) { SaveWordWrappingState(ref m_SavedWordWrapState, i, m_CharacterCount, textInfo); m_IsCharacterWrappingEnabled = false; flag6 = false; } else if (((num14 > 4352 && num14 < 4607) || (num14 > 11904 && num14 < 40959) || (num14 > 43360 && num14 < 43391) || (num14 > 44032 && num14 < 55295) || (num14 > 63744 && num14 < 64255) || (num14 > 65072 && num14 < 65103) || (num14 > 65280 && num14 < 65519)) && !m_IsNonBreakingSpace) { if (flag6 || flag8 || (!textSettings.lineBreakingRules.leadingCharactersLookup.Contains((uint)num14) && m_CharacterCount < totalCharacterCount - 1 && !textSettings.lineBreakingRules.followingCharactersLookup.Contains(textInfo.textElementInfo[m_CharacterCount + 1].character))) { SaveWordWrappingState(ref m_SavedWordWrapState, i, m_CharacterCount, textInfo); m_IsCharacterWrappingEnabled = false; flag6 = false; } } else if (flag6 || m_IsCharacterWrappingEnabled || flag8) { SaveWordWrappingState(ref m_SavedWordWrapState, i, m_CharacterCount, textInfo); } } m_CharacterCount++; } float num52 = m_MaxFontSize - m_MinFontSize; if (!m_IsCharacterWrappingEnabled && generationSettings.autoSize && num52 > 0.051f && m_FontSize < generationSettings.fontSizeMax) { m_MinFontSize = m_FontSize; m_FontSize += Mathf.Max((m_MaxFontSize - m_FontSize) / 2f, 0.05f); m_FontSize = (float)(int)(Mathf.Min(m_FontSize, generationSettings.fontSizeMax) * 20f + 0.5f) / 20f; if (m_LoopCountA <= 20) { GenerateTextMesh(generationSettings, textInfo); } return; } m_IsCharacterWrappingEnabled = false; if (m_CharacterCount == 0) { ClearMesh(updateMesh: true, textInfo); return; } int index = m_MaterialReferences[0].referenceCount * 4; textInfo.meshInfo[0].Clear(uploadChanges: false); Vector3 val13 = Vector3.zero; Vector3[] rectTransformCorners = m_RectTransformCorners; switch (generationSettings.textAlignment) { case TextAlignment.TopLeft: case TextAlignment.TopCenter: case TextAlignment.TopRight: case TextAlignment.TopJustified: case TextAlignment.TopFlush: case TextAlignment.TopGeoAligned: val13 = ((generationSettings.overflowMode == TextOverflowMode.Page) ? (rectTransformCorners[1] + new Vector3(0f + margins.x, 0f - textInfo.pageInfo[num7].ascender - margins.y, 0f)) : (rectTransformCorners[1] + new Vector3(0f + margins.x, 0f - m_MaxAscender - margins.y, 0f))); break; case TextAlignment.MiddleLeft: case TextAlignment.MiddleCenter: case TextAlignment.MiddleRight: case TextAlignment.MiddleJustified: case TextAlignment.MiddleFlush: case TextAlignment.MiddleGeoAligned: val13 = ((generationSettings.overflowMode == TextOverflowMode.Page) ? ((rectTransformCorners[0] + rectTransformCorners[1]) / 2f + new Vector3(0f + margins.x, 0f - (textInfo.pageInfo[num7].ascender + margins.y + textInfo.pageInfo[num7].descender - margins.w) / 2f, 0f)) : ((rectTransformCorners[0] + rectTransformCorners[1]) / 2f + new Vector3(0f + margins.x, 0f - (m_MaxAscender + margins.y + num12 - margins.w) / 2f, 0f))); break; case TextAlignment.BottomLeft: case TextAlignment.BottomCenter: case TextAlignment.BottomRight: case TextAlignment.BottomJustified: case TextAlignment.BottomFlush: case TextAlignment.BottomGeoAligned: val13 = ((generationSettings.overflowMode == TextOverflowMode.Page) ? (rectTransformCorners[0] + new Vector3(0f + margins.x, 0f - textInfo.pageInfo[num7].descender + margins.w, 0f)) : (rectTransformCorners[0] + new Vector3(0f + margins.x, 0f - num12 + margins.w, 0f))); break; case TextAlignment.BaselineLeft: case TextAlignment.BaselineCenter: case TextAlignment.BaselineRight: case TextAlignment.BaselineJustified: case TextAlignment.BaselineFlush: case TextAlignment.BaselineGeoAligned: val13 = (rectTransformCorners[0] + rectTransformCorners[1]) / 2f + new Vector3(0f + margins.x, 0f, 0f); break; case TextAlignment.MidlineLeft: case TextAlignment.MidlineCenter: case TextAlignment.MidlineRight: case TextAlignment.MidlineJustified: case TextAlignment.MidlineFlush: case TextAlignment.MidlineGeoAligned: val13 = (rectTransformCorners[0] + rectTransformCorners[1]) / 2f + new Vector3(0f + margins.x, 0f - (m_MeshExtents.max.y + margins.y + m_MeshExtents.min.y - margins.w) / 2f, 0f); break; case TextAlignment.CaplineLeft: case TextAlignment.CaplineCenter: case TextAlignment.CaplineRight: case TextAlignment.CaplineJustified: case TextAlignment.CaplineFlush: case TextAlignment.CaplineGeoAligned: val13 = (rectTransformCorners[0] + rectTransformCorners[1]) / 2f + new Vector3(0f + margins.x, 0f - (m_MaxCapHeight - margins.y - margins.w) / 2f, 0f); break; } Vector3 val14 = Vector3.zero; int num53 = 0; int lineCount = 0; int num54 = 0; bool flag10 = false; bool flag11 = false; int num55 = 0; Color32 val15 = Color32.op_Implicit(Color.white); Color32 underlineColor = Color32.op_Implicit(Color.white); Color32 highlightColor = default(Color32); ((Color32)(ref highlightColor))..ctor(byte.MaxValue, byte.MaxValue, (byte)0, (byte)64); float num56 = 0f; float num57 = 0f; float num58 = 0f; float num59 = 32767f; int num60 = 0; float num61 = 0f; float num62 = 0f; float b = 0f; TextElementInfo[] textElementInfo = textInfo.textElementInfo; Vector3 end = default(Vector3); Vector3 end2 = default(Vector3); for (int j = 0; j < m_CharacterCount; j++) { FontAsset fontAsset = textElementInfo[j].fontAsset; char character = textElementInfo[j].character; int lineNumber = textElementInfo[j].lineNumber; LineInfo lineInfo = textInfo.lineInfo[lineNumber]; lineCount = lineNumber + 1; TextAlignment alignment = lineInfo.alignment; switch (alignment) { case TextAlignment.TopLeft: case TextAlignment.MiddleLeft: case TextAlignment.BottomLeft: case TextAlignment.BaselineLeft: case TextAlignment.MidlineLeft: case TextAlignment.CaplineLeft: if (!generationSettings.isRightToLeft) { ((Vector3)(ref val14))..ctor(0f + lineInfo.marginLeft, 0f, 0f); } else { ((Vector3)(ref val14))..ctor(0f - lineInfo.maxAdvance, 0f, 0f); } break; case TextAlignment.TopCenter: case TextAlignment.MiddleCenter: case TextAlignment.BottomCenter: case TextAlignment.BaselineCenter: case TextAlignment.MidlineCenter: case TextAlignment.CaplineCenter: ((Vector3)(ref val14))..ctor(lineInfo.marginLeft + lineInfo.width / 2f - lineInfo.maxAdvance / 2f, 0f, 0f); break; case TextAlignment.TopGeoAligned: case TextAlignment.MiddleGeoAligned: case TextAlignment.BottomGeoAligned: case TextAlignment.BaselineGeoAligned: case TextAlignment.MidlineGeoAligned: case TextAlignment.CaplineGeoAligned: ((Vector3)(ref val14))..ctor(lineInfo.marginLeft + lineInfo.width / 2f - (lineInfo.lineExtents.min.x + lineInfo.lineExtents.max.x) / 2f, 0f, 0f); break; case TextAlignment.TopRight: case TextAlignment.MiddleRight: case TextAlignment.BottomRight: case TextAlignment.BaselineRight: case TextAlignment.MidlineRight: case TextAlignment.CaplineRight: if (!generationSettings.isRightToLeft) { ((Vector3)(ref val14))..ctor(lineInfo.marginLeft + lineInfo.width - lineInfo.maxAdvance, 0f, 0f); } else { ((Vector3)(ref val14))..ctor(lineInfo.marginLeft + lineInfo.width, 0f, 0f); } break; case TextAlignment.TopJustified: case TextAlignment.TopFlush: case TextAlignment.MiddleJustified: case TextAlignment.MiddleFlush: case TextAlignment.BottomJustified: case TextAlignment.BottomFlush: case TextAlignment.BaselineJustified: case TextAlignment.BaselineFlush: case TextAlignment.MidlineJustified: case TextAlignment.MidlineFlush: case TextAlignment.CaplineJustified: case TextAlignment.CaplineFlush: { if (character == '\u00ad' || character == '\u200b' || character == '\u2060') { break; } char character2 = textElementInfo[lineInfo.lastCharacterIndex].character; bool flag12 = (alignment & (TextAlignment)16) == (TextAlignment)16; if ((!char.IsControl(character2) && lineNumber < m_LineNumber) || flag12 || lineInfo.maxAdvance > lineInfo.width) { if (lineNumber != num54 || j == 0 || j == generationSettings.firstVisibleCharacter) { if (!generationSettings.isRightToLeft) { ((Vector3)(ref val14))..ctor(lineInfo.marginLeft, 0f, 0f); } else { ((Vector3)(ref val14))..ctor(lineInfo.marginLeft + lineInfo.width, 0f, 0f); } flag10 = (char.IsSeparator(character) ? true : false); break; } float num63 = ((!generationSettings.isRightToLeft) ? (lineInfo.width - lineInfo.maxAdvance) : (lineInfo.width + lineInfo.maxAdvance)); int num64 = lineInfo.visibleCharacterCount - 1 + lineInfo.controlCharacterCount; int num65 = (textElementInfo[lineInfo.lastCharacterIndex].isVisible ? lineInfo.spaceCount : (lineInfo.spaceCount - 1)) - lineInfo.controlCharacterCount; if (flag10) { num65--; num64++; } float num66 = ((num65 > 0) ? generationSettings.wordWrappingRatio : 1f); if (num65 < 1) { num65 = 1; } val14 = ((character != '\u00a0' && (character == '\t' || char.IsSeparator(character))) ? (generationSettings.isRightToLeft ? (val14 - new Vector3(num63 * (1f - num66) / (float)num65, 0f, 0f)) : (val14 + new Vector3(num63 * (1f - num66) / (float)num65, 0f, 0f))) : (generationSettings.isRightToLeft ? (val14 - new Vector3(num63 * num66 / (float)num64, 0f, 0f)) : (val14 + new Vector3(num63 * num66 / (float)num64, 0f, 0f)))); } else if (!generationSettings.isRightToLeft) { ((Vector3)(ref val14))..ctor(lineInfo.marginLeft, 0f, 0f); } else { ((Vector3)(ref val14))..ctor(lineInfo.marginLeft + lineInfo.width, 0f, 0f); } break; } } Vector3 val16 = val13 + val14; ref Vector3 position; if (textElementInfo[j].isVisible) { TextElementType elementType = textElementInfo[j].elementType; switch (elementType) { case TextElementType.Character: { Extents lineExtents = lineInfo.lineExtents; float num67 = generationSettings.uvLineOffset * (float)lineNumber % 1f; switch (generationSettings.horizontalMapping) { case TextureMapping.Character: textElementInfo[j].vertexBottomLeft.uv2.x = 0f; textElementInfo[j].vertexTopLeft.uv2.x = 0f; textElementInfo[j].vertexTopRight.uv2.x = 1f; textElementInfo[j].vertexBottomRight.uv2.x = 1f; break; case TextureMapping.Line: if (generationSettings.textAlignment != TextAlignment.MiddleJustified) { textElementInfo[j].vertexBottomLeft.uv2.x = (textElementInfo[j].vertexBottomLeft.position.x - lineExtents.min.x) / (lineExtents.max.x - lineExtents.min.x) + num67; textElementInfo[j].vertexTopLeft.uv2.x = (textElementInfo[j].vertexTopLeft.position.x - lineExtents.min.x) / (lineExtents.max.x - lineExtents.min.x) + num67; textElementInfo[j].vertexTopRight.uv2.x = (textElementInfo[j].vertexTopRight.position.x - lineExtents.min.x) / (lineExtents.max.x - lineExtents.min.x) + num67; textElementInfo[j].vertexBottomRight.uv2.x = (textElementInfo[j].vertexBottomRight.position.x - lineExtents.min.x) / (lineExtents.max.x - lineExtents.min.x) + num67; } else { textElementInfo[j].vertexBottomLeft.uv2.x = (textElementInfo[j].vertexBottomLeft.position.x + val14.x - m_MeshExtents.min.x) / (m_MeshExtents.max.x - m_MeshExtents.min.x) + num67; textElementInfo[j].vertexTopLeft.uv2.x = (textElementInfo[j].vertexTopLeft.position.x + val14.x - m_MeshExtents.min.x) / (m_MeshExtents.max.x - m_MeshExtents.min.x) + num67; textElementInfo[j].vertexTopRight.uv2.x = (textElementInfo[j].vertexTopRight.position.x + val14.x - m_MeshExtents.min.x) / (m_MeshExtents.max.x - m_MeshExtents.min.x) + num67; textElementInfo[j].vertexBottomRight.uv2.x = (textElementInfo[j].vertexBottomRight.position.x + val14.x - m_MeshExtents.min.x) / (m_MeshExtents.max.x - m_MeshExtents.min.x) + num67; } break; case TextureMapping.Paragraph: textElementInfo[j].vertexBottomLeft.uv2.x = (textElementInfo[j].vertexBottomLeft.position.x + val14.x - m_MeshExtents.min.x) / (m_MeshExtents.max.x - m_MeshExtents.min.x) + num67; textElementInfo[j].vertexTopLeft.uv2.x = (textElementInfo[j].vertexTopLeft.position.x + val14.x - m_MeshExtents.min.x) / (m_MeshExtents.max.x - m_MeshExtents.min.x) + num67; textElementInfo[j].vertexTopRight.uv2.x = (textElementInfo[j].vertexTopRight.position.x + val14.x - m_MeshExtents.min.x) / (m_MeshExtents.max.x - m_MeshExtents.min.x) + num67; textElementInfo[j].vertexBottomRight.uv2.x = (textElementInfo[j].vertexBottomRight.position.x + val14.x - m_MeshExtents.min.x) / (m_MeshExtents.max.x - m_MeshExtents.min.x) + num67; break; case TextureMapping.MatchAspect: { switch (generationSettings.verticalMapping) { case TextureMapping.Character: textElementInfo[j].vertexBottomLeft.uv2.y = 0f; textElementInfo[j].vertexTopLeft.uv2.y = 1f; textElementInfo[j].vertexTopRight.uv2.y = 0f; textElementInfo[j].vertexBottomRight.uv2.y = 1f; break; case TextureMapping.Line: textElementInfo[j].vertexBottomLeft.uv2.y = (textElementInfo[j].vertexBottomLeft.position.y - lineExtents.min.y) / (lineExtents.max.y - lineExtents.min.y) + num67; textElementInfo[j].vertexTopLeft.uv2.y = (textElementInfo[j].vertexTopLeft.position.y - lineExtents.min.y) / (lineExtents.max.y - lineExtents.min.y) + num67; textElementInfo[j].vertexTopRight.uv2.y = textElementInfo[j].vertexBottomLeft.uv2.y; textElementInfo[j].vertexBottomRight.uv2.y = textElementInfo[j].vertexTopLeft.uv2.y; break; case TextureMapping.Paragraph: textElementInfo[j].vertexBottomLeft.uv2.y = (textElementInfo[j].vertexBottomLeft.position.y - m_MeshExtents.min.y) / (m_MeshExtents.max.y - m_MeshExtents.min.y) + num67; textElementInfo[j].vertexTopLeft.uv2.y = (textElementInfo[j].vertexTopLeft.position.y - m_MeshExtents.min.y) / (m_MeshExtents.max.y - m_MeshExtents.min.y) + num67; textElementInfo[j].vertexTopRight.uv2.y = textElementInfo[j].vertexBottomLeft.uv2.y; textElementInfo[j].vertexBottomRight.uv2.y = textElementInfo[j].vertexTopLeft.uv2.y; break; case TextureMapping.MatchAspect: Debug.Log((object)"ERROR: Cannot Match both Vertical & Horizontal."); break; } float num68 = (1f - (textElementInfo[j].vertexBottomLeft.uv2.y + textElementInfo[j].vertexTopLeft.uv2.y) * textElementInfo[j].aspectRatio) / 2f; textElementInfo[j].vertexBottomLeft.uv2.x = textElementInfo[j].vertexBottomLeft.uv2.y * textElementInfo[j].aspectRatio + num68 + num67; textElementInfo[j].vertexTopLeft.uv2.x = textElementInfo[j].vertexBottomLeft.uv2.x; textElementInfo[j].vertexTopRight.uv2.x = textElementInfo[j].vertexTopLeft.uv2.y * textElementInfo[j].aspectRatio + num68 + num67; textElementInfo[j].vertexBottomRight.uv2.x = textElementInfo[j].vertexTopRight.uv2.x; break; } } switch (generationSettings.verticalMapping) { case TextureMapping.Character: textElementInfo[j].vertexBottomLeft.uv2.y = 0f; textElementInfo[j].vertexTopLeft.uv2.y = 1f; textElementInfo[j].vertexTopRight.uv2.y = 1f; textElementInfo[j].vertexBottomRight.uv2.y = 0f; break; case TextureMapping.Line: textElementInfo[j].vertexBottomLeft.uv2.y = (textElementInfo[j].vertexBottomLeft.position.y - lineInfo.descender) / (lineInfo.ascender - lineInfo.descender); textElementInfo[j].vertexTopLeft.uv2.y = (textElementInfo[j].vertexTopLeft.position.y - lineInfo.descender) / (lineInfo.ascender - lineInfo.descender); textElementInfo[j].vertexTopRight.uv2.y = textElementInfo[j].vertexTopLeft.uv2.y; textElementInfo[j].vertexBottomRight.uv2.y = textElementInfo[j].vertexBottomLeft.uv2.y; break; case TextureMapping.Paragraph: textElementInfo[j].vertexBottomLeft.uv2.y = (textElementInfo[j].vertexBottomLeft.position.y - m_MeshExtents.min.y) / (m_MeshExtents.max.y - m_MeshExtents.min.y); textElementInfo[j].vertexTopLeft.uv2.y = (textElementInfo[j].vertexTopLeft.position.y - m_MeshExtents.min.y) / (m_MeshExtents.max.y - m_MeshExtents.min.y); textElementInfo[j].vertexTopRight.uv2.y = textElementInfo[j].vertexTopLeft.uv2.y; textElementInfo[j].vertexBottomRight.uv2.y = textElementInfo[j].vertexBottomLeft.uv2.y; break; case TextureMapping.MatchAspect: { float num69 = (1f - (textElementInfo[j].vertexBottomLeft.uv2.x + textElementInfo[j].vertexTopRight.uv2.x) / textElementInfo[j].aspectRatio) / 2f; textElementInfo[j].vertexBottomLeft.uv2.y = num69 + textElementInfo[j].vertexBottomLeft.uv2.x / textElementInfo[j].aspectRatio; textElementInfo[j].vertexTopLeft.uv2.y = num69 + textElementInfo[j].vertexTopRight.uv2.x / textElementInfo[j].aspectRatio; textElementInfo[j].vertexBottomRight.uv2.y = textElementInfo[j].vertexBottomLeft.uv2.y; textElementInfo[j].vertexTopRight.uv2.y = textElementInfo[j].vertexTopLeft.uv2.y; break; } } num56 = textElementInfo[j].scale * (1f - m_CharWidthAdjDelta) * 1f; if (!textElementInfo[j].isUsingAlternateTypeface && (textElementInfo[j].style & FontStyles.Bold) == FontStyles.Bold) { num56 *= -1f; } textElementInfo[j].vertexBottomLeft.uv2.x = 1f; textElementInfo[j].vertexBottomLeft.uv2.y = num56; textElementInfo[j].vertexTopLeft.uv2.x = 1f; textElementInfo[j].vertexTopLeft.uv2.y = num56; textElementInfo[j].vertexTopRight.uv2.x = 1f; textElementInfo[j].vertexTopRight.uv2.y = num56; textElementInfo[j].vertexBottomRight.uv2.x = 1f; textElementInfo[j].vertexBottomRight.uv2.y = num56; break; } } if (j < generationSettings.maxVisibleCharacters && num53 < generationSettings.maxVisibleWords && lineNumber < generationSettings.maxVisibleLines && generationSettings.overflowMode != TextOverflowMode.Page) { position = ref textElementInfo[j].vertexBottomLeft.position; position += val16; position = ref textElementInfo[j].vertexTopLeft.position; position += val16; position = ref textElementInfo[j].vertexTopRight.position; position += val16; position = ref textElementInfo[j].vertexBottomRight.position; position += val16; } else if (j < generationSettings.maxVisibleCharacters && num53 < generationSettings.maxVisibleWords && lineNumber < generationSettings.maxVisibleLines && generationSettings.overflowMode == TextOverflowMode.Page && textElementInfo[j].pageNumber == num7) { position = ref textElementInfo[j].vertexBottomLeft.position; position += val16; position = ref textElementInfo[j].vertexTopLeft.position; position += val16; position = ref textElementInfo[j].vertexTopRight.position; position += val16; position = ref textElementInfo[j].vertexBottomRight.position; position += val16; } else { textElementInfo[j].vertexBottomLeft.position = Vector3.zero; textElementInfo[j].vertexTopLeft.position = Vector3.zero; textElementInfo[j].vertexTopRight.position = Vector3.zero; textElementInfo[j].vertexBottomRight.position = Vector3.zero; textElementInfo[j].isVisible = false; } switch (elementType) { case TextElementType.Character: TextGeneratorUtilities.FillCharacterVertexBuffers(j, generationSettings, textInfo); break; case TextElementType.Sprite: TextGeneratorUtilities.FillSpriteVertexBuffers(j, generationSettings, textInfo); break; } } position = ref textInfo.textElementInfo[j].bottomLeft; position += val16; position = ref textInfo.textElementInfo[j].topLeft; position += val16; position = ref textInfo.textElementInfo[j].topRight; position += val16; position = ref textInfo.textElementInfo[j].bottomRight; position += val16; textInfo.textElementInfo[j].origin += val16.x; textInfo.textElementInfo[j].xAdvance += val16.x; textInfo.textElementInfo[j].ascender += val16.y; textInfo.textElementInfo[j].descender += val16.y; textInfo.textElementInfo[j].baseLine += val16.y; if (lineNumber != num54 || j == m_CharacterCount - 1) { if (lineNumber != num54) { textInfo.lineInfo[num54].baseline += val16.y; textInfo.lineInfo[num54].ascender += val16.y; textInfo.lineInfo[num54].descender += val16.y; textInfo.lineInfo[num54].lineExtents.min = new Vector2(textInfo.textElementInfo[textInfo.lineInfo[num54].firstCharacterIndex].bottomLeft.x, textInfo.lineInfo[num54].descender); textInfo.lineInfo[num54].lineExtents.max = new Vector2(textInfo.textElementInfo[textInfo.lineInfo[num54].lastVisibleCharacterIndex].topRight.x, textInfo.lineInfo[num54].ascender); } if (j == m_CharacterCount - 1) { textInfo.lineInfo[lineNumber].baseline += val16.y; textInfo.lineInfo[lineNumber].ascender += val16.y; textInfo.lineInfo[lineNumber].descender += val16.y; textInfo.lineInfo[lineNumber].lineExtents.min = new Vector2(textInfo.textElementInfo[textInfo.lineInfo[lineNumber].firstCharacterIndex].bottomLeft.x, textInfo.lineInfo[lineNumber].descender); textInfo.lineInfo[lineNumber].lineExtents.max = new Vector2(textInfo.textElementInfo[textInfo.lineInfo[lineNumber].lastVisibleCharacterIndex].topRight.x, textInfo.lineInfo[lineNumber].ascender); } } if (char.IsLetterOrDigit(character) || character == '-' || character == '\u00ad' || character == '‐' || character == '‑') { if (!flag11) { flag11 = true; num55 = j; } if (flag11 && j == m_CharacterCount - 1) { int num70 = textInfo.wordInfo.Length; int wordCount = textInfo.wordCount; if (textInfo.wordCount + 1 > num70) { TextInfo.Resize(ref textInfo.wordInfo, num70 + 1); } int num71 = j; textInfo.wordInfo[wordCount].firstCharacterIndex = num55; textInfo.wordInfo[wordCount].lastCharacterIndex = num71; textInfo.wordInfo[wordCount].characterCount = num71 - num55 + 1; num53++; TextInfo textInfo2 = textInfo; textInfo2.wordCount++; textInfo.lineInfo[lineNumber].wordCount++; } } else if ((flag11 || (j == 0 && (!char.IsPunctuation(character) || char.IsWhiteSpace(character) || character == '\u200b' || j == m_CharacterCount - 1))) && (j <= 0 || j >= textElementInfo.Length - 1 || j >= m_CharacterCount || (character != '\'' && character != '’') || !char.IsLetterOrDigit(textElementInfo[j - 1].character) || !char.IsLetterOrDigit(textElementInfo[j + 1].character))) { int num71 = ((j == m_CharacterCount - 1 && char.IsLetterOrDigit(character)) ? j : (j - 1)); flag11 = false; int num72 = textInfo.wordInfo.Length; int wordCount2 = textInfo.wordCount; if (textInfo.wordCount + 1 > num72) { TextInfo.Resize(ref textInfo.wordInfo, num72 + 1); } textInfo.wordInfo[wordCount2].firstCharacterIndex = num55; textInfo.wordInfo[wordCount2].lastCharacterIndex = num71; textInfo.wordInfo[wordCount2].characterCount = num71 - num55 + 1; num53++; TextInfo textInfo2 = textInfo; textInfo2.wordCount++; textInfo.lineInfo[lineNumber].wordCount++; } if ((textInfo.textElementInfo[j].style & FontStyles.Underline) == FontStyles.Underline) { bool flag13 = true; int pageNumber = textInfo.textElementInfo[j].pageNumber; if (j > generationSettings.maxVisibleCharacters || lineNumber > generationSettings.maxVisibleLines || (generationSettings.overflowMode == TextOverflowMode.Page && pageNumber + 1 != generationSettings.pageToDisplay)) { flag13 = false; } if (!char.IsWhiteSpace(character) && character != '\u200b') { num58 = Mathf.Max(num58, textInfo.textElementInfo[j].scale); float num73 = ((pageNumber == num60) ? num59 : 32767f); float baseLine = textInfo.textElementInfo[j].baseLine; faceInfo = generationSettings.fontAsset.faceInfo; num59 = Mathf.Min(num73, baseLine + ((FaceInfo)(ref faceInfo)).underlineOffset * num58); num60 = pageNumber; } if (!flag && flag13 && j <= lineInfo.lastVisibleCharacterIndex && character != '\n' && character != '\r' && (j != lineInfo.lastVisibleCharacterIndex || !char.IsSeparator(character))) { flag = true; num57 = textInfo.textElementInfo[j].scale; if (num58 == 0f) { num58 = num57; } ((Vector3)(ref zero))..ctor(textInfo.textElementInfo[j].bottomLeft.x, num59, 0f); val15 = textInfo.textElementInfo[j].underlineColor; } if (flag && m_CharacterCount == 1) { flag = false; ((Vector3)(ref end))..ctor(textInfo.textElementInfo[j].topRight.x, num59, 0f); float scale = textInfo.textElementInfo[j].scale; DrawUnderlineMesh(zero, end, ref index, num57, scale, num58, num56, val15, generationSettings, textInfo); num58 = 0f; num59 = 32767f; } else if (flag && (j == lineInfo.lastCharacterIndex || j >= lineInfo.lastVisibleCharacterIndex)) { float scale; if (char.IsWhiteSpace(character) || character == '\u200b') { int lastVisibleCharacterIndex = lineInfo.lastVisibleCharacterIndex; ((Vector3)(ref end))..ctor(textInfo.textElementInfo[lastVisibleCharacterIndex].topRight.x, num59, 0f); scale = textInfo.textElementInfo[lastVisibleCharacterIndex].scale; } else { ((Vector3)(ref end))..ctor(textInfo.textElementInfo[j].topRight.x, num59, 0f); scale = textInfo.textElementInfo[j].scale; } flag = false; DrawUnderlineMesh(zero, end, ref index, num57, scale, num58, num56, val15, generationSettings, textInfo); num58 = 0f; num59 = 32767f; } else if (flag && !flag13) { flag = false; ((Vector3)(ref end))..ctor(textInfo.textElementInfo[j - 1].topRight.x, num59, 0f); float scale = textInfo.textElementInfo[j - 1].scale; DrawUnderlineMesh(zero, end, ref index, num57, scale, num58, num56, val15, generationSettings, textInfo); num58 = 0f; num59 = 32767f; } else if (flag && j < m_CharacterCount - 1 && !ColorUtilities.CompareColors(val15, textInfo.textElementInfo[j + 1].underlineColor)) { flag = false; ((Vector3)(ref end))..ctor(textInfo.textElementInfo[j].topRight.x, num59, 0f); float scale = textInfo.textElementInfo[j].scale; DrawUnderlineMesh(zero, end, ref index, num57, scale, num58, num56, val15, generationSettings, textInfo); num58 = 0f; num59 = 32767f; } } else if (flag) { flag = false; ((Vector3)(ref end))..ctor(textInfo.textElementInfo[j - 1].topRight.x, num59, 0f); float scale = textInfo.textElementInfo[j - 1].scale; DrawUnderlineMesh(zero, end, ref index, num57, scale, num58, num56, val15, generationSettings, textInfo); num58 = 0f; num59 = 32767f; } bool flag14 = (textInfo.textElementInfo[j].style & FontStyles.Strikethrough) == FontStyles.Strikethrough; faceInfo = fontAsset.faceInfo; float strikethroughOffset = ((FaceInfo)(ref faceInfo)).strikethroughOffset; if (flag14) { bool flag15 = j <= generationSettings.maxVisibleCharacters && lineNumber <= generationSettings.maxVisibleLines && (generationSettings.overflowMode != TextOverflowMode.Page || textInfo.textElementInfo[j].pageNumber + 1 == generationSettings.pageToDisplay); if (!flag2 && flag15 && j <= lineInfo.lastVisibleCharacterIndex && character != '\n' && character != '\r' && (j != lineInfo.lastVisibleCharacterIndex || !char.IsSeparator(character))) { flag2 = true; num61 = textInfo.textElementInfo[j].pointSize; num62 = textInfo.textElementInfo[j].scale; ((Vector3)(ref zero2))..ctor(textInfo.textElementInfo[j].bottomLeft.x, textInfo.textElementInfo[j].baseLine + strikethroughOffset * num62, 0f); underlineColor = textInfo.textElementInfo[j].strikethroughColor; b = textInfo.textElementInfo[j].baseLine; } if (flag2 && m_CharacterCount == 1) { flag2 = false; ((Vector3)(ref end2))..ctor(textInfo.textElementInfo[j].topRight.x, textInfo.textElementInfo[j].baseLine + strikethroughOffset * num62, 0f); DrawUnderlineMesh(zero2, end2, ref index, num62, num62, num62, num56, underlineColor, generationSettings, textInfo); } else if (flag2 && j == lineInfo.lastCharacterIndex) { if (char.IsWhiteSpace(character) || character == '\u200b') { int lastVisibleCharacterIndex2 = lineInfo.lastVisibleCharacterIndex; ((Vector3)(ref end2))..ctor(textInfo.textElementInfo[lastVisibleCharacterIndex2].topRight.x, textInfo.textElementInfo[lastVisibleCharacterIndex2].baseLine + strikethroughOffset * num62, 0f); } else { ((Vector3)(ref end2))..ctor(textInfo.textElementInfo[j].topRight.x, textInfo.textElementInfo[j].baseLine + strikethroughOffset * num62, 0f); } flag2 = false; DrawUnderlineMesh(zero2, end2, ref index, num62, num62, num62, num56, underlineColor, generationSettings, textInfo); } else if (flag2 && j < m_CharacterCount && (textInfo.textElementInfo[j + 1].pointSize != num61 || !TextGeneratorUtilities.Approximately(textInfo.textElementInfo[j + 1].baseLine + val16.y, b))) { flag2 = false; int lastVisibleCharacterIndex3 = lineInfo.lastVisibleCharacterIndex; if (j > lastVisibleCharacterIndex3) { ((Vector3)(ref end2))..ctor(textInfo.textElementInfo[lastVisibleCharacterIndex3].topRight.x, textInfo.textElementInfo[lastVisibleCharacterIndex3].baseLine + strikethroughOffset * num62, 0f); } else { ((Vector3)(ref end2))..ctor(textInfo.textElementInfo[j].topRight.x, textInfo.textElementInfo[j].baseLine + strikethroughOffset * num62, 0f); } DrawUnderlineMesh(zero2, end2, ref index, num62, num62, num62, num56, underlineColor, generationSettings, textInfo); } else if (flag2 && j < m_CharacterCount && ((Object)fontAsset).GetInstanceID() != ((Object)textElementInfo[j + 1].fontAsset).GetInstanceID()) { flag2 = false; ((Vector3)(ref end2))..ctor(textInfo.textElementInfo[j].topRight.x, textInfo.textElementInfo[j].baseLine + strikethroughOffset * num62, 0f); DrawUnderlineMesh(zero2, end2, ref index, num62, num62, num62, num56, underlineColor, generationSettings, textInfo); } else if (flag2 && !flag15) { flag2 = false; ((Vector3)(ref end2))..ctor(textInfo.textElementInfo[j - 1].topRight.x, textInfo.textElementInfo[j - 1].baseLine + strikethroughOffset * num62, 0f); DrawUnderlineMesh(zero2, end2, ref index, num62, num62, num62, num56, underlineColor, generationSettings, textInfo); } } else if (flag2) { flag2 = false; ((Vector3)(ref end2))..ctor(textInfo.textElementInfo[j - 1].topRight.x, textInfo.textElementInfo[j - 1].baseLine + strikethroughOffset * num62, 0f); DrawUnderlineMesh(zero2, end2, ref index, num62, num62, num62, num56, underlineColor, generationSettings, textInfo); } if ((textInfo.textElementInfo[j].style & FontStyles.Highlight) == FontStyles.Highlight) { bool flag16 = true; int pageNumber2 = textInfo.textElementInfo[j].pageNumber; if (j > generationSettings.maxVisibleCharacters || lineNumber > generationSettings.maxVisibleLines || (generationSettings.overflowMode == TextOverflowMode.Page && pageNumber2 + 1 != generationSettings.pageToDisplay)) { flag16 = false; } if (!flag3 && flag16 && j <= lineInfo.lastVisibleCharacterIndex && character != '\n' && character != '\r' && (j != lineInfo.lastVisibleCharacterIndex || !char.IsSeparator(character))) { flag3 = true; val = Vector2.op_Implicit(TextGeneratorUtilities.largePositiveVector2); val2 = Vector2.op_Implicit(TextGeneratorUtilities.largeNegativeVector2); highlightColor = textInfo.textElementInfo[j].highlightColor; } if (flag3) { Color32 highlightColor2 = textInfo.textElementInfo[j].highlightColor; bool flag17 = false; if (!ColorUtilities.CompareColors(highlightColor, highlightColor2)) { val2.x = (val2.x + textInfo.textElementInfo[j].bottomLeft.x) / 2f; val.y = Mathf.Min(val.y, textInfo.textElementInfo[j].descender); val2.y = Mathf.Max(val2.y, textInfo.textElementInfo[j].ascender); DrawTextHighlight(val, val2, ref index, highlightColor, generationSettings, textInfo); flag3 = true; val = val2; ((Vector3)(ref val2))..ctor(textInfo.textElementInfo[j].topRight.x, textInfo.textElementInfo[j].descender, 0f); highlightColor = textInfo.textElementInfo[j].highlightColor; flag17 = true; } if (!flag17) { val.x = Mathf.Min(val.x, textInfo.textElementInfo[j].bottomLeft.x); val.y = Mathf.Min(val.y, textInfo.textElementInfo[j].descender); val2.x = Mathf.Max(val2.x, textInfo.textElementInfo[j].topRight.x); val2.y = Mathf.Max(val2.y, textInfo.textElementInfo[j].ascender); } } if (flag3 && m_CharacterCount == 1) { flag3 = false; DrawTextHighlight(val, val2, ref index, highlightColor, generationSettings, textInfo); } else if (flag3 && (j == lineInfo.lastCharacterIndex || j >= lineInfo.lastVisibleCharacterIndex)) { flag3 = false; DrawTextHighlight(val, val2, ref index, highlightColor, generationSettings, textInfo); } else if (flag3 && !flag16) { flag3 = false; DrawTextHighlight(val, val2, ref index, highlightColor, generationSettings, textInfo); } } else if (flag3) { flag3 = false; DrawTextHighlight(val, val2, ref index, highlightColor, generationSettings, textInfo); } num54 = lineNumber; } textInfo.characterCount = m_CharacterCount; textInfo.spriteCount = m_SpriteCount; textInfo.lineCount = lineCount; textInfo.wordCount = ((num53 == 0 || m_CharacterCount <= 0) ? 1 : num53); textInfo.pageCount = m_PageNumber + 1; textInfo.meshInfo[m_Underline.materialIndex].vertexCount = index; if (generationSettings.geometrySortingOrder != VertexSortingOrder.Normal) { textInfo.meshInfo[0].SortGeometry(VertexSortingOrder.Reverse); } for (int k = 1; k < textInfo.materialCount; k++) { textInfo.meshInfo[k].ClearUnusedVertices(); if (generationSettings.geometrySortingOrder != VertexSortingOrder.Normal) { textInfo.meshInfo[k].SortGeometry(VertexSortingOrder.Reverse); } } } private void SaveWordWrappingState(ref WordWrapState state, int index, int count, TextInfo textInfo) { //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) state.currentFontAsset = m_CurrentFontAsset; state.currentSpriteAsset = m_CurrentSpriteAsset; state.currentMaterial = m_CurrentMaterial; state.currentMaterialIndex = m_CurrentMaterialIndex; state.previousWordBreak = index; state.totalCharacterCount = count; state.visibleCharacterCount = m_LineVisibleCharacterCount; state.visibleLinkCount = textInfo.linkCount; state.firstCharacterIndex = m_FirstCharacterOfLine; state.firstVisibleCharacterIndex = m_FirstVisibleCharacterOfLine; state.lastVisibleCharIndex = m_LastVisibleCharacterOfLine; state.fontStyle = m_FontStyleInternal; state.fontScale = m_FontScale; state.fontScaleMultiplier = m_FontScaleMultiplier; state.currentFontSize = m_CurrentFontSize; state.xAdvance = m_XAdvance; state.maxCapHeight = m_MaxCapHeight; state.maxAscender = m_MaxAscender; state.maxDescender = m_MaxDescender; state.maxLineAscender = m_MaxLineAscender; state.maxLineDescender = m_MaxLineDescender; state.previousLineAscender = m_StartOfLineAscender; state.preferredWidth = m_PreferredWidth; state.preferredHeight = m_PreferredHeight; state.meshExtents = m_MeshExtents; state.lineNumber = m_LineNumber; state.lineOffset = m_LineOffset; state.baselineOffset = m_BaselineOffset; state.vertexColor = m_HtmlColor; state.underlineColor = m_UnderlineColor; state.strikethroughColor = m_StrikethroughColor; state.highlightColor = m_HighlightColor; state.isNonBreakingSpace = m_IsNonBreakingSpace; state.tagNoParsing = m_TagNoParsing; state.basicStyleStack = m_FontStyleStack; state.colorStack = m_ColorStack; state.underlineColorStack = m_UnderlineColorStack; state.strikethroughColorStack = m_StrikethroughColorStack; state.highlightColorStack = m_HighlightColorStack; state.colorGradientStack = m_ColorGradientStack; state.sizeStack = m_SizeStack; state.indentStack = m_IndentStack; state.fontWeightStack = m_FontWeightStack; state.styleStack = m_StyleStack; state.baselineStack = m_BaselineOffsetStack; state.actionStack = m_ActionStack; state.materialReferenceStack = m_MaterialReferenceStack; state.lineJustificationStack = m_LineJustificationStack; state.spriteAnimationId = m_SpriteAnimationId; if (m_LineNumber < textInfo.lineInfo.Length) { state.lineInfo = textInfo.lineInfo[m_LineNumber]; } } protected int RestoreWordWrappingState(ref WordWrapState state, TextInfo textInfo) { //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) int previousWordBreak = state.previousWordBreak; m_CurrentFontAsset = state.currentFontAsset; m_CurrentSpriteAsset = state.currentSpriteAsset; m_CurrentMaterial = state.currentMaterial; m_CurrentMaterialIndex = state.currentMaterialIndex; m_CharacterCount = state.totalCharacterCount + 1; m_LineVisibleCharacterCount = state.visibleCharacterCount; textInfo.linkCount = state.visibleLinkCount; m_FirstCharacterOfLine = state.firstCharacterIndex; m_FirstVisibleCharacterOfLine = state.firstVisibleCharacterIndex; m_LastVisibleCharacterOfLine = state.lastVisibleCharIndex; m_FontStyleInternal = state.fontStyle; m_FontScale = state.fontScale; m_FontScaleMultiplier = state.fontScaleMultiplier; m_CurrentFontSize = state.currentFontSize; m_XAdvance = state.xAdvance; m_MaxCapHeight = state.maxCapHeight; m_MaxAscender = state.maxAscender; m_MaxDescender = state.maxDescender; m_MaxLineAscender = state.maxLineAscender; m_MaxLineDescender = state.maxLineDescender; m_StartOfLineAscender = state.previousLineAscender; m_PreferredWidth = state.preferredWidth; m_PreferredHeight = state.preferredHeight; m_MeshExtents = state.meshExtents; m_LineNumber = state.lineNumber; m_LineOffset = state.lineOffset; m_BaselineOffset = state.baselineOffset; m_HtmlColor = state.vertexColor; m_UnderlineColor = state.underlineColor; m_StrikethroughColor = state.strikethroughColor; m_HighlightColor = state.highlightColor; m_IsNonBreakingSpace = state.isNonBreakingSpace; m_TagNoParsing = state.tagNoParsing; m_FontStyleStack = state.basicStyleStack; m_ColorStack = state.colorStack; m_UnderlineColorStack = state.underlineColorStack; m_StrikethroughColorStack = state.strikethroughColorStack; m_HighlightColorStack = state.highlightColorStack; m_ColorGradientStack = state.colorGradientStack; m_SizeStack = state.sizeStack; m_IndentStack = state.indentStack; m_FontWeightStack = state.fontWeightStack; m_StyleStack = state.styleStack; m_BaselineOffsetStack = state.baselineStack; m_ActionStack = state.actionStack; m_MaterialReferenceStack = state.materialReferenceStack; m_LineJustificationStack = state.lineJustificationStack; m_SpriteAnimationId = state.spriteAnimationId; if (m_LineNumber < textInfo.lineInfo.Length) { textInfo.lineInfo[m_LineNumber] = state.lineInfo; } return previousWordBreak; } private bool ValidateRichTextTag(string sourceText, ref int readIndex, ref int writeIndex, TextGenerationSettings generationSettings, TextInfo textInfo) { int num = readIndex; int num2 = writeIndex; int length = sourceText.Length; bool flag = false; byte b = 0; bool flag2 = false; int num3 = 0; m_Attributes[num3].nameHashCode = 0; m_Attributes[num3].valueHashCode = 0; m_Attributes[num3].valueLength = 0; for (; readIndex < length && sourceText[readIndex] != 0; readIndex++) { uint num4 = sourceText[readIndex]; if (writeIndex == m_InternalTextParsingBuffer.Length) { TextGeneratorUtilities.ResizeArray(m_InternalTextParsingBuffer); } m_InternalTextParsingBuffer[writeIndex] = num4; writeIndex++; switch (num4) { case 60u: if (readIndex > num) { break; } continue; case 62u: flag = true; break; default: if (b == 0) { if ((num4 >= 65 && num4 <= 90) || (num4 >= 97 && num4 <= 122) || num4 == 47 || num4 == 45) { m_Attributes[num3].nameHashCode = ((m_Attributes[num3].nameHashCode << 5) + m_Attributes[num3].nameHashCode) ^ (int)TextUtilities.ToUpperASCIIFast(num4); continue; } switch (num4) { case 61u: b = 1; continue; case 35u: m_Attributes[num3].nameHashCode = 81999901; b = 2; readIndex--; continue; case 32u: num3++; m_Attributes[num3].nameHashCode = 0; m_Attributes[num3].valueHashCode = 0; m_Attributes[num3].valueLength = 0; continue; } break; } if (b == 1) { flag2 = false; b = 2; if (num4 == 34) { flag2 = true; continue; } } if (b != 2) { continue; } if (num4 == 34) { if (flag2) { b = 0; continue; } break; } if (!flag2 && num4 == 32) { num3++; m_Attributes[num3].nameHashCode = 0; m_Attributes[num3].valueHashCode = 0; m_Attributes[num3].valueLength = 0; b = 0; } else { if (m_Attributes[num3].valueLength == 0) { m_Attributes[num3].valueStartIndex = readIndex; } m_Attributes[num3].valueHashCode = ((m_Attributes[num3].valueHashCode << 5) + m_Attributes[num3].valueHashCode) ^ (int)TextUtilities.ToUpperASCIIFast(num4); m_Attributes[num3].valueLength++; } continue; } break; } if (!flag) { readIndex = num; writeIndex = num2; return false; } return false; } protected bool ValidateHtmlTag(int[] chars, int startIndex, out int endIndex, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07e5: Unknown result type (might be due to invalid IL or missing references) //IL_2806: Unknown result type (might be due to invalid IL or missing references) //IL_280b: Unknown result type (might be due to invalid IL or missing references) //IL_1e4b: Unknown result type (might be due to invalid IL or missing references) //IL_1e50: Unknown result type (might be due to invalid IL or missing references) //IL_1e61: Unknown result type (might be due to invalid IL or missing references) //IL_1e66: Unknown result type (might be due to invalid IL or missing references) //IL_110b: Unknown result type (might be due to invalid IL or missing references) //IL_1110: Unknown result type (might be due to invalid IL or missing references) //IL_11da: Unknown result type (might be due to invalid IL or missing references) //IL_11df: Unknown result type (might be due to invalid IL or missing references) //IL_1b86: Unknown result type (might be due to invalid IL or missing references) //IL_1b8b: Unknown result type (might be due to invalid IL or missing references) //IL_1b9c: Unknown result type (might be due to invalid IL or missing references) //IL_1ba1: Unknown result type (might be due to invalid IL or missing references) //IL_11fc: Unknown result type (might be due to invalid IL or missing references) //IL_1201: Unknown result type (might be due to invalid IL or missing references) //IL_1047: Unknown result type (might be due to invalid IL or missing references) //IL_104c: Unknown result type (might be due to invalid IL or missing references) //IL_0ffd: Unknown result type (might be due to invalid IL or missing references) //IL_1002: Unknown result type (might be due to invalid IL or missing references) //IL_1ac6: Unknown result type (might be due to invalid IL or missing references) //IL_1acb: Unknown result type (might be due to invalid IL or missing references) //IL_1adc: Unknown result type (might be due to invalid IL or missing references) //IL_1ae1: Unknown result type (might be due to invalid IL or missing references) //IL_1157: Unknown result type (might be due to invalid IL or missing references) //IL_12cb: Unknown result type (might be due to invalid IL or missing references) //IL_12d0: Unknown result type (might be due to invalid IL or missing references) //IL_122f: Unknown result type (might be due to invalid IL or missing references) //IL_1234: Unknown result type (might be due to invalid IL or missing references) //IL_1343: Unknown result type (might be due to invalid IL or missing references) //IL_1348: Unknown result type (might be due to invalid IL or missing references) //IL_1058: Unknown result type (might be due to invalid IL or missing references) //IL_2c7f: Unknown result type (might be due to invalid IL or missing references) //IL_2c84: Unknown result type (might be due to invalid IL or missing references) //IL_2aa4: Unknown result type (might be due to invalid IL or missing references) //IL_2aa9: Unknown result type (might be due to invalid IL or missing references) //IL_297a: Unknown result type (might be due to invalid IL or missing references) //IL_297f: Unknown result type (might be due to invalid IL or missing references) //IL_24f2: Unknown result type (might be due to invalid IL or missing references) //IL_24f7: Unknown result type (might be due to invalid IL or missing references) //IL_2503: Unknown result type (might be due to invalid IL or missing references) //IL_118f: Unknown result type (might be due to invalid IL or missing references) //IL_1194: Unknown result type (might be due to invalid IL or missing references) //IL_12ed: Unknown result type (might be due to invalid IL or missing references) //IL_12f2: Unknown result type (might be due to invalid IL or missing references) //IL_1365: Unknown result type (might be due to invalid IL or missing references) //IL_136a: Unknown result type (might be due to invalid IL or missing references) //IL_1088: Unknown result type (might be due to invalid IL or missing references) //IL_108d: Unknown result type (might be due to invalid IL or missing references) //IL_0f2e: Unknown result type (might be due to invalid IL or missing references) //IL_0f33: Unknown result type (might be due to invalid IL or missing references) //IL_0ee4: Unknown result type (might be due to invalid IL or missing references) //IL_0ee9: Unknown result type (might be due to invalid IL or missing references) //IL_3807: Unknown result type (might be due to invalid IL or missing references) //IL_3818: Unknown result type (might be due to invalid IL or missing references) //IL_381d: Unknown result type (might be due to invalid IL or missing references) //IL_3822: Unknown result type (might be due to invalid IL or missing references) //IL_3827: Unknown result type (might be due to invalid IL or missing references) //IL_20ad: Unknown result type (might be due to invalid IL or missing references) //IL_20b2: Unknown result type (might be due to invalid IL or missing references) //IL_1a08: Unknown result type (might be due to invalid IL or missing references) //IL_1a0d: Unknown result type (might be due to invalid IL or missing references) //IL_1a1e: Unknown result type (might be due to invalid IL or missing references) //IL_1a23: Unknown result type (might be due to invalid IL or missing references) //IL_1a6e: Unknown result type (might be due to invalid IL or missing references) //IL_1a73: Unknown result type (might be due to invalid IL or missing references) //IL_1a84: Unknown result type (might be due to invalid IL or missing references) //IL_1a89: Unknown result type (might be due to invalid IL or missing references) //IL_1434: Unknown result type (might be due to invalid IL or missing references) //IL_1439: Unknown result type (might be due to invalid IL or missing references) //IL_1398: Unknown result type (might be due to invalid IL or missing references) //IL_139d: Unknown result type (might be due to invalid IL or missing references) //IL_16ab: Unknown result type (might be due to invalid IL or missing references) //IL_16b0: Unknown result type (might be due to invalid IL or missing references) //IL_0f3f: Unknown result type (might be due to invalid IL or missing references) //IL_346a: Unknown result type (might be due to invalid IL or missing references) //IL_346f: Unknown result type (might be due to invalid IL or missing references) //IL_356d: Unknown result type (might be due to invalid IL or missing references) //IL_3572: Unknown result type (might be due to invalid IL or missing references) //IL_333d: Unknown result type (might be due to invalid IL or missing references) //IL_3342: Unknown result type (might be due to invalid IL or missing references) //IL_2b7c: Unknown result type (might be due to invalid IL or missing references) //IL_2b81: Unknown result type (might be due to invalid IL or missing references) //IL_3780: Unknown result type (might be due to invalid IL or missing references) //IL_3785: Unknown result type (might be due to invalid IL or missing references) //IL_3796: Unknown result type (might be due to invalid IL or missing references) //IL_379b: Unknown result type (might be due to invalid IL or missing references) //IL_37a0: Unknown result type (might be due to invalid IL or missing references) //IL_18db: Unknown result type (might be due to invalid IL or missing references) //IL_18e0: Unknown result type (might be due to invalid IL or missing references) //IL_18f1: Unknown result type (might be due to invalid IL or missing references) //IL_18f6: Unknown result type (might be due to invalid IL or missing references) //IL_1456: Unknown result type (might be due to invalid IL or missing references) //IL_145b: Unknown result type (might be due to invalid IL or missing references) //IL_1785: Unknown result type (might be due to invalid IL or missing references) //IL_178a: Unknown result type (might be due to invalid IL or missing references) //IL_2539: Unknown result type (might be due to invalid IL or missing references) //IL_253e: Unknown result type (might be due to invalid IL or missing references) //IL_254a: Unknown result type (might be due to invalid IL or missing references) //IL_19a8: Unknown result type (might be due to invalid IL or missing references) //IL_19ad: Unknown result type (might be due to invalid IL or missing references) //IL_19be: Unknown result type (might be due to invalid IL or missing references) //IL_19c3: Unknown result type (might be due to invalid IL or missing references) //IL_194e: Unknown result type (might be due to invalid IL or missing references) //IL_1953: Unknown result type (might be due to invalid IL or missing references) //IL_1964: Unknown result type (might be due to invalid IL or missing references) //IL_1969: Unknown result type (might be due to invalid IL or missing references) //IL_1dd7: Unknown result type (might be due to invalid IL or missing references) //IL_1ddc: Unknown result type (might be due to invalid IL or missing references) //IL_1ded: Unknown result type (might be due to invalid IL or missing references) //IL_1df2: Unknown result type (might be due to invalid IL or missing references) //IL_3676: Unknown result type (might be due to invalid IL or missing references) //IL_367b: Unknown result type (might be due to invalid IL or missing references) //IL_369b: Unknown result type (might be due to invalid IL or missing references) //IL_36a0: Unknown result type (might be due to invalid IL or missing references) //IL_2580: Unknown result type (might be due to invalid IL or missing references) //IL_2585: Unknown result type (might be due to invalid IL or missing references) //IL_2591: Unknown result type (might be due to invalid IL or missing references) //IL_2f14: Unknown result type (might be due to invalid IL or missing references) //IL_2f19: Unknown result type (might be due to invalid IL or missing references) //IL_2f1e: Unknown result type (might be due to invalid IL or missing references) //IL_25c7: Unknown result type (might be due to invalid IL or missing references) //IL_25cc: Unknown result type (might be due to invalid IL or missing references) //IL_25d8: Unknown result type (might be due to invalid IL or missing references) //IL_270f: Unknown result type (might be due to invalid IL or missing references) //IL_2714: Unknown result type (might be due to invalid IL or missing references) //IL_2719: Unknown result type (might be due to invalid IL or missing references) //IL_2725: Unknown result type (might be due to invalid IL or missing references) //IL_26bb: Unknown result type (might be due to invalid IL or missing references) //IL_26c0: Unknown result type (might be due to invalid IL or missing references) //IL_26c5: Unknown result type (might be due to invalid IL or missing references) //IL_26d1: Unknown result type (might be due to invalid IL or missing references) //IL_27ce: Unknown result type (might be due to invalid IL or missing references) //IL_27d3: Unknown result type (might be due to invalid IL or missing references) //IL_27d8: Unknown result type (might be due to invalid IL or missing references) //IL_27e4: Unknown result type (might be due to invalid IL or missing references) //IL_27a9: Unknown result type (might be due to invalid IL or missing references) //IL_27ae: Unknown result type (might be due to invalid IL or missing references) //IL_27ba: Unknown result type (might be due to invalid IL or missing references) //IL_2739: Unknown result type (might be due to invalid IL or missing references) //IL_273e: Unknown result type (might be due to invalid IL or missing references) //IL_2743: Unknown result type (might be due to invalid IL or missing references) //IL_274f: Unknown result type (might be due to invalid IL or missing references) //IL_26e5: Unknown result type (might be due to invalid IL or missing references) //IL_26ea: Unknown result type (might be due to invalid IL or missing references) //IL_26ef: Unknown result type (might be due to invalid IL or missing references) //IL_26fb: Unknown result type (might be due to invalid IL or missing references) //IL_2691: Unknown result type (might be due to invalid IL or missing references) //IL_2696: Unknown result type (might be due to invalid IL or missing references) //IL_269b: Unknown result type (might be due to invalid IL or missing references) //IL_26a7: Unknown result type (might be due to invalid IL or missing references) //IL_2773: Unknown result type (might be due to invalid IL or missing references) //IL_2778: Unknown result type (might be due to invalid IL or missing references) //IL_2784: Unknown result type (might be due to invalid IL or missing references) //IL_30ca: Unknown result type (might be due to invalid IL or missing references) //IL_30cf: Unknown result type (might be due to invalid IL or missing references) TextSettings textSettings = generationSettings.textSettings; int num = 0; byte b = 0; TagUnitType tagUnitType = TagUnitType.Pixels; TagValueType tagValueType = TagValueType.None; int num2 = 0; m_XmlAttribute[num2].nameHashCode = 0; m_XmlAttribute[num2].valueType = TagValueType.None; m_XmlAttribute[num2].valueHashCode = 0; m_XmlAttribute[num2].valueStartIndex = 0; m_XmlAttribute[num2].valueLength = 0; m_XmlAttribute[1].nameHashCode = 0; m_XmlAttribute[2].nameHashCode = 0; m_XmlAttribute[3].nameHashCode = 0; m_XmlAttribute[4].nameHashCode = 0; endIndex = startIndex; bool flag = false; bool flag2 = false; for (int i = startIndex; i < chars.Length && chars[i] != 0; i++) { if (num >= m_RichTextTag.Length) { break; } if (chars[i] == 60) { break; } uint num3 = (uint)chars[i]; if (num3 == 62) { flag2 = true; endIndex = i; m_RichTextTag[num] = '\0'; break; } m_RichTextTag[num] = (char)num3; num++; if (b == 1) { switch (tagValueType) { case TagValueType.None: if (num3 == 43 || num3 == 45 || num3 == 46 || (num3 >= 48 && num3 <= 57)) { tagValueType = TagValueType.NumericalValue; m_XmlAttribute[num2].valueType = TagValueType.NumericalValue; m_XmlAttribute[num2].valueStartIndex = num - 1; m_XmlAttribute[num2].valueLength++; break; } switch (num3) { case 35u: tagValueType = TagValueType.ColorValue; m_XmlAttribute[num2].valueType = TagValueType.ColorValue; m_XmlAttribute[num2].valueStartIndex = num - 1; m_XmlAttribute[num2].valueLength++; break; case 34u: tagValueType = TagValueType.StringValue; m_XmlAttribute[num2].valueType = TagValueType.StringValue; m_XmlAttribute[num2].valueStartIndex = num; break; default: tagValueType = TagValueType.StringValue; m_XmlAttribute[num2].valueType = TagValueType.StringValue; m_XmlAttribute[num2].valueStartIndex = num - 1; m_XmlAttribute[num2].valueHashCode = ((m_XmlAttribute[num2].valueHashCode << 5) + m_XmlAttribute[num2].valueHashCode) ^ (int)TextUtilities.ToUpperASCIIFast(num3); m_XmlAttribute[num2].valueLength++; break; } break; case TagValueType.NumericalValue: if (num3 == 112 || num3 == 101 || num3 == 37 || num3 == 32) { b = 2; tagValueType = TagValueType.None; num2++; m_XmlAttribute[num2].nameHashCode = 0; m_XmlAttribute[num2].valueType = TagValueType.None; m_XmlAttribute[num2].valueHashCode = 0; m_XmlAttribute[num2].valueStartIndex = 0; m_XmlAttribute[num2].valueLength = 0; switch (num3) { case 101u: tagUnitType = TagUnitType.FontUnits; break; case 37u: tagUnitType = TagUnitType.Percentage; break; } } else if (b != 2) { m_XmlAttribute[num2].valueLength++; } break; case TagValueType.ColorValue: if (num3 != 32) { m_XmlAttribute[num2].valueLength++; break; } b = 2; tagValueType = TagValueType.None; num2++; m_XmlAttribute[num2].nameHashCode = 0; m_XmlAttribute[num2].valueType = TagValueType.None; m_XmlAttribute[num2].valueHashCode = 0; m_XmlAttribute[num2].valueStartIndex = 0; m_XmlAttribute[num2].valueLength = 0; break; case TagValueType.StringValue: if (num3 != 34) { m_XmlAttribute[num2].valueHashCode = ((m_XmlAttribute[num2].valueHashCode << 5) + m_XmlAttribute[num2].valueHashCode) ^ (int)TextUtilities.ToUpperASCIIFast(num3); m_XmlAttribute[num2].valueLength++; break; } b = 2; tagValueType = TagValueType.None; num2++; m_XmlAttribute[num2].nameHashCode = 0; m_XmlAttribute[num2].valueType = TagValueType.None; m_XmlAttribute[num2].valueHashCode = 0; m_XmlAttribute[num2].valueStartIndex = 0; m_XmlAttribute[num2].valueLength = 0; break; } } if (num3 == 61) { b = 1; } if (b == 0 && num3 == 32) { if (flag) { return false; } flag = true; b = 2; tagValueType = TagValueType.None; num2++; m_XmlAttribute[num2].nameHashCode = 0; m_XmlAttribute[num2].valueType = TagValueType.None; m_XmlAttribute[num2].valueHashCode = 0; m_XmlAttribute[num2].valueStartIndex = 0; m_XmlAttribute[num2].valueLength = 0; } if (b == 0) { m_XmlAttribute[num2].nameHashCode = ((m_XmlAttribute[num2].nameHashCode << 5) + m_XmlAttribute[num2].nameHashCode) ^ (int)TextUtilities.ToUpperASCIIFast(num3); } if (b == 2 && num3 == 32) { b = 0; } } if (!flag2) { return false; } if (m_TagNoParsing && m_XmlAttribute[0].nameHashCode != -294095813) { return false; } if (m_XmlAttribute[0].nameHashCode == -294095813) { m_TagNoParsing = false; return true; } if (m_RichTextTag[0] == '#' && num == 4) { m_HtmlColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, num); m_ColorStack.Add(m_HtmlColor); return true; } if (m_RichTextTag[0] == '#' && num == 5) { m_HtmlColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, num); m_ColorStack.Add(m_HtmlColor); return true; } if (m_RichTextTag[0] == '#' && num == 7) { m_HtmlColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, num); m_ColorStack.Add(m_HtmlColor); return true; } if (m_RichTextTag[0] == '#' && num == 9) { m_HtmlColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, num); m_ColorStack.Add(m_HtmlColor); return true; } FaceInfo faceInfo; Material material; switch ((MarkupTag)m_XmlAttribute[0].nameHashCode) { case MarkupTag.BOLD: m_FontStyleInternal |= FontStyles.Bold; m_FontStyleStack.Add(FontStyles.Bold); m_FontWeightInternal = TextFontWeight.Bold; return true; case MarkupTag.SLASH_BOLD: if ((generationSettings.fontStyle & FontStyles.Bold) != FontStyles.Bold && m_FontStyleStack.Remove(FontStyles.Bold) == 0) { m_FontStyleInternal &= ~FontStyles.Bold; m_FontWeightInternal = m_FontWeightStack.Peek(); } return true; case MarkupTag.ITALIC: m_FontStyleInternal |= FontStyles.Italic; m_FontStyleStack.Add(FontStyles.Italic); return true; case MarkupTag.SLASH_ITALIC: if ((generationSettings.fontStyle & FontStyles.Italic) != FontStyles.Italic && m_FontStyleStack.Remove(FontStyles.Italic) == 0) { m_FontStyleInternal &= ~FontStyles.Italic; } return true; case MarkupTag.STRIKETHROUGH: m_FontStyleInternal |= FontStyles.Strikethrough; m_FontStyleStack.Add(FontStyles.Strikethrough); if ((long)m_XmlAttribute[1].nameHashCode == 81999901) { m_StrikethroughColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, m_XmlAttribute[1].valueStartIndex, m_XmlAttribute[1].valueLength); m_StrikethroughColor.a = ((m_HtmlColor.a < m_StrikethroughColor.a) ? m_HtmlColor.a : m_StrikethroughColor.a); } else { m_StrikethroughColor = m_HtmlColor; } m_StrikethroughColorStack.Add(m_StrikethroughColor); return true; case MarkupTag.SLASH_STRIKETHROUGH: if ((generationSettings.fontStyle & FontStyles.Strikethrough) != FontStyles.Strikethrough && m_FontStyleStack.Remove(FontStyles.Strikethrough) == 0) { m_FontStyleInternal &= ~FontStyles.Strikethrough; } return true; case MarkupTag.UNDERLINE: m_FontStyleInternal |= FontStyles.Underline; m_FontStyleStack.Add(FontStyles.Underline); if ((long)m_XmlAttribute[1].nameHashCode == 81999901) { m_UnderlineColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, m_XmlAttribute[1].valueStartIndex, m_XmlAttribute[1].valueLength); m_UnderlineColor.a = ((m_HtmlColor.a < m_UnderlineColor.a) ? m_HtmlColor.a : m_UnderlineColor.a); } else { m_UnderlineColor = m_HtmlColor; } m_UnderlineColorStack.Add(m_UnderlineColor); return true; case MarkupTag.SLASH_UNDERLINE: if ((generationSettings.fontStyle & FontStyles.Underline) != FontStyles.Underline) { m_UnderlineColor = m_UnderlineColorStack.Remove(); if (m_FontStyleStack.Remove(FontStyles.Underline) == 0) { m_FontStyleInternal &= ~FontStyles.Underline; } } return true; case MarkupTag.MARK: m_FontStyleInternal |= FontStyles.Highlight; m_FontStyleStack.Add(FontStyles.Highlight); m_HighlightColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); m_HighlightColor.a = ((m_HtmlColor.a < m_HighlightColor.a) ? m_HtmlColor.a : m_HighlightColor.a); m_HighlightColorStack.Add(m_HighlightColor); return true; case MarkupTag.SLASH_MARK: if ((generationSettings.fontStyle & FontStyles.Highlight) != FontStyles.Highlight) { m_HighlightColor = m_HighlightColorStack.Remove(); if (m_FontStyleStack.Remove(FontStyles.Highlight) == 0) { m_FontStyleInternal &= ~FontStyles.Highlight; } } return true; case MarkupTag.SUBSCRIPT: { float fontScaleMultiplier = m_FontScaleMultiplier; faceInfo = m_CurrentFontAsset.faceInfo; float num6; if (!(((FaceInfo)(ref faceInfo)).subscriptSize > 0f)) { num6 = 1f; } else { faceInfo = m_CurrentFontAsset.faceInfo; num6 = ((FaceInfo)(ref faceInfo)).subscriptSize; } m_FontScaleMultiplier = fontScaleMultiplier * num6; m_BaselineOffsetStack.Push(m_BaselineOffset); float baselineOffset = m_BaselineOffset; faceInfo = m_CurrentFontAsset.faceInfo; m_BaselineOffset = baselineOffset + ((FaceInfo)(ref faceInfo)).subscriptOffset * m_FontScale * m_FontScaleMultiplier; m_FontStyleStack.Add(FontStyles.Subscript); m_FontStyleInternal |= FontStyles.Subscript; return true; } case MarkupTag.SLASH_SUBSCRIPT: if ((m_FontStyleInternal & FontStyles.Subscript) == FontStyles.Subscript) { if (m_FontScaleMultiplier < 1f) { m_BaselineOffset = m_BaselineOffsetStack.Pop(); float fontScaleMultiplier3 = m_FontScaleMultiplier; faceInfo = m_CurrentFontAsset.faceInfo; float num12; if (!(((FaceInfo)(ref faceInfo)).subscriptSize > 0f)) { num12 = 1f; } else { faceInfo = m_CurrentFontAsset.faceInfo; num12 = ((FaceInfo)(ref faceInfo)).subscriptSize; } m_FontScaleMultiplier = fontScaleMultiplier3 / num12; } if (m_FontStyleStack.Remove(FontStyles.Subscript) == 0) { m_FontStyleInternal &= ~FontStyles.Subscript; } } return true; case MarkupTag.SUPERSCRIPT: { float fontScaleMultiplier2 = m_FontScaleMultiplier; faceInfo = m_CurrentFontAsset.faceInfo; float num11; if (!(((FaceInfo)(ref faceInfo)).superscriptSize > 0f)) { num11 = 1f; } else { faceInfo = m_CurrentFontAsset.faceInfo; num11 = ((FaceInfo)(ref faceInfo)).superscriptSize; } m_FontScaleMultiplier = fontScaleMultiplier2 * num11; m_BaselineOffsetStack.Push(m_BaselineOffset); float baselineOffset2 = m_BaselineOffset; faceInfo = m_CurrentFontAsset.faceInfo; m_BaselineOffset = baselineOffset2 + ((FaceInfo)(ref faceInfo)).superscriptOffset * m_FontScale * m_FontScaleMultiplier; m_FontStyleStack.Add(FontStyles.Superscript); m_FontStyleInternal |= FontStyles.Superscript; return true; } case MarkupTag.SLASH_SUPERSCRIPT: if ((m_FontStyleInternal & FontStyles.Superscript) == FontStyles.Superscript) { if (m_FontScaleMultiplier < 1f) { m_BaselineOffset = m_BaselineOffsetStack.Pop(); float fontScaleMultiplier4 = m_FontScaleMultiplier; faceInfo = m_CurrentFontAsset.faceInfo; float num13; if (!(((FaceInfo)(ref faceInfo)).superscriptSize > 0f)) { num13 = 1f; } else { faceInfo = m_CurrentFontAsset.faceInfo; num13 = ((FaceInfo)(ref faceInfo)).superscriptSize; } m_FontScaleMultiplier = fontScaleMultiplier4 / num13; } if (m_FontStyleStack.Remove(FontStyles.Superscript) == 0) { m_FontStyleInternal &= ~FontStyles.Superscript; } } return true; case MarkupTag.FONT_WEIGHT: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); switch ((int)num4) { case 100: m_FontWeightInternal = TextFontWeight.Thin; break; case 200: m_FontWeightInternal = TextFontWeight.ExtraLight; break; case 300: m_FontWeightInternal = TextFontWeight.Light; break; case 400: m_FontWeightInternal = TextFontWeight.Regular; break; case 500: m_FontWeightInternal = TextFontWeight.Medium; break; case 600: m_FontWeightInternal = TextFontWeight.SemiBold; break; case 700: m_FontWeightInternal = TextFontWeight.Bold; break; case 800: m_FontWeightInternal = TextFontWeight.Heavy; break; case 900: m_FontWeightInternal = TextFontWeight.Black; break; } m_FontWeightStack.Add(m_FontWeightInternal); return true; } case MarkupTag.SLASH_FONT_WEIGHT: m_FontWeightStack.Remove(); if (m_FontStyleInternal == FontStyles.Bold) { m_FontWeightInternal = TextFontWeight.Bold; } else { m_FontWeightInternal = m_FontWeightStack.Peek(); } return true; case MarkupTag.POSITION: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: m_XAdvance = num4; return true; case TagUnitType.FontUnits: { float num10 = num4 * m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_XAdvance = num10 * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple; return true; } case TagUnitType.Percentage: m_XAdvance = m_MarginWidth * num4 / 100f; return true; default: return false; } } case MarkupTag.SLASH_POSITION: return true; case MarkupTag.VERTICAL_OFFSET: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: m_BaselineOffset = num4; return true; case TagUnitType.FontUnits: { float num7 = num4 * m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_BaselineOffset = num7 * ((FaceInfo)(ref faceInfo)).ascentLine; return true; } case TagUnitType.Percentage: return false; default: return false; } } case MarkupTag.SLASH_VERTICAL_OFFSET: m_BaselineOffset = 0f; return true; case MarkupTag.PAGE: if (generationSettings.overflowMode == TextOverflowMode.Page) { m_XAdvance = 0f + m_TagLineIndent + m_TagIndent; m_LineOffset = 0f; m_PageNumber++; m_IsNewPage = true; } return true; case MarkupTag.NO_BREAK: m_IsNonBreakingSpace = true; return true; case MarkupTag.SLASH_NO_BREAK: m_IsNonBreakingSpace = false; return true; case MarkupTag.SIZE: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: { if (m_RichTextTag[5] == '+') { m_CurrentFontSize = m_FontSize + num4; m_SizeStack.Add(m_CurrentFontSize); float currentFontSize7 = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num19 = currentFontSize7 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num19 * ((FaceInfo)(ref faceInfo)).scale; return true; } if (m_RichTextTag[5] == '-') { m_CurrentFontSize = m_FontSize + num4; m_SizeStack.Add(m_CurrentFontSize); float currentFontSize8 = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num20 = currentFontSize8 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num20 * ((FaceInfo)(ref faceInfo)).scale; return true; } m_CurrentFontSize = num4; m_SizeStack.Add(m_CurrentFontSize); float currentFontSize9 = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num21 = currentFontSize9 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num21 * ((FaceInfo)(ref faceInfo)).scale; return true; } case TagUnitType.FontUnits: { m_CurrentFontSize = m_FontSize * num4; m_SizeStack.Add(m_CurrentFontSize); float currentFontSize6 = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num18 = currentFontSize6 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num18 * ((FaceInfo)(ref faceInfo)).scale; return true; } case TagUnitType.Percentage: { m_CurrentFontSize = m_FontSize * num4 / 100f; m_SizeStack.Add(m_CurrentFontSize); float currentFontSize5 = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num17 = currentFontSize5 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num17 * ((FaceInfo)(ref faceInfo)).scale; return true; } default: return false; } } case MarkupTag.SLASH_SIZE: { m_CurrentFontSize = m_SizeStack.Remove(); float currentFontSize4 = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num15 = currentFontSize4 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num15 * ((FaceInfo)(ref faceInfo)).scale; return true; } case MarkupTag.FONT: { int valueHashCode3 = m_XmlAttribute[0].valueHashCode; int nameHashCode = m_XmlAttribute[1].nameHashCode; int valueHashCode = m_XmlAttribute[1].valueHashCode; if (valueHashCode3 == -620974005) { m_CurrentFontAsset = m_MaterialReferences[0].fontAsset; m_CurrentMaterial = m_MaterialReferences[0].material; m_CurrentMaterialIndex = 0; float currentFontSize2 = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num8 = currentFontSize2 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num8 * ((FaceInfo)(ref faceInfo)).scale; m_MaterialReferenceStack.Add(m_MaterialReferences[0]); return true; } if (!MaterialReferenceManager.TryGetFontAsset(valueHashCode3, out var fontAsset)) { fontAsset = Resources.Load(textSettings.defaultFontAssetPath + new string(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength)); if ((Object)(object)fontAsset == (Object)null) { return false; } MaterialReferenceManager.AddFontAsset(fontAsset); } if (nameHashCode == 0 && valueHashCode == 0) { m_CurrentMaterial = fontAsset.material; m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(m_CurrentMaterial, fontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); m_MaterialReferenceStack.Add(m_MaterialReferences[m_CurrentMaterialIndex]); } else { if ((long)nameHashCode != 825491659) { return false; } if (MaterialReferenceManager.TryGetMaterial(valueHashCode, out material)) { m_CurrentMaterial = material; m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(m_CurrentMaterial, fontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); m_MaterialReferenceStack.Add(m_MaterialReferences[m_CurrentMaterialIndex]); } else { material = Resources.Load(textSettings.defaultFontAssetPath + new string(m_RichTextTag, m_XmlAttribute[1].valueStartIndex, m_XmlAttribute[1].valueLength)); if ((Object)(object)material == (Object)null) { return false; } MaterialReferenceManager.AddFontMaterial(valueHashCode, material); m_CurrentMaterial = material; m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(m_CurrentMaterial, fontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); m_MaterialReferenceStack.Add(m_MaterialReferences[m_CurrentMaterialIndex]); } } m_CurrentFontAsset = fontAsset; float currentFontSize3 = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num9 = currentFontSize3 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num9 * ((FaceInfo)(ref faceInfo)).scale; return true; } case MarkupTag.SLASH_FONT: { MaterialReference materialReference2 = m_MaterialReferenceStack.Remove(); m_CurrentFontAsset = materialReference2.fontAsset; m_CurrentMaterial = materialReference2.material; m_CurrentMaterialIndex = materialReference2.index; float currentFontSize = m_CurrentFontSize; faceInfo = m_CurrentFontAsset.faceInfo; float num5 = currentFontSize / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num5 * ((FaceInfo)(ref faceInfo)).scale; return true; } case MarkupTag.MATERIAL: { int valueHashCode = m_XmlAttribute[0].valueHashCode; if (valueHashCode == -620974005) { m_CurrentMaterial = m_MaterialReferences[0].material; m_CurrentMaterialIndex = 0; m_MaterialReferenceStack.Add(m_MaterialReferences[0]); return true; } if (MaterialReferenceManager.TryGetMaterial(valueHashCode, out material)) { m_CurrentMaterial = material; m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(m_CurrentMaterial, m_CurrentFontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); m_MaterialReferenceStack.Add(m_MaterialReferences[m_CurrentMaterialIndex]); } else { material = Resources.Load(textSettings.defaultFontAssetPath + new string(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength)); if ((Object)(object)material == (Object)null) { return false; } MaterialReferenceManager.AddFontMaterial(valueHashCode, material); m_CurrentMaterial = material; m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(m_CurrentMaterial, m_CurrentFontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); m_MaterialReferenceStack.Add(m_MaterialReferences[m_CurrentMaterialIndex]); } return true; } case MarkupTag.SLASH_MATERIAL: { MaterialReference materialReference = m_MaterialReferenceStack.Remove(); m_CurrentMaterial = materialReference.material; m_CurrentMaterialIndex = materialReference.index; return true; } case MarkupTag.SPACE: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: m_XAdvance += num4; return true; case TagUnitType.FontUnits: { float xAdvance = m_XAdvance; float num16 = num4 * m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_XAdvance = xAdvance + num16 * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple; return true; } case TagUnitType.Percentage: return false; default: return false; } } case MarkupTag.ALPHA: if (m_XmlAttribute[0].valueLength != 3) { return false; } m_HtmlColor.a = (byte)(TextGeneratorUtilities.HexToInt(m_RichTextTag[7]) * 16 + TextGeneratorUtilities.HexToInt(m_RichTextTag[8])); return true; case MarkupTag.A: return false; case MarkupTag.SLASH_A: return true; case MarkupTag.LINK: if (m_IsParsingText && !m_IsCalculatingPreferredValues) { int linkCount = textInfo.linkCount; if (linkCount + 1 > textInfo.linkInfo.Length) { TextInfo.Resize(ref textInfo.linkInfo, linkCount + 1); } textInfo.linkInfo[linkCount].hashCode = m_XmlAttribute[0].valueHashCode; textInfo.linkInfo[linkCount].linkTextfirstCharacterIndex = m_CharacterCount; textInfo.linkInfo[linkCount].linkIdFirstCharacterIndex = startIndex + m_XmlAttribute[0].valueStartIndex; textInfo.linkInfo[linkCount].linkIdLength = m_XmlAttribute[0].valueLength; textInfo.linkInfo[linkCount].SetLinkId(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); } return true; case MarkupTag.SLASH_LINK: if (m_IsParsingText && !m_IsCalculatingPreferredValues && textInfo.linkCount < textInfo.linkInfo.Length) { textInfo.linkInfo[textInfo.linkCount].linkTextLength = m_CharacterCount - textInfo.linkInfo[textInfo.linkCount].linkTextfirstCharacterIndex; textInfo.linkCount++; } return true; case MarkupTag.ALIGN: switch ((MarkupTag)m_XmlAttribute[0].valueHashCode) { case MarkupTag.LEFT: m_LineJustification = TextAlignment.MiddleLeft; m_LineJustificationStack.Add(m_LineJustification); return true; case MarkupTag.RIGHT: m_LineJustification = TextAlignment.MiddleRight; m_LineJustificationStack.Add(m_LineJustification); return true; case MarkupTag.CENTER: m_LineJustification = TextAlignment.MiddleCenter; m_LineJustificationStack.Add(m_LineJustification); return true; case MarkupTag.JUSTIFIED: m_LineJustification = TextAlignment.MiddleJustified; m_LineJustificationStack.Add(m_LineJustification); return true; case MarkupTag.FLUSH: m_LineJustification = TextAlignment.MiddleFlush; m_LineJustificationStack.Add(m_LineJustification); return true; default: return false; } case MarkupTag.SLASH_ALIGN: m_LineJustification = m_LineJustificationStack.Remove(); return true; case MarkupTag.WIDTH: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: m_Width = num4; break; case TagUnitType.FontUnits: return false; case TagUnitType.Percentage: m_Width = m_MarginWidth * num4 / 100f; break; } return true; } case MarkupTag.SLASH_WIDTH: m_Width = -1f; return true; case MarkupTag.COLOR: if (m_RichTextTag[6] == '#' && num == 10) { m_HtmlColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, num); m_ColorStack.Add(m_HtmlColor); return true; } if (m_RichTextTag[6] == '#' && num == 11) { m_HtmlColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, num); m_ColorStack.Add(m_HtmlColor); return true; } if (m_RichTextTag[6] == '#' && num == 13) { m_HtmlColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, num); m_ColorStack.Add(m_HtmlColor); return true; } if (m_RichTextTag[6] == '#' && num == 15) { m_HtmlColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, num); m_ColorStack.Add(m_HtmlColor); return true; } switch ((MarkupTag)m_XmlAttribute[0].valueHashCode) { case MarkupTag.RED: m_HtmlColor = Color32.op_Implicit(Color.red); m_ColorStack.Add(m_HtmlColor); return true; case MarkupTag.BLUE: m_HtmlColor = Color32.op_Implicit(Color.blue); m_ColorStack.Add(m_HtmlColor); return true; case MarkupTag.BLACK: m_HtmlColor = Color32.op_Implicit(Color.black); m_ColorStack.Add(m_HtmlColor); return true; case MarkupTag.GREEN: m_HtmlColor = Color32.op_Implicit(Color.green); m_ColorStack.Add(m_HtmlColor); return true; case MarkupTag.WHITE: m_HtmlColor = Color32.op_Implicit(Color.white); m_ColorStack.Add(m_HtmlColor); return true; case MarkupTag.ORANGE: m_HtmlColor = new Color32(byte.MaxValue, (byte)128, (byte)0, byte.MaxValue); m_ColorStack.Add(m_HtmlColor); return true; case MarkupTag.PURPLE: m_HtmlColor = new Color32((byte)160, (byte)32, (byte)240, byte.MaxValue); m_ColorStack.Add(m_HtmlColor); return true; case MarkupTag.YELLOW: m_HtmlColor = Color32.op_Implicit(Color.yellow); m_ColorStack.Add(m_HtmlColor); return true; default: return false; } case MarkupTag.SLASH_COLOR: m_HtmlColor = m_ColorStack.Remove(); return true; case MarkupTag.GRADIENT: { int valueHashCode5 = m_XmlAttribute[0].valueHashCode; if (MaterialReferenceManager.TryGetColorGradientPreset(valueHashCode5, out var gradientPreset)) { m_ColorGradientPreset = gradientPreset; } else { if ((Object)(object)gradientPreset == (Object)null) { gradientPreset = Resources.Load(textSettings.defaultColorGradientPresetsPath + new string(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength)); } if ((Object)(object)gradientPreset == (Object)null) { return false; } MaterialReferenceManager.AddColorGradientPreset(valueHashCode5, gradientPreset); m_ColorGradientPreset = gradientPreset; } m_ColorGradientStack.Add(m_ColorGradientPreset); return true; } case MarkupTag.SLASH_GRADIENT: m_ColorGradientPreset = m_ColorGradientStack.Remove(); return true; case MarkupTag.CHARACTER_SPACE: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: m_CSpacing = num4; break; case TagUnitType.FontUnits: { m_CSpacing = num4; float cSpacing = m_CSpacing; float fontScale7 = m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_CSpacing = cSpacing * (fontScale7 * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple); break; } case TagUnitType.Percentage: return false; } return true; } case MarkupTag.SLASH_CHARACTER_SPACE: if (!m_IsParsingText) { return true; } if (m_CharacterCount > 0) { m_XAdvance -= m_CSpacing; textInfo.textElementInfo[m_CharacterCount - 1].xAdvance = m_XAdvance; } m_CSpacing = 0f; return true; case MarkupTag.MONOSPACE: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: m_MonoSpacing = num4; break; case TagUnitType.FontUnits: { m_MonoSpacing = num4; float monoSpacing = m_MonoSpacing; float fontScale6 = m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_MonoSpacing = monoSpacing * (fontScale6 * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple); break; } case TagUnitType.Percentage: return false; } return true; } case MarkupTag.SLASH_MONOSPACE: m_MonoSpacing = 0f; return true; case MarkupTag.CLASS: return false; case MarkupTag.INDENT: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: m_TagIndent = num4; break; case TagUnitType.FontUnits: { m_TagIndent = num4; float tagIndent = m_TagIndent; float fontScale4 = m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_TagIndent = tagIndent * (fontScale4 * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple); break; } case TagUnitType.Percentage: m_TagIndent = m_MarginWidth * num4 / 100f; break; } m_IndentStack.Add(m_TagIndent); m_XAdvance = m_TagIndent; return true; } case MarkupTag.SLASH_INDENT: m_TagIndent = m_IndentStack.Remove(); return true; case MarkupTag.LINE_INDENT: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } switch (tagUnitType) { case TagUnitType.Pixels: m_TagLineIndent = num4; break; case TagUnitType.FontUnits: { m_TagLineIndent = num4; float tagLineIndent = m_TagLineIndent; float fontScale3 = m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_TagLineIndent = tagLineIndent * (fontScale3 * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple); break; } case TagUnitType.Percentage: m_TagLineIndent = m_MarginWidth * num4 / 100f; break; } m_XAdvance += m_TagLineIndent; return true; } case MarkupTag.SLASH_LINE_INDENT: m_TagLineIndent = 0f; return true; case MarkupTag.SPRITE: { int valueHashCode4 = m_XmlAttribute[0].valueHashCode; m_SpriteIndex = -1; SpriteAsset spriteAsset; if (m_XmlAttribute[0].valueType == TagValueType.None || m_XmlAttribute[0].valueType == TagValueType.NumericalValue) { if ((Object)(object)generationSettings.spriteAsset != (Object)null) { m_CurrentSpriteAsset = generationSettings.spriteAsset; } else if ((Object)(object)m_DefaultSpriteAsset != (Object)null) { m_CurrentSpriteAsset = m_DefaultSpriteAsset; } else if ((Object)(object)m_DefaultSpriteAsset == (Object)null) { if ((Object)(object)textSettings.defaultSpriteAsset != (Object)null) { m_DefaultSpriteAsset = textSettings.defaultSpriteAsset; } else { m_DefaultSpriteAsset = Resources.Load("Sprite Assets/Default Sprite Asset"); } m_CurrentSpriteAsset = m_DefaultSpriteAsset; } if ((Object)(object)m_CurrentSpriteAsset == (Object)null) { return false; } } else if (MaterialReferenceManager.TryGetSpriteAsset(valueHashCode4, out spriteAsset)) { m_CurrentSpriteAsset = spriteAsset; } else { if ((Object)(object)spriteAsset == (Object)null) { spriteAsset = Resources.Load(textSettings.defaultSpriteAssetPath + new string(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength)); } if ((Object)(object)spriteAsset == (Object)null) { return false; } MaterialReferenceManager.AddSpriteAsset(valueHashCode4, spriteAsset); m_CurrentSpriteAsset = spriteAsset; } if (m_XmlAttribute[0].valueType == TagValueType.NumericalValue) { int num14 = (int)TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if ((float)num14 == -32767f) { return false; } if (num14 > m_CurrentSpriteAsset.spriteCharacterTable.Count - 1) { return false; } m_SpriteIndex = num14; } m_SpriteColor = Color32.op_Implicit(Color.white); m_TintSprite = false; for (int j = 0; j < m_XmlAttribute.Length && m_XmlAttribute[j].nameHashCode != 0; j++) { int nameHashCode2 = m_XmlAttribute[j].nameHashCode; int spriteIndex; switch ((MarkupTag)nameHashCode2) { case MarkupTag.NAME: m_CurrentSpriteAsset = SpriteAsset.SearchForSpriteByHashCode(m_CurrentSpriteAsset, m_XmlAttribute[j].valueHashCode, includeFallbacks: true, out spriteIndex); if (spriteIndex == -1) { return false; } m_SpriteIndex = spriteIndex; break; case MarkupTag.INDEX: spriteIndex = (int)TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[1].valueStartIndex, m_XmlAttribute[1].valueLength); if ((float)spriteIndex == -32767f) { return false; } if (spriteIndex > m_CurrentSpriteAsset.spriteCharacterTable.Count - 1) { return false; } m_SpriteIndex = spriteIndex; break; case MarkupTag.TINT: m_TintSprite = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[j].valueStartIndex, m_XmlAttribute[j].valueLength) != 0f; break; case MarkupTag.COLOR: m_SpriteColor = TextGeneratorUtilities.HexCharsToColor(m_RichTextTag, m_XmlAttribute[j].valueStartIndex, m_XmlAttribute[j].valueLength); break; case MarkupTag.ANIM: Debug.LogWarning((object)"Sprite animations are not currently supported in TextCore"); break; default: if (nameHashCode2 != -991527447) { return false; } break; } } if (m_SpriteIndex == -1) { return false; } m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(m_CurrentSpriteAsset.material, m_CurrentSpriteAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); m_TextElementType = TextElementType.Sprite; return true; } case MarkupTag.LOWERCASE: m_FontStyleInternal |= FontStyles.LowerCase; m_FontStyleStack.Add(FontStyles.LowerCase); return true; case MarkupTag.SLASH_LOWERCASE: if ((generationSettings.fontStyle & FontStyles.LowerCase) != FontStyles.LowerCase && m_FontStyleStack.Remove(FontStyles.LowerCase) == 0) { m_FontStyleInternal &= ~FontStyles.LowerCase; } return true; case MarkupTag.UPPERCASE: case MarkupTag.ALLCAPS: m_FontStyleInternal |= FontStyles.UpperCase; m_FontStyleStack.Add(FontStyles.UpperCase); return true; case MarkupTag.SLASH_ALLCAPS: case MarkupTag.SLASH_UPPERCASE: if ((generationSettings.fontStyle & FontStyles.UpperCase) != FontStyles.UpperCase && m_FontStyleStack.Remove(FontStyles.UpperCase) == 0) { m_FontStyleInternal &= ~FontStyles.UpperCase; } return true; case MarkupTag.SMALLCAPS: m_FontStyleInternal |= FontStyles.SmallCaps; m_FontStyleStack.Add(FontStyles.SmallCaps); return true; case MarkupTag.SLASH_SMALLCAPS: if ((generationSettings.fontStyle & FontStyles.SmallCaps) != FontStyles.SmallCaps && m_FontStyleStack.Remove(FontStyles.SmallCaps) == 0) { m_FontStyleInternal &= ~FontStyles.SmallCaps; } return true; case MarkupTag.MARGIN: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } m_MarginLeft = num4; switch (tagUnitType) { case TagUnitType.FontUnits: { float marginLeft2 = m_MarginLeft; float fontScale5 = m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_MarginLeft = marginLeft2 * (fontScale5 * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple); break; } case TagUnitType.Percentage: m_MarginLeft = (m_MarginWidth - ((m_Width != -1f) ? m_Width : 0f)) * m_MarginLeft / 100f; break; } m_MarginLeft = ((m_MarginLeft >= 0f) ? m_MarginLeft : 0f); m_MarginRight = m_MarginLeft; return true; } case MarkupTag.SLASH_MARGIN: m_MarginLeft = 0f; m_MarginRight = 0f; return true; case MarkupTag.MARGIN_LEFT: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } m_MarginLeft = num4; switch (tagUnitType) { case TagUnitType.FontUnits: { float marginLeft = m_MarginLeft; float fontScale2 = m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_MarginLeft = marginLeft * (fontScale2 * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple); break; } case TagUnitType.Percentage: m_MarginLeft = (m_MarginWidth - ((m_Width != -1f) ? m_Width : 0f)) * m_MarginLeft / 100f; break; } m_MarginLeft = ((m_MarginLeft >= 0f) ? m_MarginLeft : 0f); return true; } case MarkupTag.MARGIN_RIGHT: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } m_MarginRight = num4; switch (tagUnitType) { case TagUnitType.FontUnits: { float marginRight = m_MarginRight; float fontScale = m_FontScale; faceInfo = generationSettings.fontAsset.faceInfo; m_MarginRight = marginRight * (fontScale * ((FaceInfo)(ref faceInfo)).tabWidth / (float)(int)generationSettings.fontAsset.tabMultiple); break; } case TagUnitType.Percentage: m_MarginRight = (m_MarginWidth - ((m_Width != -1f) ? m_Width : 0f)) * m_MarginRight / 100f; break; } m_MarginRight = ((m_MarginRight >= 0f) ? m_MarginRight : 0f); return true; } case MarkupTag.LINE_HEIGHT: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f || num4 == 0f) { return false; } m_LineHeight = num4; switch (tagUnitType) { case TagUnitType.FontUnits: { float lineHeight = m_LineHeight; faceInfo = generationSettings.fontAsset.faceInfo; m_LineHeight = lineHeight * (((FaceInfo)(ref faceInfo)).lineHeight * m_FontScale); break; } case TagUnitType.Percentage: faceInfo = generationSettings.fontAsset.faceInfo; m_LineHeight = ((FaceInfo)(ref faceInfo)).lineHeight * m_LineHeight / 100f * m_FontScale; break; } return true; } case MarkupTag.SLASH_LINE_HEIGHT: m_LineHeight = -32767f; return true; case MarkupTag.NO_PARSE: m_TagNoParsing = true; return true; case MarkupTag.ACTION: { int valueHashCode2 = m_XmlAttribute[0].valueHashCode; if (m_IsParsingText) { m_ActionStack.Add(valueHashCode2); } return false; } case MarkupTag.SLASH_ACTION: m_ActionStack.Remove(); return false; case MarkupTag.SCALE: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } m_FxMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(num4, 1f, 1f)); m_IsFxMatrixSet = true; return true; } case MarkupTag.SLASH_SCALE: m_IsFxMatrixSet = false; return true; case MarkupTag.ROTATE: { float num4 = TextGeneratorUtilities.ConvertToFloat(m_RichTextTag, m_XmlAttribute[0].valueStartIndex, m_XmlAttribute[0].valueLength); if (num4 == -32767f) { return false; } m_FxMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0f, 0f, num4), Vector3.one); m_IsFxMatrixSet = true; return true; } case MarkupTag.SLASH_ROTATE: m_IsFxMatrixSet = false; return true; default: return false; } } private void SaveGlyphVertexInfo(float padding, float stylePadding, Color32 vertexColor, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.position = textInfo.textElementInfo[m_CharacterCount].bottomLeft; textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.position = textInfo.textElementInfo[m_CharacterCount].topLeft; textInfo.textElementInfo[m_CharacterCount].vertexTopRight.position = textInfo.textElementInfo[m_CharacterCount].topRight; textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.position = textInfo.textElementInfo[m_CharacterCount].bottomRight; vertexColor.a = ((m_FontColor32.a < vertexColor.a) ? m_FontColor32.a : vertexColor.a); if ((Object)(object)generationSettings.fontColorGradient == (Object)null) { textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.color = vertexColor; textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.color = vertexColor; textInfo.textElementInfo[m_CharacterCount].vertexTopRight.color = vertexColor; textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.color = vertexColor; } else if (!generationSettings.overrideRichTextColors && m_ColorStack.index > 1) { textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.color = vertexColor; textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.color = vertexColor; textInfo.textElementInfo[m_CharacterCount].vertexTopRight.color = vertexColor; textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.color = vertexColor; } else { textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.color = Color32.op_Implicit(generationSettings.fontColorGradient.bottomLeft * Color32.op_Implicit(vertexColor)); textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.color = Color32.op_Implicit(generationSettings.fontColorGradient.topLeft * Color32.op_Implicit(vertexColor)); textInfo.textElementInfo[m_CharacterCount].vertexTopRight.color = Color32.op_Implicit(generationSettings.fontColorGradient.topRight * Color32.op_Implicit(vertexColor)); textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.color = Color32.op_Implicit(generationSettings.fontColorGradient.bottomRight * Color32.op_Implicit(vertexColor)); } if ((Object)(object)m_ColorGradientPreset != (Object)null) { ref Color32 color = ref textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.color; color = Color32.op_Implicit(Color32.op_Implicit(color) * m_ColorGradientPreset.bottomLeft); ref Color32 color2 = ref textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.color; color2 = Color32.op_Implicit(Color32.op_Implicit(color2) * m_ColorGradientPreset.topLeft); ref Color32 color3 = ref textInfo.textElementInfo[m_CharacterCount].vertexTopRight.color; color3 = Color32.op_Implicit(Color32.op_Implicit(color3) * m_ColorGradientPreset.topRight); ref Color32 color4 = ref textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.color; color4 = Color32.op_Implicit(Color32.op_Implicit(color4) * m_ColorGradientPreset.bottomRight); } if (!m_IsSdfShader) { stylePadding = 0f; } GlyphRect glyphRect = m_CachedTextElement.glyph.glyphRect; Vector2 val = default(Vector2); val.x = ((float)((GlyphRect)(ref glyphRect)).x - padding - stylePadding) / (float)m_CurrentFontAsset.atlasWidth; glyphRect = m_CachedTextElement.glyph.glyphRect; val.y = ((float)((GlyphRect)(ref glyphRect)).y - padding - stylePadding) / (float)m_CurrentFontAsset.atlasHeight; Vector2 val2 = default(Vector2); val2.x = val.x; glyphRect = m_CachedTextElement.glyph.glyphRect; float num = (float)((GlyphRect)(ref glyphRect)).y + padding + stylePadding; glyphRect = m_CachedTextElement.glyph.glyphRect; val2.y = (num + (float)((GlyphRect)(ref glyphRect)).height) / (float)m_CurrentFontAsset.atlasHeight; glyphRect = m_CachedTextElement.glyph.glyphRect; float num2 = (float)((GlyphRect)(ref glyphRect)).x + padding + stylePadding; glyphRect = m_CachedTextElement.glyph.glyphRect; Vector2 val3 = default(Vector2); val3.x = (num2 + (float)((GlyphRect)(ref glyphRect)).width) / (float)m_CurrentFontAsset.atlasWidth; val3.y = val2.y; Vector2 uv = default(Vector2); uv.x = val3.x; uv.y = val.y; textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.uv = val; textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.uv = val2; textInfo.textElementInfo[m_CharacterCount].vertexTopRight.uv = val3; textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.uv = uv; } private void SaveSpriteVertexInfo(Color32 vertexColor, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.position = textInfo.textElementInfo[m_CharacterCount].bottomLeft; textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.position = textInfo.textElementInfo[m_CharacterCount].topLeft; textInfo.textElementInfo[m_CharacterCount].vertexTopRight.position = textInfo.textElementInfo[m_CharacterCount].topRight; textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.position = textInfo.textElementInfo[m_CharacterCount].bottomRight; if (generationSettings.tintSprites) { m_TintSprite = true; } Color32 val = (m_TintSprite ? ColorUtilities.MultiplyColors(m_SpriteColor, vertexColor) : m_SpriteColor); val.a = ((val.a < m_FontColor32.a) ? (val.a = ((val.a < vertexColor.a) ? val.a : vertexColor.a)) : m_FontColor32.a); Color32 val2 = val; Color32 val3 = val; Color32 val4 = val; Color32 val5 = val; if ((Object)(object)generationSettings.fontColorGradient != (Object)null) { val2 = (m_TintSprite ? ColorUtilities.MultiplyColors(val2, Color32.op_Implicit(generationSettings.fontColorGradient.bottomLeft)) : val2); val3 = (m_TintSprite ? ColorUtilities.MultiplyColors(val3, Color32.op_Implicit(generationSettings.fontColorGradient.topLeft)) : val3); val4 = (m_TintSprite ? ColorUtilities.MultiplyColors(val4, Color32.op_Implicit(generationSettings.fontColorGradient.topRight)) : val4); val5 = (m_TintSprite ? ColorUtilities.MultiplyColors(val5, Color32.op_Implicit(generationSettings.fontColorGradient.bottomRight)) : val5); } if ((Object)(object)m_ColorGradientPreset != (Object)null) { val2 = (m_TintSprite ? ColorUtilities.MultiplyColors(val2, Color32.op_Implicit(m_ColorGradientPreset.bottomLeft)) : val2); val3 = (m_TintSprite ? ColorUtilities.MultiplyColors(val3, Color32.op_Implicit(m_ColorGradientPreset.topLeft)) : val3); val4 = (m_TintSprite ? ColorUtilities.MultiplyColors(val4, Color32.op_Implicit(m_ColorGradientPreset.topRight)) : val4); val5 = (m_TintSprite ? ColorUtilities.MultiplyColors(val5, Color32.op_Implicit(m_ColorGradientPreset.bottomRight)) : val5); } textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.color = val2; textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.color = val3; textInfo.textElementInfo[m_CharacterCount].vertexTopRight.color = val4; textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.color = val5; GlyphRect glyphRect = m_CachedTextElement.glyph.glyphRect; float num = (float)((GlyphRect)(ref glyphRect)).x / (float)m_CurrentSpriteAsset.spriteSheet.width; glyphRect = m_CachedTextElement.glyph.glyphRect; Vector2 val6 = default(Vector2); ((Vector2)(ref val6))..ctor(num, (float)((GlyphRect)(ref glyphRect)).y / (float)m_CurrentSpriteAsset.spriteSheet.height); float x = val6.x; glyphRect = m_CachedTextElement.glyph.glyphRect; int y = ((GlyphRect)(ref glyphRect)).y; glyphRect = m_CachedTextElement.glyph.glyphRect; Vector2 val7 = default(Vector2); ((Vector2)(ref val7))..ctor(x, (float)(y + ((GlyphRect)(ref glyphRect)).height) / (float)m_CurrentSpriteAsset.spriteSheet.height); glyphRect = m_CachedTextElement.glyph.glyphRect; int x2 = ((GlyphRect)(ref glyphRect)).x; glyphRect = m_CachedTextElement.glyph.glyphRect; Vector2 val8 = default(Vector2); ((Vector2)(ref val8))..ctor((float)(x2 + ((GlyphRect)(ref glyphRect)).width) / (float)m_CurrentSpriteAsset.spriteSheet.width, val7.y); Vector2 uv = default(Vector2); ((Vector2)(ref uv))..ctor(val8.x, val6.y); textInfo.textElementInfo[m_CharacterCount].vertexBottomLeft.uv = val6; textInfo.textElementInfo[m_CharacterCount].vertexTopLeft.uv = val7; textInfo.textElementInfo[m_CharacterCount].vertexTopRight.uv = val8; textInfo.textElementInfo[m_CharacterCount].vertexBottomRight.uv = uv; } private void DrawUnderlineMesh(Vector3 start, Vector3 end, ref int index, float startScale, float endScale, float maxScale, float sdfScale, Color32 underlineColor, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06c6: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Unknown result type (might be due to invalid IL or missing references) //IL_0714: Unknown result type (might be due to invalid IL or missing references) //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_076c: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_07a3: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07c4: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Unknown result type (might be due to invalid IL or missing references) //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_081d: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_0889: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_08a2: Unknown result type (might be due to invalid IL or missing references) //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Unknown result type (might be due to invalid IL or missing references) //IL_08c3: Unknown result type (might be due to invalid IL or missing references) //IL_08c9: Unknown result type (might be due to invalid IL or missing references) //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Unknown result type (might be due to invalid IL or missing references) //IL_08f0: Unknown result type (might be due to invalid IL or missing references) //IL_0909: Unknown result type (might be due to invalid IL or missing references) //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_0922: Unknown result type (might be due to invalid IL or missing references) //IL_0927: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0954: Unknown result type (might be due to invalid IL or missing references) //IL_0959: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_0975: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_09ae: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09e8: Unknown result type (might be due to invalid IL or missing references) //IL_09ed: Unknown result type (might be due to invalid IL or missing references) //IL_09ff: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_0a08: Unknown result type (might be due to invalid IL or missing references) //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a3b: Unknown result type (might be due to invalid IL or missing references) //IL_0a46: Unknown result type (might be due to invalid IL or missing references) //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a55: Unknown result type (might be due to invalid IL or missing references) //IL_0a60: Unknown result type (might be due to invalid IL or missing references) //IL_0a62: Unknown result type (might be due to invalid IL or missing references) //IL_0a6d: Unknown result type (might be due to invalid IL or missing references) //IL_0a6f: Unknown result type (might be due to invalid IL or missing references) //IL_0a7a: Unknown result type (might be due to invalid IL or missing references) //IL_0a7c: Unknown result type (might be due to invalid IL or missing references) //IL_0a87: Unknown result type (might be due to invalid IL or missing references) //IL_0a89: Unknown result type (might be due to invalid IL or missing references) //IL_0a94: Unknown result type (might be due to invalid IL or missing references) //IL_0a96: Unknown result type (might be due to invalid IL or missing references) //IL_0aa1: Unknown result type (might be due to invalid IL or missing references) //IL_0aa3: Unknown result type (might be due to invalid IL or missing references) //IL_0aaf: Unknown result type (might be due to invalid IL or missing references) //IL_0ab1: Unknown result type (might be due to invalid IL or missing references) //IL_0abd: Unknown result type (might be due to invalid IL or missing references) //IL_0abf: Unknown result type (might be due to invalid IL or missing references) //IL_0acb: Unknown result type (might be due to invalid IL or missing references) //IL_0acd: Unknown result type (might be due to invalid IL or missing references) TextSettings textSettings = generationSettings.textSettings; GetUnderlineSpecialCharacter(generationSettings); if (m_Underline.character == null) { if (textSettings.displayWarnings) { Debug.LogWarning((object)"Unable to add underline since the primary Font Asset doesn't contain the underline character."); } return; } int materialIndex = m_Underline.materialIndex; int num = index + 12; if (num > textInfo.meshInfo[materialIndex].vertices.Length) { textInfo.meshInfo[materialIndex].ResizeMeshInfo(num / 4); } start.y = Mathf.Min(start.y, end.y); end.y = Mathf.Min(start.y, end.y); GlyphMetrics metrics = m_Underline.character.glyph.metrics; GlyphRect glyphRect = m_Underline.character.glyph.glyphRect; float num2 = ((GlyphMetrics)(ref metrics)).width / 2f * maxScale; if (end.x - start.x < ((GlyphMetrics)(ref metrics)).width * maxScale) { num2 = (end.x - start.x) / 2f; } float num3 = m_Padding * startScale / maxScale; float num4 = m_Padding * endScale / maxScale; FaceInfo faceInfo = m_Underline.fontAsset.faceInfo; float underlineThickness = ((FaceInfo)(ref faceInfo)).underlineThickness; Vector3[] vertices = textInfo.meshInfo[0].vertices; vertices[index] = start + new Vector3(0f, 0f - (underlineThickness + m_Padding) * maxScale, 0f); vertices[index + 1] = start + new Vector3(0f, m_Padding * maxScale, 0f); vertices[index + 2] = vertices[index + 1] + new Vector3(num2, 0f, 0f); vertices[index + 3] = vertices[index] + new Vector3(num2, 0f, 0f); vertices[index + 4] = vertices[index + 3]; vertices[index + 5] = vertices[index + 2]; vertices[index + 6] = end + new Vector3(0f - num2, m_Padding * maxScale, 0f); vertices[index + 7] = end + new Vector3(0f - num2, (0f - (underlineThickness + m_Padding)) * maxScale, 0f); vertices[index + 8] = vertices[index + 7]; vertices[index + 9] = vertices[index + 6]; vertices[index + 10] = end + new Vector3(0f, m_Padding * maxScale, 0f); vertices[index + 11] = end + new Vector3(0f, (0f - (underlineThickness + m_Padding)) * maxScale, 0f); if (generationSettings.inverseYAxis) { Vector3 val = default(Vector3); val.x = 0f; val.y = ((Rect)(ref generationSettings.screenRect)).y + ((Rect)(ref generationSettings.screenRect)).height; val.z = 0f; vertices[index].y = vertices[index].y * -1f + val.y; vertices[index + 1].y = vertices[index + 1].y * -1f + val.y; vertices[index + 2].y = vertices[index + 2].y * -1f + val.y; vertices[index + 3].y = vertices[index + 3].y * -1f + val.y; vertices[index + 4].y = vertices[index + 4].y * -1f + val.y; vertices[index + 5].y = vertices[index + 5].y * -1f + val.y; vertices[index + 6].y = vertices[index + 6].y * -1f + val.y; vertices[index + 7].y = vertices[index + 7].y * -1f + val.y; vertices[index + 8].y = vertices[index + 8].y * -1f + val.y; vertices[index + 9].y = vertices[index + 9].y * -1f + val.y; vertices[index + 10].y = vertices[index + 10].y * -1f + val.y; vertices[index + 11].y = vertices[index + 11].y * -1f + val.y; } Vector2[] uvs = textInfo.meshInfo[materialIndex].uvs0; int atlasWidth = m_Underline.fontAsset.atlasWidth; int atlasHeight = m_Underline.fontAsset.atlasHeight; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((float)((GlyphRect)(ref glyphRect)).x - num3) / (float)atlasWidth, ((float)((GlyphRect)(ref glyphRect)).y - m_Padding) / (float)atlasHeight); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(val2.x, ((float)(((GlyphRect)(ref glyphRect)).y + ((GlyphRect)(ref glyphRect)).height) + m_Padding) / (float)atlasHeight); Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(((float)((GlyphRect)(ref glyphRect)).x - num3 + (float)((GlyphRect)(ref glyphRect)).width / 2f) / (float)atlasWidth, val3.y); Vector2 val5 = default(Vector2); ((Vector2)(ref val5))..ctor(val4.x, val2.y); Vector2 val6 = default(Vector2); ((Vector2)(ref val6))..ctor(((float)((GlyphRect)(ref glyphRect)).x + num4 + (float)((GlyphRect)(ref glyphRect)).width / 2f) / (float)atlasWidth, val3.y); Vector2 val7 = default(Vector2); ((Vector2)(ref val7))..ctor(val6.x, val2.y); Vector2 val8 = default(Vector2); ((Vector2)(ref val8))..ctor(((float)((GlyphRect)(ref glyphRect)).x + num4 + (float)((GlyphRect)(ref glyphRect)).width) / (float)atlasWidth, val3.y); Vector2 val9 = default(Vector2); ((Vector2)(ref val9))..ctor(val8.x, val2.y); uvs[index] = val2; uvs[1 + index] = val3; uvs[2 + index] = val4; uvs[3 + index] = val5; uvs[4 + index] = new Vector2(val4.x - val4.x * 0.001f, val2.y); uvs[5 + index] = new Vector2(val4.x - val4.x * 0.001f, val3.y); uvs[6 + index] = new Vector2(val4.x + val4.x * 0.001f, val3.y); uvs[7 + index] = new Vector2(val4.x + val4.x * 0.001f, val2.y); uvs[8 + index] = val7; uvs[9 + index] = val6; uvs[10 + index] = val8; uvs[11 + index] = val9; float x = (vertices[index + 2].x - start.x) / (end.x - start.x); float scale = Mathf.Abs(sdfScale); Vector2[] uvs2 = textInfo.meshInfo[materialIndex].uvs2; uvs2[index] = TextGeneratorUtilities.PackUV(0f, 0f, scale); uvs2[1 + index] = TextGeneratorUtilities.PackUV(0f, 1f, scale); uvs2[2 + index] = TextGeneratorUtilities.PackUV(x, 1f, scale); uvs2[3 + index] = TextGeneratorUtilities.PackUV(x, 0f, scale); float x2 = (vertices[index + 4].x - start.x) / (end.x - start.x); x = (vertices[index + 6].x - start.x) / (end.x - start.x); uvs2[4 + index] = TextGeneratorUtilities.PackUV(x2, 0f, scale); uvs2[5 + index] = TextGeneratorUtilities.PackUV(x2, 1f, scale); uvs2[6 + index] = TextGeneratorUtilities.PackUV(x, 1f, scale); uvs2[7 + index] = TextGeneratorUtilities.PackUV(x, 0f, scale); x2 = (vertices[index + 8].x - start.x) / (end.x - start.x); uvs2[8 + index] = TextGeneratorUtilities.PackUV(x2, 0f, scale); uvs2[9 + index] = TextGeneratorUtilities.PackUV(x2, 1f, scale); uvs2[10 + index] = TextGeneratorUtilities.PackUV(1f, 1f, scale); uvs2[11 + index] = TextGeneratorUtilities.PackUV(1f, 0f, scale); underlineColor.a = ((m_FontColor32.a < underlineColor.a) ? m_FontColor32.a : underlineColor.a); Color32[] colors = textInfo.meshInfo[materialIndex].colors32; colors[index] = underlineColor; colors[1 + index] = underlineColor; colors[2 + index] = underlineColor; colors[3 + index] = underlineColor; colors[4 + index] = underlineColor; colors[5 + index] = underlineColor; colors[6 + index] = underlineColor; colors[7 + index] = underlineColor; colors[8 + index] = underlineColor; colors[9 + index] = underlineColor; colors[10 + index] = underlineColor; colors[11 + index] = underlineColor; index += 12; } private void DrawTextHighlight(Vector3 start, Vector3 end, ref int index, Color32 highlightColor, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) TextSettings textSettings = generationSettings.textSettings; if (m_Underline.character == null) { GetUnderlineSpecialCharacter(generationSettings); if (m_Underline.character == null) { if (textSettings.displayWarnings) { Debug.LogWarning((object)"Unable to add highlight since the primary Font Asset doesn't contain the underline character."); } return; } } int materialIndex = m_Underline.materialIndex; int num = index + 4; if (num > textInfo.meshInfo[materialIndex].vertices.Length) { textInfo.meshInfo[materialIndex].ResizeMeshInfo(num / 4); } Vector3[] vertices = textInfo.meshInfo[materialIndex].vertices; vertices[index] = start; vertices[index + 1] = new Vector3(start.x, end.y, 0f); vertices[index + 2] = end; vertices[index + 3] = new Vector3(end.x, start.y, 0f); if (generationSettings.inverseYAxis) { Vector3 val = default(Vector3); val.x = 0f; val.y = ((Rect)(ref generationSettings.screenRect)).y + ((Rect)(ref generationSettings.screenRect)).height; val.z = 0f; vertices[index].y = vertices[index].y * -1f + val.y; vertices[index + 1].y = vertices[index + 1].y * -1f + val.y; vertices[index + 2].y = vertices[index + 2].y * -1f + val.y; vertices[index + 3].y = vertices[index + 3].y * -1f + val.y; } Vector2[] uvs = textInfo.meshInfo[materialIndex].uvs0; int atlasWidth = m_Underline.fontAsset.atlasWidth; int atlasHeight = m_Underline.fontAsset.atlasHeight; GlyphRect glyphRect = m_Underline.character.glyph.glyphRect; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((float)((GlyphRect)(ref glyphRect)).x + (float)(((GlyphRect)(ref glyphRect)).width / 2)) / (float)atlasWidth, ((float)((GlyphRect)(ref glyphRect)).y + (float)((GlyphRect)(ref glyphRect)).height / 2f) / (float)atlasHeight); uvs[index] = val2 + new Vector2(-0.0001f, -0.0001f); uvs[1 + index] = val2 + new Vector2(-0.0001f, 0.0001f); uvs[2 + index] = val2 + new Vector2(0.0001f, 0.0001f); uvs[3 + index] = val2 + new Vector2(0.0001f, -0.0001f); Vector2[] uvs2 = textInfo.meshInfo[materialIndex].uvs2; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 1f); uvs2[index] = val3; uvs2[1 + index] = val3; uvs2[2 + index] = val3; uvs2[3 + index] = val3; highlightColor.a = ((m_FontColor32.a < highlightColor.a) ? m_FontColor32.a : highlightColor.a); Color32[] colors = textInfo.meshInfo[materialIndex].colors32; colors[index] = highlightColor; colors[1 + index] = highlightColor; colors[2 + index] = highlightColor; colors[3 + index] = highlightColor; index += 4; } private static void ClearMesh(bool updateMesh, TextInfo textInfo) { textInfo.ClearMeshInfo(updateMesh); } private void EnableMasking() { m_IsMaskingEnabled = true; } private void DisableMasking() { m_IsMaskingEnabled = false; } private void SetArraySizes(int[] chars, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_07ff: Unknown result type (might be due to invalid IL or missing references) //IL_081b: Expected O, but got Unknown TextSettings textSettings = generationSettings.textSettings; int num = 0; m_TotalCharacterCount = 0; m_IsUsingBold = false; m_IsParsingText = false; m_TagNoParsing = false; m_FontStyleInternal = generationSettings.fontStyle; m_FontWeightInternal = (((m_FontStyleInternal & FontStyles.Bold) == FontStyles.Bold) ? TextFontWeight.Bold : generationSettings.fontWeight); m_FontWeightStack.SetDefault(m_FontWeightInternal); m_CurrentFontAsset = generationSettings.fontAsset; m_CurrentMaterial = generationSettings.material; m_CurrentMaterialIndex = 0; m_MaterialReferenceStack.SetDefault(new MaterialReference(m_CurrentMaterialIndex, m_CurrentFontAsset, null, m_CurrentMaterial, m_Padding)); m_MaterialReferenceIndexLookup.Clear(); MaterialReference.AddMaterialReference(m_CurrentMaterial, m_CurrentFontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); if (textInfo == null) { textInfo = new TextInfo(); } m_TextElementType = TextElementType.Character; for (int i = 0; i < chars.Length && chars[i] != 0; i++) { if (textInfo.textElementInfo == null || m_TotalCharacterCount >= textInfo.textElementInfo.Length) { TextInfo.Resize(ref textInfo.textElementInfo, m_TotalCharacterCount + 1, isBlockAllocated: true); } int num2 = chars[i]; if (generationSettings.richText && num2 == 60) { int currentMaterialIndex = m_CurrentMaterialIndex; if (ValidateHtmlTag(chars, i + 1, out var endIndex, generationSettings, textInfo)) { i = endIndex; if ((m_FontStyleInternal & FontStyles.Bold) == FontStyles.Bold) { m_IsUsingBold = true; } if (m_TextElementType == TextElementType.Sprite) { m_MaterialReferences[m_CurrentMaterialIndex].referenceCount++; textInfo.textElementInfo[m_TotalCharacterCount].character = (char)(57344 + m_SpriteIndex); textInfo.textElementInfo[m_TotalCharacterCount].spriteIndex = m_SpriteIndex; textInfo.textElementInfo[m_TotalCharacterCount].fontAsset = m_CurrentFontAsset; textInfo.textElementInfo[m_TotalCharacterCount].spriteAsset = m_CurrentSpriteAsset; textInfo.textElementInfo[m_TotalCharacterCount].materialReferenceIndex = m_CurrentMaterialIndex; textInfo.textElementInfo[m_TotalCharacterCount].textElement = m_CurrentSpriteAsset.spriteCharacterTable[m_SpriteIndex]; textInfo.textElementInfo[m_TotalCharacterCount].elementType = m_TextElementType; m_TextElementType = TextElementType.Character; m_CurrentMaterialIndex = currentMaterialIndex; num++; m_TotalCharacterCount++; } continue; } } bool flag = false; FontAsset currentFontAsset = m_CurrentFontAsset; Material currentMaterial = m_CurrentMaterial; int currentMaterialIndex2 = m_CurrentMaterialIndex; if (m_TextElementType == TextElementType.Character) { if ((m_FontStyleInternal & FontStyles.UpperCase) == FontStyles.UpperCase) { if (char.IsLower((char)num2)) { num2 = char.ToUpper((char)num2); } } else if ((m_FontStyleInternal & FontStyles.LowerCase) == FontStyles.LowerCase) { if (char.IsUpper((char)num2)) { num2 = char.ToLower((char)num2); } } else if ((m_FontStyleInternal & FontStyles.SmallCaps) == FontStyles.SmallCaps && char.IsLower((char)num2)) { num2 = char.ToUpper((char)num2); } } bool isUsingAlternativeTypeface; TextElement textElement = GetTextElement(generationSettings, (uint)num2, m_CurrentFontAsset, m_FontStyleInternal, m_FontWeightInternal, out isUsingAlternativeTypeface); if (textElement == null) { int num3 = num2; num2 = ((textSettings.missingCharacterUnicode == 0) ? 9633 : textSettings.missingCharacterUnicode); textElement = FontAssetUtilities.GetCharacterFromFontAsset((uint)num2, m_CurrentFontAsset, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isUsingAlternativeTypeface); if (textElement == null && textSettings.fallbackFontAssets != null && textSettings.fallbackFontAssets.Count > 0) { textElement = FontAssetUtilities.GetCharacterFromFontAssets((uint)num2, m_CurrentFontAsset, textSettings.fallbackFontAssets, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isUsingAlternativeTypeface); } if (textElement == null && (Object)(object)textSettings.defaultFontAsset != (Object)null) { textElement = FontAssetUtilities.GetCharacterFromFontAsset((uint)num2, textSettings.defaultFontAsset, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isUsingAlternativeTypeface); } if (textElement == null) { num2 = 32; textElement = FontAssetUtilities.GetCharacterFromFontAsset((uint)num2, m_CurrentFontAsset, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isUsingAlternativeTypeface); if (textSettings.displayWarnings) { string text = ((num3 > 65535) ? $"The character with Unicode value \\U{num3:X8} was not found in the [{((Object)generationSettings.fontAsset).name}] font asset or any potential fallbacks. It was replaced by a space." : $"The character with Unicode value \\u{num3:X4} was not found in the [{((Object)generationSettings.fontAsset).name}] font asset or any potential fallbacks. It was replaced by a space."); Debug.LogWarning((object)text); } } } if (textElement.elementType == TextElementType.Character && textElement.textAsset.instanceID != m_CurrentFontAsset.instanceID) { flag = true; m_CurrentFontAsset = textElement.textAsset as FontAsset; } textInfo.textElementInfo[m_TotalCharacterCount].elementType = TextElementType.Character; textInfo.textElementInfo[m_TotalCharacterCount].textElement = textElement; textInfo.textElementInfo[m_TotalCharacterCount].isUsingAlternateTypeface = isUsingAlternativeTypeface; textInfo.textElementInfo[m_TotalCharacterCount].character = (char)num2; textInfo.textElementInfo[m_TotalCharacterCount].fontAsset = m_CurrentFontAsset; if (textElement.elementType == TextElementType.Sprite) { SpriteAsset spriteAsset = textElement.textAsset as SpriteAsset; m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(spriteAsset.material, spriteAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); m_MaterialReferences[m_CurrentMaterialIndex].referenceCount++; textInfo.textElementInfo[m_TotalCharacterCount].elementType = TextElementType.Sprite; textInfo.textElementInfo[m_TotalCharacterCount].materialReferenceIndex = m_CurrentMaterialIndex; textInfo.textElementInfo[m_TotalCharacterCount].spriteAsset = spriteAsset; textInfo.textElementInfo[m_TotalCharacterCount].spriteIndex = (int)textElement.glyphIndex; m_TextElementType = TextElementType.Character; m_CurrentMaterialIndex = currentMaterialIndex2; num++; m_TotalCharacterCount++; continue; } if (flag && m_CurrentFontAsset.instanceID != generationSettings.fontAsset.instanceID) { if (textSettings.matchMaterialPreset) { m_CurrentMaterial = MaterialManager.GetFallbackMaterial(m_CurrentMaterial, m_CurrentFontAsset.material); } else { m_CurrentMaterial = m_CurrentFontAsset.material; } m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(m_CurrentMaterial, m_CurrentFontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); } if (textElement != null && textElement.glyph.atlasIndex > 0) { m_CurrentMaterial = MaterialManager.GetFallbackMaterial(m_CurrentFontAsset, m_CurrentMaterial, textElement.glyph.atlasIndex); m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(m_CurrentMaterial, m_CurrentFontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); flag = true; } if (!char.IsWhiteSpace((char)num2) && num2 != 8203) { if (m_MaterialReferences[m_CurrentMaterialIndex].referenceCount < 16383) { m_MaterialReferences[m_CurrentMaterialIndex].referenceCount++; } else { m_CurrentMaterialIndex = MaterialReference.AddMaterialReference(new Material(m_CurrentMaterial), m_CurrentFontAsset, ref m_MaterialReferences, m_MaterialReferenceIndexLookup); m_MaterialReferences[m_CurrentMaterialIndex].referenceCount++; } } textInfo.textElementInfo[m_TotalCharacterCount].material = m_CurrentMaterial; textInfo.textElementInfo[m_TotalCharacterCount].materialReferenceIndex = m_CurrentMaterialIndex; m_MaterialReferences[m_CurrentMaterialIndex].isFallbackMaterial = flag; if (flag) { m_MaterialReferences[m_CurrentMaterialIndex].fallbackMaterial = currentMaterial; m_CurrentFontAsset = currentFontAsset; m_CurrentMaterial = currentMaterial; m_CurrentMaterialIndex = currentMaterialIndex2; } m_TotalCharacterCount++; } if (m_IsCalculatingPreferredValues) { m_IsCalculatingPreferredValues = false; return; } textInfo.spriteCount = num; int num4 = (textInfo.materialCount = m_MaterialReferenceIndexLookup.Count); if (num4 > textInfo.meshInfo.Length) { TextInfo.Resize(ref textInfo.meshInfo, num4, isBlockAllocated: false); } if (textInfo.textElementInfo.Length - m_TotalCharacterCount > 256) { TextInfo.Resize(ref textInfo.textElementInfo, Mathf.Max(m_TotalCharacterCount + 1, 256), isBlockAllocated: true); } for (int j = 0; j < num4; j++) { int referenceCount = m_MaterialReferences[j].referenceCount; if (textInfo.meshInfo[j].vertices == null || textInfo.meshInfo[j].vertices.Length < referenceCount * 4) { if (textInfo.meshInfo[j].vertices == null) { textInfo.meshInfo[j] = new MeshInfo(referenceCount + 1); } else { textInfo.meshInfo[j].ResizeMeshInfo((referenceCount > 1024) ? (referenceCount + 256) : Mathf.NextPowerOfTwo(referenceCount)); } } else if (textInfo.meshInfo[j].vertices.Length - referenceCount * 4 > 1024) { textInfo.meshInfo[j].ResizeMeshInfo((referenceCount > 1024) ? (referenceCount + 256) : Mathf.Max(Mathf.NextPowerOfTwo(referenceCount), 256)); } textInfo.meshInfo[j].material = m_MaterialReferences[j].material; } } internal TextElement GetTextElement(TextGenerationSettings generationSettings, uint unicode, FontAsset fontAsset, FontStyles fontStyle, TextFontWeight fontWeight, out bool isUsingAlternativeTypeface) { TextSettings textSettings = generationSettings.textSettings; Character character = FontAssetUtilities.GetCharacterFromFontAsset(unicode, fontAsset, includeFallbacks: false, fontStyle, fontWeight, out isUsingAlternativeTypeface); if (character != null) { return character; } if (fontAsset.m_FallbackFontAssetTable != null && fontAsset.m_FallbackFontAssetTable.Count > 0) { character = FontAssetUtilities.GetCharacterFromFontAssets(unicode, fontAsset, fontAsset.m_FallbackFontAssetTable, includeFallbacks: true, fontStyle, fontWeight, out isUsingAlternativeTypeface); } if (character != null) { fontAsset.AddCharacterToLookupCache(unicode, character); return character; } if (fontAsset.instanceID != generationSettings.fontAsset.instanceID) { character = FontAssetUtilities.GetCharacterFromFontAsset(unicode, generationSettings.fontAsset, includeFallbacks: false, fontStyle, fontWeight, out isUsingAlternativeTypeface); if (character != null) { m_CurrentMaterialIndex = 0; m_CurrentMaterial = m_MaterialReferences[0].material; fontAsset.AddCharacterToLookupCache(unicode, character); return character; } if (generationSettings.fontAsset.m_FallbackFontAssetTable != null && generationSettings.fontAsset.m_FallbackFontAssetTable.Count > 0) { character = FontAssetUtilities.GetCharacterFromFontAssets(unicode, fontAsset, generationSettings.fontAsset.m_FallbackFontAssetTable, includeFallbacks: true, fontStyle, fontWeight, out isUsingAlternativeTypeface); } if (character != null) { fontAsset.AddCharacterToLookupCache(unicode, character); return character; } } if ((Object)(object)generationSettings.spriteAsset != (Object)null) { SpriteCharacter spriteCharacterFromSpriteAsset = FontAssetUtilities.GetSpriteCharacterFromSpriteAsset(unicode, generationSettings.spriteAsset, includeFallbacks: true); if (spriteCharacterFromSpriteAsset != null) { return spriteCharacterFromSpriteAsset; } } if (textSettings.fallbackFontAssets != null && textSettings.fallbackFontAssets.Count > 0) { character = FontAssetUtilities.GetCharacterFromFontAssets(unicode, fontAsset, textSettings.fallbackFontAssets, includeFallbacks: true, fontStyle, fontWeight, out isUsingAlternativeTypeface); } if (character != null) { fontAsset.AddCharacterToLookupCache(unicode, character); return character; } if ((Object)(object)textSettings.defaultFontAsset != (Object)null) { character = FontAssetUtilities.GetCharacterFromFontAsset(unicode, textSettings.defaultFontAsset, includeFallbacks: true, fontStyle, fontWeight, out isUsingAlternativeTypeface); } if (character != null) { fontAsset.AddCharacterToLookupCache(unicode, character); return character; } if ((Object)(object)textSettings.defaultSpriteAsset != (Object)null) { SpriteCharacter spriteCharacterFromSpriteAsset2 = FontAssetUtilities.GetSpriteCharacterFromSpriteAsset(unicode, textSettings.defaultSpriteAsset, includeFallbacks: true); if (spriteCharacterFromSpriteAsset2 != null) { return spriteCharacterFromSpriteAsset2; } } return null; } private void ComputeMarginSize(Rect rect, Vector4 margins) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) m_MarginWidth = ((Rect)(ref rect)).width - margins.x - margins.z; m_MarginHeight = ((Rect)(ref rect)).height - margins.y - margins.w; m_RectTransformCorners[0].x = 0f; m_RectTransformCorners[0].y = 0f; m_RectTransformCorners[1].x = 0f; m_RectTransformCorners[1].y = ((Rect)(ref rect)).height; m_RectTransformCorners[2].x = ((Rect)(ref rect)).width; m_RectTransformCorners[2].y = ((Rect)(ref rect)).height; m_RectTransformCorners[3].x = ((Rect)(ref rect)).width; m_RectTransformCorners[3].y = 0f; } protected void GetSpecialCharacters(TextGenerationSettings generationSettings) { GetEllipsisSpecialCharacter(generationSettings); GetUnderlineSpecialCharacter(generationSettings); } protected void GetEllipsisSpecialCharacter(TextGenerationSettings generationSettings) { FontAsset fontAsset = generationSettings.fontAsset; TextSettings textSettings = generationSettings.textSettings; bool isAlternativeTypeface; Character character = FontAssetUtilities.GetCharacterFromFontAsset(8230u, fontAsset, includeFallbacks: false, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface); if (character == null && fontAsset.m_FallbackFontAssetTable != null && fontAsset.m_FallbackFontAssetTable.Count > 0) { character = FontAssetUtilities.GetCharacterFromFontAssets(8230u, fontAsset, fontAsset.m_FallbackFontAssetTable, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface); } if (character == null && textSettings.fallbackFontAssets != null && textSettings.fallbackFontAssets.Count > 0) { character = FontAssetUtilities.GetCharacterFromFontAssets(8230u, fontAsset, textSettings.fallbackFontAssets, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface); } if (character == null && (Object)(object)textSettings.defaultFontAsset != (Object)null) { character = FontAssetUtilities.GetCharacterFromFontAsset(8230u, textSettings.defaultFontAsset, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface); } if (character != null) { m_Ellipsis = new SpecialCharacter(character, 0); } } protected void GetUnderlineSpecialCharacter(TextGenerationSettings generationSettings) { FontAsset fontAsset = generationSettings.fontAsset; TextSettings textSettings = generationSettings.textSettings; bool isAlternativeTypeface; Character characterFromFontAsset = FontAssetUtilities.GetCharacterFromFontAsset(95u, fontAsset, includeFallbacks: false, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface); if (characterFromFontAsset != null) { m_Underline = new SpecialCharacter(characterFromFontAsset, 0); } else if (textSettings.displayWarnings) { Debug.LogWarning((object)("The character used for Underline is not available in font asset [" + ((Object)fontAsset).name + "].")); } } private float GetPaddingForMaterial(Material material, bool extraPadding) { TextShaderUtilities.GetShaderPropertyIDs(); if ((Object)(object)material == (Object)null) { return 0f; } m_Padding = TextShaderUtilities.GetPadding(material, extraPadding, m_IsUsingBold); m_IsMaskingEnabled = TextShaderUtilities.IsMaskingEnabled(material); m_IsSdfShader = material.HasProperty(TextShaderUtilities.ID_WeightNormal); return m_Padding; } private float GetPreferredWidthInternal(TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)generationSettings.textSettings == (Object)null) { return 0f; } float defaultFontSize = (generationSettings.autoSize ? generationSettings.fontSizeMax : m_FontSize); m_MinFontSize = generationSettings.fontSizeMin; m_MaxFontSize = generationSettings.fontSizeMax; m_CharWidthAdjDelta = 0f; Vector2 largePositiveVector = TextGeneratorUtilities.largePositiveVector2; m_RecursiveCount = 0; return CalculatePreferredValues(defaultFontSize, largePositiveVector, ignoreTextAutoSizing: true, generationSettings, textInfo).x; } private float GetPreferredHeightInternal(TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)generationSettings.textSettings == (Object)null) { return 0f; } float defaultFontSize = (generationSettings.autoSize ? generationSettings.fontSizeMax : m_FontSize); m_MinFontSize = generationSettings.fontSizeMin; m_MaxFontSize = generationSettings.fontSizeMax; m_CharWidthAdjDelta = 0f; Vector2 marginSize = default(Vector2); ((Vector2)(ref marginSize))..ctor((m_MarginWidth != 0f) ? m_MarginWidth : 32767f, 32767f); m_RecursiveCount = 0; return CalculatePreferredValues(defaultFontSize, marginSize, !generationSettings.autoSize, generationSettings, textInfo).y; } private Vector2 GetPreferredValuesInternal(TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)generationSettings.textSettings == (Object)null) { return Vector2.zero; } float defaultFontSize = (generationSettings.autoSize ? generationSettings.fontSizeMax : m_FontSize); m_MinFontSize = generationSettings.fontSizeMin; m_MaxFontSize = generationSettings.fontSizeMax; m_CharWidthAdjDelta = 0f; Vector2 marginSize = default(Vector2); ((Vector2)(ref marginSize))..ctor((m_MarginWidth != 0f) ? m_MarginWidth : 32767f, 32767f); m_RecursiveCount = 0; return CalculatePreferredValues(defaultFontSize, marginSize, !generationSettings.autoSize, generationSettings, textInfo); } protected virtual Vector2 CalculatePreferredValues(float defaultFontSize, Vector2 marginSize, bool ignoreTextAutoSizing, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_1784: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_167b: Unknown result type (might be due to invalid IL or missing references) //IL_1681: Unknown result type (might be due to invalid IL or missing references) //IL_1686: Unknown result type (might be due to invalid IL or missing references) //IL_166d: Unknown result type (might be due to invalid IL or missing references) //IL_1672: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_063f: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_177b: Unknown result type (might be due to invalid IL or missing references) //IL_1780: Unknown result type (might be due to invalid IL or missing references) //IL_08d2: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_094e: Unknown result type (might be due to invalid IL or missing references) //IL_0953: Unknown result type (might be due to invalid IL or missing references) //IL_09e4: Unknown result type (might be due to invalid IL or missing references) //IL_09e9: Unknown result type (might be due to invalid IL or missing references) //IL_0a26: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_103a: Unknown result type (might be due to invalid IL or missing references) //IL_103f: Unknown result type (might be due to invalid IL or missing references) //IL_0b1d: Unknown result type (might be due to invalid IL or missing references) //IL_0b22: Unknown result type (might be due to invalid IL or missing references) //IL_112f: Unknown result type (might be due to invalid IL or missing references) //IL_1134: Unknown result type (might be due to invalid IL or missing references) //IL_0cdd: Unknown result type (might be due to invalid IL or missing references) //IL_0ce3: Unknown result type (might be due to invalid IL or missing references) //IL_0ce8: Unknown result type (might be due to invalid IL or missing references) //IL_0f16: Unknown result type (might be due to invalid IL or missing references) //IL_0f1c: Unknown result type (might be due to invalid IL or missing references) //IL_0f21: Unknown result type (might be due to invalid IL or missing references) //IL_0f90: Unknown result type (might be due to invalid IL or missing references) //IL_0f96: Unknown result type (might be due to invalid IL or missing references) //IL_0f9b: Unknown result type (might be due to invalid IL or missing references) //IL_0f82: Unknown result type (might be due to invalid IL or missing references) //IL_0f87: Unknown result type (might be due to invalid IL or missing references) //IL_0bff: Unknown result type (might be due to invalid IL or missing references) //IL_0c05: Unknown result type (might be due to invalid IL or missing references) //IL_0c0a: Unknown result type (might be due to invalid IL or missing references) //IL_0c79: Unknown result type (might be due to invalid IL or missing references) //IL_0c7f: Unknown result type (might be due to invalid IL or missing references) //IL_0c84: Unknown result type (might be due to invalid IL or missing references) //IL_0c6b: Unknown result type (might be due to invalid IL or missing references) //IL_0c70: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)generationSettings.fontAsset == (Object)null || generationSettings.fontAsset.characterLookupTable == null) { return Vector2.zero; } if (m_CharBuffer == null || m_CharBuffer.Length == 0 || m_CharBuffer[0] == 0) { return Vector2.zero; } m_CurrentFontAsset = generationSettings.fontAsset; m_CurrentMaterial = generationSettings.material; m_CurrentMaterialIndex = 0; m_MaterialReferenceStack.SetDefault(new MaterialReference(0, m_CurrentFontAsset, null, m_CurrentMaterial, m_Padding)); int totalCharacterCount = m_TotalCharacterCount; if (m_InternalTextElementInfo == null || totalCharacterCount > m_InternalTextElementInfo.Length) { m_InternalTextElementInfo = new TextElementInfo[(totalCharacterCount > 1024) ? (totalCharacterCount + 256) : Mathf.NextPowerOfTwo(totalCharacterCount)]; } float num = defaultFontSize; FaceInfo faceInfo = generationSettings.fontAsset.faceInfo; float num2 = num / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = generationSettings.fontAsset.faceInfo; float num3 = (m_FontScale = num2 * ((FaceInfo)(ref faceInfo)).scale); float num4 = num3; m_FontScaleMultiplier = 1f; m_CurrentFontSize = defaultFontSize; m_SizeStack.SetDefault(m_CurrentFontSize); m_FontStyleInternal = generationSettings.fontStyle; m_LineJustification = generationSettings.textAlignment; m_LineJustificationStack.SetDefault(m_LineJustification); m_BaselineOffset = 0f; m_BaselineOffsetStack.Clear(); m_LineOffset = 0f; m_LineHeight = -32767f; faceInfo = m_CurrentFontAsset.faceInfo; float lineHeight = ((FaceInfo)(ref faceInfo)).lineHeight; faceInfo = m_CurrentFontAsset.faceInfo; float ascentLine = ((FaceInfo)(ref faceInfo)).ascentLine; faceInfo = m_CurrentFontAsset.faceInfo; float num5 = lineHeight - (ascentLine - ((FaceInfo)(ref faceInfo)).descentLine); m_CSpacing = 0f; m_MonoSpacing = 0f; m_XAdvance = 0f; float num6 = 0f; m_TagLineIndent = 0f; m_TagIndent = 0f; m_IndentStack.SetDefault(0f); m_TagNoParsing = false; m_CharacterCount = 0; m_FirstCharacterOfLine = 0; m_MaxLineAscender = -32767f; m_MaxLineDescender = 32767f; m_LineNumber = 0; TextSettings textSettings = generationSettings.textSettings; float x = marginSize.x; m_MarginLeft = 0f; m_MarginRight = 0f; m_Width = -1f; float num7 = 0f; float num8 = 0f; float num9 = 0f; m_IsCalculatingPreferredValues = true; m_MaxAscender = 0f; m_MaxDescender = 0f; bool flag = true; bool flag2 = false; WordWrapState state = default(WordWrapState); SaveWordWrappingState(ref state, 0, 0, textInfo); WordWrapState state2 = default(WordWrapState); int num10 = 0; m_RecursiveCount++; for (int i = 0; m_CharBuffer[i] != 0; i++) { int num11 = m_CharBuffer[i]; m_TextElementType = textInfo.textElementInfo[m_CharacterCount].elementType; m_CurrentMaterialIndex = textInfo.textElementInfo[m_CharacterCount].materialReferenceIndex; m_CurrentFontAsset = m_MaterialReferences[m_CurrentMaterialIndex].fontAsset; int currentMaterialIndex = m_CurrentMaterialIndex; if (generationSettings.richText && num11 == 60) { m_IsParsingText = true; m_TextElementType = TextElementType.Character; if (ValidateHtmlTag(m_CharBuffer, i + 1, out var endIndex, generationSettings, textInfo)) { i = endIndex; if (m_TextElementType == TextElementType.Character) { continue; } } } m_IsParsingText = false; bool isUsingAlternateTypeface = textInfo.textElementInfo[m_CharacterCount].isUsingAlternateTypeface; float num12 = 1f; if (m_TextElementType == TextElementType.Character) { if ((m_FontStyleInternal & FontStyles.UpperCase) == FontStyles.UpperCase) { if (char.IsLower((char)num11)) { num11 = char.ToUpper((char)num11); } } else if ((m_FontStyleInternal & FontStyles.LowerCase) == FontStyles.LowerCase) { if (char.IsUpper((char)num11)) { num11 = char.ToLower((char)num11); } } else if ((m_FontStyleInternal & FontStyles.SmallCaps) == FontStyles.SmallCaps && char.IsLower((char)num11)) { num12 = 0.8f; num11 = char.ToUpper((char)num11); } } GlyphMetrics metrics; if (m_TextElementType == TextElementType.Sprite) { SpriteCharacter spriteCharacter = (SpriteCharacter)textInfo.textElementInfo[m_CharacterCount].textElement; m_CurrentSpriteAsset = spriteCharacter.textAsset as SpriteAsset; m_SpriteIndex = (int)spriteCharacter.glyphIndex; if (spriteCharacter == null) { continue; } if (num11 == 60) { num11 = 57344 + m_SpriteIndex; } m_CurrentFontAsset = generationSettings.fontAsset; float currentFontSize = m_CurrentFontSize; faceInfo = generationSettings.fontAsset.faceInfo; float num13 = currentFontSize / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = generationSettings.fontAsset.faceInfo; float num14 = num13 * ((FaceInfo)(ref faceInfo)).scale; faceInfo = generationSettings.fontAsset.faceInfo; float ascentLine2 = ((FaceInfo)(ref faceInfo)).ascentLine; metrics = spriteCharacter.glyph.metrics; num4 = ascentLine2 / ((GlyphMetrics)(ref metrics)).height * spriteCharacter.scale * num14; m_CachedTextElement = spriteCharacter; m_InternalTextElementInfo[m_CharacterCount].elementType = TextElementType.Sprite; m_InternalTextElementInfo[m_CharacterCount].scale = num14; m_CurrentMaterialIndex = currentMaterialIndex; } else if (m_TextElementType == TextElementType.Character) { m_CachedTextElement = textInfo.textElementInfo[m_CharacterCount].textElement; if (m_CachedTextElement == null) { continue; } m_CurrentMaterialIndex = textInfo.textElementInfo[m_CharacterCount].materialReferenceIndex; float num15 = m_CurrentFontSize * num12; faceInfo = m_CurrentFontAsset.faceInfo; float num16 = num15 / (float)((FaceInfo)(ref faceInfo)).pointSize; faceInfo = m_CurrentFontAsset.faceInfo; m_FontScale = num16 * ((FaceInfo)(ref faceInfo)).scale; num4 = m_FontScale * m_FontScaleMultiplier * m_CachedTextElement.scale; m_InternalTextElementInfo[m_CharacterCount].elementType = TextElementType.Character; } float num17 = num4; if (num11 == 173) { num4 = 0f; } m_InternalTextElementInfo[m_CharacterCount].character = (char)num11; GlyphValueRecord val = default(GlyphValueRecord); float characterSpacing = generationSettings.characterSpacing; if (generationSettings.enableKerning) { uint glyphIndex = m_CachedTextElement.glyphIndex; GlyphPairAdjustmentRecord value; GlyphAdjustmentRecord val2; if (m_CharacterCount < totalCharacterCount - 1) { uint glyphIndex2 = textInfo.textElementInfo[m_CharacterCount + 1].textElement.glyphIndex; uint key = (glyphIndex2 << 16) | glyphIndex; if (m_CurrentFontAsset.m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.TryGetValue(key, out value)) { val2 = ((GlyphPairAdjustmentRecord)(ref value)).firstAdjustmentRecord; val = ((GlyphAdjustmentRecord)(ref val2)).glyphValueRecord; } } if (m_CharacterCount >= 1) { uint glyphIndex3 = textInfo.textElementInfo[m_CharacterCount - 1].textElement.glyphIndex; uint key2 = (glyphIndex << 16) | glyphIndex3; if (m_CurrentFontAsset.m_FontFeatureTable.m_GlyphPairAdjustmentRecordLookup.TryGetValue(key2, out value)) { GlyphValueRecord val3 = val; val2 = ((GlyphPairAdjustmentRecord)(ref value)).secondAdjustmentRecord; val = val3 + ((GlyphAdjustmentRecord)(ref val2)).glyphValueRecord; } } } float num18 = 0f; if (m_MonoSpacing != 0f) { float num19 = m_MonoSpacing / 2f; metrics = m_CachedTextElement.glyph.metrics; float num20 = ((GlyphMetrics)(ref metrics)).width / 2f; metrics = m_CachedTextElement.glyph.metrics; num18 = num19 - (num20 + ((GlyphMetrics)(ref metrics)).horizontalBearingX) * num4; m_XAdvance += num18; } float num21 = ((m_TextElementType != TextElementType.Character || isUsingAlternateTypeface || (m_FontStyleInternal & FontStyles.Bold) != FontStyles.Bold) ? 1f : (1f + m_CurrentFontAsset.boldStyleSpacing * 0.01f)); m_InternalTextElementInfo[m_CharacterCount].baseLine = 0f - m_LineOffset + m_BaselineOffset; faceInfo = m_CurrentFontAsset.faceInfo; float num22 = ((FaceInfo)(ref faceInfo)).ascentLine * ((m_TextElementType == TextElementType.Character) ? (num4 / num12) : m_InternalTextElementInfo[m_CharacterCount].scale) + m_BaselineOffset; m_InternalTextElementInfo[m_CharacterCount].ascender = num22 - m_LineOffset; m_MaxLineAscender = ((num22 > m_MaxLineAscender) ? num22 : m_MaxLineAscender); faceInfo = m_CurrentFontAsset.faceInfo; float num23 = ((FaceInfo)(ref faceInfo)).descentLine * ((m_TextElementType == TextElementType.Character) ? (num4 / num12) : m_InternalTextElementInfo[m_CharacterCount].scale) + m_BaselineOffset; m_MaxLineDescender = ((num23 < m_MaxLineDescender) ? num23 : m_MaxLineDescender); if ((m_FontStyleInternal & FontStyles.Subscript) == FontStyles.Subscript || (m_FontStyleInternal & FontStyles.Superscript) == FontStyles.Superscript) { float num24 = num22 - m_BaselineOffset; faceInfo = m_CurrentFontAsset.faceInfo; float num25 = num24 / ((FaceInfo)(ref faceInfo)).subscriptSize; num22 = m_MaxLineAscender; m_MaxLineAscender = ((num25 > m_MaxLineAscender) ? num25 : m_MaxLineAscender); float num26 = num23 - m_BaselineOffset; faceInfo = m_CurrentFontAsset.faceInfo; float num27 = num26 / ((FaceInfo)(ref faceInfo)).subscriptSize; m_MaxLineDescender = ((num27 < m_MaxLineDescender) ? num27 : m_MaxLineDescender); } if (m_LineNumber == 0) { m_MaxAscender = ((m_MaxAscender > num22) ? m_MaxAscender : num22); } if (num11 == 9 || (!char.IsWhiteSpace((char)num11) && num11 != 8203) || m_TextElementType == TextElementType.Sprite) { float num28 = ((m_Width != -1f) ? Mathf.Min(x + 0.0001f - m_MarginLeft - m_MarginRight, m_Width) : (x + 0.0001f - m_MarginLeft - m_MarginRight)); bool flag3 = (m_LineJustification & (TextAlignment)16) == (TextAlignment)16 || (m_LineJustification & (TextAlignment)8) == (TextAlignment)8; float xAdvance = m_XAdvance; metrics = m_CachedTextElement.glyph.metrics; num9 = xAdvance + ((GlyphMetrics)(ref metrics)).horizontalAdvance * (1f - m_CharWidthAdjDelta) * ((num11 != 173) ? num4 : num17); if (num9 > num28 * (flag3 ? 1.05f : 1f)) { if (generationSettings.wordWrap && m_CharacterCount != m_FirstCharacterOfLine) { if (num10 == state2.previousWordBreak || flag) { if (!ignoreTextAutoSizing && m_CurrentFontSize > generationSettings.fontSizeMin) { if (m_CharWidthAdjDelta < generationSettings.charWidthMaxAdj / 100f) { m_RecursiveCount = 0; m_CharWidthAdjDelta += 0.01f; return CalculatePreferredValues(defaultFontSize, marginSize, ignoreTextAutoSizing: false, generationSettings, textInfo); } m_MaxFontSize = defaultFontSize; defaultFontSize -= Mathf.Max((defaultFontSize - m_MinFontSize) / 2f, 0.05f); defaultFontSize = (float)(int)(Mathf.Max(defaultFontSize, generationSettings.fontSizeMin) * 20f + 0.5f) / 20f; if (m_RecursiveCount > 20) { return new Vector2(num7, num8); } return CalculatePreferredValues(defaultFontSize, marginSize, ignoreTextAutoSizing: false, generationSettings, textInfo); } if (!m_IsCharacterWrappingEnabled) { m_IsCharacterWrappingEnabled = true; } else { flag2 = true; } } i = RestoreWordWrappingState(ref state2, textInfo); num10 = i; if (m_CharBuffer[i] == 173) { m_CharBuffer[i] = 45; return CalculatePreferredValues(defaultFontSize, marginSize, ignoreTextAutoSizing: true, generationSettings, textInfo); } if (m_LineNumber > 0 && !TextGeneratorUtilities.Approximately(m_MaxLineAscender, m_StartOfLineAscender) && m_LineHeight == -32767f) { float num29 = m_MaxLineAscender - m_StartOfLineAscender; m_LineOffset += num29; state2.lineOffset = m_LineOffset; state2.previousLineAscender = m_MaxLineAscender; } float num30 = m_MaxLineAscender - m_LineOffset; float num31 = m_MaxLineDescender - m_LineOffset; m_MaxDescender = ((m_MaxDescender < num31) ? m_MaxDescender : num31); m_FirstCharacterOfLine = m_CharacterCount; num7 += m_XAdvance; num8 = ((!generationSettings.wordWrap) ? Mathf.Max(num8, num30 - num31) : (m_MaxAscender - m_MaxDescender)); SaveWordWrappingState(ref state, i, m_CharacterCount - 1, textInfo); m_LineNumber++; if (m_LineHeight == -32767f) { float num32 = m_InternalTextElementInfo[m_CharacterCount].ascender - m_InternalTextElementInfo[m_CharacterCount].baseLine; float num33 = 0f - m_MaxLineDescender + num32 + (num5 + generationSettings.lineSpacing + m_LineSpacingDelta) * num3; m_LineOffset += num33; m_StartOfLineAscender = num32; } else { m_LineOffset += m_LineHeight + generationSettings.lineSpacing * num3; } m_MaxLineAscender = -32767f; m_MaxLineDescender = 32767f; m_XAdvance = 0f + m_TagIndent; continue; } if (!ignoreTextAutoSizing && defaultFontSize > generationSettings.fontSizeMin) { if (m_CharWidthAdjDelta < generationSettings.charWidthMaxAdj / 100f) { m_RecursiveCount = 0; m_CharWidthAdjDelta += 0.01f; return CalculatePreferredValues(defaultFontSize, marginSize, ignoreTextAutoSizing: false, generationSettings, textInfo); } m_MaxFontSize = defaultFontSize; defaultFontSize -= Mathf.Max((defaultFontSize - m_MinFontSize) / 2f, 0.05f); defaultFontSize = (float)(int)(Mathf.Max(defaultFontSize, generationSettings.fontSizeMin) * 20f + 0.5f) / 20f; if (m_RecursiveCount > 20) { return new Vector2(num7, num8); } return CalculatePreferredValues(defaultFontSize, marginSize, ignoreTextAutoSizing: false, generationSettings, textInfo); } } } if (m_LineNumber > 0 && !TextGeneratorUtilities.Approximately(m_MaxLineAscender, m_StartOfLineAscender) && m_LineHeight == -32767f && !m_IsNewPage) { float num34 = m_MaxLineAscender - m_StartOfLineAscender; m_LineOffset += num34; m_StartOfLineAscender += num34; state2.lineOffset = m_LineOffset; state2.previousLineAscender = m_StartOfLineAscender; } if (num11 == 9) { faceInfo = m_CurrentFontAsset.faceInfo; float num35 = ((FaceInfo)(ref faceInfo)).tabWidth * (float)(int)m_CurrentFontAsset.tabMultiple * num4; float num36 = Mathf.Ceil(m_XAdvance / num35) * num35; m_XAdvance = ((num36 > m_XAdvance) ? num36 : (m_XAdvance + num35)); } else if (m_MonoSpacing != 0f) { m_XAdvance += (m_MonoSpacing - num18 + (generationSettings.characterSpacing + m_CurrentFontAsset.regularStyleSpacing) * num4 + m_CSpacing) * (1f - m_CharWidthAdjDelta); if (char.IsWhiteSpace((char)num11) || num11 == 8203) { m_XAdvance += generationSettings.wordSpacing * num4; } } else { float xAdvance2 = m_XAdvance; metrics = m_CachedTextElement.glyph.metrics; m_XAdvance = xAdvance2 + ((((GlyphMetrics)(ref metrics)).horizontalAdvance * num21 + generationSettings.characterSpacing + m_CurrentFontAsset.regularStyleSpacing + ((GlyphValueRecord)(ref val)).xAdvance) * num4 + m_CSpacing) * (1f - m_CharWidthAdjDelta); if (char.IsWhiteSpace((char)num11) || num11 == 8203) { m_XAdvance += generationSettings.wordSpacing * num4; } } if (num11 == 13) { num6 = Mathf.Max(num6, num7 + m_XAdvance); num7 = 0f; m_XAdvance = 0f + m_TagIndent; } if (num11 == 10 || m_CharacterCount == totalCharacterCount - 1) { if (m_LineNumber > 0 && !TextGeneratorUtilities.Approximately(m_MaxLineAscender, m_StartOfLineAscender) && m_LineHeight == -32767f) { float num37 = m_MaxLineAscender - m_StartOfLineAscender; m_LineOffset += num37; } float num38 = m_MaxLineDescender - m_LineOffset; m_MaxDescender = ((m_MaxDescender < num38) ? m_MaxDescender : num38); m_FirstCharacterOfLine = m_CharacterCount + 1; if (num11 == 10 && m_CharacterCount != totalCharacterCount - 1) { num6 = Mathf.Max(num6, num7 + num9); num7 = 0f; } else { num7 = Mathf.Max(num6, num7 + num9); } num8 = m_MaxAscender - m_MaxDescender; if (num11 == 10) { SaveWordWrappingState(ref state, i, m_CharacterCount, textInfo); SaveWordWrappingState(ref state2, i, m_CharacterCount, textInfo); m_LineNumber++; if (m_LineHeight == -32767f) { float num33 = 0f - m_MaxLineDescender + num22 + (num5 + generationSettings.lineSpacing + generationSettings.paragraphSpacing + m_LineSpacingDelta) * num3; m_LineOffset += num33; } else { m_LineOffset += m_LineHeight + (generationSettings.lineSpacing + generationSettings.paragraphSpacing) * num3; } m_MaxLineAscender = -32767f; m_MaxLineDescender = 32767f; m_StartOfLineAscender = num22; m_XAdvance = 0f + m_TagLineIndent + m_TagIndent; m_CharacterCount++; continue; } } if (generationSettings.wordWrap || generationSettings.overflowMode == TextOverflowMode.Truncate || generationSettings.overflowMode == TextOverflowMode.Ellipsis) { if ((char.IsWhiteSpace((char)num11) || num11 == 8203 || num11 == 45 || num11 == 173) && !m_IsNonBreakingSpace && num11 != 160 && num11 != 8209 && num11 != 8239 && num11 != 8288) { SaveWordWrappingState(ref state2, i, m_CharacterCount, textInfo); m_IsCharacterWrappingEnabled = false; flag = false; } else if (((num11 > 4352 && num11 < 4607) || (num11 > 11904 && num11 < 40959) || (num11 > 43360 && num11 < 43391) || (num11 > 44032 && num11 < 55295) || (num11 > 63744 && num11 < 64255) || (num11 > 65072 && num11 < 65103) || (num11 > 65280 && num11 < 65519)) && !m_IsNonBreakingSpace) { if (flag || flag2 || (!textSettings.lineBreakingRules.leadingCharactersLookup.Contains((uint)num11) && m_CharacterCount < totalCharacterCount - 1 && !textSettings.lineBreakingRules.followingCharactersLookup.Contains(m_InternalTextElementInfo[m_CharacterCount + 1].character))) { SaveWordWrappingState(ref state2, i, m_CharacterCount, textInfo); m_IsCharacterWrappingEnabled = false; flag = false; } } else if (flag || m_IsCharacterWrappingEnabled || flag2) { SaveWordWrappingState(ref state2, i, m_CharacterCount, textInfo); } } m_CharacterCount++; } float num39 = m_MaxFontSize - m_MinFontSize; if (!m_IsCharacterWrappingEnabled && !ignoreTextAutoSizing && num39 > 0.051f && defaultFontSize < generationSettings.fontSizeMax) { m_MinFontSize = defaultFontSize; defaultFontSize += Mathf.Max((m_MaxFontSize - defaultFontSize) / 2f, 0.05f); defaultFontSize = (float)(int)(Mathf.Min(defaultFontSize, generationSettings.fontSizeMax) * 20f + 0.5f) / 20f; if (m_RecursiveCount > 20) { return new Vector2(num7, num8); } return CalculatePreferredValues(defaultFontSize, marginSize, ignoreTextAutoSizing: false, generationSettings, textInfo); } m_IsCharacterWrappingEnabled = false; m_IsCalculatingPreferredValues = false; num7 += ((generationSettings.margins.x > 0f) ? generationSettings.margins.x : 0f); num7 += ((generationSettings.margins.z > 0f) ? generationSettings.margins.z : 0f); num8 += ((generationSettings.margins.y > 0f) ? generationSettings.margins.y : 0f); num8 += ((generationSettings.margins.w > 0f) ? generationSettings.margins.w : 0f); num7 = (float)(int)(num7 * 100f + 1f) / 100f; num8 = (float)(int)(num8 * 100f + 1f) / 100f; return new Vector2(num7, num8); } } [Flags] internal enum HorizontalAlignment { Left = 1, Center = 2, Right = 4, Justified = 8, Flush = 0x10, Geometry = 0x20 } [Flags] internal enum VerticalAlignment { Top = 0x100, Middle = 0x200, Bottom = 0x400, Baseline = 0x800, Midline = 0x1000, Capline = 0x2000 } internal enum TextAlignment { TopLeft = 257, TopCenter = 258, TopRight = 260, TopJustified = 264, TopFlush = 272, TopGeoAligned = 288, MiddleLeft = 513, MiddleCenter = 514, MiddleRight = 516, MiddleJustified = 520, MiddleFlush = 528, MiddleGeoAligned = 544, BottomLeft = 1025, BottomCenter = 1026, BottomRight = 1028, BottomJustified = 1032, BottomFlush = 1040, BottomGeoAligned = 1056, BaselineLeft = 2049, BaselineCenter = 2050, BaselineRight = 2052, BaselineJustified = 2056, BaselineFlush = 2064, BaselineGeoAligned = 2080, MidlineLeft = 4097, MidlineCenter = 4098, MidlineRight = 4100, MidlineJustified = 4104, MidlineFlush = 4112, MidlineGeoAligned = 4128, CaplineLeft = 8193, CaplineCenter = 8194, CaplineRight = 8196, CaplineJustified = 8200, CaplineFlush = 8208, CaplineGeoAligned = 8224 } [Flags] public enum FontStyles { Normal = 0, Bold = 1, Italic = 2, Underline = 4, LowerCase = 8, UpperCase = 0x10, SmallCaps = 0x20, Strikethrough = 0x40, Superscript = 0x80, Subscript = 0x100, Highlight = 0x200 } [Serializable] internal struct MeshExtents { public Vector2 min; public Vector2 max; public MeshExtents(Vector2 min, Vector2 max) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) this.min = min; this.max = max; } public override string ToString() { return "Min (" + min.x.ToString("f2") + ", " + min.y.ToString("f2") + ") Max (" + max.x.ToString("f2") + ", " + max.y.ToString("f2") + ")"; } } internal struct XmlTagAttribute { public int nameHashCode; public TagValueType valueType; public int valueStartIndex; public int valueLength; public int valueHashCode; } internal struct RichTextTagAttribute { public int nameHashCode; public int valueHashCode; public TagValueType valueType; public int valueStartIndex; public int valueLength; } internal struct WordWrapState { public int previousWordBreak; public int totalCharacterCount; public int visibleCharacterCount; public int visibleSpriteCount; public int visibleLinkCount; public int firstCharacterIndex; public int firstVisibleCharacterIndex; public int lastCharacterIndex; public int lastVisibleCharIndex; public int lineNumber; public float maxCapHeight; public float maxAscender; public float maxDescender; public float maxLineAscender; public float maxLineDescender; public float previousLineAscender; public float xAdvance; public float preferredWidth; public float preferredHeight; public float previousLineScale; public int wordCount; public FontStyles fontStyle; public float fontScale; public float fontScaleMultiplier; public float currentFontSize; public float baselineOffset; public float lineOffset; public TextInfo textInfo; public LineInfo lineInfo; public Color32 vertexColor; public Color32 underlineColor; public Color32 strikethroughColor; public Color32 highlightColor; public FontStyleStack basicStyleStack; public TextProcessingStack colorStack; public TextProcessingStack underlineColorStack; public TextProcessingStack strikethroughColorStack; public TextProcessingStack highlightColorStack; public TextProcessingStack colorGradientStack; public TextProcessingStack sizeStack; public TextProcessingStack indentStack; public TextProcessingStack fontWeightStack; public TextProcessingStack styleStack; public TextProcessingStack baselineStack; public TextProcessingStack actionStack; public TextProcessingStack materialReferenceStack; public TextProcessingStack lineJustificationStack; public int spriteAnimationId; public FontAsset currentFontAsset; public SpriteAsset currentSpriteAsset; public Material currentMaterial; public int currentMaterialIndex; public Extents meshExtents; public bool tagNoParsing; public bool isNonBreakingSpace; } internal static class TextGeneratorUtilities { public static readonly Vector2 largePositiveVector2 = new Vector2(2.1474836E+09f, 2.1474836E+09f); public static readonly Vector2 largeNegativeVector2 = new Vector2(-214748370f, -214748370f); public const float largePositiveFloat = 32767f; public const float largeNegativeFloat = -32767f; public static bool Approximately(float a, float b) { return b - 0.0001f < a && a < b + 0.0001f; } public static Color32 HexCharsToColor(char[] hexChars, int tagCount) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) switch (tagCount) { case 4: { byte b26 = (byte)(HexToInt(hexChars[1]) * 16 + HexToInt(hexChars[1])); byte b27 = (byte)(HexToInt(hexChars[2]) * 16 + HexToInt(hexChars[2])); byte b28 = (byte)(HexToInt(hexChars[3]) * 16 + HexToInt(hexChars[3])); return new Color32(b26, b27, b28, byte.MaxValue); } case 5: { byte b22 = (byte)(HexToInt(hexChars[1]) * 16 + HexToInt(hexChars[1])); byte b23 = (byte)(HexToInt(hexChars[2]) * 16 + HexToInt(hexChars[2])); byte b24 = (byte)(HexToInt(hexChars[3]) * 16 + HexToInt(hexChars[3])); byte b25 = (byte)(HexToInt(hexChars[4]) * 16 + HexToInt(hexChars[4])); return new Color32(b22, b23, b24, b25); } case 7: { byte b19 = (byte)(HexToInt(hexChars[1]) * 16 + HexToInt(hexChars[2])); byte b20 = (byte)(HexToInt(hexChars[3]) * 16 + HexToInt(hexChars[4])); byte b21 = (byte)(HexToInt(hexChars[5]) * 16 + HexToInt(hexChars[6])); return new Color32(b19, b20, b21, byte.MaxValue); } case 9: { byte b15 = (byte)(HexToInt(hexChars[1]) * 16 + HexToInt(hexChars[2])); byte b16 = (byte)(HexToInt(hexChars[3]) * 16 + HexToInt(hexChars[4])); byte b17 = (byte)(HexToInt(hexChars[5]) * 16 + HexToInt(hexChars[6])); byte b18 = (byte)(HexToInt(hexChars[7]) * 16 + HexToInt(hexChars[8])); return new Color32(b15, b16, b17, b18); } case 10: { byte b12 = (byte)(HexToInt(hexChars[7]) * 16 + HexToInt(hexChars[7])); byte b13 = (byte)(HexToInt(hexChars[8]) * 16 + HexToInt(hexChars[8])); byte b14 = (byte)(HexToInt(hexChars[9]) * 16 + HexToInt(hexChars[9])); return new Color32(b12, b13, b14, byte.MaxValue); } case 11: { byte b8 = (byte)(HexToInt(hexChars[7]) * 16 + HexToInt(hexChars[7])); byte b9 = (byte)(HexToInt(hexChars[8]) * 16 + HexToInt(hexChars[8])); byte b10 = (byte)(HexToInt(hexChars[9]) * 16 + HexToInt(hexChars[9])); byte b11 = (byte)(HexToInt(hexChars[10]) * 16 + HexToInt(hexChars[10])); return new Color32(b8, b9, b10, b11); } case 13: { byte b5 = (byte)(HexToInt(hexChars[7]) * 16 + HexToInt(hexChars[8])); byte b6 = (byte)(HexToInt(hexChars[9]) * 16 + HexToInt(hexChars[10])); byte b7 = (byte)(HexToInt(hexChars[11]) * 16 + HexToInt(hexChars[12])); return new Color32(b5, b6, b7, byte.MaxValue); } case 15: { byte b = (byte)(HexToInt(hexChars[7]) * 16 + HexToInt(hexChars[8])); byte b2 = (byte)(HexToInt(hexChars[9]) * 16 + HexToInt(hexChars[10])); byte b3 = (byte)(HexToInt(hexChars[11]) * 16 + HexToInt(hexChars[12])); byte b4 = (byte)(HexToInt(hexChars[13]) * 16 + HexToInt(hexChars[14])); return new Color32(b, b2, b3, b4); } default: return new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); } } public static Color32 HexCharsToColor(char[] hexChars, int startIndex, int length) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) switch (length) { case 7: { byte b5 = (byte)(HexToInt(hexChars[startIndex + 1]) * 16 + HexToInt(hexChars[startIndex + 2])); byte b6 = (byte)(HexToInt(hexChars[startIndex + 3]) * 16 + HexToInt(hexChars[startIndex + 4])); byte b7 = (byte)(HexToInt(hexChars[startIndex + 5]) * 16 + HexToInt(hexChars[startIndex + 6])); return new Color32(b5, b6, b7, byte.MaxValue); } case 9: { byte b = (byte)(HexToInt(hexChars[startIndex + 1]) * 16 + HexToInt(hexChars[startIndex + 2])); byte b2 = (byte)(HexToInt(hexChars[startIndex + 3]) * 16 + HexToInt(hexChars[startIndex + 4])); byte b3 = (byte)(HexToInt(hexChars[startIndex + 5]) * 16 + HexToInt(hexChars[startIndex + 6])); byte b4 = (byte)(HexToInt(hexChars[startIndex + 7]) * 16 + HexToInt(hexChars[startIndex + 8])); return new Color32(b, b2, b3, b4); } default: return new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); } } public static int HexToInt(char hex) { return hex switch { '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15, 'a' => 10, 'b' => 11, 'c' => 12, 'd' => 13, 'e' => 14, 'f' => 15, _ => 15, }; } public static float ConvertToFloat(char[] chars, int startIndex, int length) { int lastIndex; return ConvertToFloat(chars, startIndex, length, out lastIndex); } public static float ConvertToFloat(char[] chars, int startIndex, int length, out int lastIndex) { if (startIndex == 0) { lastIndex = 0; return -32767f; } int num = startIndex + length; bool flag = true; float num2 = 0f; int num3 = 1; if (chars[startIndex] == '+') { num3 = 1; startIndex++; } else if (chars[startIndex] == '-') { num3 = -1; startIndex++; } float num4 = 0f; for (int i = startIndex; i < num; i++) { uint num5 = chars[i]; if ((num5 >= 48 && num5 <= 57) || num5 == 46) { if (num5 == 46) { flag = false; num2 = 0.1f; } else if (flag) { num4 = num4 * 10f + (float)((num5 - 48) * num3); } else { num4 += (float)(num5 - 48) * num2 * (float)num3; num2 *= 0.1f; } } else if (num5 == 44) { if (i + 1 < num && chars[i + 1] == ' ') { lastIndex = i + 1; } else { lastIndex = i; } return num4; } } lastIndex = num; return num4; } public static Vector2 PackUV(float x, float y, float scale) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); val.x = (int)(x * 511f); val.y = (int)(y * 511f); val.x = val.x * 4096f + val.y; val.y = scale; return val; } public static void StringToCharArray(string sourceText, ref int[] charBuffer, ref TextProcessingStack styleStack, TextGenerationSettings generationSettings) { if (sourceText == null) { charBuffer[0] = 0; return; } if (charBuffer == null) { charBuffer = new int[8]; } styleStack.SetDefault(0); int writeIndex = 0; for (int i = 0; i < sourceText.Length; i++) { if (sourceText[i] == '\\' && sourceText.Length > i + 1) { switch (sourceText[i + 1]) { case 85: if (sourceText.Length > i + 9) { if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = GetUtf32(sourceText, i + 2); i += 9; writeIndex++; continue; } break; case 92: if (!generationSettings.parseControlCharacters || sourceText.Length <= i + 2) { break; } if (writeIndex + 2 > charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = sourceText[i + 1]; charBuffer[writeIndex + 1] = sourceText[i + 2]; i += 2; writeIndex += 2; continue; case 110: if (!generationSettings.parseControlCharacters) { break; } if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = 10; i++; writeIndex++; continue; case 114: if (!generationSettings.parseControlCharacters) { break; } if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = 13; i++; writeIndex++; continue; case 116: if (!generationSettings.parseControlCharacters) { break; } if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = 9; i++; writeIndex++; continue; case 117: if (sourceText.Length > i + 5) { if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = (ushort)GetUtf16(sourceText, i + 2); i += 5; writeIndex++; continue; } break; } } if (char.IsHighSurrogate(sourceText[i]) && char.IsLowSurrogate(sourceText[i + 1])) { if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = char.ConvertToUtf32(sourceText[i], sourceText[i + 1]); i++; writeIndex++; continue; } if (sourceText[i] == '<' && generationSettings.richText) { if (IsTagName(ref sourceText, "
", i)) { if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = 10; writeIndex++; i += 3; continue; } if (IsTagName(ref sourceText, "", i)) { ReplaceClosingStyleTag(ref charBuffer, ref writeIndex, ref styleStack, ref generationSettings); i += 7; continue; } } if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = sourceText[i]; writeIndex++; } if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = 0; } private static void ResizeInternalArray(ref T[] array) { int newSize = Mathf.NextPowerOfTwo(array.Length + 1); Array.Resize(ref array, newSize); } internal static void ResizeArray(T[] array) { int num = array.Length * 2; if (num == 0) { num = 8; } Array.Resize(ref array, num); } private static bool IsTagName(ref string text, string tag, int index) { if (text.Length < index + tag.Length) { return false; } for (int i = 0; i < tag.Length; i++) { if (TextUtilities.ToUpperFast(text[index + i]) != tag[i]) { return false; } } return true; } private static bool IsTagName(ref int[] text, string tag, int index) { if (text.Length < index + tag.Length) { return false; } for (int i = 0; i < tag.Length; i++) { if (TextUtilities.ToUpperFast((char)text[index + i]) != tag[i]) { return false; } } return true; } private static bool ReplaceOpeningStyleTag(ref int[] sourceText, int srcIndex, out int srcOffset, ref int[] charBuffer, ref int writeIndex, ref TextProcessingStack styleStack, ref TextGenerationSettings generationSettings) { int tagHashCode = GetTagHashCode(ref sourceText, srcIndex + 7, out srcOffset); TextStyle style = GetStyle(generationSettings, tagHashCode); if (style == null || srcOffset == 0) { return false; } styleStack.Add(style.hashCode); int num = style.styleOpeningTagArray.Length; int[] text = style.styleOpeningTagArray; for (int i = 0; i < num; i++) { int num2 = text[i]; if (num2 == 60) { if (IsTagName(ref text, "
", i)) { if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = 10; writeIndex++; i += 3; continue; } if (IsTagName(ref text, "", i)) { ReplaceClosingStyleTag(ref charBuffer, ref writeIndex, ref styleStack, ref generationSettings); i += 7; continue; } } if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = num2; writeIndex++; } return true; } private static bool ReplaceOpeningStyleTag(ref string sourceText, int srcIndex, out int srcOffset, ref int[] charBuffer, ref int writeIndex, ref TextProcessingStack styleStack, ref TextGenerationSettings generationSettings) { int tagHashCode = GetTagHashCode(ref sourceText, srcIndex + 7, out srcOffset); TextStyle style = GetStyle(generationSettings, tagHashCode); if (style == null || srcOffset == 0) { return false; } styleStack.Add(style.hashCode); int num = style.styleOpeningTagArray.Length; int[] text = style.styleOpeningTagArray; for (int i = 0; i < num; i++) { int num2 = text[i]; if (num2 == 60) { if (IsTagName(ref text, "
", i)) { if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = 10; writeIndex++; i += 3; continue; } if (IsTagName(ref text, "", i)) { ReplaceClosingStyleTag(ref charBuffer, ref writeIndex, ref styleStack, ref generationSettings); i += 7; continue; } } if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = num2; writeIndex++; } return true; } private static void ReplaceClosingStyleTag(ref int[] charBuffer, ref int writeIndex, ref TextProcessingStack styleStack, ref TextGenerationSettings generationSettings) { int hashCode = styleStack.CurrentItem(); TextStyle style = GetStyle(generationSettings, hashCode); styleStack.Remove(); if (style == null) { return; } int num = style.styleClosingTagArray.Length; int[] text = style.styleClosingTagArray; for (int i = 0; i < num; i++) { int num2 = text[i]; if (num2 == 60) { if (IsTagName(ref text, "
", i)) { if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = 10; writeIndex++; i += 3; continue; } if (IsTagName(ref text, "", i)) { ReplaceClosingStyleTag(ref charBuffer, ref writeIndex, ref styleStack, ref generationSettings); i += 7; continue; } } if (writeIndex == charBuffer.Length) { ResizeInternalArray(ref charBuffer); } charBuffer[writeIndex] = num2; writeIndex++; } } private static TextStyle GetStyle(TextGenerationSettings generationSetting, int hashCode) { TextStyle textStyle = null; TextStyleSheet styleSheet = generationSetting.styleSheet; if ((Object)(object)styleSheet != (Object)null) { textStyle = styleSheet.GetStyle(hashCode); if (textStyle != null) { return textStyle; } } styleSheet = generationSetting.textSettings.defaultStyleSheet; if ((Object)(object)styleSheet != (Object)null) { textStyle = styleSheet.GetStyle(hashCode); } return textStyle; } private static int GetUtf32(string text, int i) { int num = 0; num += HexToInt(text[i]) << 30; num += HexToInt(text[i + 1]) << 24; num += HexToInt(text[i + 2]) << 20; num += HexToInt(text[i + 3]) << 16; num += HexToInt(text[i + 4]) << 12; num += HexToInt(text[i + 5]) << 8; num += HexToInt(text[i + 6]) << 4; return num + HexToInt(text[i + 7]); } private static int GetUtf16(string text, int i) { int num = 0; num += HexToInt(text[i]) << 12; num += HexToInt(text[i + 1]) << 8; num += HexToInt(text[i + 2]) << 4; return num + HexToInt(text[i + 3]); } private static int GetTagHashCode(ref int[] text, int index, out int closeIndex) { int num = 0; closeIndex = 0; for (int i = index; i < text.Length; i++) { if (text[i] != 34) { if (text[i] == 62) { closeIndex = i; break; } num = ((num << 5) + num) ^ (int)TextUtilities.ToUpperASCIIFast((ushort)text[i]); } } return num; } private static int GetTagHashCode(ref string text, int index, out int closeIndex) { int num = 0; closeIndex = 0; for (int i = index; i < text.Length; i++) { if (text[i] != '"') { if (text[i] == '>') { closeIndex = i; break; } num = ((num << 5) + num) ^ (int)TextUtilities.ToUpperASCIIFast(text[i]); } } return num; } public static void FillCharacterVertexBuffers(int i, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) int materialReferenceIndex = textInfo.textElementInfo[i].materialReferenceIndex; int vertexCount = textInfo.meshInfo[materialReferenceIndex].vertexCount; if (vertexCount >= textInfo.meshInfo[materialReferenceIndex].vertices.Length) { textInfo.meshInfo[materialReferenceIndex].ResizeMeshInfo(Mathf.NextPowerOfTwo((vertexCount + 4) / 4)); } TextElementInfo[] textElementInfo = textInfo.textElementInfo; textInfo.textElementInfo[i].vertexIndex = vertexCount; if (generationSettings.inverseYAxis) { Vector3 val = default(Vector3); val.x = 0f; val.y = ((Rect)(ref generationSettings.screenRect)).y + ((Rect)(ref generationSettings.screenRect)).height; val.z = 0f; Vector3 position = textElementInfo[i].vertexBottomLeft.position; position.y *= -1f; textInfo.meshInfo[materialReferenceIndex].vertices[vertexCount] = position + val; position = textElementInfo[i].vertexTopLeft.position; position.y *= -1f; textInfo.meshInfo[materialReferenceIndex].vertices[1 + vertexCount] = position + val; position = textElementInfo[i].vertexTopRight.position; position.y *= -1f; textInfo.meshInfo[materialReferenceIndex].vertices[2 + vertexCount] = position + val; position = textElementInfo[i].vertexBottomRight.position; position.y *= -1f; textInfo.meshInfo[materialReferenceIndex].vertices[3 + vertexCount] = position + val; } else { textInfo.meshInfo[materialReferenceIndex].vertices[vertexCount] = textElementInfo[i].vertexBottomLeft.position; textInfo.meshInfo[materialReferenceIndex].vertices[1 + vertexCount] = textElementInfo[i].vertexTopLeft.position; textInfo.meshInfo[materialReferenceIndex].vertices[2 + vertexCount] = textElementInfo[i].vertexTopRight.position; textInfo.meshInfo[materialReferenceIndex].vertices[3 + vertexCount] = textElementInfo[i].vertexBottomRight.position; } textInfo.meshInfo[materialReferenceIndex].uvs0[vertexCount] = textElementInfo[i].vertexBottomLeft.uv; textInfo.meshInfo[materialReferenceIndex].uvs0[1 + vertexCount] = textElementInfo[i].vertexTopLeft.uv; textInfo.meshInfo[materialReferenceIndex].uvs0[2 + vertexCount] = textElementInfo[i].vertexTopRight.uv; textInfo.meshInfo[materialReferenceIndex].uvs0[3 + vertexCount] = textElementInfo[i].vertexBottomRight.uv; textInfo.meshInfo[materialReferenceIndex].uvs2[vertexCount] = textElementInfo[i].vertexBottomLeft.uv2; textInfo.meshInfo[materialReferenceIndex].uvs2[1 + vertexCount] = textElementInfo[i].vertexTopLeft.uv2; textInfo.meshInfo[materialReferenceIndex].uvs2[2 + vertexCount] = textElementInfo[i].vertexTopRight.uv2; textInfo.meshInfo[materialReferenceIndex].uvs2[3 + vertexCount] = textElementInfo[i].vertexBottomRight.uv2; textInfo.meshInfo[materialReferenceIndex].colors32[vertexCount] = textElementInfo[i].vertexBottomLeft.color; textInfo.meshInfo[materialReferenceIndex].colors32[1 + vertexCount] = textElementInfo[i].vertexTopLeft.color; textInfo.meshInfo[materialReferenceIndex].colors32[2 + vertexCount] = textElementInfo[i].vertexTopRight.color; textInfo.meshInfo[materialReferenceIndex].colors32[3 + vertexCount] = textElementInfo[i].vertexBottomRight.color; textInfo.meshInfo[materialReferenceIndex].vertexCount = vertexCount + 4; } public static void FillSpriteVertexBuffers(int i, TextGenerationSettings generationSettings, TextInfo textInfo) { //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) int materialReferenceIndex = textInfo.textElementInfo[i].materialReferenceIndex; int vertexCount = textInfo.meshInfo[materialReferenceIndex].vertexCount; TextElementInfo[] textElementInfo = textInfo.textElementInfo; textInfo.textElementInfo[i].vertexIndex = vertexCount; if (generationSettings.inverseYAxis) { Vector3 val = default(Vector3); val.x = 0f; val.y = ((Rect)(ref generationSettings.screenRect)).y + ((Rect)(ref generationSettings.screenRect)).height; val.z = 0f; Vector3 position = textElementInfo[i].vertexBottomLeft.position; position.y *= -1f; textInfo.meshInfo[materialReferenceIndex].vertices[vertexCount] = position + val; position = textElementInfo[i].vertexTopLeft.position; position.y *= -1f; textInfo.meshInfo[materialReferenceIndex].vertices[1 + vertexCount] = position + val; position = textElementInfo[i].vertexTopRight.position; position.y *= -1f; textInfo.meshInfo[materialReferenceIndex].vertices[2 + vertexCount] = position + val; position = textElementInfo[i].vertexBottomRight.position; position.y *= -1f; textInfo.meshInfo[materialReferenceIndex].vertices[3 + vertexCount] = position + val; } else { textInfo.meshInfo[materialReferenceIndex].vertices[vertexCount] = textElementInfo[i].vertexBottomLeft.position; textInfo.meshInfo[materialReferenceIndex].vertices[1 + vertexCount] = textElementInfo[i].vertexTopLeft.position; textInfo.meshInfo[materialReferenceIndex].vertices[2 + vertexCount] = textElementInfo[i].vertexTopRight.position; textInfo.meshInfo[materialReferenceIndex].vertices[3 + vertexCount] = textElementInfo[i].vertexBottomRight.position; } textInfo.meshInfo[materialReferenceIndex].uvs0[vertexCount] = textElementInfo[i].vertexBottomLeft.uv; textInfo.meshInfo[materialReferenceIndex].uvs0[1 + vertexCount] = textElementInfo[i].vertexTopLeft.uv; textInfo.meshInfo[materialReferenceIndex].uvs0[2 + vertexCount] = textElementInfo[i].vertexTopRight.uv; textInfo.meshInfo[materialReferenceIndex].uvs0[3 + vertexCount] = textElementInfo[i].vertexBottomRight.uv; textInfo.meshInfo[materialReferenceIndex].uvs2[vertexCount] = textElementInfo[i].vertexBottomLeft.uv2; textInfo.meshInfo[materialReferenceIndex].uvs2[1 + vertexCount] = textElementInfo[i].vertexTopLeft.uv2; textInfo.meshInfo[materialReferenceIndex].uvs2[2 + vertexCount] = textElementInfo[i].vertexTopRight.uv2; textInfo.meshInfo[materialReferenceIndex].uvs2[3 + vertexCount] = textElementInfo[i].vertexBottomRight.uv2; textInfo.meshInfo[materialReferenceIndex].colors32[vertexCount] = textElementInfo[i].vertexBottomLeft.color; textInfo.meshInfo[materialReferenceIndex].colors32[1 + vertexCount] = textElementInfo[i].vertexTopLeft.color; textInfo.meshInfo[materialReferenceIndex].colors32[2 + vertexCount] = textElementInfo[i].vertexTopRight.color; textInfo.meshInfo[materialReferenceIndex].colors32[3 + vertexCount] = textElementInfo[i].vertexBottomRight.color; textInfo.meshInfo[materialReferenceIndex].vertexCount = vertexCount + 4; } public static void AdjustLineOffset(int startIndex, int endIndex, float offset, TextInfo textInfo) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, offset, 0f); for (int i = startIndex; i <= endIndex; i++) { ref Vector3 bottomLeft = ref textInfo.textElementInfo[i].bottomLeft; bottomLeft -= val; ref Vector3 topLeft = ref textInfo.textElementInfo[i].topLeft; topLeft -= val; ref Vector3 topRight = ref textInfo.textElementInfo[i].topRight; topRight -= val; ref Vector3 bottomRight = ref textInfo.textElementInfo[i].bottomRight; bottomRight -= val; textInfo.textElementInfo[i].ascender -= val.y; textInfo.textElementInfo[i].baseLine -= val.y; textInfo.textElementInfo[i].descender -= val.y; if (textInfo.textElementInfo[i].isVisible) { ref Vector3 position = ref textInfo.textElementInfo[i].vertexBottomLeft.position; position -= val; ref Vector3 position2 = ref textInfo.textElementInfo[i].vertexTopLeft.position; position2 -= val; ref Vector3 position3 = ref textInfo.textElementInfo[i].vertexTopRight.position; position3 -= val; ref Vector3 position4 = ref textInfo.textElementInfo[i].vertexBottomRight.position; position4 -= val; } } } public static void ResizeLineExtents(int size, TextInfo textInfo) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) size = ((size > 1024) ? (size + 256) : Mathf.NextPowerOfTwo(size + 1)); LineInfo[] array = new LineInfo[size]; for (int i = 0; i < size; i++) { if (i < textInfo.lineInfo.Length) { array[i] = textInfo.lineInfo[i]; continue; } array[i].lineExtents.min = largePositiveVector2; array[i].lineExtents.max = largeNegativeVector2; array[i].ascender = -32767f; array[i].descender = 32767f; } textInfo.lineInfo = array; } public static FontStyles LegacyStyleToNewStyle(FontStyle fontStyle) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected I4, but got Unknown return (fontStyle - 1) switch { 0 => FontStyles.Bold, 1 => FontStyles.Italic, 2 => FontStyles.Bold | FontStyles.Italic, _ => FontStyles.Normal, }; } public static TextAlignment LegacyAlignmentToNewAlignment(TextAnchor anchor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected I4, but got Unknown return (int)anchor switch { 0 => TextAlignment.TopLeft, 1 => TextAlignment.TopCenter, 2 => TextAlignment.TopRight, 3 => TextAlignment.MiddleLeft, 4 => TextAlignment.MiddleCenter, 5 => TextAlignment.MiddleRight, 6 => TextAlignment.BottomLeft, 7 => TextAlignment.BottomCenter, 8 => TextAlignment.BottomRight, _ => TextAlignment.TopLeft, }; } } internal struct PageInfo { public int firstCharacterIndex; public int lastCharacterIndex; public float ascender; public float baseLine; public float descender; } internal struct WordInfo { public int firstCharacterIndex; public int lastCharacterIndex; public int characterCount; } internal class TextInfo { private static Vector2 s_InfinityVectorPositive = new Vector2(32767f, 32767f); private static Vector2 s_InfinityVectorNegative = new Vector2(-32767f, -32767f); public int characterCount; public int spriteCount; public int spaceCount; public int wordCount; public int linkCount; public int lineCount; public int pageCount; public int materialCount; public TextElementInfo[] textElementInfo; public WordInfo[] wordInfo; public LinkInfo[] linkInfo; public LineInfo[] lineInfo; public PageInfo[] pageInfo; public MeshInfo[] meshInfo; public bool isDirty; public TextInfo() { textElementInfo = new TextElementInfo[4]; wordInfo = new WordInfo[1]; lineInfo = new LineInfo[1]; pageInfo = new PageInfo[1]; linkInfo = new LinkInfo[0]; meshInfo = new MeshInfo[1]; materialCount = 0; isDirty = true; } internal void Clear() { characterCount = 0; spaceCount = 0; wordCount = 0; linkCount = 0; lineCount = 0; pageCount = 0; spriteCount = 0; for (int i = 0; i < meshInfo.Length; i++) { meshInfo[i].vertexCount = 0; } } internal void ClearMeshInfo(bool updateMesh) { for (int i = 0; i < meshInfo.Length; i++) { meshInfo[i].Clear(updateMesh); } } internal void ClearLineInfo() { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) if (lineInfo == null) { lineInfo = new LineInfo[1]; } for (int i = 0; i < lineInfo.Length; i++) { lineInfo[i].characterCount = 0; lineInfo[i].spaceCount = 0; lineInfo[i].wordCount = 0; lineInfo[i].controlCharacterCount = 0; lineInfo[i].ascender = s_InfinityVectorNegative.x; lineInfo[i].baseline = 0f; lineInfo[i].descender = s_InfinityVectorPositive.x; lineInfo[i].maxAdvance = 0f; lineInfo[i].marginLeft = 0f; lineInfo[i].marginRight = 0f; lineInfo[i].lineExtents.min = s_InfinityVectorPositive; lineInfo[i].lineExtents.max = s_InfinityVectorNegative; lineInfo[i].width = 0f; } } internal static void Resize(ref T[] array, int size) { int newSize = ((size > 1024) ? (size + 256) : Mathf.NextPowerOfTwo(size)); Array.Resize(ref array, newSize); } internal static void Resize(ref T[] array, int size, bool isBlockAllocated) { if (isBlockAllocated) { size = ((size > 1024) ? (size + 256) : Mathf.NextPowerOfTwo(size)); } if (size != array.Length) { Array.Resize(ref array, size); } } } internal enum MarkupTag { BOLD = 66, SLASH_BOLD = 1613, ITALIC = 73, SLASH_ITALIC = 1606, UNDERLINE = 85, SLASH_UNDERLINE = 1626, STRIKETHROUGH = 83, SLASH_STRIKETHROUGH = 1628, MARK = 2699125, SLASH_MARK = 57644506, SUBSCRIPT = 92132, SLASH_SUBSCRIPT = 1770219, SUPERSCRIPT = 92150, SLASH_SUPERSCRIPT = 1770233, COLOR = 81999901, SLASH_COLOR = 1909026194, ALPHA = 75165780, A = 65, SLASH_A = 1614, SIZE = 3061285, SLASH_SIZE = 58429962, SPRITE = -991527447, NO_BREAK = 2856657, SLASH_NO_BREAK = 57477502, STYLE = 100252951, SLASH_STYLE = 1927738392, FONT = 2586451, SLASH_FONT = 57747708, SLASH_MATERIAL = -1100708252, LINK = 2656128, SLASH_LINK = 57686191, FONT_WEIGHT = -1889896162, SLASH_FONT_WEIGHT = -757976431, NO_PARSE = -408011596, SLASH_NO_PARSE = -294095813, POSITION = 85420, SLASH_POSITION = 1777699, VERTICAL_OFFSET = 1952379995, SLASH_VERTICAL_OFFSET = -11107948, SPACE = 100083556, SLASH_SPACE = 1927873067, PAGE = 2808691, SLASH_PAGE = 58683868, ALIGN = 75138797, SLASH_ALIGN = 1916026786, WIDTH = 105793766, SLASH_WIDTH = 1923459625, GRADIENT = -1999759898, SLASH_GRADIENT = -1854491959, CHARACTER_SPACE = -1584382009, SLASH_CHARACTER_SPACE = -1394426712, MONOSPACE = -1340221943, SLASH_MONOSPACE = -1638865562, CLASS = 82115566, INDENT = -1514123076, SLASH_INDENT = -1496889389, LINE_INDENT = -844305121, SLASH_LINE_INDENT = 93886352, MARGIN = -1355614050, SLASH_MARGIN = -1649644303, MARGIN_LEFT = -272933656, MARGIN_RIGHT = -447416589, LINE_HEIGHT = -799081892, SLASH_LINE_HEIGHT = 200452819, ACTION = -1827519330, SLASH_ACTION = -1187217679, SCALE = 100553336, SLASH_SCALE = 1928413879, ROTATE = -1000007783, SLASH_ROTATE = -764695562, LOWERCASE = -1506899689, SLASH_LOWERCASE = -1451284584, ALLCAPS = 218273952, SLASH_ALLCAPS = -797437649, UPPERCASE = -305409418, SLASH_UPPERCASE = -582368199, SMALLCAPS = -766062114, SLASH_SMALLCAPS = 199921873, LIGA = 2655971, SLASH_LIGA = 57686604, FRAC = 2598518, SLASH_FRAC = 57774681, NAME = 2875623, INDEX = 84268030, TINT = 2960519, ANIM = 2283339, MATERIAL = 825491659, HREF = 2535353, ANGLE = 75347905, RED = 91635, GREEN = 87065851, BLUE = 2457214, YELLOW = -882444668, ORANGE = -1108587920, BLACK = 81074727, WHITE = 105680263, PURPLE = -1250222130, BR = 2256, ZWSP = 3288238, NBSP = 2869039, SHY = 92674, LEFT = 2660507, RIGHT = 99937376, CENTER = -1591113269, JUSTIFIED = 817091359, FLUSH = 85552164, NONE = 2857034, PLUS = 43, MINUS = 45, PX = 2568, PLUS_PX = 49507, MINUS_PX = 47461, EM = 2216, PLUS_EM = 49091, MINUS_EM = 46789, PCT = 85031, PLUS_PCT = 1634348, MINUS_PCT = 1567082, PERCENTAGE = 37, PLUS_PERCENTAGE = 1454, MINUS_PERCENTAGE = 1512, TRUE = 2932022, FALSE = 85422813, INVALID = 1585415185, NORMAL = -1183493901, DEFAULT = -620974005 } internal enum TagValueType { None = 0, NumericalValue = 1, StringValue = 2, ColorValue = 4 } internal enum TagUnitType { Pixels, FontUnits, Percentage } internal static class UnicodeCodePoint { public const uint SPACE = 32u; public const uint DOUBLE_QUOTE = 34u; public const uint NUMBER_SIGN = 35u; public const uint PERCENTAGE = 37u; public const uint PLUS = 43u; public const uint MINUS = 45u; public const uint PERIOD = 46u; public const uint HYPHEN_MINUS = 45u; public const uint SOFT_HYPHEN = 173u; public const uint HYPHEN = 8208u; public const uint NON_BREAKING_HYPHEN = 8209u; public const uint ZERO_WIDTH_SPACE = 8203u; public const uint RIGHT_SINGLE_QUOTATION = 8217u; public const uint APOSTROPHE = 39u; public const uint WORD_JOINER = 8288u; public const uint HIGH_SURROGATE_START = 55296u; public const uint HIGH_SURROGATE_END = 56319u; public const uint LOW_SURROGATE_START = 56320u; public const uint LOW_SURROGATE_END = 57343u; public const int UNICODE_PLANE01_START = 65536; } internal struct FontStyleStack { public byte bold; public byte italic; public byte underline; public byte strikethrough; public byte highlight; public byte superscript; public byte subscript; public byte uppercase; public byte lowercase; public byte smallcaps; public void Clear() { bold = 0; italic = 0; underline = 0; strikethrough = 0; highlight = 0; superscript = 0; subscript = 0; uppercase = 0; lowercase = 0; smallcaps = 0; } public byte Add(FontStyles style) { switch (style) { case FontStyles.Bold: bold++; return bold; case FontStyles.Italic: italic++; return italic; case FontStyles.Underline: underline++; return underline; case FontStyles.UpperCase: uppercase++; return uppercase; case FontStyles.LowerCase: lowercase++; return lowercase; case FontStyles.Strikethrough: strikethrough++; return strikethrough; case FontStyles.Superscript: superscript++; return superscript; case FontStyles.Subscript: subscript++; return subscript; case FontStyles.Highlight: highlight++; return highlight; default: return 0; } } public byte Remove(FontStyles style) { switch (style) { case FontStyles.Bold: if (bold > 1) { bold--; } else { bold = 0; } return bold; case FontStyles.Italic: if (italic > 1) { italic--; } else { italic = 0; } return italic; case FontStyles.Underline: if (underline > 1) { underline--; } else { underline = 0; } return underline; case FontStyles.UpperCase: if (uppercase > 1) { uppercase--; } else { uppercase = 0; } return uppercase; case FontStyles.LowerCase: if (lowercase > 1) { lowercase--; } else { lowercase = 0; } return lowercase; case FontStyles.Strikethrough: if (strikethrough > 1) { strikethrough--; } else { strikethrough = 0; } return strikethrough; case FontStyles.Highlight: if (highlight > 1) { highlight--; } else { highlight = 0; } return highlight; case FontStyles.Superscript: if (superscript > 1) { superscript--; } else { superscript = 0; } return superscript; case FontStyles.Subscript: if (subscript > 1) { subscript--; } else { subscript = 0; } return subscript; default: return 0; } } } [DebuggerDisplay("Item count = {m_Count}")] internal struct TextProcessingStack { public T[] itemStack; public int index; private T m_DefaultItem; private int m_Capacity; private int m_RolloverSize; private int m_Count; private const int k_DefaultCapacity = 4; public int Count => m_Count; public T current { get { if (index > 0) { return itemStack[index - 1]; } return itemStack[0]; } } public int rolloverSize { get { return m_RolloverSize; } set { m_RolloverSize = value; } } public TextProcessingStack(T[] stack) { itemStack = stack; m_Capacity = stack.Length; index = 0; m_RolloverSize = 0; m_DefaultItem = default(T); m_Count = 0; } public TextProcessingStack(int capacity) { itemStack = new T[capacity]; m_Capacity = capacity; index = 0; m_RolloverSize = 0; m_DefaultItem = default(T); m_Count = 0; } public TextProcessingStack(int capacity, int rolloverSize) { itemStack = new T[capacity]; m_Capacity = capacity; index = 0; m_RolloverSize = rolloverSize; m_DefaultItem = default(T); m_Count = 0; } internal static void SetDefault(TextProcessingStack[] stack, T item) { for (int i = 0; i < stack.Length; i++) { stack[i].SetDefault(item); } } public void Clear() { index = 0; m_Count = 0; } public void SetDefault(T item) { if (itemStack == null) { m_Capacity = 4; itemStack = new T[m_Capacity]; m_DefaultItem = default(T); } itemStack[0] = item; index = 1; } public void Add(T item) { if (index < itemStack.Length) { itemStack[index] = item; index++; } } public T Remove() { index--; if (index <= 0) { index = 1; return itemStack[0]; } return itemStack[index - 1]; } public void Push(T item) { if (index == m_Capacity) { m_Capacity *= 2; if (m_Capacity == 0) { m_Capacity = 4; } Array.Resize(ref itemStack, m_Capacity); } itemStack[index] = item; if (m_RolloverSize == 0) { index++; m_Count++; } else { index = (index + 1) % m_RolloverSize; m_Count = ((m_Count < m_RolloverSize) ? (m_Count + 1) : m_RolloverSize); } } public T Pop() { if (index == 0 && m_RolloverSize == 0) { return default(T); } if (m_RolloverSize == 0) { index--; } else { index = (index - 1) % m_RolloverSize; index = ((index < 0) ? (index + m_RolloverSize) : index); } T result = itemStack[index]; itemStack[index] = m_DefaultItem; m_Count = ((m_Count > 0) ? (m_Count - 1) : 0); return result; } public T Peek() { if (index == 0) { return m_DefaultItem; } return itemStack[index - 1]; } public T CurrentItem() { if (index > 0) { return itemStack[index - 1]; } return itemStack[0]; } public T PreviousItem() { if (index > 1) { return itemStack[index - 2]; } return itemStack[0]; } } internal class TextResourceManager { private struct FontAssetRef { public int nameHashCode; public int familyNameHashCode; public int styleNameHashCode; public long familyNameAndStyleHashCode; public readonly FontAsset fontAsset; public FontAssetRef(int nameHashCode, int familyNameHashCode, int styleNameHashCode, FontAsset fontAsset) { this.nameHashCode = nameHashCode; this.familyNameHashCode = familyNameHashCode; this.styleNameHashCode = styleNameHashCode; familyNameAndStyleHashCode = ((long)styleNameHashCode << 32) | (uint)familyNameHashCode; this.fontAsset = fontAsset; } } private static readonly Dictionary s_FontAssetReferences = new Dictionary(); private static readonly Dictionary s_FontAssetNameReferenceLookup = new Dictionary(); private static readonly Dictionary s_FontAssetFamilyNameAndStyleReferenceLookup = new Dictionary(); private static readonly List s_FontAssetRemovalList = new List(16); private static readonly int k_RegularStyleHashCode = TextUtilities.GetHashCodeCaseInSensitive("Regular"); internal static void AddFontAsset(FontAsset fontAsset) { int instanceID = fontAsset.instanceID; if (!s_FontAssetReferences.ContainsKey(instanceID)) { FontAssetRef value = new FontAssetRef(fontAsset.hashCode, fontAsset.familyNameHashCode, fontAsset.styleNameHashCode, fontAsset); s_FontAssetReferences.Add(instanceID, value); if (!s_FontAssetNameReferenceLookup.ContainsKey(value.nameHashCode)) { s_FontAssetNameReferenceLookup.Add(value.nameHashCode, fontAsset); } if (!s_FontAssetFamilyNameAndStyleReferenceLookup.ContainsKey(value.familyNameAndStyleHashCode)) { s_FontAssetFamilyNameAndStyleReferenceLookup.Add(value.familyNameAndStyleHashCode, fontAsset); } return; } FontAssetRef value2 = s_FontAssetReferences[instanceID]; if (value2.nameHashCode == fontAsset.hashCode && value2.familyNameHashCode == fontAsset.familyNameHashCode && value2.styleNameHashCode == fontAsset.styleNameHashCode) { return; } if (value2.nameHashCode != fontAsset.hashCode) { s_FontAssetNameReferenceLookup.Remove(value2.nameHashCode); value2.nameHashCode = fontAsset.hashCode; if (!s_FontAssetNameReferenceLookup.ContainsKey(value2.nameHashCode)) { s_FontAssetNameReferenceLookup.Add(value2.nameHashCode, fontAsset); } } if (value2.familyNameHashCode != fontAsset.familyNameHashCode || value2.styleNameHashCode != fontAsset.styleNameHashCode) { s_FontAssetFamilyNameAndStyleReferenceLookup.Remove(value2.familyNameAndStyleHashCode); value2.familyNameHashCode = fontAsset.familyNameHashCode; value2.styleNameHashCode = fontAsset.styleNameHashCode; value2.familyNameAndStyleHashCode = ((long)fontAsset.styleNameHashCode << 32) | (uint)fontAsset.familyNameHashCode; if (!s_FontAssetFamilyNameAndStyleReferenceLookup.ContainsKey(value2.familyNameAndStyleHashCode)) { s_FontAssetFamilyNameAndStyleReferenceLookup.Add(value2.familyNameAndStyleHashCode, fontAsset); } } s_FontAssetReferences[instanceID] = value2; } internal static void RemoveFontAsset(FontAsset fontAsset) { } internal static bool TryGetFontAssetByName(int nameHashcode, out FontAsset fontAsset) { return s_FontAssetNameReferenceLookup.TryGetValue(nameHashcode, out fontAsset); } internal static bool TryGetFontAssetByFamilyName(int familyNameHashCode, int styleNameHashCode, out FontAsset fontAsset) { fontAsset = null; if (styleNameHashCode == 0) { styleNameHashCode = k_RegularStyleHashCode; } long key = ((long)styleNameHashCode << 32) | (uint)familyNameHashCode; return s_FontAssetFamilyNameAndStyleReferenceLookup.TryGetValue(key, out fontAsset); } internal static void RebuildFontAssetCache() { foreach (KeyValuePair s_FontAssetReference in s_FontAssetReferences) { FontAssetRef value = s_FontAssetReference.Value; FontAsset fontAsset = value.fontAsset; if ((Object)(object)fontAsset == (Object)null) { s_FontAssetNameReferenceLookup.Remove(value.nameHashCode); s_FontAssetFamilyNameAndStyleReferenceLookup.Remove(value.familyNameAndStyleHashCode); s_FontAssetRemovalList.Add(s_FontAssetReference.Key); } else { fontAsset.InitializeCharacterLookupDictionary(); fontAsset.AddSynthesizedCharactersAndFaceMetrics(); } } for (int i = 0; i < s_FontAssetRemovalList.Count; i++) { s_FontAssetReferences.Remove(s_FontAssetRemovalList[i]); } s_FontAssetRemovalList.Clear(); TextEventManager.ON_FONT_PROPERTY_CHANGED(isChanged: true, null); } } [Serializable] [ExcludeFromObjectFactory] [ExcludeFromPreset] public class TextSettings : ScriptableObject { [Serializable] private struct FontReferenceMap { public Font font; public FontAsset fontAsset; public FontReferenceMap(Font font, FontAsset fontAsset) { this.font = font; this.fontAsset = fontAsset; } } [SerializeField] protected string m_Version; [FormerlySerializedAs("m_defaultFontAsset")] [SerializeField] protected FontAsset m_DefaultFontAsset; [FormerlySerializedAs("m_defaultFontAssetPath")] [SerializeField] protected string m_DefaultFontAssetPath = "Fonts & Materials/"; [FormerlySerializedAs("m_fallbackFontAssets")] [SerializeField] protected List m_FallbackFontAssets; [FormerlySerializedAs("m_matchMaterialPreset")] [SerializeField] protected bool m_MatchMaterialPreset; [FormerlySerializedAs("m_missingGlyphCharacter")] [SerializeField] protected int m_MissingCharacterUnicode; [SerializeField] protected bool m_ClearDynamicDataOnBuild = true; [FormerlySerializedAs("m_defaultSpriteAsset")] [SerializeField] protected SpriteAsset m_DefaultSpriteAsset; [FormerlySerializedAs("m_defaultSpriteAssetPath")] [SerializeField] protected string m_DefaultSpriteAssetPath = "Sprite Assets/"; [SerializeField] protected List m_FallbackSpriteAssets; [SerializeField] protected uint m_MissingSpriteCharacterUnicode; [SerializeField] [FormerlySerializedAs("m_defaultStyleSheet")] protected TextStyleSheet m_DefaultStyleSheet; [SerializeField] protected string m_StyleSheetsResourcePath = "Text Style Sheets/"; [FormerlySerializedAs("m_defaultColorGradientPresetsPath")] [SerializeField] protected string m_DefaultColorGradientPresetsPath = "Text Color Gradients/"; [SerializeField] protected UnicodeLineBreakingRules m_UnicodeLineBreakingRules; [FormerlySerializedAs("m_warningsDisabled")] [SerializeField] protected bool m_DisplayWarnings = false; internal Dictionary m_FontLookup; private List m_FontReferences = new List(); public string version { get { return m_Version; } internal set { m_Version = value; } } public FontAsset defaultFontAsset { get { return m_DefaultFontAsset; } set { m_DefaultFontAsset = value; } } public string defaultFontAssetPath { get { return m_DefaultFontAssetPath; } set { m_DefaultFontAssetPath = value; } } public List fallbackFontAssets { get { return m_FallbackFontAssets; } set { m_FallbackFontAssets = value; } } public bool matchMaterialPreset { get { return m_MatchMaterialPreset; } set { m_MatchMaterialPreset = value; } } public int missingCharacterUnicode { get { return m_MissingCharacterUnicode; } set { m_MissingCharacterUnicode = value; } } public bool clearDynamicDataOnBuild { get { return m_ClearDynamicDataOnBuild; } set { m_ClearDynamicDataOnBuild = value; } } public SpriteAsset defaultSpriteAsset { get { return m_DefaultSpriteAsset; } set { m_DefaultSpriteAsset = value; } } public string defaultSpriteAssetPath { get { return m_DefaultSpriteAssetPath; } set { m_DefaultSpriteAssetPath = value; } } public List fallbackSpriteAssets { get { return m_FallbackSpriteAssets; } set { m_FallbackSpriteAssets = value; } } public uint missingSpriteCharacterUnicode { get { return m_MissingSpriteCharacterUnicode; } set { m_MissingSpriteCharacterUnicode = value; } } public TextStyleSheet defaultStyleSheet { get { return m_DefaultStyleSheet; } set { m_DefaultStyleSheet = value; } } public string styleSheetsResourcePath { get { return m_StyleSheetsResourcePath; } set { m_StyleSheetsResourcePath = value; } } public string defaultColorGradientPresetsPath { get { return m_DefaultColorGradientPresetsPath; } set { m_DefaultColorGradientPresetsPath = value; } } public UnicodeLineBreakingRules lineBreakingRules { get { if (m_UnicodeLineBreakingRules == null) { m_UnicodeLineBreakingRules = new UnicodeLineBreakingRules(); UnicodeLineBreakingRules.LoadLineBreakingRules(); } return m_UnicodeLineBreakingRules; } set { m_UnicodeLineBreakingRules = value; } } public bool displayWarnings { get { return m_DisplayWarnings; } set { m_DisplayWarnings = value; } } protected void InitializeFontReferenceLookup() { if (m_FontReferences == null) { m_FontReferences = new List(); } for (int i = 0; i < m_FontReferences.Count; i++) { FontReferenceMap fontReferenceMap = m_FontReferences[i]; if ((Object)(object)fontReferenceMap.font == (Object)null || (Object)(object)fontReferenceMap.fontAsset == (Object)null) { Debug.Log((object)"Deleting invalid font reference."); m_FontReferences.RemoveAt(i); i--; continue; } int instanceID = ((Object)fontReferenceMap.font).GetInstanceID(); if (!m_FontLookup.ContainsKey(instanceID)) { m_FontLookup.Add(instanceID, fontReferenceMap.fontAsset); } } } protected FontAsset GetCachedFontAssetInternal(Font font) { if (m_FontLookup == null) { m_FontLookup = new Dictionary(); InitializeFontReferenceLookup(); } int instanceID = ((Object)font).GetInstanceID(); if (m_FontLookup.ContainsKey(instanceID)) { return m_FontLookup[instanceID]; } FontAsset fontAsset = null; fontAsset = ((!(((Object)font).name == "System Normal")) ? FontAsset.CreateFontAsset(font, 90, 9, (GlyphRenderMode)4165, 1024, 1024) : FontAsset.CreateFontAsset("Lucida Grande", "Regular")); if ((Object)(object)fontAsset != (Object)null) { ((Object)fontAsset).hideFlags = (HideFlags)52; ((Object)fontAsset.atlasTextures[0]).hideFlags = (HideFlags)52; ((Object)fontAsset.material).hideFlags = (HideFlags)52; fontAsset.isMultiAtlasTexturesEnabled = true; m_FontReferences.Add(new FontReferenceMap(font, fontAsset)); m_FontLookup.Add(instanceID, fontAsset); } return fontAsset; } } public static class TextShaderUtilities { public static int ID_MainTex; public static int ID_FaceTex; public static int ID_FaceColor; public static int ID_FaceDilate; public static int ID_Shininess; public static int ID_UnderlayColor; public static int ID_UnderlayOffsetX; public static int ID_UnderlayOffsetY; public static int ID_UnderlayDilate; public static int ID_UnderlaySoftness; public static int ID_WeightNormal; public static int ID_WeightBold; public static int ID_OutlineTex; public static int ID_OutlineWidth; public static int ID_OutlineSoftness; public static int ID_OutlineColor; public static int ID_Outline2Color; public static int ID_Outline2Width; public static int ID_Padding; public static int ID_GradientScale; public static int ID_ScaleX; public static int ID_ScaleY; public static int ID_PerspectiveFilter; public static int ID_Sharpness; public static int ID_TextureWidth; public static int ID_TextureHeight; public static int ID_BevelAmount; public static int ID_GlowColor; public static int ID_GlowOffset; public static int ID_GlowPower; public static int ID_GlowOuter; public static int ID_GlowInner; public static int ID_LightAngle; public static int ID_EnvMap; public static int ID_EnvMatrix; public static int ID_EnvMatrixRotation; public static int ID_MaskCoord; public static int ID_ClipRect; public static int ID_MaskSoftnessX; public static int ID_MaskSoftnessY; public static int ID_VertexOffsetX; public static int ID_VertexOffsetY; public static int ID_UseClipRect; public static int ID_StencilID; public static int ID_StencilOp; public static int ID_StencilComp; public static int ID_StencilReadMask; public static int ID_StencilWriteMask; public static int ID_ShaderFlags; public static int ID_ScaleRatio_A; public static int ID_ScaleRatio_B; public static int ID_ScaleRatio_C; public static string Keyword_Bevel; public static string Keyword_Glow; public static string Keyword_Underlay; public static string Keyword_Ratios; public static string Keyword_MASK_SOFT; public static string Keyword_MASK_HARD; public static string Keyword_MASK_TEX; public static string Keyword_Outline; public static string ShaderTag_ZTestMode; public static string ShaderTag_CullMode; private static float m_clamp; public static bool isInitialized; private static Shader k_ShaderRef_MobileSDF; private static Shader k_ShaderRef_MobileBitmap; private static Shader k_ShaderRef_Sprite; internal static Shader ShaderRef_MobileSDF { get { if ((Object)(object)k_ShaderRef_MobileSDF == (Object)null) { k_ShaderRef_MobileSDF = Shader.Find("Text/Mobile/Distance Field SSD"); if ((Object)(object)k_ShaderRef_MobileSDF == (Object)null) { k_ShaderRef_MobileSDF = Shader.Find("Hidden/TextCore/Distance Field SSD"); } } return k_ShaderRef_MobileSDF; } } internal static Shader ShaderRef_MobileBitmap { get { if ((Object)(object)k_ShaderRef_MobileBitmap == (Object)null) { k_ShaderRef_MobileBitmap = Shader.Find("Text/Bitmap"); if ((Object)(object)k_ShaderRef_MobileBitmap == (Object)null) { k_ShaderRef_MobileBitmap = Shader.Find("Hidden/Internal-GUITextureClipText"); } } return k_ShaderRef_MobileBitmap; } } internal static Shader ShaderRef_Sprite { get { if ((Object)(object)k_ShaderRef_Sprite == (Object)null) { k_ShaderRef_Sprite = Shader.Find("Text/Sprite"); if ((Object)(object)k_ShaderRef_Sprite == (Object)null) { k_ShaderRef_Sprite = Shader.Find("Hidden/TextCore/Sprite"); } } return k_ShaderRef_Sprite; } } static TextShaderUtilities() { Keyword_Bevel = "BEVEL_ON"; Keyword_Glow = "GLOW_ON"; Keyword_Underlay = "UNDERLAY_ON"; Keyword_Ratios = "RATIOS_OFF"; Keyword_MASK_SOFT = "MASK_SOFT"; Keyword_MASK_HARD = "MASK_HARD"; Keyword_MASK_TEX = "MASK_TEX"; Keyword_Outline = "OUTLINE_ON"; ShaderTag_ZTestMode = "unity_GUIZTestMode"; ShaderTag_CullMode = "_CullMode"; m_clamp = 1f; isInitialized = false; GetShaderPropertyIDs(); } internal static void GetShaderPropertyIDs() { if (!isInitialized) { isInitialized = true; ID_MainTex = Shader.PropertyToID("_MainTex"); ID_FaceTex = Shader.PropertyToID("_FaceTex"); ID_FaceColor = Shader.PropertyToID("_FaceColor"); ID_FaceDilate = Shader.PropertyToID("_FaceDilate"); ID_Shininess = Shader.PropertyToID("_FaceShininess"); ID_UnderlayColor = Shader.PropertyToID("_UnderlayColor"); ID_UnderlayOffsetX = Shader.PropertyToID("_UnderlayOffsetX"); ID_UnderlayOffsetY = Shader.PropertyToID("_UnderlayOffsetY"); ID_UnderlayDilate = Shader.PropertyToID("_UnderlayDilate"); ID_UnderlaySoftness = Shader.PropertyToID("_UnderlaySoftness"); ID_WeightNormal = Shader.PropertyToID("_WeightNormal"); ID_WeightBold = Shader.PropertyToID("_WeightBold"); ID_OutlineTex = Shader.PropertyToID("_OutlineTex"); ID_OutlineWidth = Shader.PropertyToID("_OutlineWidth"); ID_OutlineSoftness = Shader.PropertyToID("_OutlineSoftness"); ID_OutlineColor = Shader.PropertyToID("_OutlineColor"); ID_Outline2Color = Shader.PropertyToID("_Outline2Color"); ID_Outline2Width = Shader.PropertyToID("_Outline2Width"); ID_Padding = Shader.PropertyToID("_Padding"); ID_GradientScale = Shader.PropertyToID("_GradientScale"); ID_ScaleX = Shader.PropertyToID("_ScaleX"); ID_ScaleY = Shader.PropertyToID("_ScaleY"); ID_PerspectiveFilter = Shader.PropertyToID("_PerspectiveFilter"); ID_Sharpness = Shader.PropertyToID("_Sharpness"); ID_TextureWidth = Shader.PropertyToID("_TextureWidth"); ID_TextureHeight = Shader.PropertyToID("_TextureHeight"); ID_BevelAmount = Shader.PropertyToID("_Bevel"); ID_LightAngle = Shader.PropertyToID("_LightAngle"); ID_EnvMap = Shader.PropertyToID("_Cube"); ID_EnvMatrix = Shader.PropertyToID("_EnvMatrix"); ID_EnvMatrixRotation = Shader.PropertyToID("_EnvMatrixRotation"); ID_GlowColor = Shader.PropertyToID("_GlowColor"); ID_GlowOffset = Shader.PropertyToID("_GlowOffset"); ID_GlowPower = Shader.PropertyToID("_GlowPower"); ID_GlowOuter = Shader.PropertyToID("_GlowOuter"); ID_GlowInner = Shader.PropertyToID("_GlowInner"); ID_MaskCoord = Shader.PropertyToID("_MaskCoord"); ID_ClipRect = Shader.PropertyToID("_ClipRect"); ID_UseClipRect = Shader.PropertyToID("_UseClipRect"); ID_MaskSoftnessX = Shader.PropertyToID("_MaskSoftnessX"); ID_MaskSoftnessY = Shader.PropertyToID("_MaskSoftnessY"); ID_VertexOffsetX = Shader.PropertyToID("_VertexOffsetX"); ID_VertexOffsetY = Shader.PropertyToID("_VertexOffsetY"); ID_StencilID = Shader.PropertyToID("_Stencil"); ID_StencilOp = Shader.PropertyToID("_StencilOp"); ID_StencilComp = Shader.PropertyToID("_StencilComp"); ID_StencilReadMask = Shader.PropertyToID("_StencilReadMask"); ID_StencilWriteMask = Shader.PropertyToID("_StencilWriteMask"); ID_ShaderFlags = Shader.PropertyToID("_ShaderFlags"); ID_ScaleRatio_A = Shader.PropertyToID("_ScaleRatioA"); ID_ScaleRatio_B = Shader.PropertyToID("_ScaleRatioB"); ID_ScaleRatio_C = Shader.PropertyToID("_ScaleRatioC"); } } private static void UpdateShaderRatios(Material mat) { float num = 1f; float num2 = 1f; float num3 = 1f; bool flag = !mat.shaderKeywords.Contains(Keyword_Ratios); if (mat.HasProperty(ID_GradientScale) && mat.HasProperty(ID_FaceDilate)) { float num4 = mat.GetFloat(ID_GradientScale); float num5 = mat.GetFloat(ID_FaceDilate); float num6 = mat.GetFloat(ID_OutlineWidth); float num7 = mat.GetFloat(ID_OutlineSoftness); float num8 = Mathf.Max(mat.GetFloat(ID_WeightNormal), mat.GetFloat(ID_WeightBold)) / 4f; float num9 = Mathf.Max(1f, num8 + num5 + num6 + num7); num = (flag ? ((num4 - m_clamp) / (num4 * num9)) : 1f); mat.SetFloat(ID_ScaleRatio_A, num); if (mat.HasProperty(ID_GlowOffset)) { float num10 = mat.GetFloat(ID_GlowOffset); float num11 = mat.GetFloat(ID_GlowOuter); float num12 = (num8 + num5) * (num4 - m_clamp); num9 = Mathf.Max(1f, num10 + num11); num2 = (flag ? (Mathf.Max(0f, num4 - m_clamp - num12) / (num4 * num9)) : 1f); mat.SetFloat(ID_ScaleRatio_B, num2); } if (mat.HasProperty(ID_UnderlayOffsetX)) { float num13 = mat.GetFloat(ID_UnderlayOffsetX); float num14 = mat.GetFloat(ID_UnderlayOffsetY); float num15 = mat.GetFloat(ID_UnderlayDilate); float num16 = mat.GetFloat(ID_UnderlaySoftness); float num17 = (num8 + num5) * (num4 - m_clamp); num9 = Mathf.Max(1f, Mathf.Max(Mathf.Abs(num13), Mathf.Abs(num14)) + num15 + num16); num3 = (flag ? (Mathf.Max(0f, num4 - m_clamp - num17) / (num4 * num9)) : 1f); mat.SetFloat(ID_ScaleRatio_C, num3); } } } internal static Vector4 GetFontExtent(Material material) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) return Vector4.zero; } internal static bool IsMaskingEnabled(Material material) { if ((Object)(object)material == (Object)null || !material.HasProperty(ID_ClipRect)) { return false; } if (material.shaderKeywords.Contains(Keyword_MASK_SOFT) || material.shaderKeywords.Contains(Keyword_MASK_HARD) || material.shaderKeywords.Contains(Keyword_MASK_TEX)) { return true; } return false; } internal static float GetPadding(Material material, bool enableExtraPadding, bool isBold) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) if (!isInitialized) { GetShaderPropertyIDs(); } if ((Object)(object)material == (Object)null) { return 0f; } int num = (enableExtraPadding ? 4 : 0); if (!material.HasProperty(ID_GradientScale)) { if (material.HasProperty(ID_Padding)) { num += (int)material.GetFloat(ID_Padding); } return (float)num + 1f; } Vector4 zero = Vector4.zero; Vector4 zero2 = Vector4.zero; float num2 = 0f; float num3 = 0f; float num4 = 0f; float num5 = 0f; float num6 = 0f; float num7 = 0f; float num8 = 0f; float num9 = 0f; float num10 = 0f; UpdateShaderRatios(material); string[] shaderKeywords = material.shaderKeywords; if (material.HasProperty(ID_ScaleRatio_A)) { num5 = material.GetFloat(ID_ScaleRatio_A); } if (material.HasProperty(ID_FaceDilate)) { num2 = material.GetFloat(ID_FaceDilate) * num5; } if (material.HasProperty(ID_OutlineSoftness)) { num3 = material.GetFloat(ID_OutlineSoftness) * num5; } if (material.HasProperty(ID_OutlineWidth)) { num4 = material.GetFloat(ID_OutlineWidth) * num5; } num10 = num4 + num3 + num2; if (material.HasProperty(ID_GlowOffset) && shaderKeywords.Contains(Keyword_Glow)) { if (material.HasProperty(ID_ScaleRatio_B)) { num6 = material.GetFloat(ID_ScaleRatio_B); } num8 = material.GetFloat(ID_GlowOffset) * num6; num9 = material.GetFloat(ID_GlowOuter) * num6; } num10 = Mathf.Max(num10, num2 + num8 + num9); if (material.HasProperty(ID_UnderlaySoftness) && shaderKeywords.Contains(Keyword_Underlay)) { if (material.HasProperty(ID_ScaleRatio_C)) { num7 = material.GetFloat(ID_ScaleRatio_C); } float num11 = material.GetFloat(ID_UnderlayOffsetX) * num7; float num12 = material.GetFloat(ID_UnderlayOffsetY) * num7; float num13 = material.GetFloat(ID_UnderlayDilate) * num7; float num14 = material.GetFloat(ID_UnderlaySoftness) * num7; zero.x = Mathf.Max(zero.x, num2 + num13 + num14 - num11); zero.y = Mathf.Max(zero.y, num2 + num13 + num14 - num12); zero.z = Mathf.Max(zero.z, num2 + num13 + num14 + num11); zero.w = Mathf.Max(zero.w, num2 + num13 + num14 + num12); } zero.x = Mathf.Max(zero.x, num10); zero.y = Mathf.Max(zero.y, num10); zero.z = Mathf.Max(zero.z, num10); zero.w = Mathf.Max(zero.w, num10); zero.x += num; zero.y += num; zero.z += num; zero.w += num; zero.x = Mathf.Min(zero.x, 1f); zero.y = Mathf.Min(zero.y, 1f); zero.z = Mathf.Min(zero.z, 1f); zero.w = Mathf.Min(zero.w, 1f); zero2.x = ((zero2.x < zero.x) ? zero.x : zero2.x); zero2.y = ((zero2.y < zero.y) ? zero.y : zero2.y); zero2.z = ((zero2.z < zero.z) ? zero.z : zero2.z); zero2.w = ((zero2.w < zero.w) ? zero.w : zero2.w); float num15 = material.GetFloat(ID_GradientScale); zero *= num15; num10 = Mathf.Max(zero.x, zero.y); num10 = Mathf.Max(zero.z, num10); num10 = Mathf.Max(zero.w, num10); return num10 + 4f; } internal static float GetPadding(Material[] materials, bool enableExtraPadding, bool isBold) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) if (!isInitialized) { GetShaderPropertyIDs(); } if (materials == null) { return 0f; } int num = (enableExtraPadding ? 4 : 0); if (materials[0].HasProperty(ID_Padding)) { return (float)num + materials[0].GetFloat(ID_Padding); } Vector4 zero = Vector4.zero; Vector4 zero2 = Vector4.zero; float num2 = 0f; float num3 = 0f; float num4 = 0f; float num5 = 0f; float num6 = 0f; float num7 = 0f; float num8 = 0f; float num9 = 0f; float num10 = 0f; for (int i = 0; i < materials.Length; i++) { UpdateShaderRatios(materials[i]); string[] shaderKeywords = materials[i].shaderKeywords; if (materials[i].HasProperty(ID_ScaleRatio_A)) { num5 = materials[i].GetFloat(ID_ScaleRatio_A); } if (materials[i].HasProperty(ID_FaceDilate)) { num2 = materials[i].GetFloat(ID_FaceDilate) * num5; } if (materials[i].HasProperty(ID_OutlineSoftness)) { num3 = materials[i].GetFloat(ID_OutlineSoftness) * num5; } if (materials[i].HasProperty(ID_OutlineWidth)) { num4 = materials[i].GetFloat(ID_OutlineWidth) * num5; } num10 = num4 + num3 + num2; if (materials[i].HasProperty(ID_GlowOffset) && shaderKeywords.Contains(Keyword_Glow)) { if (materials[i].HasProperty(ID_ScaleRatio_B)) { num6 = materials[i].GetFloat(ID_ScaleRatio_B); } num8 = materials[i].GetFloat(ID_GlowOffset) * num6; num9 = materials[i].GetFloat(ID_GlowOuter) * num6; } num10 = Mathf.Max(num10, num2 + num8 + num9); if (materials[i].HasProperty(ID_UnderlaySoftness) && shaderKeywords.Contains(Keyword_Underlay)) { if (materials[i].HasProperty(ID_ScaleRatio_C)) { num7 = materials[i].GetFloat(ID_ScaleRatio_C); } float num11 = materials[i].GetFloat(ID_UnderlayOffsetX) * num7; float num12 = materials[i].GetFloat(ID_UnderlayOffsetY) * num7; float num13 = materials[i].GetFloat(ID_UnderlayDilate) * num7; float num14 = materials[i].GetFloat(ID_UnderlaySoftness) * num7; zero.x = Mathf.Max(zero.x, num2 + num13 + num14 - num11); zero.y = Mathf.Max(zero.y, num2 + num13 + num14 - num12); zero.z = Mathf.Max(zero.z, num2 + num13 + num14 + num11); zero.w = Mathf.Max(zero.w, num2 + num13 + num14 + num12); } zero.x = Mathf.Max(zero.x, num10); zero.y = Mathf.Max(zero.y, num10); zero.z = Mathf.Max(zero.z, num10); zero.w = Mathf.Max(zero.w, num10); zero.x += num; zero.y += num; zero.z += num; zero.w += num; zero.x = Mathf.Min(zero.x, 1f); zero.y = Mathf.Min(zero.y, 1f); zero.z = Mathf.Min(zero.z, 1f); zero.w = Mathf.Min(zero.w, 1f); zero2.x = ((zero2.x < zero.x) ? zero.x : zero2.x); zero2.y = ((zero2.y < zero.y) ? zero.y : zero2.y); zero2.z = ((zero2.z < zero.z) ? zero.z : zero2.z); zero2.w = ((zero2.w < zero.w) ? zero.w : zero2.w); } float num15 = materials[0].GetFloat(ID_GradientScale); zero *= num15; num10 = Mathf.Max(zero.x, zero.y); num10 = Mathf.Max(zero.z, num10); num10 = Mathf.Max(zero.w, num10); return num10 + 0.25f; } } [Serializable] public class TextStyle { internal static TextStyle k_NormalStyle; [SerializeField] private string m_Name; [SerializeField] private int m_HashCode; [SerializeField] private string m_OpeningDefinition; [SerializeField] private string m_ClosingDefinition; [SerializeField] private int[] m_OpeningTagArray; [SerializeField] private int[] m_ClosingTagArray; [SerializeField] internal uint[] m_OpeningTagUnicodeArray; [SerializeField] internal uint[] m_ClosingTagUnicodeArray; public static TextStyle NormalStyle { get { if (k_NormalStyle == null) { k_NormalStyle = new TextStyle("Normal", string.Empty, string.Empty); } return k_NormalStyle; } } public string name { get { return m_Name; } set { if (value != m_Name) { m_Name = value; } } } public int hashCode { get { return m_HashCode; } set { if (value != m_HashCode) { m_HashCode = value; } } } public string styleOpeningDefinition => m_OpeningDefinition; public string styleClosingDefinition => m_ClosingDefinition; public int[] styleOpeningTagArray => m_OpeningTagArray; public int[] styleClosingTagArray => m_ClosingTagArray; internal TextStyle(string styleName, string styleOpeningDefinition, string styleClosingDefinition) { m_Name = styleName; m_HashCode = TextUtilities.GetHashCodeCaseInSensitive(styleName); m_OpeningDefinition = styleOpeningDefinition; m_ClosingDefinition = styleClosingDefinition; RefreshStyle(); } public void RefreshStyle() { m_HashCode = TextUtilities.GetHashCodeCaseInSensitive(m_Name); m_OpeningTagArray = new int[m_OpeningDefinition.Length]; m_OpeningTagUnicodeArray = new uint[m_OpeningDefinition.Length]; for (int i = 0; i < m_OpeningDefinition.Length; i++) { m_OpeningTagArray[i] = m_OpeningDefinition[i]; m_OpeningTagUnicodeArray[i] = m_OpeningDefinition[i]; } m_ClosingTagArray = new int[m_ClosingDefinition.Length]; m_ClosingTagUnicodeArray = new uint[m_ClosingDefinition.Length]; for (int j = 0; j < m_ClosingDefinition.Length; j++) { m_ClosingTagArray[j] = m_ClosingDefinition[j]; m_ClosingTagUnicodeArray[j] = m_ClosingDefinition[j]; } } } [Serializable] [ExcludeFromObjectFactory] [ExcludeFromPreset] public class TextStyleSheet : ScriptableObject { [SerializeField] private List m_StyleList = new List(1); private Dictionary m_StyleLookupDictionary; internal List styles => m_StyleList; public TextStyle GetStyle(int hashCode) { if (m_StyleLookupDictionary == null) { LoadStyleDictionaryInternal(); } if (m_StyleLookupDictionary.TryGetValue(hashCode, out var value)) { return value; } return null; } public TextStyle GetStyle(string name) { if (m_StyleLookupDictionary == null) { LoadStyleDictionaryInternal(); } int hashCodeCaseInSensitive = TextUtilities.GetHashCodeCaseInSensitive(name); if (m_StyleLookupDictionary.TryGetValue(hashCodeCaseInSensitive, out var value)) { return value; } return null; } public void RefreshStyles() { LoadStyleDictionaryInternal(); } private void LoadStyleDictionaryInternal() { if (m_StyleLookupDictionary == null) { m_StyleLookupDictionary = new Dictionary(); } else { m_StyleLookupDictionary.Clear(); } for (int i = 0; i < m_StyleList.Count; i++) { m_StyleList[i].RefreshStyle(); if (!m_StyleLookupDictionary.ContainsKey(m_StyleList[i].hashCode)) { m_StyleLookupDictionary.Add(m_StyleList[i].hashCode, m_StyleList[i]); } } } } internal static class TextUtilities { private const string k_LookupStringL = "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[-]^_`abcdefghijklmnopqrstuvwxyz{|}~-"; private const string k_LookupStringU = "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[-]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~-"; internal static void ResizeArray(ref T[] array) { int newSize = NextPowerOfTwo(array.Length); Array.Resize(ref array, newSize); } internal static void ResizeArray(ref T[] array, int size) { size = NextPowerOfTwo(size); Array.Resize(ref array, size); } internal static int NextPowerOfTwo(int v) { v |= v >> 16; v |= v >> 8; v |= v >> 4; v |= v >> 2; v |= v >> 1; return v + 1; } internal static char ToLowerFast(char c) { if (c > "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[-]^_`abcdefghijklmnopqrstuvwxyz{|}~-".Length - 1) { return c; } return "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[-]^_`abcdefghijklmnopqrstuvwxyz{|}~-"[c]; } internal static char ToUpperFast(char c) { if (c > "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[-]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~-".Length - 1) { return c; } return "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[-]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~-"[c]; } internal static uint ToUpperASCIIFast(uint c) { if (c > "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[-]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~-".Length - 1) { return c; } return "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[-]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~-"[(int)c]; } internal static uint ToLowerASCIIFast(uint c) { if (c > "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[-]^_`abcdefghijklmnopqrstuvwxyz{|}~-".Length - 1) { return c; } return "-------------------------------- !-#$%&-()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[-]^_`abcdefghijklmnopqrstuvwxyz{|}~-"[(int)c]; } public static int GetHashCodeCaseSensitive(string s) { int num = 0; for (int i = 0; i < s.Length; i++) { num = ((num << 5) + num) ^ s[i]; } return num; } public static int GetHashCodeCaseInSensitive(string s) { int num = 0; for (int i = 0; i < s.Length; i++) { num = ((num << 5) + num) ^ ToUpperFast(s[i]); } return num; } public static uint GetSimpleHashCodeLowercase(string s) { uint num = 0u; for (int i = 0; i < s.Length; i++) { num = ((num << 5) + num) ^ ToLowerFast(s[i]); } return num; } internal static uint ConvertToUTF32(uint highSurrogate, uint lowSurrogate) { return (highSurrogate - 55296) * 1024 + (lowSurrogate - 56320 + 65536); } internal static uint ReadUTF16(uint[] text, int index) { uint num = 0u; num += HexToInt((char)text[index]) << 12; num += HexToInt((char)text[index + 1]) << 8; num += HexToInt((char)text[index + 2]) << 4; return num + HexToInt((char)text[index + 3]); } internal static uint ReadUTF32(uint[] text, int index) { uint num = 0u; num += HexToInt((char)text[index]) << 30; num += HexToInt((char)text[index + 1]) << 24; num += HexToInt((char)text[index + 2]) << 20; num += HexToInt((char)text[index + 3]) << 16; num += HexToInt((char)text[index + 4]) << 12; num += HexToInt((char)text[index + 5]) << 8; num += HexToInt((char)text[index + 6]) << 4; return num + HexToInt((char)text[index + 7]); } private static uint HexToInt(char hex) { return hex switch { '0' => 0u, '1' => 1u, '2' => 2u, '3' => 3u, '4' => 4u, '5' => 5u, '6' => 6u, '7' => 7u, '8' => 8u, '9' => 9u, 'A' => 10u, 'B' => 11u, 'C' => 12u, 'D' => 13u, 'E' => 14u, 'F' => 15u, 'a' => 10u, 'b' => 11u, 'c' => 12u, 'd' => 13u, 'e' => 14u, 'f' => 15u, _ => 15u, }; } public static uint StringHexToInt(string s) { uint num = 0u; int length = s.Length; for (int i = 0; i < length; i++) { num += HexToInt(s[i]) * (uint)Mathf.Pow(16f, (float)(length - 1 - i)); } return num; } internal static string UintToString(this List unicodes) { char[] array = new char[unicodes.Count]; for (int i = 0; i < unicodes.Count; i++) { array[i] = (char)unicodes[i]; } return new string(array); } } [Serializable] public class UnicodeLineBreakingRules { private static UnicodeLineBreakingRules s_Instance = new UnicodeLineBreakingRules(); [SerializeField] private TextAsset m_UnicodeLineBreakingRules; [SerializeField] private TextAsset m_LeadingCharacters; [SerializeField] private TextAsset m_FollowingCharacters; [SerializeField] private bool m_UseModernHangulLineBreakingRules; private static HashSet s_LeadingCharactersLookup; private static HashSet s_FollowingCharactersLookup; public TextAsset lineBreakingRules => m_UnicodeLineBreakingRules; public TextAsset leadingCharacters => m_LeadingCharacters; public TextAsset followingCharacters => m_FollowingCharacters; internal HashSet leadingCharactersLookup { get { if (s_LeadingCharactersLookup == null) { LoadLineBreakingRules(); } return s_LeadingCharactersLookup; } set { s_LeadingCharactersLookup = value; } } internal HashSet followingCharactersLookup { get { if (s_LeadingCharactersLookup == null) { LoadLineBreakingRules(); } return s_FollowingCharactersLookup; } set { s_FollowingCharactersLookup = value; } } public bool useModernHangulLineBreakingRules { get { return m_UseModernHangulLineBreakingRules; } set { m_UseModernHangulLineBreakingRules = value; } } internal static void LoadLineBreakingRules() { if (s_LeadingCharactersLookup == null) { if ((Object)(object)s_Instance.m_LeadingCharacters == (Object)null) { s_Instance.m_LeadingCharacters = Resources.Load("LineBreaking Leading Characters"); } s_LeadingCharactersLookup = (((Object)(object)s_Instance.m_LeadingCharacters != (Object)null) ? GetCharacters(s_Instance.m_LeadingCharacters) : new HashSet()); if ((Object)(object)s_Instance.m_FollowingCharacters == (Object)null) { s_Instance.m_FollowingCharacters = Resources.Load("LineBreaking Following Characters"); } s_FollowingCharactersLookup = (((Object)(object)s_Instance.m_FollowingCharacters != (Object)null) ? GetCharacters(s_Instance.m_FollowingCharacters) : new HashSet()); } } internal static void LoadLineBreakingRules(TextAsset leadingRules, TextAsset followingRules) { if (s_LeadingCharactersLookup == null) { if ((Object)(object)leadingRules == (Object)null) { leadingRules = Resources.Load("LineBreaking Leading Characters"); } s_LeadingCharactersLookup = (((Object)(object)leadingRules != (Object)null) ? GetCharacters(leadingRules) : new HashSet()); if ((Object)(object)followingRules == (Object)null) { followingRules = Resources.Load("LineBreaking Following Characters"); } s_FollowingCharactersLookup = (((Object)(object)followingRules != (Object)null) ? GetCharacters(followingRules) : new HashSet()); } } private static HashSet GetCharacters(TextAsset file) { HashSet hashSet = new HashSet(); string text = file.text; for (int i = 0; i < text.Length; i++) { hashSet.Add(text[i]); } return hashSet; } }