Example #1
0
    /// <summary>
    /// Changes the score based off of the Source.
    /// </summary>
    /// <param name="changeScore">The amount to change the score by.</param>
    /// <param name="srcType">The source of what changed the score.</param>
    /// <returns>whether the score was changed based of the source.</returns>
    public bool EditScore(int changeScore, ScoreSource srcType)
    {
        if (srcType == ScoreSource.BackGroundObj)
        {
            if (BGObjScoreRemain <= 0)
            {
                return(false);
            }
            BGObjScoreRemain -= changeScore;
            score            += changeScore;
        }
        else if (srcType == ScoreSource.BonusBee)
        {
            bonusScore += changeScore;
        }
        else
        {
            score += changeScore;
        }

        if (!SVM_Script.Instance.isBonus)
        {
            if (score < 0)
            {
                score = 0;
            }
            DisplayScore(scoreNum1, scoreNum2, score);
        }
        else
        {
            DisplayScore(scoreNum1, scoreNum2, bonusScore);
        }
        return(true);
    }
Example #2
0
    private void Start()
    {
        colorHandler = FindObjectOfType <ColorHandler>();

        animator   = GetComponent <Animator>();
        interactor = GetComponent <BucketInteractor>();
        source     = GetComponent <ScoreSource>();
    }
Example #3
0
 public ScoreRecord(int userID, int sroce, string sourceUniqueID, ScoreSource source)
 {
     this.UserID = userID;
     this.Score = sroce;
     this.SourceID = 0;
     this.SourceUniqueID = sourceUniqueID;
     this.Source = source;
     this.CreateAt = DateTime.Now.ToUnixTimestamp();
 }
Example #4
0
 public ScoreRecord FindBySourceIDAndSourceType(int sourceID, ScoreSource source)
 {
     return this._session.QueryOver<ScoreRecord>()
                         .Where(sr => sr.SourceID == sourceID && sr.Source == source)
                         .SingleOrDefault();
 }