public static void Init(Products.Product targetBase = null, Action <Products.Product> OnComplete = null) { CompletedAction = OnComplete; if (targetBase != null) { CurrentBase = (Products.Product)targetBase.Clone(); } else { CurrentBase = new Products.Product(); } int itemCount = TemplateEditor.CurrentTemplate.ItemDefinitions.Count; itemList = new string[itemCount]; for (int i = 0; i < itemCount; i++) { if (TemplateEditor.CurrentTemplate.ItemDefinitions[i].Id == CurrentBase.ItemId) { selection = i; } itemList[i] = TemplateEditor.CurrentTemplate.ItemDefinitions[i].Id; } pricesEditor = new PricesEditor(); // Create window. var window = (ProductEditor)GetWindow(typeof(ProductEditor)); window.minSize = new Vector2(320, 435); window.maxSize = new Vector2(320, 435); window.Show(); }