Recently a game called Wood stone century (Timber and Stone), sandbox game class, looked good.
Search the game information, some people seek Chinese but because it is a minority game, no one out of Chinese. Look at the eye is Unity3d, since it is. NET, as long as the resources are not in the resource bundle, it should be quite simple.
Just started to do a string substitution, found that some places are still more troublesome, it is better to take unityengine inside the GUI function surgery, that is, a simple oh Han process.
First, write a simple class to inject
public class Txtinjection {public static string doinjection (String txt) { return txt + "X"; } }
After the injection succeeds, all the injected strings should appear after an X;
Then write a small example for the IL reference:
public static void Label (object position, string text, object style) { text = doinjection (text); Labela (position, text, style); } public static void Labela (object position, string text, object style) { }
Text = doinjection (text);
That's where we changed the string.
Anti-compilation See IL
0nop1ldarg.12callsystem.string uintyengineguipatch.txtinjection::D oinjection (System.String) 7starg.s-> (1) text (System.String)
4 rows, and then look for the GUI drawing function of Unity3d, looking for 2:
Gui. Box,gui. Lable is written directly to IL using the reflector il injection plugin.
Run look effect ...
(at present, the Chinese part of the direct call Baidu online translation, do not shoot bricks ...)
The following is simple, output all text to a txt, and then use the
English | Chinese
This format, automatic or manual translation ...
Late program dropped ...
Unity3d game Chinese IL injection text replacement--Wood stone century