public void Clear(Score.ScoreType type) { Score.Get().Up(type); Debug.Log(((int)type).ToString()); enabled = false; renderer.enabled = false; }
public void Clear(Score.ScoreType type) { enabled = false; renderer.enabled = false; processed = true; if (connector) { if ((int)this.type >= 2) { connector.GetComponent <SpriteRenderer>().enabled = false; } else { connector.SetFirstJoint(transform.parent); } } if (type == Score.ScoreType.Good) { // Debug.Log("Good"); DobbyControll.Get().Damage(5); EffectShower.Get().Good(transform); Score.Get().Up(150); } else if (type == Score.ScoreType.Great) { // Debug.Log("Great"); DobbyControll.Get().Damage(10); EffectShower.Get().Great(transform); Score.Get().Up(300); } switch (this.type) { case Type.UP: case Type.OUT_UP: SoundEffectManager.Get().PlayUpSound(); break; case Type.DOWN: case Type.OUT_DOWN: SoundEffectManager.Get().PlayDownSound(); break; default: break; } checker.Next(); }
//--------------------------------------------------- public void AddScore(Score.ScoreType scoreType) { if (!this.isRunning) { return; } int additionalScore = Score.GetScore(scoreType); this.score = Mathf.Clamp(this.score + additionalScore, Score.MinScore, Score.MaxScore); this.UpdateScoreText(this.score); SIGVerseLogger.Info("Score (" + scoreType.ToString() + ") add [" + Score.GetScore(scoreType) + "], Challenge " + HumanNaviConfig.Instance.numberOfTrials + " Score=" + this.score); // Send the Score Notification ScoreStatus scoreStatus = new ScoreStatus(additionalScore, this.score, HumanNaviConfig.Instance.GetTotalScore()); foreach (GameObject scoreNotificationDestination in this.scoreNotificationDestinations) { ExecuteEvents.Execute <IScoreHandler> ( target: scoreNotificationDestination, eventData: null, functor: (reciever, eventData) => reciever.OnScoreChange(scoreStatus) ); } if (scoreType == Score.ScoreType.IncorrectObjectIsGrasped) { this.wrongObjectGraspCount++; } if (this.maxWrongObjectGraspCount > 0) { if (this.wrongObjectGraspCount >= this.maxWrongObjectGraspCount) { foreach (GameObject reachMaxWrongObjectGraspCountDestination in this.reachMaxWrongObjectGraspCountDestinations) { ExecuteEvents.Execute <IReachMaxWrongObjectGraspCountHandler> ( target: reachMaxWrongObjectGraspCountDestination, eventData: null, functor: (reciever, eventData) => reciever.OnReachMaxWrongObjectGraspCount() ); } } } }