Browse Source

二次进入演练轻伤员报错

连接车辆的水幕水带如果只有单条水带(没有拐弯)不出水
develop
曹衍涛 5 years ago
parent
commit
4cd5797462
  1. 9
      Assets/Scripts/Common/Disasters/Wound_Trapped/WoundedSave.cs
  2. 3
      Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs
  3. 193
      Assets/Scripts/Common/Tools/WaterCurtainHoseSkillCtrl.cs
  4. 1
      Assets/Scripts/DongYouLiQing/LeadGroup/ExitDrillButton.cs

9
Assets/Scripts/Common/Disasters/Wound_Trapped/WoundedSave.cs

@ -66,8 +66,8 @@ public class WoundedSave : MonoBehaviour {
private void OnDisable() private void OnDisable()
{ {
MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveWounded); MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveWounded);
MessageDispatcher.AddListener("GUIDANCE_MAN_COMMAND", GuidanceWounded); MessageDispatcher.RemoveListener("GUIDANCE_MAN_COMMAND", GuidanceWounded);
MessageDispatcher.AddListener("FRISTAID_MAN_COMMAND", FristAidWounded); MessageDispatcher.RemoveListener("FRISTAID_MAN_COMMAND", FristAidWounded);
WoundedInfo.getAllWoundedCount -= addMyWounded; WoundedInfo.getAllWoundedCount -= addMyWounded;
WoundedInfo.getWoundedRescuedCount -= addMyRescue; WoundedInfo.getWoundedRescuedCount -= addMyRescue;
RescuedValue.getAllRescuedWounded -= addMyRescue; RescuedValue.getAllRescuedWounded -= addMyRescue;
@ -79,8 +79,8 @@ public class WoundedSave : MonoBehaviour {
private void OnDestroy() private void OnDestroy()
{ {
MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveWounded); MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveWounded);
MessageDispatcher.AddListener("GUIDANCE_MAN_COMMAND", GuidanceWounded); MessageDispatcher.RemoveListener("GUIDANCE_MAN_COMMAND", GuidanceWounded);
MessageDispatcher.AddListener("FRISTAID_MAN_COMMAND", FristAidWounded); MessageDispatcher.RemoveListener("FRISTAID_MAN_COMMAND", FristAidWounded);
WoundedInfo.getAllWoundedCount -= addMyWounded; WoundedInfo.getAllWoundedCount -= addMyWounded;
WoundedInfo.getWoundedRescuedCount -= addMyRescue; WoundedInfo.getWoundedRescuedCount -= addMyRescue;
RescuedValue.getAllRescuedWounded -= addMyRescue; RescuedValue.getAllRescuedWounded -= addMyRescue;
@ -91,6 +91,7 @@ public class WoundedSave : MonoBehaviour {
{ {
data = (ForcibleEntryCmdArgs)msg.Data; data = (ForcibleEntryCmdArgs)msg.Data;
if (data == null) return; if (data == null) return;
if (!gameObject.GetComponent<BaseGameObjInfo>()) return;
if ((gameObject.GetComponent<BaseGameObjInfo>().gameObjID != data.gameObjID)) return; if ((gameObject.GetComponent<BaseGameObjInfo>().gameObjID != data.gameObjID)) return;
//if (GameSettings.othersSettings.playState == PlayState.Playing) //if (GameSettings.othersSettings.playState == PlayState.Playing)
//{ //{

3
Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs

@ -946,7 +946,8 @@ public class InputManager : MonoBehaviour
{ {
if (SelectedObjs.gameObjs.Contains(hit.transform.gameObject)) if (SelectedObjs.gameObjs.Contains(hit.transform.gameObject))
{ {
if (SelectedObjs.selectedObj!=null&&hit.transform.gameObject!=null&& SelectedObjs.selectedObj != hit.transform.gameObject) if (hit.transform.gameObject!=null&& hit.transform.GetComponent<BaseGameObjInfo>()
&& SelectedObjs.selectedObj != hit.transform.gameObject)
{ {
if (CurrentUserInfo.generalCommanding && if (CurrentUserInfo.generalCommanding &&
GameObject.Find("Main Camera").GetComponent<CameraManager>().viewType == CameraViewState.ThirdPersonView) GameObject.Find("Main Camera").GetComponent<CameraManager>().viewType == CameraViewState.ThirdPersonView)

193
Assets/Scripts/Common/Tools/WaterCurtainHoseSkillCtrl.cs

@ -82,51 +82,58 @@ public class WaterCurtainHoseSkillCtrl : MonoBehaviour
{ {
if ((i + 1) < pathPoints.Count) if ((i + 1) < pathPoints.Count)
{ {
//var distance = Vector3.Distance(pathPoints[i], pathPoints[i + 1]);
//if (accumulationDis < startSprayWaterDistance)
//{
// accumulationDis += distance;
//}
//else
//{
// if (accumulationDis % startSprayWaterDistance == 0)
// {//正好整数段水幕水带子对象加起来为5米长
// sprayWaterPoss.Add(pathPoints[i]);
// var result = (int)(distance / spaceDistance);
// for (int j = 1; j <= result; j++)
// {
// var sprayWaterPos = Vector3.MoveTowards(pathPoints[i], pathPoints[i + 1], spaceDistance * j);
// sprayWaterPoss.Add(sprayWaterPos);
// }
// }
// else
// {//整数段水幕水带子对象加起来已大于5米
// if (!flag)
// {
// var dis = accumulationDis - startSprayWaterDistance;
// var startpos = Vector3.MoveTowards(pathPoints[i - 1], pathPoints[i], startSprayWaterDistance);
// sprayWaterPoss.Add(startpos);
// var res = (int)(dis / spaceDistance);
// for (int j = 1; j <= res; j++)
// {
// var sprayWtPos = Vector3.MoveTowards(startpos, pathPoints[i], spaceDistance * j);
// sprayWaterPoss.Add(sprayWtPos);
// }
// flag = true;
// }
// var result = (int)(distance / spaceDistance);
// for (int j = 1; j <= result; j++)
// {
// var sprayWaterPos = Vector3.MoveTowards(pathPoints[i], pathPoints[i + 1], spaceDistance * j);
// sprayWaterPoss.Add(sprayWaterPos);
// }
// }
//}
var distance = Vector3.Distance(pathPoints[i], pathPoints[i + 1]); var distance = Vector3.Distance(pathPoints[i], pathPoints[i + 1]);
if (accumulationDis < startSprayWaterDistance) var result = (int)(distance / spaceDistance);
{ for (int j = 1; j <= result; j++)
accumulationDis += distance;
}
else
{ {
if (accumulationDis % startSprayWaterDistance == 0) var sprayWaterPos = Vector3.MoveTowards(pathPoints[i], pathPoints[i + 1], spaceDistance * j);
{//正好整数段水幕水带子对象加起来为5米长 sprayWaterPoss.Add(sprayWaterPos);
sprayWaterPoss.Add(pathPoints[i]);
var result = (int)(distance / spaceDistance);
for (int j = 1; j <= result; j++)
{
var sprayWaterPos = Vector3.MoveTowards(pathPoints[i], pathPoints[i + 1], spaceDistance * j);
sprayWaterPoss.Add(sprayWaterPos);
}
}
else
{//整数段水幕水带子对象加起来已大于5米
if (!flag)
{
var dis = accumulationDis - startSprayWaterDistance;
var startpos = Vector3.MoveTowards(pathPoints[i - 1], pathPoints[i], startSprayWaterDistance);
sprayWaterPoss.Add(startpos);
var res = (int)(dis / spaceDistance);
for (int j = 1; j <= res; j++)
{
var sprayWtPos = Vector3.MoveTowards(startpos, pathPoints[i], spaceDistance * j);
sprayWaterPoss.Add(sprayWtPos);
}
flag = true;
}
var result = (int)(distance / spaceDistance);
for (int j = 1; j <= result; j++)
{
var sprayWaterPos = Vector3.MoveTowards(pathPoints[i], pathPoints[i + 1], spaceDistance * j);
sprayWaterPoss.Add(sprayWaterPos);
}
}
} }
} }
@ -165,53 +172,61 @@ public class WaterCurtainHoseSkillCtrl : MonoBehaviour
{ {
if ((i - 1) > 0) if ((i - 1) > 0)
{ {
//var distance = Vector3.Distance(pathPoints[i - 1], pathPoints[i - 2]);
//if (accumulationDis < startSprayWaterDistance)
//{
// accumulationDis += distance;
// sprayWaterPoss.Add(pathPoints[i - 1]);
//}
//else
//{
// if (accumulationDis % startSprayWaterDistance == 0)
// {//正好整数段水幕水带子对象加起来为5米长
// sprayWaterPoss.Add(pathPoints[i - 1]);
// //加入每段根据间隔的分割点
// var result = (int)(distance / spaceDistance);
// for (int j = 1; j <= result; j++)
// {
// var sprayWaterPos = Vector3.MoveTowards(pathPoints[i - 1], pathPoints[i - 2], spaceDistance * j);
// sprayWaterPoss.Add(sprayWaterPos);
// }
// }
// else
// {//整数段水幕水带子对象加起来已大于5米
// if (!flag)
// {
// var dis = accumulationDis - startSprayWaterDistance;
// var startpos = Vector3.MoveTowards(pathPoints[i], pathPoints[i - 1], startSprayWaterDistance);
// sprayWaterPoss.Add(startpos);
// var res = (int)(dis / spaceDistance);
// for (int j = 1; j <= res; j++)
// {
// var sprayWtPos = Vector3.MoveTowards(startpos, pathPoints[i - 1], spaceDistance * j);
// sprayWaterPoss.Add(sprayWtPos);
// }
// flag = true;
// }
// var result = (int)(distance / spaceDistance);
// for (int j = 1; j <= result; j++)
// {
// var sprayWaterPos = Vector3.MoveTowards(pathPoints[i - 1], pathPoints[i - 2], spaceDistance * j);
// sprayWaterPoss.Add(sprayWaterPos);
// }
// }
//}
var distance = Vector3.Distance(pathPoints[i - 1], pathPoints[i - 2]); var distance = Vector3.Distance(pathPoints[i - 1], pathPoints[i - 2]);
if (accumulationDis < startSprayWaterDistance) var result = (int)(distance / spaceDistance);
{ for (int j = 1; j <= result; j++)
accumulationDis += distance;
}
else
{ {
if (accumulationDis % startSprayWaterDistance == 0) var sprayWaterPos = Vector3.MoveTowards(pathPoints[i - 1], pathPoints[i - 2], spaceDistance * j);
{//正好整数段水幕水带子对象加起来为5米长 sprayWaterPoss.Add(sprayWaterPos);
sprayWaterPoss.Add(pathPoints[i - 1]);
//加入每段根据间隔的分割点
var result = (int)(distance / spaceDistance);
for (int j = 1; j <= result; j++)
{
var sprayWaterPos = Vector3.MoveTowards(pathPoints[i - 1], pathPoints[i - 2], spaceDistance * j);
sprayWaterPoss.Add(sprayWaterPos);
}
}
else
{//整数段水幕水带子对象加起来已大于5米
if (!flag)
{
var dis = accumulationDis - startSprayWaterDistance;
var startpos = Vector3.MoveTowards(pathPoints[i], pathPoints[i - 1], startSprayWaterDistance);
sprayWaterPoss.Add(startpos);
var res = (int)(dis / spaceDistance);
for (int j = 1; j <= res; j++)
{
var sprayWtPos = Vector3.MoveTowards(startpos, pathPoints[i - 1], spaceDistance * j);
sprayWaterPoss.Add(sprayWtPos);
}
flag = true;
}
var result = (int)(distance / spaceDistance);
for (int j = 1; j <= result; j++)
{
var sprayWaterPos = Vector3.MoveTowards(pathPoints[i - 1], pathPoints[i - 2], spaceDistance * j);
sprayWaterPoss.Add(sprayWaterPos);
}
}
} }
} }
} }
@ -253,7 +268,7 @@ public class WaterCurtainHoseSkillCtrl : MonoBehaviour
} }
} }
if (!isClonedWaterCurtain) if (!isClonedWaterCurtain)
{//选中的水幕水带不存在水幕粒子特效,实例化水幕 {//选中的水幕水带不存在水幕粒子特效,实例化水幕
CloneGameObjInfo info = selectedWaterCurtainHose.GetComponent<CloneGameObjInfo>(); CloneGameObjInfo info = selectedWaterCurtainHose.GetComponent<CloneGameObjInfo>();
for (int i = 0; i < sprayWaterPoss.Count; i++) for (int i = 0; i < sprayWaterPoss.Count; i++)

1
Assets/Scripts/DongYouLiQing/LeadGroup/ExitDrillButton.cs

@ -45,6 +45,7 @@ public class ExitDrillButton : BaseButton
user.IsReady = false; user.IsReady = false;
//重置房间 //重置房间
CurrentUserInfo.room = null; CurrentUserInfo.room = null;
EntitiesManager.Instance.Reset();
NetworkManager.Default.SendAsync("ROOM_LEAVE_SYNC", data); NetworkManager.Default.SendAsync("ROOM_LEAVE_SYNC", data);
SceneManager.LoadScene(GoTo.RolesSelection.ToString()); SceneManager.LoadScene(GoTo.RolesSelection.ToString());
} }

Loading…
Cancel
Save