Skip to content

phuong-axie/unity-axie-tracking

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unity-axie-tracking

Tracking SDK for Unity Editor

DemoScene.cs

private IEnumerator Start()
{
    Score = 0;

    string apiKey = "a66b0798-e3f4-4a7d-8f75-77f905000c02"; //YOUR API KEY, GET IT ON: https://developers.skymavis.com/console/app-tracking/
    AnalyticManager.InitManager(apiKey);
    yield return new WaitForEndOfFrame();

    AnalyticManager.IdentifyLocalUser(); //INIT IDENTIFY LOCAL USER
    yield return new WaitForEndOfFrame();

    AnalyticManager.AddEvent(EventTypes.Screen, new { @event = "demo_screen" }); //LOG EVENT OPEN SCREEN     
}


public void GameOver()
{
    gameOver.SetActive(true);

    //TRACKING EVENT GAME OVER
    var jObject = new JObject();
    jObject.Add(AnalyticConst.Event, "game_over");
    var properties = new JObject();
    properties.Add("score", score);
    jObject.Add(AnalyticConst.ACTION_PROPERTIES, properties);
    AnalyticManager.AddEvent(EventTypes.Track, jObject);
}

DemoScene Preview Untitled Untitled (1)

About

Tracking SDK for Unity Editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%