コード例 #1
0
        private static void UpdateManifest(string modPath, string manifestPath)
        {
            if (!Directory.Exists(modPath))
            {
                return;
            }

            ManifestMod.UpdateManifestFromManifestModsUnderPath(manifestPath, modPath, true);
        }
コード例 #2
0
 public static void SetAppIdAndSecret(string appId, string appSecret)
 {
     if (appId == null || appSecret == null)
     {
         throw new ArgumentNullException("NPNF app Id and app secret cannot be null");
     }
     else
     {
         NPNFSettings.Instance.AppId     = appId;
         NPNFSettings.Instance.AppSecret = appSecret;
         ManifestMod.GenerateManifest();
     }
 }
コード例 #3
0
    private void AppKeyGUI()
    {
        EditorGUILayout.HelpBox("Add the App keys associated with this game", MessageType.None);
        string newAppId     = EditableField(appIdLabel, instance.AppId, 180, isAppSettingsValid);
        string newAppSecret = EditableField(appSecretLabel, instance.AppSecret, 180, isAppSettingsValid);

        if (newAppId != instance.AppId || newAppSecret != instance.AppSecret)
        {
            ClearVersions();
            instance.AppId     = newAppId;
            instance.AppSecret = newAppSecret;
            ManifestMod.GenerateManifest();
        }
    }
コード例 #4
0
    private void AndroidUtilGUI()
    {
        showAndroidUtils = EditorGUILayout.Foldout(showAndroidUtils, "Android Build Facebook Settings");
        if (showAndroidUtils)
        {
            if (!FacebookAndroidUtil.IsSetupProperly())
            {
                var msg = "Your Android setup is not right. Check the documentation.";
                switch (FacebookAndroidUtil.SetupError)
                {
                case FacebookAndroidUtil.ERROR_NO_SDK:
                    msg = "You don't have the Android SDK setup!  Go to " + (Application.platform == RuntimePlatform.OSXEditor ? "Unity" : "Edit") + "->Preferences... and set your Android SDK Location under External Tools";
                    break;

                case FacebookAndroidUtil.ERROR_NO_KEYSTORE:
                    // msg = "Your android debug keystore file is missing! You can create new one by creating and building empty Android project in Ecplise.";
                    msg = "Your keystore file is missing! You can create one by going into Unity's Build Settings->Android->Publish Settings.";
                    break;

                case FacebookAndroidUtil.ERROR_NO_KEYTOOL:
                    msg = "Keytool not found. Make sure that Java is installed, and that Java tools are in your path.";
                    break;

                case FacebookAndroidUtil.ERROR_NO_OPENSSL:
                    msg = "OpenSSL not found. Make sure that OpenSSL is installed, and that it is in your path.";
                    break;

                case FacebookAndroidUtil.ERROR_KEYTOOL_ERROR:
                    msg = "Unkown error while getting Debug Android Key Hash.";
                    break;
                }
                EditorGUILayout.HelpBox(msg, MessageType.Warning);
            }
            EditorGUILayout.HelpBox("Copy and Paste these into your \"Native Android App\" Settings on developers.facebook.com/apps", MessageType.None);
            SelectableLabelField(packageNameLabel, PlayerSettings.bundleIdentifier);
            SelectableLabelField(classNameLabel, ManifestMod.DeepLinkingActivityName);
            SelectableLabelField(debugAndroidKeyLabel, FacebookAndroidUtil.DebugKeyHash);

            if (GUILayout.Button("Refresh Keyhash"))
            {
                FacebookAndroidUtil.refresh();
            }

            if (GUILayout.Button("Regenerate Android Manifest"))
            {
                ManifestMod.GenerateManifest();
            }
        }
        EditorGUILayout.Space();
    }
コード例 #5
0
 internal static void CheckFacebookSettings(string facebookId, bool buildTargetAndroid)
 {
     if (string.IsNullOrEmpty(facebookId))
     {
         Debug.LogError("Missing Facebook App Id");
     }
     else if (facebookId.ToLower() != IgnoreCheck)
     {
         FacebookSettings.AppIds = new List <string> {
             facebookId
         };
         FacebookSettings.AppLabels = new List <string> {
             Application.productName
         };
         EditorUtility.SetDirty(FacebookSettings.Instance);
         if (buildTargetAndroid && ManifestMod.CheckManifest())
         {
             ManifestMod.GenerateManifest();
         }
     }
 }
コード例 #6
0
    //Save or Update Settings Data

    void SaveSetting()
    {
        AppotaSetting.FacebookAppID         = _facebookID;
        AppotaSetting.FacebookAppSecretID   = _facebookSecretID;
        AppotaSetting.FacebookAppLinkUrl    = _facebookAppLinkUrl;
        AppotaSetting.TwitterConsumerKey    = _twitterKey;
        AppotaSetting.TwitterConsumerSecret = _twitterSecret;
        AppotaSetting.GoogleClientId        = _googleID;
        AppotaSetting.GoogleClientSecretId  = _googleSecretID;
        AppotaSetting.InAppApiKey           = _inAppApiKey;
        AppotaSetting.GameID = _gameID;

        AppotaSetting.UsingAppFlyer = _usingAppFlyer;
        AppotaSetting.AppleAppID    = _appleAppID;
        AppotaSetting.AppFlyerKey   = _appFlyerKey;

        AppotaSetting.UsingAdWords        = _usingAdWords;
        AppotaSetting.AdWordsConversionID = _adWordsConversionID;
        AppotaSetting.AdWordsLabel        = _adWordsLabel;
        AppotaSetting.AdWordsValue        = _adWordsValue;
        AppotaSetting.AdWordsIsRepeatable = _adWordsIsRepeatable;
        ManifestMod.GenerateManifest();
        Debug.Log("Complete setting!!!");
    }
コード例 #7
0
    private void AppIdGUI()
    {
        EditorGUILayout.HelpBox("1) Add the Facebook App Id(s) associated with this game", MessageType.None);
        if (instance.AppIds.Length == 0 || instance.AppIds[instance.SelectedAppIndex] == "0")
        {
            EditorGUILayout.HelpBox("Invalid App Id", MessageType.Error);
        }
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField(appNameLabel);
        EditorGUILayout.LabelField(appIdLabel);
        EditorGUILayout.EndHorizontal();
        for (int i = 0; i < instance.AppIds.Length; ++i)
        {
            EditorGUILayout.BeginHorizontal();
            instance.SetAppLabel(i, EditorGUILayout.TextField(instance.AppLabels[i]));
            GUI.changed = false;
            instance.SetAppId(i, EditorGUILayout.TextField(instance.AppIds[i]));
            if (GUI.changed)
            {
                ManifestMod.GenerateManifest();
            }
            EditorGUILayout.EndHorizontal();
        }
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Add Another App Id"))
        {
            var appLabels = new List <string>(instance.AppLabels);
            appLabels.Add("New App");
            instance.AppLabels = appLabels.ToArray();

            var appIds = new List <string>(instance.AppIds);
            appIds.Add("0");
            instance.AppIds = appIds.ToArray();
        }
        if (instance.AppLabels.Length > 1)
        {
            if (GUILayout.Button("Remove Last App Id"))
            {
                var appLabels = new List <string>(instance.AppLabels);
                appLabels.RemoveAt(appLabels.Count - 1);
                instance.AppLabels = appLabels.ToArray();

                var appIds = new List <string>(instance.AppIds);
                appIds.RemoveAt(appIds.Count - 1);
                instance.AppIds = appIds.ToArray();
            }
        }
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.Space();
        if (instance.AppIds.Length > 1)
        {
            EditorGUILayout.HelpBox("2) Select Facebook App Id to be compiled with this game", MessageType.None);
            GUI.changed = false;
            instance.SetAppIndex(EditorGUILayout.Popup("Selected App Id", instance.SelectedAppIndex, instance.AppLabels));
            if (GUI.changed)
            {
                ManifestMod.GenerateManifest();
            }
            EditorGUILayout.Space();
        }
        else
        {
            instance.SetAppIndex(0);
        }
    }