Unity3d game Chinese IL injection text replacement--Wood stone century

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.