Shortcut function to get Localize Component

More
9 years 3 weeks ago #1132 by yuewah
Sometime, adding localize component and set term in code is preferred.
Is it possible to add the following static function to get and add localize component if not exist ?

Localize.cs

static public Localize Get (GameObject go)
{
Localize localize = go.GetComponent<Localize>();
if (localize == null) localize = go.AddComponent<Localize>();
return localize;
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.160 seconds
Template by JoomlaShine