Ejemplo n.º 1
0
 public static PSSDKObject getInstance()
 {
     if (instance == null)
     {
         GameObject polyCallback = new GameObject(Unity_Callback_Class_Name);
         polyCallback.hideFlags = HideFlags.HideAndDontSave;
         DontDestroyOnLoad(polyCallback);
         instance = polyCallback.AddComponent <PSSDKObject> ();
     }
     return(instance);
 }
Ejemplo n.º 2
0
        // "do nothing";
#endif


        public PSSDKCall()
        {
            PSSDKObject.getInstance();
#if UNITY_IOS && !UNITY_EDITOR
            setIosPSSDKCallbackWithClassAndFunction(PSSDKObject.Unity_Callback_Class_Name, PSSDKObject.Unity_Callback_Function_Name);
            Debug.Log("===> PSSDKCall instanced.");
#elif UNITY_ANDROID && !UNITY_EDITOR
            if (jc == null)
            {
                Debug.Log("===> PSSDKCall instanced.");
                jc = new AndroidJavaClass(JavaClassName);
            }
#endif
        }
Ejemplo n.º 3
0
        public void requestPrivacyAuthorization(string pid, string playerId, Action <PSSDKAuthModel> success, Action <string> fail)
        {
            Debug.Log("===> call requestPrivacyAuthorization in pssdkcall");
            PSSDKObject.getInstance().setRequestAuthCallback(success, fail);



#if UNITY_IOS && !UNITY_EDITOR
            requestPrivacyAuthorization(pid, playerId);
#elif UNITY_ANDROID && !UNITY_EDITOR
            if (jc != null)
            {
                jc.CallStatic(JavaClassStaticMethod_requestAuth, pid, playerId,
                              PSSDKObject.Unity_Callback_Class_Name,
                              PSSDKObject.Unity_Callback_Function_Name);
            }
#endif
        }