private void Awake()
        {
            if (transform != transform.root)
            {
                throw new Exception("TinySauce prefab HAS to be at the ROOT level!");
            }

            _sauceSettings = TinySauceSettings.Load();

            if (_sauceSettings == null)
            {
                throw new Exception("Can't find TinySauce sauceSettings file.");
            }

            if (_instance != null)
            {
                Destroy(gameObject);
                return;
            }

            _instance = this;
            DontDestroyOnLoad(this);

            VoodooLog.Initialize(VoodooLogLevel.WARNING);
            // init TinySauce sdk
            InitAnalytics();
        }
        private void Awake()
        {
            if (transform != transform.root)
            {
                throw new Exception("TinySauce prefab HAS to be at the ROOT level!");
            }

            _settings = Resources.Load <TinySettings>("TinySauce/Settings");
            if (_settings == null)
            {
                throw new Exception("Can't find TinySauce settings file.");
            }

            VoodooLog.Initialize(VoodooLogLevel.WARNING);
            if (_instance != null)
            {
                VoodooLog.LogW(Tag, "TinySauce is already initialized!. This object will be destroyed: " + gameObject.name);
                Destroy(gameObject);
                return;
            }

            _instance = this;
            DontDestroyOnLoad(this);

            // init TinySauce sdk
            InitFacebook();
            InitGameAnalytics();
            InitTenjin();
        }
Пример #3
0
        private void Awake()
        {
            #if UNITY_IOS
            NativeWrapper.RequestAuthorization((status) =>
            {
                InitFacebook();
            });
            #elif UNITY_ANDROID
            InitFacebook();
            #endif

            if (transform != transform.root)
            {
                throw new Exception("TinySauce prefab HAS to be at the ROOT level!");
            }

            _sauceSettings = TinySauceSettings.Load();
            if (_sauceSettings == null)
            {
                throw new Exception("Can't find TinySauce sauceSettings file.");
            }

            if (_instance != null)
            {
                Destroy(gameObject);
                return;
            }

            _instance = this;
            DontDestroyOnLoad(this);

            VoodooLog.Initialize(VoodooLogLevel.WARNING);
            // init TinySauce sdk
            InitAnalytics();
        }