void SetupTracker() { tracker = GameObject.Find("Tracker").GetComponent <TrackerScript>(); // Determine if tablet or phone string screenType = "?"; if (Application.platform == RuntimePlatform.Android) { float widthInchesSqrd = Mathf.Pow(DisplayMetricsAndroid.WidthPixels / DisplayMetricsAndroid.XDPI, 2); float heightInchesSqrd = Mathf.Pow(DisplayMetricsAndroid.HeightPixels / DisplayMetricsAndroid.YDPI, 2); diagonalInInches = Mathf.Sqrt(widthInchesSqrd + heightInchesSqrd); //Debug.Log(string.Format("diagonalInInches = {0}", diagonalInInches)); if (diagonalInInches < SCREEN_TABLET_INCH) { screenType = "P"; } else { screenType = "T"; } } else { // Lets just use pixels diagonalInPixels = Mathf.Sqrt(Mathf.Pow(Screen.width, 2) + Mathf.Pow(Screen.height, 2)); //Debug.Log(string.Format("diagonalInPixels = {0}", diagonalInPixels)); if (diagonalInPixels < SCREEN_TABLET_PX) { screenType = "P"; } else { screenType = "T"; } } // Level name based on mode number level = string.Format("{0}{1}-{2}", modeNum, screenType, NotesData.DIFFICULTY_LEVEL.Substring(0, 1)); // Song started tracker.Counter(level, "started"); // Force send tracker.Resume(); tracker.Pause(); }
public void SendTrackerData() { // Song finished tracker.Counter(level, "completed"); // Accuracy tracker.Average(level, "scorePercent", Mathf.RoundToInt(scorePercent)); // Rounded is good enough tracker.Average(level, "timeDiffAvg", timeDiffAvg); tracker.Average(level, "hit_5_MARVELOUS", (int)accuracyTable.GetValue((int)Accuracy.MARVELOUS)); tracker.Average(level, "hit_4_PERFECT", (int)accuracyTable.GetValue((int)Accuracy.PERFECT)); tracker.Average(level, "hit_3_GREAT", (int)accuracyTable.GetValue((int)Accuracy.GREAT)); tracker.Average(level, "hit_2_GOOD", (int)accuracyTable.GetValue((int)Accuracy.GOOD)); tracker.Average(level, "hit_1_ALMOST", (int)accuracyTable.GetValue((int)Accuracy.ALMOST)); tracker.Average(level, "hit_0_MISS", (int)accuracyTable.GetValue((int)Accuracy.MISS)); // Max combos tracker.Average(level, "comboMax", comboMax); // Force send tracker.Resume(); }
void SendTrackerData() { string level = common.level; TrackerScript tracker = common.tracker; // Song finished tracker.Counter(level, "feedbackSubmitted"); // Accuracy tracker.Average(level, "ratingChallenge", ratings[0]); tracker.Average(level, "ratingIntuitive", ratings[1]); tracker.Average(level, "ratingUnique", ratings[2]); tracker.Average(level, "ratingFun", ratings[3]); tracker.Average(level, "ratingOverall", ratings[4]); // Force send tracker.Resume(); // Exit common.OnBackButton(); }