Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ChopChop/Assets/Scripts/ChopChopAnalytics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class ChopChopAnalytics : MonoBehaviour
private int rightAttack = 0;
private int upAttack = 0;
private int stealweapon = 0;
private int enemydied = 0;
private string currentTime;
[HideInInspector]
public enum functiontype
Expand All @@ -30,7 +31,8 @@ public enum functiontype
rightAttack,
upAttack,
currenttime,
stealweapon
stealweapon,
enemydied
}

public void IncrementEnemyDamaged()
Expand Down Expand Up @@ -67,7 +69,8 @@ public void TimeTrack()
Debug.Log("Result: " + result);

AnalyticsResult result2 = Analytics.CustomEvent("AvgGameSession2", new Dictionary<string, object>{
{"WeaponStolen", stealweapon}
{"WeaponStolen", stealweapon},
{"EnemyDestroyed", enemydied}
});
Debug.Log("Result: " + result2);

Expand Down Expand Up @@ -103,6 +106,10 @@ public void IncrementSteal()
{
stealweapon++;
}
public void IncrementDestroy()
{
enemydied++;
}

public static void RunAnalytics(ChopChopAnalytics chop, functiontype func, string weaponname = null)
{
Expand Down Expand Up @@ -137,6 +144,9 @@ public static void RunAnalytics(ChopChopAnalytics chop, functiontype func, strin
case functiontype.stealweapon:
chop.IncrementSteal();
break;
case functiontype.enemydied:
chop.IncrementDestroy();
break;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions ChopChop/Assets/Scripts/Health.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private void OnCollisionEnter(Collision other)
gameCharacter.GetComponentInParent<EnemySpawner>().ResetTimeBetweenNextSpawn();
ChopChopAnalytics.RunAnalytics(chopAnalytics, ChopChopAnalytics.functiontype.enemiesKilledSword, opponentWeapon.gameObject.name);
Score.addScore(5, 25);
ChopChopAnalytics.RunAnalytics(chopAnalytics, ChopChopAnalytics.functiontype.enemydied);
}
if (characterTag == "Player")
{
Expand Down