// The initial `GetCore` logic. It creates and setups the `Translator` object used in this plugin. // This also means that we redirect the logs to the Unity Console and set up all globals // that are unique to `Unity`, rather than being specific to the `.NET` environment. // After that it switches the `GetCore` logic to a simply returner function. private static Translator CreateCore() { L20nCore.IO.StreamReaderFactory.SetCallback(CreateStreamReader); s_Core = new Translator(); s_Core.SetWarningDelegate(Debug.LogWarning); GetCore = (() => s_Core); s_Fonts = new Dictionary <string, Font> (); AddUnityGlobals(); return(s_Core); }
// The initial `GetCore` logic. It creates and setups the `Translator` object used in this plugin. // This also means that we redirect the logs to the Unity Console and set up all globals // that are unique to `Unity`, rather than being specific to the `.NET` environment. // After that it switches the `GetCore` logic to a simply returner function. private static Translator CreateCore () { L20nCore.IO.StreamReaderFactory.SetCallback (CreateStreamReader); s_Core = new Translator (); s_Core.SetWarningDelegate (Debug.LogWarning); GetCore = (() => s_Core); s_Fonts = new Dictionary<string, Font> (); AddUnityGlobals (); return s_Core; }