/// <summary>Sets up the map.</summary> public static void Setup() { Map = new Dictionary <string, string>(); #if UNITY // Get the entity file: UnityEngine.TextAsset ncData = (UnityEngine.Resources.Load("NamedCharacters") as UnityEngine.TextAsset); if (ncData == null) { return; } byte[] file = ncData.bytes; // Create a reader: BinaryIO.Reader reader = new BinaryIO.Reader(file); while (reader.More()) { // Read the line: string rowName = reader.ReadString(); string chars = reader.ReadString(); // Add to map: Map[rowName] = chars; } #else // Load entities from a standalone file. #warning Named characters won't be available #endif }
/// <summary>Sets up the bidirectional data.</summary> public static void Setup() { if (Blocks != null) { return; } // Get the bidi data now: #if UNITY // Get the entity file: UnityEngine.TextAsset bidiData = (UnityEngine.Resources.Load("BidirectionalData") as UnityEngine.TextAsset); if (bidiData == null) { return; } byte[] file = bidiData.bytes; // Create a reader: BinaryIO.Reader reader = new BinaryIO.Reader(file); int count = (int)reader.ReadCompressed(); Blocks = new BidiBlock[count]; int index = 0; // Setup all blocks: while (reader.More()) { // Read the block: Blocks[index++] = new BidiBlock( (int)reader.ReadCompressed(), (int)reader.ReadCompressed(), reader.ReadByte() ); } #else #warning Bidirectional data not available #endif }