Пример #1
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, 1024, 512), false, "IAP Settings");
     //automatically repaint whenever the scene has changed (for caution)
     iapEditor.autoRepaintOnSceneChange = true;
 }
Пример #2
0
        //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;
            }
        }
Пример #3
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;
 }
Пример #4
0
 public static string[] OnWillSaveAssets(string[] paths)
 {
     if (IAPEditor.iapEditor)
     {
         IAPEditor.SavePrefab();
     }
     return(paths);
 }
Пример #5
0
        //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();
        }
Пример #6
0
        //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;
                }
            }
        }
Пример #7
0
        //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;
        }