|
|
@@ -146,7 +146,7 @@ public abstract class GameMode
|
|
|
public GameMode(GameMgr gameMgr) {
|
|
|
this.gameMgr = gameMgr;
|
|
|
}
|
|
|
- public abstract void HitTarget(int score);
|
|
|
+ public abstract void HitTarget(float score);
|
|
|
public abstract bool DoNextShoot();
|
|
|
public abstract object[] Settle();
|
|
|
public virtual void Start() {}
|
|
|
@@ -174,7 +174,7 @@ public class GameModeTest : GameMode {
|
|
|
TargetBody targetBody = GameObject.Find("GameArea/010/TargetBody").GetComponent<TargetBody>();
|
|
|
GameObject.Find("Main Camera/ArmBow").GetComponent<ArmBow>().validTargets.Add(targetBody);
|
|
|
}
|
|
|
- public override void HitTarget(int score) {
|
|
|
+ public override void HitTarget(float score) {
|
|
|
HitTargetNumber.Create(score);
|
|
|
}
|
|
|
public override bool DoNextShoot() { return true; }
|
|
|
@@ -185,7 +185,7 @@ public class GameModeTest : GameMode {
|
|
|
public class TimeLimitGameMode : GameMode {
|
|
|
public static int[] distanceCanSelected = {10, 20, 30, 50, 70};
|
|
|
public static int distance = 10;
|
|
|
- public int score = 0;
|
|
|
+ public float score = 0;
|
|
|
int oneStarScore = 10;
|
|
|
float time = 60;
|
|
|
TargetBody targetBody;
|
|
|
@@ -214,7 +214,7 @@ public class TimeLimitGameMode : GameMode {
|
|
|
TargetView.ins.Show(true);
|
|
|
}
|
|
|
|
|
|
- public override void HitTarget(int score) {
|
|
|
+ public override void HitTarget(float score) {
|
|
|
this.score += score;
|
|
|
HitTargetNumber.Create(score);
|
|
|
}
|
|
|
@@ -224,11 +224,11 @@ public class TimeLimitGameMode : GameMode {
|
|
|
}
|
|
|
|
|
|
public override object[] Settle() {
|
|
|
- int starCount = this.score / this.oneStarScore;
|
|
|
- int highestScore = 0;
|
|
|
+ int starCount = Mathf.FloorToInt(this.score / this.oneStarScore);
|
|
|
+ float highestScore = 0;
|
|
|
string distanceStr = distance.ToString();
|
|
|
System.Object highestScoreObj = LoginMgr.myUserInfo.timeLimitGameHighestScores[distanceStr];
|
|
|
- if (highestScoreObj != null) highestScore = int.Parse(highestScoreObj.ToString());
|
|
|
+ if (highestScoreObj != null) highestScore = float.Parse(highestScoreObj.ToString());
|
|
|
if (this.score > highestScore) {
|
|
|
LoginMgr.myUserInfo.timeLimitGameHighestScores.Remove(distanceStr);
|
|
|
LoginMgr.myUserInfo.timeLimitGameHighestScores.Add(distanceStr, this.score);
|
|
|
@@ -274,7 +274,7 @@ public class TimeLimitGameMode : GameMode {
|
|
|
public class PKGameMode : GameMode {
|
|
|
public int currentPlayerIndex = 0;
|
|
|
public int[] totalScores = {0, 0};
|
|
|
- public int[] currentScores = {0, 0};
|
|
|
+ public float[] currentScores = {0, 0};
|
|
|
public int round = 1;
|
|
|
public int showRoundValue = 0; //回合开始提示值,如果已经提示,则showRoundValue == round
|
|
|
float[] targetDistancesOnRound = {10, 20, 30, 50, 70, 70};
|
|
|
@@ -337,7 +337,7 @@ public class PKGameMode : GameMode {
|
|
|
GameObject.Instantiate(view);
|
|
|
}
|
|
|
|
|
|
- public override void HitTarget(int score) {
|
|
|
+ public override void HitTarget(float score) {
|
|
|
currentScores[currentPlayerIndex] += score;
|
|
|
shootCount[currentPlayerIndex]++;
|
|
|
HitTargetNumber.Create(score);
|