Editor scirpt: compute and save scene changes
At the moment in the editor I have a little script that sets up (setting the item title, image,ecc) a UI item: (this script is accutally on the same object that has to be inizialized)
[ExecuteInEditMode]
public class Editor_ShopItemSetup : MonoBehaviour {
#if UNITY_EDITOR
void Update ()
{
UIShopItem i = GetComponent<UIShopItem>();
if( i != null)
{ i.EditorSetUp(); }
}
#endif
}
In the editor the script work fine and sets up everything. How can I keep the changes made by the script into a game build. At the moment if I build the game the result I get are all the UI elements uninitialized becase the script in never run. The game if for Android Only, I've not tested to build it on other platforms.
The objective of this script is to initializete buttons in the editor so that the game on the phone will not need to do this.
Your answer
Follow this Question
Related Questions
Any way to set AnimatorOverrideController's animation clips programatically? 1 Answer
How to Undo a lot of created objects at once? [Solved] 1 Answer
Access an Array of class inside another Array of class? (EditorGUILayout) 1 Answer
CommandInvokationFailure: Unable to convert classes into dex format. 1 Answer