Exemplo n.º 1
0
 private void OnGUI()
 {
     OKSettings.AppKey        = EditorGUILayout.TextField("OpenKit App Key", OKSettings.AppKey);
     OKSettings.AppSecretKey  = EditorGUILayout.TextField("OpenKit Secret Key", OKSettings.AppSecretKey);
     OKSettings.FacebookAppId = EditorGUILayout.TextField("Facebook App Id", OKSettings.FacebookAppId);
     if (GUILayout.Button("Apply"))
     {
         OKSettings.Save();
     }
 }
Exemplo n.º 2
0
    void SetupOpenKit()
    {
        OKSettings.Load();
        // AppKey and SecretKey are set in the OpenKit menu
        OKManager.Configure(OKSettings.AppKey, OKSettings.AppSecretKey);

        // If you want to disable the achievements UI, uncomment the line below
        //OKManager.SetAchievementsEnabled(false);

        // If you want to display a LeaderboardListTag other than the default "v1" tag, then
        // uncomment this line and set the tag
        //OKManager.SetLeaderboardListTag("v1");

        // If you want to disable Google Login, uncomment the below line (Android only)
        //OKManager.SetGoogleLoginEnabled(false);
    }
Exemplo n.º 3
0
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
    {
        OKSettings.Load();
        if (string.IsNullOrEmpty(OKSettings.FacebookAppId))
        {
            UnityEngine.Debug.LogError("Missing Facebook App Id for OpenKit - add it using the OpenKit config menu to configure your app before deploying!");
        }

        if (string.IsNullOrEmpty(OKSettings.AppKey) || string.IsNullOrEmpty(OKSettings.AppSecretKey))
        {
            UnityEngine.Debug.LogError("Missing AppKey or SecretKey for OpenKit. You must add it using the OpenKit config menu to configure your app before building");
            throw new System.ArgumentException("Missing appKey or secretKey for OpenKit");
        }

#if UNITY_IOS
        string f       = "OpenKitIOSBuildLogFile.txt";
        string logfile = System.IO.Directory.GetCurrentDirectory() + "/" + f;
        UnityEngine.Debug.Log("Logging OpenKit post build to " + f);
        LogTo(logfile, "In Editor/OpenKitPostProcessBuildPlayer.cs\n");

        Process proc = new Process();
        proc.EnableRaisingEvents = false;
        proc.StartInfo.FileName  = Application.dataPath + "/Plugins/OpenKit/PostbuildScripts/PostBuildOpenKitIOSScript";
        proc.StartInfo.Arguments = "'" + pathToBuiltProject + "' '" + OKSettings.FacebookAppId + "'";

        // Add the Unity version as an argument to the postbuild script, use 'Unity3' for all 3.x versions and for
        // 4 and up use the API to get it
        string unityVersion;
#if UNITY_3_5 || UNITY_3_4 || UNITY_3_3 || UNITY_3_2 || UNITY_3_1 || UNITY_3_0_0 || UNITY_3_0
        unityVersion = "Unity3";
#else
        unityVersion = Application.unityVersion;
#endif
        proc.StartInfo.Arguments += " '" + unityVersion + "'";
        proc.Start();
        proc.WaitForExit();
#endif
    }
Exemplo n.º 4
0
 private void OnEnable()
 {
     OKSettings.Load();
 }