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. 175
      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()
{
MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveWounded);
MessageDispatcher.AddListener("GUIDANCE_MAN_COMMAND", GuidanceWounded);
MessageDispatcher.AddListener("FRISTAID_MAN_COMMAND", FristAidWounded);
MessageDispatcher.RemoveListener("GUIDANCE_MAN_COMMAND", GuidanceWounded);
MessageDispatcher.RemoveListener("FRISTAID_MAN_COMMAND", FristAidWounded);
WoundedInfo.getAllWoundedCount -= addMyWounded;
WoundedInfo.getWoundedRescuedCount -= addMyRescue;
RescuedValue.getAllRescuedWounded -= addMyRescue;
@ -79,8 +79,8 @@ public class WoundedSave : MonoBehaviour {
private void OnDestroy()
{
MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveWounded);
MessageDispatcher.AddListener("GUIDANCE_MAN_COMMAND", GuidanceWounded);
MessageDispatcher.AddListener("FRISTAID_MAN_COMMAND", FristAidWounded);
MessageDispatcher.RemoveListener("GUIDANCE_MAN_COMMAND", GuidanceWounded);
MessageDispatcher.RemoveListener("FRISTAID_MAN_COMMAND", FristAidWounded);
WoundedInfo.getAllWoundedCount -= addMyWounded;
WoundedInfo.getWoundedRescuedCount -= addMyRescue;
RescuedValue.getAllRescuedWounded -= addMyRescue;
@ -91,6 +91,7 @@ public class WoundedSave : MonoBehaviour {
{
data = (ForcibleEntryCmdArgs)msg.Data;
if (data == null) return;
if (!gameObject.GetComponent<BaseGameObjInfo>()) return;
if ((gameObject.GetComponent<BaseGameObjInfo>().gameObjID != data.gameObjID)) return;
//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.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 &&
GameObject.Find("Main Camera").GetComponent<CameraManager>().viewType == CameraViewState.ThirdPersonView)

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

@ -82,52 +82,59 @@ public class WaterCurtainHoseSkillCtrl : MonoBehaviour
{
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]);
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);
}
}
}
}
}
@ -165,19 +172,56 @@ public class WaterCurtainHoseSkillCtrl : MonoBehaviour
{
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]);
if (accumulationDis < startSprayWaterDistance)
{
accumulationDis += distance;
}
else
{
if (accumulationDis % startSprayWaterDistance == 0)
{//正好整数段水幕水带子对象加起来为5米长
sprayWaterPoss.Add(pathPoints[i - 1]);
//加入每段根据间隔的分割点
var result = (int)(distance / spaceDistance);
for (int j = 1; j <= result; j++)
{
@ -185,35 +229,6 @@ public class WaterCurtainHoseSkillCtrl : MonoBehaviour
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);
}
}
}
}
}
}
else

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

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

Loading…
Cancel
Save