|
|
@@ -92,6 +92,8 @@ namespace DuckHunter
|
|
|
private static bool AutoNextLevel = false;
|
|
|
[System.NonSerialized] public int hitScore; //得分
|
|
|
private int uploadScore;//上传服务器的分数
|
|
|
+ private bool bAddCountScore = false;
|
|
|
+
|
|
|
[System.NonSerialized] public int level = 1;
|
|
|
/// <summary>
|
|
|
/// 通关需要击落的鸭子数量
|
|
|
@@ -258,17 +260,23 @@ namespace DuckHunter
|
|
|
_lastFallDownTime = Time.time;
|
|
|
}
|
|
|
[System.NonSerialized] public int hitCount = 0;
|
|
|
+ private int bowHitCount = 0;
|
|
|
void HandleOnHitDead(Duck duck)
|
|
|
{
|
|
|
hitCount++;
|
|
|
int scoreToPlus = duck.config.type * 500;
|
|
|
hitScore += scoreToPlus;
|
|
|
GameUI.Instance.RenderHitDuckCount(duck.config.type);
|
|
|
- // GameUI.Instance.RenderHitScore(hitScore, GetBestScore());
|
|
|
- _CumulativeScore += scoreToPlus;
|
|
|
- uploadScore += scoreToPlus; //击杀野鸭分数
|
|
|
- GameUI.Instance.RenderHitScore(_CumulativeScore, GetBestScore());
|
|
|
- GameUI.Instance.ShowTextHitScore(scoreToPlus, duck.transform.position);
|
|
|
+
|
|
|
+ //射击状态下,刷新添加分数
|
|
|
+ if (bAddCountScore) {
|
|
|
+ bowHitCount++;
|
|
|
+ _CumulativeScore += scoreToPlus;
|
|
|
+ uploadScore += scoreToPlus; //击杀野鸭分数
|
|
|
+ GameUI.Instance.RenderHitScore(_CumulativeScore, GetBestScore());
|
|
|
+ GameUI.Instance.ShowTextHitScore(scoreToPlus, duck.transform.position);
|
|
|
+ }
|
|
|
+
|
|
|
RemoveArrows(duck);
|
|
|
}
|
|
|
|
|
|
@@ -380,12 +388,11 @@ namespace DuckHunter
|
|
|
else
|
|
|
{
|
|
|
//完美通关
|
|
|
- if (needCreateDuckCount == hitCount)
|
|
|
+ if (needCreateDuckCount == hitCount && needCreateDuckCount == bowHitCount)
|
|
|
{
|
|
|
//奖励额外积分
|
|
|
int plusScore = 10000;
|
|
|
hitScore += plusScore;
|
|
|
- // GameUI.Instance.RenderHitScore(hitScore, GetBestScore());
|
|
|
_CumulativeScore += plusScore;
|
|
|
uploadScore += plusScore;
|
|
|
GameUI.Instance.RenderHitScore(_CumulativeScore, GetBestScore());
|
|
|
@@ -468,6 +475,9 @@ namespace DuckHunter
|
|
|
|
|
|
bool UseOneArrow(bool bAddCount = false)
|
|
|
{
|
|
|
+ //根据射箭状态赋值
|
|
|
+ bAddCountScore = bAddCount;
|
|
|
+
|
|
|
if (arrowCount > 0)
|
|
|
{
|
|
|
// foreach (var e in _duckCanShootCountList)
|