|
|
@@ -3,17 +3,18 @@ using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
using UnityStandardAssets.ImageEffects;
|
|
|
using DG.Tweening;
|
|
|
+using UnityEngine.UI;
|
|
|
|
|
|
public class WolfHuntGameMode : ChallengeGameMode
|
|
|
{
|
|
|
public WolfHuntGameMode(GameMgr gameMgr) : base(gameMgr) {
|
|
|
this.animalTypeID = 2;
|
|
|
animalPrefab = animalsBaseT.Find("Wolf").gameObject;
|
|
|
- // AddSelectLevelView();
|
|
|
- this.time = 1800;
|
|
|
- this.arrowCount = 100;
|
|
|
- this.SetLevel(5);
|
|
|
- gameMgr.transform.Find("HunterGameView").gameObject.SetActive(true);
|
|
|
+ this.time = 18000;
|
|
|
+ this.arrowCount = 10000;
|
|
|
+ AddSelectLevelView();
|
|
|
+ // this.SetLevel(5);
|
|
|
+ // gameMgr.transform.Find("HunterGameView").gameObject.SetActive(true);
|
|
|
}
|
|
|
|
|
|
//动物的创建列表(数组元素表示动物颜色样式)
|
|
|
@@ -23,6 +24,7 @@ public class WolfHuntGameMode : ChallengeGameMode
|
|
|
|
|
|
//设置关卡级别
|
|
|
public override void SetLevel(int level) {
|
|
|
+ currentlevel = level;
|
|
|
if (level == 1) {
|
|
|
animalCreateList = new int[]{1, 1};
|
|
|
}
|
|
|
@@ -38,7 +40,7 @@ public class WolfHuntGameMode : ChallengeGameMode
|
|
|
else if (level == 5) {
|
|
|
animalCreateList = new int[]{1, 1, 1, 1, 2, 2, 2, 2};
|
|
|
}
|
|
|
- if (animalCreateList != null) animalCount = animalCreateList.Length;
|
|
|
+ if (animalCreateList != null) animalCountMax = animalCount = animalCreateList.Length;
|
|
|
}
|
|
|
|
|
|
float baseCreateDistance = 25;
|
|
|
@@ -77,6 +79,7 @@ public class WolfHuntGameMode : ChallengeGameMode
|
|
|
public override void Update()
|
|
|
{
|
|
|
base.Update();
|
|
|
+ if (gameMgr.gameOver || pauseTimeCounting) return;
|
|
|
timeForCreateAnimal += Time.deltaTime;
|
|
|
if ((int)(timeForCreateAnimal / 6) >= animalCreateIndex) {
|
|
|
CreateAnimal();
|
|
|
@@ -104,12 +107,12 @@ public class WolfHuntGameMode : ChallengeGameMode
|
|
|
}
|
|
|
|
|
|
Sequence hurtSeq = null;
|
|
|
- float iterations;
|
|
|
+ float hurtTweenV1 = 0;
|
|
|
public void DoTweenHurt() {
|
|
|
- iterations = 0;
|
|
|
+ GameObject screenInjuredObject = this.gameMgr.transform.Find("ScreenInjured").gameObject;
|
|
|
+ Image screenInjuredImage = screenInjuredObject.GetComponentInChildren<Image>();
|
|
|
+ Color screenInjuredColor = new Color(1, 75f/255f, 75f/255f, 0);
|
|
|
Blur blur = BowCamera.ins.transform.GetComponent<Blur>();
|
|
|
- blur.iterations = 0;
|
|
|
- blur.enabled = true;
|
|
|
if (hurtSeq != null) {
|
|
|
if (hurtSeq.IsActive()) {
|
|
|
hurtSeq.Complete();
|
|
|
@@ -117,19 +120,30 @@ public class WolfHuntGameMode : ChallengeGameMode
|
|
|
hurtSeq = null;
|
|
|
}
|
|
|
hurtSeq = DOTween.Sequence();
|
|
|
- Tween toMax = DOTween.To(() => iterations, value => {
|
|
|
- iterations = value;
|
|
|
- blur.iterations = Mathf.CeilToInt(iterations);
|
|
|
- }, 3f, 0.6f);
|
|
|
+ hurtSeq.AppendCallback(delegate() {
|
|
|
+ hurtTweenV1 = 0;
|
|
|
+ screenInjuredObject.SetActive(true);
|
|
|
+ screenInjuredImage.color = screenInjuredColor;
|
|
|
+ blur.enabled = true;
|
|
|
+ blur.iterations = 0;
|
|
|
+ });
|
|
|
+ Tween toMax = DOTween.To(() => hurtTweenV1, value => {
|
|
|
+ hurtTweenV1 = value;
|
|
|
+ blur.iterations = Mathf.CeilToInt(hurtTweenV1 * 3f);
|
|
|
+ screenInjuredColor.a = hurtTweenV1;
|
|
|
+ screenInjuredImage.color = screenInjuredColor;
|
|
|
+ }, 1f, 0.6f);
|
|
|
hurtSeq.Append(toMax);
|
|
|
- Tween toMin = DOTween.To(() => iterations, value => {
|
|
|
- iterations = value;
|
|
|
- blur.iterations = Mathf.CeilToInt(iterations);
|
|
|
+ Tween toMin = DOTween.To(() => hurtTweenV1, value => {
|
|
|
+ hurtTweenV1 = value;
|
|
|
+ blur.iterations = Mathf.CeilToInt(hurtTweenV1 * 3f);
|
|
|
+ screenInjuredColor.a = hurtTweenV1;
|
|
|
+ screenInjuredImage.color = screenInjuredColor;
|
|
|
}, 0f, 0.6f);
|
|
|
hurtSeq.Append(toMin);
|
|
|
hurtSeq.AppendCallback(delegate() {
|
|
|
- iterations = 0;
|
|
|
- blur.iterations = 0;
|
|
|
+ hurtTweenV1 = 0;
|
|
|
+ screenInjuredObject.SetActive(false);
|
|
|
blur.enabled = false;
|
|
|
});
|
|
|
hurtSeq.SetUpdate(true);
|