Browse Source

从主场景退出重置实体管理器、imputmanage、角色报告信息、到场力量信息、gamesetting等,重置逻辑放在角色选择界面。

添加了一些非空判断
灭火机器人预案视角不隐藏修改
develop
曹衍涛 5 years ago
parent
commit
05da655267
  1. 31
      Assets/ExitBack.cs
  2. 11
      Assets/ExitBack.cs.meta
  3. 120
      Assets/Prefabs/DongYouLiQing/LeadGroup/DaoDiaoZuPanel.prefab
  4. 52141
      Assets/Resources/ClonePrefabs/Tool/FirefightingRobot.prefab
  5. 13
      Assets/Scenes/RolesSelection.unity
  6. 4
      Assets/Scripts/Common/ChatSystem/FireSiteInfo/ArrivedPower/ArrivedPowerTotal.cs
  7. 45
      Assets/Scripts/Common/DisasterLibrary/DisasterLoad.cs
  8. 4
      Assets/Scripts/Common/Disasters/FireSpread/CloneFireSpreadLine.cs
  9. 2
      Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs
  10. 4
      Assets/Scripts/Common/EquipSystem/MyFrame/UIManager.cs
  11. 22
      Assets/Scripts/Common/GameSettings/GameSettings.cs
  12. 9
      Assets/Scripts/Common/HelpClasses/SelectedObjs.cs
  13. 9
      Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs
  14. 70
      Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs
  15. 14
      Assets/Scripts/DongYouLiQing/LeadGroup/ExitDrillButton.cs

31
Assets/ExitBack.cs

@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ExitBack : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
EntitiesManager.Instance.Reset();//跳转场景时要清空实体管理器中的对象
//UIManager.ResertUIManager();
//重置选择
SelectedObjs.ResertSelectObjs();
//重置装备信息
EquipManager.Instance.ResetEquipmanage();
//重置游戏设置
GameSettings.othersSettings.ResertGameSettig();
//重置报告
ReportDataMgr.ResertReportDataMgr();
//重置inputmanage 变量
InputManager.ResertInputmanage();
//重置到场力量
ArrivedPowerTotal.ResertArrivePowerTotal();
}
// Update is called once per frame
void Update()
{
}
}

11
Assets/ExitBack.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5ca9d3bcfd4f7e14bbb7b5f9abdd6b70
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

120
Assets/Prefabs/DongYouLiQing/LeadGroup/DaoDiaoZuPanel.prefab

@ -35486,6 +35486,51 @@ PrefabInstance:
propertyPath: m_Name
value: EventPanel
objectReference: {fileID: 0}
- target: {fileID: 1190701206240025528, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1412294330693008962, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412294330693008962, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412294330693008962, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412294330693008962, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412239708105463804, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412239708105463804, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412239708105463804, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412239708105463804, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412215539909383466, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_LocalPosition.x
@ -35591,66 +35636,36 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1412294330693008962, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412294330693008962, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412294330693008962, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412294330693008962, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412239708105463804, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 1412144213798520636, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412239708105463804, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 1412144213798520636, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412239708105463804, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 1412144213798520636, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412239708105463804, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 1412144213798520636, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412144213798520636, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 1412937265724521580, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMin.y
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412144213798520636, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 1412937265724521580, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412144213798520636, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412144213798520636, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412909420712092522, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMin.y
@ -35681,61 +35696,46 @@ PrefabInstance:
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1190701206240025528, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4476990272079378739, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 4799859324216749415, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4476990272079378739, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 4799859324216749415, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4476990272079378739, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 4799859324216749415, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4476990272079378739, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 4799859324216749415, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4799859324216749415, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 4476990272079378739, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4799859324216749415, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 4476990272079378739, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4799859324216749415, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 4476990272079378739, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4799859324216749415, guid: 0e9d4c9b5978e1742b91454c7740fa46,
- target: {fileID: 4476990272079378739, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412937265724521580, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1412937265724521580, guid: 0e9d4c9b5978e1742b91454c7740fa46,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0e9d4c9b5978e1742b91454c7740fa46, type: 3}
--- !u!224 &224740812104956952 stripped

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

File diff suppressed because it is too large Load Diff

13
Assets/Scenes/RolesSelection.unity

@ -2535,6 +2535,7 @@ GameObject:
- component: {fileID: 821798772}
- component: {fileID: 821798771}
- component: {fileID: 821798775}
- component: {fileID: 821798776}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
@ -2638,6 +2639,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0b9a95b8269a9f843bef91956d585158, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &821798776
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 821798770}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5ca9d3bcfd4f7e14bbb7b5f9abdd6b70, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &831812122
GameObject:
m_ObjectHideFlags: 0

4
Assets/Scripts/Common/ChatSystem/FireSiteInfo/ArrivedPower/ArrivedPowerTotal.cs

@ -23,6 +23,10 @@ public class ArrivedPowerTotal : MonoBehaviour
content = transform.parent.Find("Scroll View/Viewport/Content").gameObject;
}
}
public static void ResertArrivePowerTotal()
{
arrivedCars.Clear();
}
void OnEnable()
{
trucksCount = 0;

45
Assets/Scripts/Common/DisasterLibrary/DisasterLoad.cs

@ -71,27 +71,30 @@ public class DisasterLoad : MonoBehaviour
/// </summary>
public void LoadDisaster()
{
//设置风向风力
WindZoneSet();
//设置油罐
OilTanksSet();
//设置油罐设置UI,风向风力UI,胜利条件UI,报警信息UI,普通火属性设置UI及他们的是否可以修改
MessageDispatcher.SendMessage("LOAD_UIDISASTER");
//生成普通火
CloneNormalFire();
//生成全液面火
CloneLiquidLevelFire();
//生成泄露1
CloneLeak1();
//生成泄露2
CloneLeak2();
//生成伤员
CloneWounded();
//生成被困人员
CloneTrapped();
//生成知情人
CloneInsider();
CloneDangerous();
if (disaster!=null)
{
//设置风向风力
WindZoneSet();
//设置油罐
OilTanksSet();
//设置油罐设置UI,风向风力UI,胜利条件UI,报警信息UI,普通火属性设置UI及他们的是否可以修改
MessageDispatcher.SendMessage("LOAD_UIDISASTER");
//生成普通火
CloneNormalFire();
//生成全液面火
CloneLiquidLevelFire();
//生成泄露1
CloneLeak1();
//生成泄露2
CloneLeak2();
//生成伤员
CloneWounded();
//生成被困人员
CloneTrapped();
//生成知情人
CloneInsider();
CloneDangerous();
}
}
/// <summary>

4
Assets/Scripts/Common/Disasters/FireSpread/CloneFireSpreadLine.cs

@ -58,8 +58,8 @@ public class CloneFireSpreadLine : CloneBase
MessageDispatcher.RemoveListener("AROUND_SPREAD_SELECTED", AroundSpreadSelected);
MessageDispatcher.RemoveListener("AOTO_SPREAD_SELECTED", AotoSpreadSelected);
MessageDispatcher.AddListener("HIDE_ALL_SPREADPATH", HideAllSpreadLine);
MessageDispatcher.AddListener("SHOW_SELECTEDFIRE_SPREADPATH", ShowSelectedFireSpreadLine);
MessageDispatcher.RemoveListener("HIDE_ALL_SPREADPATH", HideAllSpreadLine);
MessageDispatcher.RemoveListener("SHOW_SELECTEDFIRE_SPREADPATH", ShowSelectedFireSpreadLine);
}
private void RoadSpreadSelected(IMessage obj)

2
Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs

@ -757,7 +757,7 @@ public class TrappedMoveFree : MonoBehaviour
{
if (timer == 1)
{
if (CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
if (CurrentUserInfo.room!=null&&CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
Vector3 dia = transform.position - DangerousLastmet;
targetPosition = dia;

4
Assets/Scripts/Common/EquipSystem/MyFrame/UIManager.cs

@ -251,14 +251,16 @@ public static class UIManager
Views.Remove(viewName);
}
}
public static void resert()
public static void ResertUIManager()
{
if (templates.Count>0)
{
templates.Clear();
}
if (Views.Count>0)
{
Views.Clear();
}
if (UIPath.Count>0)

22
Assets/Scripts/Common/GameSettings/GameSettings.cs

@ -92,6 +92,28 @@ public class OthersSettings
}
Debug.Log("没有找到要删除的车型");
}
public void ResertGameSettig()
{
//mode = Mode.None;
//startRecord = false;//先默认初始化为true,没做新建节点时好测试记录回放
isStartDrill = false;//是否开始演练
//车辆信息:Value表示某类型车的车辆数量
CarList = new List<KeyValuePair<FireCarEngine, int>>();
/// <summary>
/// 播放状态
/// </summary>
playState = PlayState.None;
//要加载的灾情库数据
disaster = null;
//总指挥移交需要
orgs = new List<Organization>();
}
}
public enum Mode

9
Assets/Scripts/Common/HelpClasses/SelectedObjs.cs

@ -12,4 +12,13 @@ public class SelectedObjs
public static List<GameObject> rolePlays = new List<GameObject>();//总,支,大,参谋等代表各自的角色对象的可选数组
public static GameObject selectedRolePlay = null;//记录总,支,大,参谋等代表各自的选中角色(默认选中)
public static void ResertSelectObjs()
{
gameObjs.Clear();
selectedObj = null;
characters.Clear();
selectedCharacters.Clear();
rolePlays.Clear();
selectedRolePlay = null;
}
}

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

@ -96,7 +96,9 @@ public class InputManager : MonoBehaviour
}
public static void ResertInputmanage()
{
skill=false;
sceneType = SceneType.None;
frameCount = 0;
skill =false;
AutoArm=false;
cloneObjType = CloneObjType.None;
selectedFireDeployObjId = -1;
@ -105,6 +107,7 @@ public class InputManager : MonoBehaviour
fireDeployPrivateToolType = FireDeployPrivateToolType.None;
fireCarEngine = null;
org = null;
//instance = null;
}
void Start()
@ -943,7 +946,7 @@ public class InputManager : MonoBehaviour
{
if (SelectedObjs.gameObjs.Contains(hit.transform.gameObject))
{
if (SelectedObjs.selectedObj != hit.transform.gameObject)
if (SelectedObjs.selectedObj!=null&&hit.transform.gameObject!=null&& SelectedObjs.selectedObj != hit.transform.gameObject)
{
if (CurrentUserInfo.generalCommanding &&
GameObject.Find("Main Camera").GetComponent<CameraManager>().viewType == CameraViewState.ThirdPersonView)
@ -961,7 +964,7 @@ public class InputManager : MonoBehaviour
}
}
if (SelectedObjs.characters.Contains(hit.transform.gameObject))
if (hit.transform.gameObject!=null&&SelectedObjs.characters.Contains(hit.transform.gameObject))
{
if (!SelectedObjs.selectedCharacters.Contains(hit.transform.gameObject))
{

70
Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs

@ -86,6 +86,76 @@ public class ReportDataMgr
// 提升投票
public static Dictionary<string, float> LevelUpScore = new Dictionary<string, float>();
public static List<ChatTaskMessage> AllChatMessage = new List<ChatTaskMessage>();
public static void ResertReportDataMgr()
{
allTrucks.Clear();
allTrappedPerson.Clear();
allWoundedPerson.Clear();
allSendCommand.Clear();
allReceiverCommand.Clear();
allSubId.Clear();
totalTruckCount = 0.0f;
waterTankerCount = 0.0f;
foamTruckCount = 0.0f;
aerialTowerTruckCount = 0.0f;
highSprayingTruckCount = 0.0f;
ladderTruckCount = 0.0f;
smokeExhaustTruckCount = 0.0f;
rescueVehicleCount = 0.0f;
apparatusCount = 0.0f;
lightingApplianceCount = 0.0f;
repairCarCount = 0.0f;
forcibleEntryTruckCount = 0.0f;
totalFireman = 0;
totalUseWater = 0.0f;
totalSaveTrappedCount = 0.0f;
totalSaveWoundedCount = 0;
totalSendCommand = 0;
totalReceiverCommand = 0;
IsVictory = false;
QuestionnaireNumber = 0;
SubmitQuestionnaireNumber = 0;
AllQuestionnaire.Clear();
FireScore = new Dictionary<string, float>();
SaveScore = new Dictionary<string, float>();
LookAtScore = new Dictionary<string, float>();
CoolScore = new Dictionary<string, float>();
WaterScore = new Dictionary<string, float>();
ActInScore = new Dictionary<string, float>();
ZhongDuiScore = new Dictionary<string, float>();
ZhiHuiScore = new Dictionary<string, float>();
StrengthScore = new Dictionary<string, float>();
WeaknessesScore = new Dictionary<string, float>();
NeedCarScore = new Dictionary<string, float>();
NeedFireEquipScore = new Dictionary<string, float>();
NeedSaveEquipScore = new Dictionary<string, float>();
VictoryScore = new Dictionary<string, float>();
DefeatScore = new Dictionary<string, float>();
LevelUpScore = new Dictionary<string, float>();
AllChatMessage = new List<ChatTaskMessage>();
}
public static void SetSendCommand(ChatTaskMessage chatTaskMessage)
{
//SEND_COMMAND_SYNC

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

@ -45,20 +45,6 @@ public class ExitDrillButton : BaseButton
user.IsReady = false;
//重置房间
CurrentUserInfo.room = null;
//重置选择
if (SelectedObjs.selectedObj!=null)
{
SelectedObjs.selectedObj = null;
}
if (SelectedObjs.selectedCharacters.Count>0)
{
SelectedObjs.selectedCharacters.Clear();
}
//重置装备信息
EquipManager.Instance.ResetEquipmanage();
//重置inputmanage 变量
InputManager.ResertInputmanage();
NetworkManager.Default.SendAsync("ROOM_LEAVE_SYNC", data);
SceneManager.LoadScene(GoTo.RolesSelection.ToString());
}

Loading…
Cancel
Save