public virtual void AddMarker(Marker marker) { this.state = GestureStates.PreReady; this.marker = marker; marker.CountDown.OnTimeOut += CountDown_OnTimeOut; }
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); }
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); }
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; } }
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; } }
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; } }
public void SetMarkerPreReady(GestureStates state) { SetColor(handSpriteRenderer, state); SetAlpha(handSpriteRenderer, alphaPreready); }
public void SetState(GestureStates state) { this.state = state; }
public void SetActive() { this.state = GestureStates.Active; this.Marker.SetMarkerActive(this.Duration, this, state); marker.Collider.OnMarkerCollision += Marker_OnMarkerCollision; }
private void CountDown_OnTimeOut(BaseGesture gesture) { this.state = GestureStates.NotHit; marker.Collider.CanCollide = false; gestureController.ExpireMarker(gesture); }