Beispiel #1
0
    void Awake()
    {
#if DEVELOPMENT_BUILD
        //PlayerPrefs.DeleteAll();
#endif
        Amplitude amplitude = Amplitude.Instance;
        if (Constants.GetConstant <bool>("AnalyticsEnabled"))
        {
            amplitude.logging = true;
            if (Constants.GetConstant <bool>("IsLiveAnalytics"))                        // Live Amplitude
            {
                amplitude.init("51dc5ebabe7286e547c06afc44302378");
            }
            else                                                                                                                        //Dev Amplitude
            {
                amplitude.init("a06f151d06c754bdbbff7bdbaffe12e2");
            }
        }

        //JSON serializer setting
        JSON.Instance.Parameters.UseExtensions             = false;
        JSON.Instance.Parameters.UseUTCDateTime            = false; //turning utc off for now
        JSON.Instance.Parameters.UseOptimizedDatasetSchema = true;

        //--------------------Make Object persistent---------------------------
        if (isCreated)
        {
            //If There is a duplicate in the scene. delete the object and jump Awake
            Destroy(gameObject);
            return;
        }
        DontDestroyOnLoad(gameObject);
        isCreated = true;
        //---------------------------------------------------------------------

        //Use this when developing on an independent scene. Will initialize all the data
        //before other classes call DataManager
        if (isDebug && PlayerPrefs.GetInt("IsDebugSaveGameFlag", 0) == 0)
        {
            PlayerPrefs.SetInt("IsDebugSaveGameFlag", 1);               // Special case here, dont load from debug if it is debug coming back
            InitGameDataForDebug();
        }
        else
        {
            // if not first time need to do version check, retrieve old version
            if (!IsFirstTime)
            {
                string currentDataVersionString = PlayerPrefs.GetString("CurrentDataVersion", CURRENT_VERSION);
                VersionCheck(currentDataVersionString);
            }

            LoadGameData();
        }
    }
Beispiel #2
0
    void Awake()
    {
        manage = this;
        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.init("8578eac3466937dd610b84480ff56bd8");
        PlayerPrefs.SetInt("AppActive", PlayerPrefs.GetInt("AppActive") + 1);
        if (PlayerPrefs.GetInt("FirstActive") == 0)
        {
            Amplitude.Instance.logEvent("AppOpen", FirstTime);
            Amplitude.Instance.logEvent("FirstTime");
            // MainMenuManager.manage.Soundtracks();
            PlayerPrefs.SetFloat("DriftCoin", PlayerPrefs.GetFloat("DriftCoin") + 10000f);
            PlayerPrefs.SetInt("citysingle", 1);
            PlayerPrefs.SetString("Player", "Player" + Random.Range(0, 9999));
            PlayerPrefs.SetInt("FirstActive", PlayerPrefs.GetInt("FirstActive") + 1);
            isFirstActivate = true;
        }

        if (LobbyManager.manage.isCityLoadingBtnClicked)
        {
            PlayerPrefs.SetInt("AppActivate", PlayerPrefs.GetInt("AppActivate") + 1);
        }
    }
Beispiel #3
0
    void Awake()
    {
        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.init("91ab9bf20d3209aae345f166f1f40542");
    }
Beispiel #4
0
    // Use this for initialization
    void Awake()
    {
        Debug.Log("awake");
        Amplitude amplitude = Amplitude.getInstance();

        amplitude.setServerUrl("https://api2.amplitude.com");
        amplitude.logging = true;
        amplitude.trackSessionEvents(true);
        amplitude.useAdvertisingIdForDeviceId();
        amplitude.init("e7177d872ff62c0356c973848c7bffba");
        Debug.Log(amplitude.getDeviceId());

        Dictionary <string, bool> trackingOptions = new Dictionary <string, bool>();

        trackingOptions.Add("disableCity", true);
        trackingOptions.Add("disableIPAddress", true);
        trackingOptions.Add("disableIDFV", true);
        trackingOptions.Add("disableIDFA", true);
        trackingOptions.Add("disableCountry", true);

        Amplitude app2 = Amplitude.getInstance("app2");

        app2.logging = true;
        app2.trackSessionEvents(true);
        app2.setTrackingOptions(trackingOptions);
        app2.setDeviceId("111111bca");
        app2.init("3653adbf32717221cacbf722f4671052");
        Debug.Log(app2.getDeviceId());
        app2.logEvent("logging to unity demo 2");
        app2.logEvent("keep logging events");
    }
Beispiel #5
0
    // Use this for initialization
    void Awake()
    {
        Debug.Log("awake");
        // Amplitude amplitude = Amplitude.Instance;
        Amplitude amplitude = Amplitude.getInstance();

        amplitude.logging = true;
        amplitude.trackSessionEvents(true);
        amplitude.init("a2dbce0e18dfe5f8e74493843ff5c053");
        Debug.Log(amplitude.getDeviceId());

        Dictionary <string, bool> trackingOptions = new Dictionary <string, bool>();

        trackingOptions.Add("disableCity", true);
        trackingOptions.Add("disableIPAddress", true);
        trackingOptions.Add("disableIDFV", true);
        trackingOptions.Add("disableIDFA", true);
        trackingOptions.Add("disableCountry", true);

        Amplitude app2 = Amplitude.getInstance("app2");

        app2.logging = true;
        app2.trackSessionEvents(true);
        app2.setTrackingOptions(trackingOptions);
        app2.init("3653adbf32717221cacbf722f4671052");
        Debug.Log(app2.getDeviceId());
        app2.logEvent("logging to unity demo 2");
        app2.logEvent("keep logging events");
    }
Beispiel #6
0
    void Awake()
    {
        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.init("3f9c7b0d19b01caf443c0a376e6e10b0");
    }
    void Awake()
    {
        Debug.Log("Initializing amplitude metrics");
        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.init("cc640845a5016ce9f116ba3d90c95ae7");
    }
Beispiel #8
0
    void Awake()
    {
        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.init("909634c0df30d00b2c617252d3d0a064");

        Amplitude.Instance.logEvent("start_app");
    }
Beispiel #9
0
    // Use this for initialization
    void Awake()
    {
        Debug.Log("awake");
        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.trackSessionEvents(true);
        amplitude.init("a2dbce0e18dfe5f8e74493843ff5c053");
        Debug.Log(amplitude.getDeviceId());
    }
Beispiel #10
0
    public void LogEvent(string EventName, string par1, string par2)
    {
        Amplitude amplitude = Amplitude.Instance;

        amplitude.trackSessionEvents(true);
        amplitude.useAdvertisingIdForDeviceId();
        amplitude.init(ApiKey);
        amplitude.logEvent(EventName);
        amplitude.setUserProperty(par1, par2);
        amplitude.uploadEvents();
        Debug.Log(amplitude.getSessionId());
    }
Beispiel #11
0
    public AmplitudeManager()
    {
        _subscriberList.Add(new Event <GameOverEvent> .Subscriber(OnGameOver));
        _subscriberList.Add(new Event <InitializeEvent> .Subscriber(OnStartRun));
        _subscriberList.Add(new Event <PlayerHaveJumped> .Subscriber(OnJump));
        _subscriberList.Add(new Event <QuitEvent> .Subscriber(OnQuit));
        _subscriberList.Add(new Event <ChangeMenuEvent> .Subscriber(OnMenuChange));
        _subscriberList.Add(new Event <FrameEvent> .Subscriber(OnFrame));
        _subscriberList.Add(new Event <AchievementSucessEvent> .Subscriber(OnAchievement));
        _subscriberList.Subscribe();

        _amplitude         = Amplitude.Instance;
        _amplitude.logging = true;
        _amplitude.init(AppKey);
    }
Beispiel #12
0
    void Awake()
    {
        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.init("24124fc176fddaf8f13b157c1586cb32");
        manage = this;

        if (PlayerPrefs.GetInt("Install") == 0)
        {
            Amplitude.Instance.logEvent("AppOpen", FirstTime);
            PlayerPrefs.SetInt("Install", PlayerPrefs.GetInt("Install") + 1);
            isFirstActivate = true;
        }
    }
Beispiel #13
0
    void Awake()
    {
        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.init("192e38bc3f24f012cf6ce443cdc45db4");
        if (!FB.IsInitialized)
        {
            // Initialize the Facebook SDK
            FB.Init(InitCallback, OnHideUnity);
        }
        else
        {
            // Already initialized, signal an app activation App Event
            FB.ActivateApp();
        }
    }
Beispiel #14
0
    public AmplitudeHelper()
    {
        amplitude         = Amplitude.Instance;
        amplitude.logging = true;

        if (string.IsNullOrEmpty(AppId))
        {
            Debug.LogError("Cannot instantiate Amplitude without proper AppId");
            return;
        }

        amplitude.trackSessionEvents(true);
        amplitude.init(AppId);

        // We chose to use the deviceId as unique userId
        if (!String.IsNullOrEmpty(SystemInfo.deviceUniqueIdentifier))
        {
            amplitude.setUserId(SystemInfo.deviceUniqueIdentifier);
        }
    }
Beispiel #15
0
    public AnaliticsCore()
    {
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
            _dependencyStatus = task.Result;
            if (_dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                /*
                 * Debug.LogError("Could not resolve all Firebase dependencies: " + _dependencyStatus);
                 */
            }
        });

        _amplitude = Amplitude.getInstance();
        _amplitude.trackSessionEvents(true);
        _amplitude.init("94a37eb01d2b2e09b2e836dcd7b44ad0");
    }
Beispiel #16
0
    void Awake()
    {
        //ResetSave();
        //ResetAchievement();
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            instance.loaded = true;
            Destroy(gameObject);
        }

        Amplitude amplitude = Amplitude.Instance;

        amplitude.logging = true;
        amplitude.init("7cc53a06785cde378112e5cd205bae7d");

        levelManager = GetComponent <LevelManager>();
        uiManager    = GetComponent <UIManager>();
        player       = GameObject.Find("Player").GetComponent <PlayerController>();

        //Camera Initialization
        Screen.orientation           = ScreenOrientation.Portrait;
        Camera.main.orthographicSize = ((Screen.height * (chunkSize + (0.5f * Screen.height / Screen.width))) / Screen.width) / 2;

        InitGame();

        //Comment or Uncomment this code to Reset saves for new version
        if (PlayerPrefs.HasKey("GameVersion") == false || PlayerPrefs.GetString("GameVersion") != gameversion)
        {
            ResetSave();
            PlayerPrefs.SetString("GameVersion", Application.version);
        }
    }
Beispiel #17
0
 void Awake()
 {
     amplitude         = Amplitude.Instance;
     amplitude.logging = true;
     amplitude.init("3f32e017748124cb86c984f4756231d4");
 }