|
|
|
@ -20,7 +20,7 @@ public class SpreadFireController : MonoBehaviour
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 火堆字典,每个火堆对应几个火,key为火堆(主火id),list为这堆火由哪几个火组成 |
|
|
|
|
/// </summary> |
|
|
|
|
public static Dictionary<long, List<FireFightNormal>> fireStruckContainDic = new Dictionary<long, List<FireFightNormal>>(); |
|
|
|
|
public static Dictionary<long, List<FireFightNormal>> fireStruckContainDic = new Dictionary<long, List<FireFightNormal>>(); |
|
|
|
|
// Use this for initialization |
|
|
|
|
void Start() |
|
|
|
|
{ |
|
|
|
@ -45,17 +45,17 @@ public class SpreadFireController : MonoBehaviour
|
|
|
|
|
{ |
|
|
|
|
if (GameSettings.othersSettings.isStartDrill) |
|
|
|
|
{ |
|
|
|
|
if (flag==false) |
|
|
|
|
if (flag == false) |
|
|
|
|
{ |
|
|
|
|
GetFireStruckList(); |
|
|
|
|
GetfireStruckContainDic(); |
|
|
|
|
flag = true; |
|
|
|
|
} |
|
|
|
|
if (CurrentUserInfo.mySelf==null||CurrentUserInfo.room==null) |
|
|
|
|
if (CurrentUserInfo.mySelf == null || CurrentUserInfo.room == null) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (CurrentUserInfo.mySelf.Id==CurrentUserInfo.room.Owner.UserInfo.Id) |
|
|
|
|
if (CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id) |
|
|
|
|
{ |
|
|
|
|
if (p_FireNormal.childCount > 0) |
|
|
|
|
{ |
|
|
|
@ -138,7 +138,7 @@ public class SpreadFireController : MonoBehaviour
|
|
|
|
|
{ |
|
|
|
|
for (int i = 0; i < fireNormalStruckList.Count; i++) |
|
|
|
|
{ |
|
|
|
|
if (fireStruckContainDic[fireNormalStruckList[i]].Count<1) |
|
|
|
|
if (fireStruckContainDic[fireNormalStruckList[i]].Count < 1) |
|
|
|
|
{ |
|
|
|
|
fireStruckContainDic.Remove(fireNormalStruckList[i]); |
|
|
|
|
fireNormalStruckList.Remove(fireNormalStruckList[i]); |
|
|
|
@ -162,21 +162,21 @@ public class SpreadFireController : MonoBehaviour
|
|
|
|
|
{ |
|
|
|
|
//该火堆中每个火的baseinfo |
|
|
|
|
BaseGameObjInfo info = nowstruck[j].GetComponent<BaseGameObjInfo>(); |
|
|
|
|
if (info.gameObjType==CloneObjType.fireNormal) |
|
|
|
|
if (info.gameObjType == CloneObjType.fireNormal) |
|
|
|
|
{ |
|
|
|
|
fireArea += info.GetComponent<FireSpreadCtrl>().fireAttribute.initialSize; |
|
|
|
|
} |
|
|
|
|
if(info.gameObjType == CloneObjType.SpreadedFire) |
|
|
|
|
if (info.gameObjType == CloneObjType.SpreadedFire) |
|
|
|
|
{ |
|
|
|
|
fireArea += 10; |
|
|
|
|
} |
|
|
|
|
if (info.GetComponent<FireFightNormal>().Straightwater.Count>0) |
|
|
|
|
if (info.GetComponent<FireFightNormal>().Straightwater.Count > 0) |
|
|
|
|
{ |
|
|
|
|
//作用在某个火的面积 |
|
|
|
|
for (int k = 0; k < info.GetComponent<FireFightNormal>().Straightwater.Count; k++) |
|
|
|
|
{ |
|
|
|
|
WaterFightFire water = info.GetComponent<FireFightNormal>().Straightwater[k]; |
|
|
|
|
if (water.GetComponentInParent<BaseGameObjInfo>().gameObjType == CloneObjType.fireman|| |
|
|
|
|
if (water.GetComponentInParent<BaseGameObjInfo>().gameObjType == CloneObjType.fireman || |
|
|
|
|
water.GetComponentInParent<BaseGameObjInfo>().gameObjType == CloneObjType.FirefightingRobot) |
|
|
|
|
{ |
|
|
|
|
waterControlArea += 50; |
|
|
|
@ -190,7 +190,8 @@ public class SpreadFireController : MonoBehaviour
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//如果可以控制住 |
|
|
|
|
if (waterControlArea >= fireArea) |
|
|
|
|
|
|
|
|
|
if (waterControlArea > fireArea) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
mainfire.GetComponent<FireSpreadCtrl>().BeController = true; |
|
|
|
@ -199,6 +200,7 @@ public class SpreadFireController : MonoBehaviour
|
|
|
|
|
{ |
|
|
|
|
mainfire.GetComponent<FireSpreadCtrl>().BeController = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|