static void Init() { //get existing open window or if none, make a new one iapEditor = (IAPEditor)EditorWindow.GetWindowWithRect(typeof(IAPEditor), new Rect(0, 0, 1024, 512), false, "IAP Settings"); //automatically repaint whenever the scene has changed (for caution) iapEditor.autoRepaintOnSceneChange = true; }
//when the window gets opened void OnEnable() { //reconnect reference if (iapEditor == null) { iapEditor = this; } //get reference to the shop and cache it shop = GameObject.FindObjectOfType(typeof(ShopManager)) as ShopManager; script = FindIAPManager(); //could not get prefab, non-existent? if (script == null) { return; } if (shop) { RemoveContainerConnections(); } //set current currency index from -1 to first one, //if currencies were specified if (script.currency.Count > 0) { currencyIndex = 0; } }
static void Init() { //get existing open window or if none, make a new one iapEditor = (IAPEditor)EditorWindow.GetWindowWithRect(typeof(IAPEditor), new Rect(0, 0, 800, 400), false, "IAP Settings"); //automatically repaint whenever the scene has changed (for caution) iapEditor.autoRepaintOnSceneChange = true; }
public static string[] OnWillSaveAssets(string[] paths) { if (IAPEditor.iapEditor) { IAPEditor.SavePrefab(); } return(paths); }
//when the window gets opened void OnEnable() { //reconnect reference if (iapEditor == null) iapEditor = this; //get reference to the shop and cache it shop = GameObject.FindObjectOfType(typeof(ShopManager)) as ShopManager; script = FindIAPManager(); //could not get prefab, non-existent? if (script == null) return; if (shop) RemoveContainerConnections(); }
//when the window gets opened void OnEnable() { //reconnect reference if (iapEditor == null) { iapEditor = this; } //scene path currentScene = EditorApplication.currentScene; //get reference to the shop and cache it shop = GameObject.FindObjectOfType(typeof(ShopManager)) as ShopManager; script = FindIAPManager(); //could not get prefab, non-existent? if (script == null) { return; } if (shop) { RemoveContainerConnections(); } //set current currency index from -1 to first one, //if currencies were specified if (script.currency.Count > 0) { currencyIndex = 0; } //get current platform variable and set selected index string currentPlatform = script.androidPlatform.ToString(); for (int i = 0; i < androidPlatformStrings.Length; i++) { if (androidPlatformStrings[i] == currentPlatform) { androidPlatform = i; break; } } }
//when the window gets opened void OnEnable() { //reconnect reference if (iapEditor == null) iapEditor = this; //get reference to the shop and cache it shop = GameObject.FindObjectOfType(typeof(ShopManager)) as ShopManager; script = FindIAPManager(); //could not get prefab, non-existent? if (script == null) return; if (shop) RemoveContainerConnections(); //set current currency index from -1 to first one, //if currencies were specified if (script.currency.Count > 0) currencyIndex = 0; }