示例#1
0
    private static BaseTenjin createTenjin(string apiKey, string sharedSecret, int appSubversion)
    {
        GameObject tenjinGameObject = new GameObject("Tenjin");

        tenjinGameObject.hideFlags = HideFlags.HideAndDontSave;
        Object.DontDestroyOnLoad(tenjinGameObject);

#if UNITY_ANDROID && !UNITY_EDITOR
        BaseTenjin retTenjin = tenjinGameObject.AddComponent <AndroidTenjin>();
#elif UNITY_IPHONE && !UNITY_EDITOR
        BaseTenjin retTenjin = tenjinGameObject.AddComponent <IosTenjin>();
#else
        BaseTenjin retTenjin = tenjinGameObject.AddComponent <DebugTenjin>();
#endif

        if (!string.IsNullOrEmpty(sharedSecret) && appSubversion != 0)
        {
            retTenjin.InitWithSharedSecretAppSubversion(apiKey, sharedSecret, appSubversion);
        }
        else if (!string.IsNullOrEmpty(sharedSecret))
        {
            retTenjin.InitWithSharedSecret(apiKey, sharedSecret);
        }
        else if (appSubversion != 0)
        {
            retTenjin.InitWithAppSubversion(apiKey, appSubversion);
        }
        else
        {
            retTenjin.Init(apiKey);
        }
        return(retTenjin);
    }
示例#2
0
    private static BaseTenjin createTenjin(string apiKey, string sharedSecret)
    {
        GameObject tenjinGameObject = new GameObject("Tenjin");

        tenjinGameObject.hideFlags = HideFlags.HideAndDontSave;
        Object.DontDestroyOnLoad(tenjinGameObject);

#if UNITY_ANDROID && !UNITY_EDITOR
        BaseTenjin retTenjin = tenjinGameObject.AddComponent <AndroidTenjin>();
#elif UNITY_IPHONE && !UNITY_EDITOR
        BaseTenjin retTenjin = tenjinGameObject.AddComponent <IosTenjin>();
#else
        BaseTenjin retTenjin = tenjinGameObject.AddComponent <DebugTenjin>();
#endif
        if (sharedSecret != null)
        {
            retTenjin.Init(apiKey, sharedSecret);
        }
        else
        {
            retTenjin.Init(apiKey);
        }
        return(retTenjin);
    }