diff --git a/Assets/Scripts/Networking/Serverside/Server.cs b/Assets/Scripts/Networking/Serverside/Server.cs index 7a1bacc..091c068 100644 --- a/Assets/Scripts/Networking/Serverside/Server.cs +++ b/Assets/Scripts/Networking/Serverside/Server.cs @@ -139,7 +139,7 @@ namespace Cyber.Networking.Serverside { SendToAll(PktType.TextMessage, new TextMessagePkt("Server: " + args[0])); }); - gameObject.AddComponent(); + Syncer = gameObject.AddComponent(); return true; } diff --git a/Assets/Scripts/Util/TextTextureRenderer.cs b/Assets/Scripts/Util/TextTextureRenderer.cs index e8054b4..ed27f8e 100644 --- a/Assets/Scripts/Util/TextTextureRenderer.cs +++ b/Assets/Scripts/Util/TextTextureRenderer.cs @@ -63,10 +63,20 @@ namespace Cyber.Util { /// Whether the texture should be rendered /// again even if it's cached. public static Texture2D GetText(TextTextureProperties text, bool forceRender = false) { - if (forceRender || !Cache.ContainsKey(text.Text)) { - Cache[text.Text] = Singleton.RenderText(text); + string Hash = CreateHash(text); + if (forceRender || !Cache.ContainsKey(Hash)) { + Cache[Hash] = Singleton.RenderText(text); + Term.Println("Created a new texture for:"); + Term.Println(Hash); + Term.Println("===="); } - return Cache[text.Text]; + return Cache[Hash]; + } + + private static string CreateHash(TextTextureProperties text) { + return text.Text + "," + text.Width + "," + text.Height + "," + + text.FontSize + "," + text.Background.r + "," + + text.Background.g + "," + text.Background.b; } } } \ No newline at end of file