Exemplo n.º 1
0
        public virtual void AddMarker(Marker marker)
        {
            this.state  = GestureStates.PreReady;
            this.marker = marker;

            marker.CountDown.OnTimeOut += CountDown_OnTimeOut;
        }
Exemplo n.º 2
0
        public int DisableMarker(int score, int maxScore, GestureStates state)
        {
            if (isActive)
            {
                isActive = false;
                this.handSpritePrefab.SetActive(false);

                switch (state)
                {
                case GestureStates.NotHit:
                    sound.clip = expiredSound;
                    this.scoreSpritePrefab.SetActive(false);
                    break;

                case GestureStates.Hit:
                    score++;
                    sound.clip = hitSound;
                    viewManager.SetScoreText(score, maxScore);
                    scoreSpritePrefab.SetActive(true);
                    scoreAnimator.SetBool("Score", true);
                    break;
                }

                sound.Play();
            }

            return(score);
        }
Exemplo n.º 3
0
 public void SetMarkerActive(DateTime time, BaseGesture gesture, GestureStates state)
 {
     SetColor(handSpriteRenderer, state);
     SetAlpha(handSpriteRenderer, alphaActive);
     spriteCollider.SetGesture(gesture);
     handSpritePrefab.GetComponent <BoxCollider>().enabled = true;
     countDown.SetCountDown(time, gesture);
 }
Exemplo n.º 4
0
 private void Marker_OnMarkerCollision(Marker marker, BaseGesture gesture, Hand hand)
 {
     if (gesture.IsGesture(hand) && this.state == GestureStates.Active)
     {
         this.state = GestureStates.Hit;
         marker.Collider.CanCollide = false;
         gestureController.ExpireMarker(gesture);
     }
     else
     {
         marker.Collider.CanCollide = true;
     }
 }
Exemplo n.º 5
0
        public void Proof(float time)
        {
            switch (state)
            {
            case GestureStates.NotAdded:
                if (time >= this.StartTime.TimeOfDay.TotalSeconds - timeOffset && time < this.StartTime.TimeOfDay.TotalSeconds)
                {
                    this.state = GestureStates.Add;
                }
                break;

            case GestureStates.PreReady:
                if (time >= this.StartTime.TimeOfDay.TotalSeconds && time <= this.EndTime.TimeOfDay.TotalSeconds)
                {
                    this.state = GestureStates.Ready;
                }
                break;
            }
        }
Exemplo n.º 6
0
        private void SetColor(SpriteRenderer renderer, GestureStates state)
        {
            switch (state)
            {
            case GestureStates.PreReady:
                renderer.color = this.inactiveColor;
                break;

            case GestureStates.Active:
                if (isLeft)
                {
                    renderer.color = this.leftDirectionColor;
                }
                else
                {
                    renderer.color = this.rightDirectionColor;
                }
                break;
            }
        }
Exemplo n.º 7
0
 public void SetMarkerPreReady(GestureStates state)
 {
     SetColor(handSpriteRenderer, state);
     SetAlpha(handSpriteRenderer, alphaPreready);
 }
Exemplo n.º 8
0
 public void SetState(GestureStates state)
 {
     this.state = state;
 }
Exemplo n.º 9
0
 public void SetActive()
 {
     this.state = GestureStates.Active;
     this.Marker.SetMarkerActive(this.Duration, this, state);
     marker.Collider.OnMarkerCollision += Marker_OnMarkerCollision;
 }
Exemplo n.º 10
0
 private void CountDown_OnTimeOut(BaseGesture gesture)
 {
     this.state = GestureStates.NotHit;
     marker.Collider.CanCollide = false;
     gestureController.ExpireMarker(gesture);
 }