Ejemplo n.º 1
0
 public void OnEnable()
 {
     // Generating AndroidManifest.xml
     ManifestTools.GenerateManifest();
 }
Ejemplo n.º 2
0
    private void AndroidGUI()
    {
        showAndroidSettings = EditorGUILayout.Foldout(showAndroidSettings, "Android Settings");
        if (showAndroidSettings)
        {
            EditorGUILayout.BeginHorizontal();
            SelectableLabelField(packageNameLabel, PlayerSettings.bundleIdentifier);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();
            EditorGUILayout.HelpBox("Billing Service Selection", MessageType.None);

            if (!SoomSettings.GPlayBP && !SoomSettings.AmazonBP)
            {
                SoomSettings.GPlayBP = true;
            }

            SoomSettings.GPlayBP = EditorGUILayout.ToggleLeft(playLabel, SoomSettings.GPlayBP);

            if (SoomSettings.GPlayBP)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.Space();
                EditorGUILayout.LabelField(publicKeyLabel, fieldWidth, fieldHeight);
                SoomSettings.AndroidPublicKey = EditorGUILayout.TextField(SoomSettings.AndroidPublicKey, fieldHeight);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(emptyContent, spaceWidth, fieldHeight);
                SoomSettings.AndroidTestPurchases = EditorGUILayout.Toggle(testPurchasesLabel, SoomSettings.AndroidTestPurchases);
                EditorGUILayout.EndHorizontal();
            }

            if (SoomSettings.GPlayBP && !playUpdate)
            {
                playUpdate   = true;
                amazonUpdate = false;

                SoomSettings.AmazonBP = false;
                ManifestTools.GenerateManifest();
                SoomlaAndroidUtil.handlePlayBPJars(false);
                SoomlaAndroidUtil.handleAmazonBPJars(true);
            }


            SoomSettings.AmazonBP = EditorGUILayout.ToggleLeft(amazonLabel, SoomSettings.AmazonBP);

            if (SoomSettings.AmazonBP && !amazonUpdate)
            {
                playUpdate   = false;
                amazonUpdate = true;

                SoomSettings.GPlayBP = false;
                ManifestTools.GenerateManifest();
                SoomlaAndroidUtil.handlePlayBPJars(true);
                SoomlaAndroidUtil.handleAmazonBPJars(false);
            }



            if (!SoomlaAndroidUtil.IsSetupProperly())
            {
                var msg = "You have errors in your Android setup. More info in the SOOMLA docs.";
                switch (SoomlaAndroidUtil.SetupError)
                {
                case SoomlaAndroidUtil.ERROR_NO_SDK:
                    msg = "You need to install the Android SDK!  Set the location of Android SDK in: " + (Application.platform == RuntimePlatform.OSXEditor ? "Unity" : "Edit") + "->Preferences->External Tools";
                    break;

                case SoomlaAndroidUtil.ERROR_NO_KEYSTORE:
                    msg = "Your defined keystore doesn't exist! You'll need to create a debug keystore or point to your keystore in 'Publishing Settings' from 'File -> Build Settings -> Player Settings...'";
                    break;
                }

                EditorGUILayout.HelpBox(msg, MessageType.Error);
            }
        }
        EditorGUILayout.Space();
    }