Browse Source

1、灭火机器人、暴风雪炮没有同步耗水流量,导致统计出现负数

2、灭火机器人连接管线时没有同步水源信息
3、退出演练时没有清空CloneObjNameTool里的数据,导致下一次同一单位克隆的车辆名称出现累加
develop
曹衍涛 4 years ago
parent
commit
08f48951f8
  1. 3
      Assets/ExitBack.cs
  2. 13
      Assets/Resources/ClonePrefabs/Tool/FirefightingRobot.prefab
  3. 49476
      Assets/Resources/ClonePrefabs/Tool/SnowCannon.prefab
  4. 4
      Assets/Scripts/Common/Clone/CloneObjNameTool.cs
  5. 6
      Assets/Scripts/Common/User/CurrentUserInfo.cs
  6. 26
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/ASSOCIATED_LINE_SYNC.cs

3
Assets/ExitBack.cs

@ -30,7 +30,8 @@ public class ExitBack : MonoBehaviour
GET_INSIDER_ANSWER_SYNC.feedback.Clear();
ArrivedPowerTotal.arrivedCars.Clear();
OnwayForceTotal.ResertOnway();
CurrentUserInfo.generalCommanding = false;
CurrentUserInfo.ResertExit();
CloneObjNameTool.Instance().ResertCloneObjNameTool();
}
// Update is called once per frame

13
Assets/Resources/ClonePrefabs/Tool/FirefightingRobot.prefab

@ -9123,6 +9123,7 @@ GameObject:
- component: {fileID: 114365251465385902}
- component: {fileID: 114393244420263936}
- component: {fileID: 1486151116281907782}
- component: {fileID: 7311562515518545331}
m_Layer: 0
m_Name: FirefightingRobot
m_TagString: Untagged
@ -9434,6 +9435,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0a2ae739074b1f74a839051cde37ee81, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &7311562515518545331
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1101292219423796}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8f43dda07f7d78848914e03dc8aae720, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1137826126722962
GameObject:
m_ObjectHideFlags: 0

49476
Assets/Resources/ClonePrefabs/Tool/SnowCannon.prefab

File diff suppressed because it is too large Load Diff

4
Assets/Scripts/Common/Clone/CloneObjNameTool.cs

@ -78,4 +78,8 @@ public class CloneObjNameTool
name = deptName + "-" + cloneObjTypeName + "-" + number;
return name;
}
public void ResertCloneObjNameTool()
{
cloneObjectNumber.Clear();
}
}

6
Assets/Scripts/Common/User/CurrentUserInfo.cs

@ -27,4 +27,10 @@ public static class CurrentUserInfo
room = null;
generalCommanding = false;
}
public static void ResertExit()
{
role = Role.None;
room = null;
generalCommanding = false;
}
}

26
Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/ASSOCIATED_LINE_SYNC.cs

@ -32,8 +32,8 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
private GameObject parent;
//private long gameObjId;
//private GameObject startHitGameobj;
// private GameObject endHitGameobj;
// private Vector3 beginLinePoint;
// private GameObject endHitGameobj;
// private Vector3 beginLinePoint;
private Vector3 startPoint;
private Vector3 endPoint;
public float Height = 0.2f;
@ -52,12 +52,12 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
InputHistory.Instance.RegisterInputHistory(message);
var info = message.Body.Deserialize<AssociatedLineSyncDate>();
var sender = info.SendUserID;
// gameObjId = info.baseGameobjInfo.gameObjID;
// gameObjId = info.baseGameobjInfo.gameObjID;
if (InputManager.Instance)
{
if (CurrentUserInfo.mySelf.Id != sender)
{
if (info.startHitGameObjId!=0&&info.endHitGameObjId!=0)
if (info.startHitGameObjId != 0 && info.endHitGameObjId != 0)
{
Associatedline(info);
}
@ -67,7 +67,7 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
//{
// NetworkSyncHelper.AddSyncData(info);
//}
}
//private void Resert()
@ -84,8 +84,8 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
if (EntitiesManager.Instance.GetEntityByID(data.gameObjID) == null)
{
parentgameobj = EntitiesManager.Instance.CreateObj(parent, transform.position,transform, data.gameObjID);
parentgameobj = EntitiesManager.Instance.CreateObj(parent, transform.position, transform, data.gameObjID);
startPoint = data.LineBeginPoint;
}
else//第三个点及以上,找到前两个点创建的对象,将末位点赋给起点
@ -93,7 +93,7 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
parentgameobj = EntitiesManager.Instance.GetEntityByID(data.gameObjID);
startPoint = parentgameobj.GetComponent<ParentLinesMessage>().EndPoint;
}
endPoint = data.hitpoint;
float distance = Vector3.Distance(startPoint, endPoint);//计算两点的距离
Vector3 clonedObjPos = (startPoint + endPoint) / 2;
@ -104,7 +104,7 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
line.name = "line";
line.transform.position = clonedObjPos;
if((endPoint - startPoint)!=Vector3.zero)
if ((endPoint - startPoint) != Vector3.zero)
{
line.transform.forward = (-(endPoint - startPoint)).normalized;//改变线条的朝向
}
@ -136,10 +136,12 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
//startPoint = endPoint;
}
//同步管线连接到物体上的处理
void ConnectObj(GameObject startobj,GameObject endobj,GameObject hose)
void ConnectObj(GameObject startobj, GameObject endobj, GameObject hose)
{
if (startobj.GetComponent<FireManControl>()||startobj.GetComponent<TruckMessage>()||startobj.GetComponent<WaterConnonController>()
|| endobj.GetComponent<FireManControl>() || endobj.GetComponent<TruckMessage>() || endobj.GetComponent<WaterConnonController>())
if (startobj.GetComponent<FireManControl>() || startobj.GetComponent<TruckMessage>() || startobj.GetComponent<WaterConnonController>()
|| startobj.GetComponent<FireRobotController>()
|| endobj.GetComponent<FireManControl>() || endobj.GetComponent<TruckMessage>() || endobj.GetComponent<WaterConnonController>()
|| endobj.GetComponent<FireRobotController>())
{
HoseConnectOrDelectData data = new HoseConnectOrDelectData();
data.StartId = startobj.GetComponent<BaseGameObjInfo>().gameObjID;

Loading…
Cancel
Save