public int GetFishScore(fish.FishType pType) { switch (pType) { case fish.FishType.Small: return(smallFishScoreValue); break; case fish.FishType.Medium: return(mediumFishScoreValue); break; case fish.FishType.Large: return(largeFishScoreValue); break; default: return(-999999); break; } }
public void CheckComboProgress(fish.FishType pFishType) { //Debug.Log("Checking Combo Progress. Combo Index: " + comboIndex); if (animatingComboBreak == false && pFishType == combo[comboIndex]) { //Debug.Log("Combo type was correct! Hit fish was " + pFishType + " and required fish was " + combo[comboIndex]); iconBackgroundsList[comboIndex].sprite = comboBackgroundIconSprites[(int)IconBackgroundStates.Completed]; comboIndex++; if (comboIndex == (comboLength + 1)) { //Debug.Log("Combo Completed! ComboIndex: " + comboIndex + " and combo length: " + comboLength); GameObject.Find("Manager").GetComponent <ScoreHandler>().AddComboScore(); CreateNewCombo(); return; } iconBackgroundsList[comboIndex].sprite = comboBackgroundIconSprites[(int)IconBackgroundStates.Next]; } else { //Debug.Log("Combo type was incorrect! Hit fish was " + pFishType + " and required fish was " + combo[comboIndex]); animatingComboBreak = true; for (int i = 0; i < iconBackgroundsList.Count; i++) { iconSlideDistancesList.Add(Random.Range(-iconSlideDistance, iconSlideDistance)); //Debug.Log("Distance: " + iconSlideDistancesList[i]); iconSlideCounterList.Add(0.0f); int iconIndex = -1; if (i < comboIndex) { iconIndex = (int)IconBackgroundStates.Completed; } else if (i == comboIndex) { iconIndex = (int)IconBackgroundStates.Next; } else if (i > comboIndex) { iconIndex = (int)IconBackgroundStates.Standard; } iconBackgroundsList[i].sprite = comboBrokenIconSprites[iconIndex]; } } }
/// <summary> /// Increments our current score. The boolean controls whether UI appears or not. /// </summary> /// <param name="pFishType"></param> /// <param name="pCreatUIAnnouncement"></param> public void AddScore(fish.FishType pFishType, bool pCreatUIAnnouncement, bool pCaughtAFish) { int pScore = GetFishScore(pFishType); HookScore += pScore; if (pCreatUIAnnouncement) { createScoreUI(pScore, false); } if (pCaughtAFish == true) { } //Briefly switch the colour and start a counter to switch it back for visual feedback //timeColourHasBeenFlashing = colourFlashTime; //colourFlashing = true; //currentHookScore.color = flashColour; //flashTextHolder = currentHookScore; //originalColourHolder = originalHookScoreColour; }