init() public static method

public static init ( string appKey, string appSecret ) : void
appKey string
appSecret string
return void
Esempio n. 1
0
    void Awake()
    {
        // collect our key and secret
        DontDestroyOnLoad(this);
        string appKey    = string.Empty;
        string appSecret = string.Empty;

#if UNITY_ANDROID
        appKey    = androidAppKey;
        appSecret = androidAppSecret;
#elif UNITY_IPHONE
        appKey    = iOSappKey;
        appSecret = iOSappSecret;
#endif

        if (appKey.Length == 0 || appSecret.Length == 0)
        {
            Debug.LogError("Enter your appKey and appSecret in the Kiip inspector for any platforms you support!");
            Destroy(gameObject);
            return;
        }

        // enforce one Kiip object
        var kiipObjects = FindObjectsOfType(typeof(Kiip));
        if (kiipObjects.Length > 1)
        {
            Destroy(gameObject);
            return;
        }

        _instance = this;
        DontDestroyOnLoad(gameObject);
        name = "Kiip";

        // start up the SDK
        KiipShim.init(appKey, appSecret);
    }