Example #1
0
        public void RecordEvent(bool hit, HitScore hitScore = null)
        {
            if (hit)
            {
                Combo++;
                if (hitScore != null)
                {
                    HitHistory.Add(hitScore);
                    Score += hitScore.score * (Combo + 1);

                    Health += HealthAddedPerHit;
                }
            }
            else
            {
                Combo   = 0;
                Health -= HealthDamage;
            }
        }
Example #2
0
        private void Outcome(double timeInMs, bool hit)
        {
            if (hit)
            {
                var cs = new HitScore()
                {
                    id       = QueueID,
                    accuracy = GetAccuracy(timeInMs)
                };
                Debug.Log($"Accuracy : {cs.accuracy}");

                if (cs.accuracy <= 20f)
                {
                    cs.score = 100;
                }
                else if (cs.accuracy <= 60f)
                {
                    cs.score = 50;
                }
                else
                {
                    cs.score = 25;
                }


                TapTapAimSetup.Tracker.RecordEvent(true, cs);
            }
            else
            {
                var cs = new HitScore()
                {
                    id       = QueueID,
                    accuracy = 0,
                    score    = 0
                };
                TapTapAimSetup.Tracker.RecordEvent(false, cs);
                Debug.LogError(InteractionID + "Failed to hit");
            }
            // gameObject.SetActive(false);
            Destroy(gameObject, 1);
        }
        private void Outcome(double timeInMs, bool hit)
        {
            //TapTapAimSetup.Tracker.NextObjToHit = InteractionID + 1;

            if (hit)
            {
                var difference = Math.Abs(timeInMs - PerfectInteractionTimeInMs);
                int score;
                if (difference <= 100)
                {
                    score = 100;
                }
                else if (difference <= 150)
                {
                    score = 50;
                }
                else
                {
                    score = 20;
                }

                var cs = new HitScore()
                {
                    id       = QueueID,
                    accuracy = GetAccuracy(difference),
                    score    = score
                };
                TapTapAimSetup.Tracker.RecordEvent(true, cs);
            }
            else
            {
                var cs = new HitScore()
                {
                    id       = QueueID,
                    accuracy = 0,
                    score    = 0
                };
                TapTapAimSetup.Tracker.RecordEvent(false, cs);
            }
        }