Browse Source

1.切层隐藏UI名称及相关修改

2.工具区车辆无法使用修改
3.调整一下安全区大小使其方便设置
4.力量部署显示工具车辆修改
master
杨栋梁 3 years ago
parent
commit
710c5b82fc
  1. 23756
      Assets/01MeiRenYu/SceneAll.prefab
  2. 93
      Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs
  3. 18
      Assets/Resources/ClonePrefabs/Tool/LifeGuaranteeCar.prefab
  4. 18
      Assets/Resources/ClonePrefabs/Tool/RescueCarrierCar.prefab
  5. 200
      Assets/Resources/ClonePrefabs/Tool/SafeArea.prefab
  6. 131
      Assets/Resources/ClonePrefabs/Tool/StagingArea.prefab
  7. 16
      Assets/Resources/ClonePrefabs/Tool/Trailer.prefab
  8. 48285
      Assets/Scenes/DongYouLiQing.unity
  9. 9
      Assets/Scripts/Common/Cars/AgentController.cs
  10. 59
      Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs
  11. 159
      Assets/Scripts/SmartX1/SmartController.cs

23756
Assets/01MeiRenYu/SceneAll.prefab

File diff suppressed because it is too large Load Diff

93
Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs

@ -87,7 +87,12 @@ public class UIFloor : BaseToggle
{
foreach (var item in floorsPanelManager.AllNei)
{
item.gameObject.SetActive(true);
Renderer[] renderers = item.GetComponentsInChildren<Renderer>();
for (int i = 0; i < renderers.Length; i++)
{
renderers[i].enabled = true;
}
//item.gameObject.SetActive(true);
}
foreach (var item in floorsPanelManager.AllWai)
{
@ -112,11 +117,21 @@ public class UIFloor : BaseToggle
{
if (item.buildNum == data.buildNum && item.floorNum > data.floorNum && Mathf.Abs(item.floorNum) > 0)
{
item.gameObject.SetActive(false);
Renderer[] renderers = item.GetComponentsInChildren<Renderer>();
for (int i = 0; i < renderers.Length; i++)
{
renderers[i].enabled = false;
}
// item.gameObject.SetActive(false);
}
if (item.buildNum == data.buildNum && item.floorNum == data.floorNum && item.interlayerNum > data.interlayerNum && Mathf.Abs(item.floorNum) > 0)
{
item.gameObject.SetActive(false);
Renderer[] renderers = item.GetComponentsInChildren<Renderer>();
for (int i = 0; i < renderers.Length; i++)
{
renderers[i].enabled = false;
}
//item.gameObject.SetActive(false);
}
}
@ -134,26 +149,27 @@ public class UIFloor : BaseToggle
private void ShowCloneObj()
{
CloneGameObjInfo[] objs = P_AllParent.GetComponentsInChildren<CloneGameObjInfo>(true);
UINameItem[] names = GameObject.Find("Canvas").transform.Find("TheHeadName").GetComponentsInChildren<UINameItem>(true);
for (int i = 0; i < objs.Length; i++)
{
//objs[i].gameObject.SetActive(true);
MeshRenderer[] renders = objs[i].GetComponentsInChildren<MeshRenderer>();
Renderer[] renders = objs[i].GetComponentsInChildren<Renderer>();
//objs[i].gameObject.SetActive(false);
for (int j = 0; j < renders.Length; j++)
{
renders[j].enabled = true;
}
ParticleSystem[] parts = objs[i].GetComponentsInChildren<ParticleSystem>();
for (int j = 0; j < parts.Length; j++)
{
parts[j].Play();
}
SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren<SkinnedMeshRenderer>();
for (int j = 0; j < skmeshs.Length; j++)
{
skmeshs[j].enabled=true;
}
//ParticleSystem[] parts = objs[i].GetComponentsInChildren<ParticleSystem>();
//for (int j = 0; j < parts.Length; j++)
//{
// parts[j].Play();
//}
//SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren<SkinnedMeshRenderer>();
//for (int j = 0; j < skmeshs.Length; j++)
//{
// skmeshs[j].enabled=true;
//}
if (objs[i].GetComponent<CreatHaemalUI>()) //如果是被困人员/伤员,绑定了UI
{
Transform ui = objs[i].GetComponent<CreatHaemalUI>().haemal.transform;
@ -169,11 +185,23 @@ public class UIFloor : BaseToggle
texts[j].enabled = true;
}
}
if (objs[i].GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.fireman ||
objs[i].GetComponent<TruckMessage>())
{
for (int j = 0; j < names.Length; j++)
{
if (names[j].Target == objs[i].gameObject)
{
names[j].gameObject.SetActive(true);
}
}
}
}
}
private void HideCloneObj(FloorData data)
{
CloneGameObjInfo[] objs = P_AllParent.GetComponentsInChildren<CloneGameObjInfo>();
UINameItem[] names = GameObject.Find("Canvas").transform.Find("TheHeadName").GetComponentsInChildren<UINameItem>(true);
for (int i = 0; i < objs.Length; i++)
{
if (objs[i].gameObject == SelectedObjs.selectedObj || SelectedObjs.selectedCharacters.Contains( objs[i].gameObject))
@ -200,23 +228,24 @@ public class UIFloor : BaseToggle
if (objs[i].floorNum > data.floorNum ||
(objs[i].floorNum == data.floorNum && objs[i].interlayerNum > data.interlayerNum))
{
MeshRenderer[] renders = objs[i].GetComponentsInChildren<MeshRenderer>();
Renderer[] renders = objs[i].GetComponentsInChildren<Renderer>();
//objs[i].gameObject.SetActive(false);
for (int j = 0; j < renders.Length; j++)
{
renders[j].enabled = false;
}
ParticleSystem[] parts = objs[i].GetComponentsInChildren<ParticleSystem>();
//objs[i].gameObject.SetActive(false);
for (int j = 0; j < parts.Length; j++)
{
parts[j].Stop();
}
SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren<SkinnedMeshRenderer>();
for (int j = 0; j < skmeshs.Length; j++)
{
skmeshs[j].enabled = false;
}
//ParticleSystem[] parts = objs[i].GetComponentsInChildren<ParticleSystem>();
////objs[i].gameObject.SetActive(false);
//for (int j = 0; j < parts.Length; j++)
//{
// // parts[j].Stop();
// parts[j].GetComponent<Renderer>().enabled = false;
//}
//SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren<SkinnedMeshRenderer>();
//for (int j = 0; j < skmeshs.Length; j++)
//{
// skmeshs[j].enabled = false;
//}
if (objs[i].GetComponent<CreatHaemalUI>()) //如果是被困人员/伤员,绑定了UI
{
Transform ui = objs[i].GetComponent<CreatHaemalUI>().haemal.transform;
@ -231,10 +260,22 @@ public class UIFloor : BaseToggle
texts[j].enabled = false;
}
}
if (objs[i].GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.fireman ||
objs[i].GetComponent<TruckMessage>())
{
for (int j = 0; j < names.Length; j++)
{
if (names[j].Target == objs[i].gameObject)
{
names[j].gameObject.SetActive(false);
}
}
}
}
}
}
}
}
//private void AddRecordUIFloor(FloorData data)

18
Assets/Resources/ClonePrefabs/Tool/LifeGuaranteeCar.prefab

@ -9,7 +9,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 5647142648243169554}
m_Layer: 0
m_Layer: 10
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -47,7 +47,7 @@ GameObject:
- component: {fileID: 3295976415008873728}
- component: {fileID: 3295976415008070944}
- component: {fileID: 3295976415006973920}
m_Layer: 0
m_Layer: 10
m_Name: BR
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -124,7 +124,7 @@ GameObject:
- component: {fileID: 3295976415008873730}
- component: {fileID: 3295976415008070946}
- component: {fileID: 3295976415006973922}
m_Layer: 0
m_Layer: 10
m_Name: FL
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -201,7 +201,7 @@ GameObject:
- component: {fileID: 3295976415008873732}
- component: {fileID: 3295976415008070948}
- component: {fileID: 3295976415006973924}
m_Layer: 0
m_Layer: 10
m_Name: BL
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -278,7 +278,7 @@ GameObject:
- component: {fileID: 3295976415008873734}
- component: {fileID: 3295976415008070950}
- component: {fileID: 3295976415006973926}
m_Layer: 0
m_Layer: 10
m_Name: Body001
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -356,7 +356,7 @@ GameObject:
- component: {fileID: 3295976415008873740}
- component: {fileID: 3295976415008070956}
- component: {fileID: 3295976415006973932}
m_Layer: 0
m_Layer: 10
m_Name: FR001
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -433,7 +433,7 @@ GameObject:
- component: {fileID: 3295976415008873742}
- component: {fileID: 3295976415008070958}
- component: {fileID: 3295976415006973934}
m_Layer: 0
m_Layer: 10
m_Name: Glass
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -510,7 +510,7 @@ GameObject:
- component: {fileID: 6261750766740231484}
- component: {fileID: 6261750766730623686}
- component: {fileID: 4681101533329235057}
m_Layer: 0
m_Layer: 10
m_Name: Car
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -583,7 +583,7 @@ GameObject:
- component: {fileID: 3812798776336947794}
- component: {fileID: 4825697099778776312}
- component: {fileID: 3144476879247977251}
m_Layer: 0
m_Layer: 10
m_Name: LifeGuaranteeCar
m_TagString: Untagged
m_Icon: {fileID: 0}

18
Assets/Resources/ClonePrefabs/Tool/RescueCarrierCar.prefab

@ -19,7 +19,7 @@ GameObject:
- component: {fileID: 2517350997227339491}
- component: {fileID: 9163130459147293298}
- component: {fileID: 7589846690690311285}
m_Layer: 0
m_Layer: 10
m_Name: RescueCarrierCar
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -197,7 +197,7 @@ GameObject:
- component: {fileID: 6805425689785551169}
- component: {fileID: 6805425689782126951}
- component: {fileID: 6805425689783258023}
m_Layer: 0
m_Layer: 10
m_Name: FR
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -273,7 +273,7 @@ GameObject:
m_Component:
- component: {fileID: 6805425689785551171}
- component: {fileID: 6805425689776006829}
m_Layer: 0
m_Layer: 10
m_Name: Car
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -327,7 +327,7 @@ GameObject:
- component: {fileID: 6805425689785551173}
- component: {fileID: 6805425689782126955}
- component: {fileID: 6805425689783258027}
m_Layer: 0
m_Layer: 10
m_Name: CheXiang
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -404,7 +404,7 @@ GameObject:
- component: {fileID: 6805425689785551175}
- component: {fileID: 6805425689782126949}
- component: {fileID: 6805425689783258021}
m_Layer: 0
m_Layer: 10
m_Name: FL
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -481,7 +481,7 @@ GameObject:
- component: {fileID: 6805425689785551177}
- component: {fileID: 6805425689782126953}
- component: {fileID: 6805425689783258025}
m_Layer: 0
m_Layer: 10
m_Name: CheChuang
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -556,7 +556,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 6805425689785551179}
m_Layer: 0
m_Layer: 10
m_Name: CheLun
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -592,7 +592,7 @@ GameObject:
- component: {fileID: 6805425689785551181}
- component: {fileID: 6805425689782126957}
- component: {fileID: 6805425689783258029}
m_Layer: 0
m_Layer: 10
m_Name: BL
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -669,7 +669,7 @@ GameObject:
- component: {fileID: 6805425689785551183}
- component: {fileID: 6805425689782126959}
- component: {fileID: 6805425689783258031}
m_Layer: 0
m_Layer: 10
m_Name: BR
m_TagString: Untagged
m_Icon: {fileID: 0}

200
Assets/Resources/ClonePrefabs/Tool/SafeArea.prefab

@ -1,22 +1,12 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1688105851940198}
m_IsPrefabParent: 1
--- !u!1 &1688105851940198
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4952618577022658}
- component: {fileID: 33578466602309864}
@ -43,29 +33,42 @@ GameObject:
m_IsActive: 1
--- !u!4 &4952618577022658
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -569.1, y: 0.3, z: -480.8}
m_LocalScale: {x: 2, y: 1, z: 2}
m_LocalScale: {x: 1.5, y: 1, z: 1.5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33578466602309864
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &23016673593429082
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 55d730777ef997c4190acc083a4f89aa, type: 2}
m_StaticBatchInfo:
@ -78,6 +81,7 @@ MeshRenderer:
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
@ -86,18 +90,12 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33578466602309864
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1688105851940198}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65925066976696038
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Material: {fileID: 0}
m_IsTrigger: 0
@ -105,33 +103,37 @@ BoxCollider:
serializedVersion: 2
m_Size: {x: 10, y: 2.220446e-16, z: 10}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &114078635669860760
--- !u!114 &114908781700621646
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 036db8a5086732a48a18fd211e676195, type: 3}
m_Script: {fileID: 11500000, guid: 4b257af13b3263c40b41dd82e9ba852c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114163703889018502
--- !u!114 &114510145518594432
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2f3bdb2ded22b3545b36eff11986b64c, type: 3}
m_Script: {fileID: 11500000, guid: c6b7a1087f068b941ba4809689ab5633, type: 3}
m_Name:
m_EditorClassIdentifier:
prevTranformPos: {x: 0, y: 0, z: 0}
--- !u!114 &114185252073218594
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
@ -139,11 +141,25 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
rotateSpeed: 60
--- !u!114 &114705891571254502
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 54153f038171b554a9142e99a94a0f98, type: 3}
m_Name:
m_EditorClassIdentifier:
selected: 0
--- !u!114 &114195044155060300
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
@ -159,95 +175,89 @@ MonoBehaviour:
Layer: 0
ShoworHidden: 0
FullName:
--- !u!114 &114330804224454362
--- !u!114 &114895149839927340
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0a2ae739074b1f74a839051cde37ee81, type: 3}
m_Script: {fileID: 11500000, guid: a2cecff9aa0169343bb23ed89a955a6c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114409671852452932
sideLength: 20
hasWounderNum: 0
--- !u!114 &114330804224454362
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 74287b0169ae6574c88664a62454410b, type: 3}
m_Script: {fileID: 11500000, guid: 0a2ae739074b1f74a839051cde37ee81, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114510145518594432
--- !u!114 &114163703889018502
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c6b7a1087f068b941ba4809689ab5633, type: 3}
m_Script: {fileID: 11500000, guid: 2f3bdb2ded22b3545b36eff11986b64c, type: 3}
m_Name:
m_EditorClassIdentifier:
prevTranformPos: {x: 0, y: 0, z: 0}
--- !u!114 &114705891571254502
--- !u!114 &114917945843515582
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 54153f038171b554a9142e99a94a0f98, type: 3}
m_Script: {fileID: 11500000, guid: 77d5c6526906a6541b532f8bbf83daa8, type: 3}
m_Name:
m_EditorClassIdentifier:
selected: 0
--- !u!114 &114720232315064228
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 73b6f886e1244434cbff8aa12f1c722a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114895149839927340
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a2cecff9aa0169343bb23ed89a955a6c, type: 3}
m_Name:
m_EditorClassIdentifier:
sideLength: 20
hasWounderNum: 0
--- !u!114 &114908781700621646
--- !u!114 &114409671852452932
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4b257af13b3263c40b41dd82e9ba852c, type: 3}
m_Script: {fileID: 11500000, guid: 74287b0169ae6574c88664a62454410b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114917945843515582
--- !u!114 &114078635669860760
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1688105851940198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 77d5c6526906a6541b532f8bbf83daa8, type: 3}
m_Script: {fileID: 11500000, guid: 036db8a5086732a48a18fd211e676195, type: 3}
m_Name:
m_EditorClassIdentifier:

131
Assets/Resources/ClonePrefabs/Tool/StagingArea.prefab

@ -1,22 +1,12 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1332081665526844}
m_IsPrefabParent: 1
--- !u!1 &1332081665526844
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4295292051964176}
- component: {fileID: 33703066060055682}
@ -38,9 +28,10 @@ GameObject:
m_IsActive: 1
--- !u!4 &4295292051964176
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -569.1, y: 0.3, z: -480.8}
@ -49,18 +40,30 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33703066060055682
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &23434608660516220
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 379cef8732e2b884b955c0d09393db0d, type: 2}
m_StaticBatchInfo:
@ -73,6 +76,7 @@ MeshRenderer:
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
@ -81,18 +85,12 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33703066060055682
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1332081665526844}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65592361035729020
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Material: {fileID: 0}
m_IsTrigger: 0
@ -102,32 +100,35 @@ BoxCollider:
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &114148192076054864
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4b257af13b3263c40b41dd82e9ba852c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114211896326477508
--- !u!114 &114848112339363518
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 54153f038171b554a9142e99a94a0f98, type: 3}
m_Script: {fileID: 11500000, guid: c6b7a1087f068b941ba4809689ab5633, type: 3}
m_Name:
m_EditorClassIdentifier:
selected: 0
prevTranformPos: {x: 0, y: 0, z: 0}
--- !u!114 &114219293897261998
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Enabled: 1
m_EditorHideFlags: 0
@ -135,25 +136,25 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
rotateSpeed: 60
--- !u!114 &114508916966310282
--- !u!114 &114211896326477508
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a2bb9f36e259aa140939ea2f0b876e24, type: 3}
m_Script: {fileID: 11500000, guid: 54153f038171b554a9142e99a94a0f98, type: 3}
m_Name:
m_EditorClassIdentifier:
PosList: []
Cars: []
tool: {fileID: 0}
selected: 0
--- !u!114 &114707579592059632
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Enabled: 1
m_EditorHideFlags: 0
@ -166,27 +167,33 @@ MonoBehaviour:
buildNum:
floorNum: 0
interlayerNum: 0
Layer: 0
ShoworHidden: 0
--- !u!114 &114848112339363518
FullName:
--- !u!114 &114508916966310282
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c6b7a1087f068b941ba4809689ab5633, type: 3}
m_Script: {fileID: 11500000, guid: a2bb9f36e259aa140939ea2f0b876e24, type: 3}
m_Name:
m_EditorClassIdentifier:
PosList: []
Cars: []
tool: {fileID: 0}
--- !u!114 &114849273356967974
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1332081665526844}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0a2ae739074b1f74a839051cde37ee81, type: 3}
m_Name:
m_EditorClassIdentifier:
Hidden: 0

16
Assets/Resources/ClonePrefabs/Tool/Trailer.prefab

@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 518475800269957360}
- component: {fileID: 518475800267090132}
- component: {fileID: 518475800268188180}
m_Layer: 0
m_Layer: 10
m_Name: RF
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -88,7 +88,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 518475800269957364}
m_Layer: 0
m_Layer: 10
m_Name: LunZ
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -124,7 +124,7 @@ GameObject:
- component: {fileID: 518475800269957366}
- component: {fileID: 518475800267090138}
- component: {fileID: 518475800268188186}
m_Layer: 0
m_Layer: 10
m_Name: RB
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -203,7 +203,7 @@ GameObject:
- component: {fileID: 518475800269957368}
- component: {fileID: 518475800267090142}
- component: {fileID: 518475800268188190}
m_Layer: 0
m_Layer: 10
m_Name: LB
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -282,7 +282,7 @@ GameObject:
- component: {fileID: 518475800269957370}
- component: {fileID: 518475800267090136}
- component: {fileID: 518475800268188184}
m_Layer: 0
m_Layer: 10
m_Name: LF
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -361,7 +361,7 @@ GameObject:
- component: {fileID: 518475800269957372}
- component: {fileID: 518475800267090140}
- component: {fileID: 518475800268188188}
m_Layer: 0
m_Layer: 10
m_Name: Cheshen
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -459,7 +459,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 518475800269957374}
m_Layer: 0
m_Layer: 10
m_Name: JiuYuanChe
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -500,7 +500,7 @@ GameObject:
- component: {fileID: 195902583939705336}
- component: {fileID: 114473283443032936}
- component: {fileID: 114625672113104814}
m_Layer: 0
m_Layer: 10
m_Name: Trailer
m_TagString: Untagged
m_Icon: {fileID: 0}

48285
Assets/Scenes/DongYouLiQing.unity

File diff suppressed because it is too large Load Diff

9
Assets/Scripts/Common/Cars/AgentController.cs

@ -223,6 +223,15 @@ public class AgentController : MonoBehaviour
{
//发送到达目的地消息
MessageDispatcher.SendMessage("ArrivedDestination", gameObject.GetComponent<CloneGameObjInfo>().gameObjID);
if (objinfo.gameObjType == CloneObjType.fireman)
{
setFloorMessage();
}
else if (objinfo.GetComponent<TruckMessage>())
{
setFloorMessage(false);
}
}
}
}

59
Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs

@ -158,7 +158,66 @@ public class PATHFIND_SYNC : NetworkMessageBehaviour
{
//setFloorMessage();
}
if (objinfo.gameObjType == CloneObjType.fireman)
{
setFloorMessage();
}
else if (objinfo.GetComponent<TruckMessage>())
{
setFloorMessage(false);
}
if (i == corners.Count)
{
if (objinfo.gameObjType == CloneObjType.fireman)
{
setFloorMessage();
}
else if (objinfo.GetComponent<TruckMessage>())
{
setFloorMessage(false);
}
}
i++;
}
}
private void setFloorMessage(bool isFireman = true)
{
//璁剧疆瀵昏矾瀵硅薄妤煎眰灞炴€?
Vector3 adPos2 = transform.position;
Ray ray = new Ray(adPos2 + Vector3.up, Vector3.down);
RaycastHit hit = new RaycastHit();
if (isFireman)
{
if (Physics.Raycast(ray, out hit, 1000, LayerMask.GetMask("SoldierRoad", "CarRoad")))
{
if (hit.transform.gameObject.GetComponent<CloneGameObjInfo>())
{
CloneGameObjInfo msg = GetComponent<CloneGameObjInfo>();
CloneGameObjInfo hitinfo = hit.transform.gameObject.GetComponent<CloneGameObjInfo>();
msg.buildNum = hitinfo.buildNum;
msg.floorNum = hitinfo.floorNum;
msg.interlayerNum = hitinfo.interlayerNum;
return;
}
}
}
else
{
if (Physics.Raycast(ray, out hit, LayerMask.NameToLayer("CarRoad")))
{
if (hit.transform.gameObject.GetComponent<CloneGameObjInfo>())
{
CloneGameObjInfo msg = GetComponent<CloneGameObjInfo>();
CloneGameObjInfo hitinfo = hit.transform.gameObject.GetComponent<CloneGameObjInfo>();
msg.buildNum = hitinfo.buildNum;
msg.floorNum = hitinfo.floorNum;
msg.interlayerNum = hitinfo.interlayerNum;
return;
}
}
}
}
}

159
Assets/Scripts/SmartX1/SmartController.cs

@ -3,28 +3,27 @@ using System;
using System.Xml;
using System.IO;
using System.Text;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Collections;
using SmartX1Demo;
public class SmartController : MonoBehaviour
public class SmartController : MonoBehaviour
{
int[] keyHandles = new int[8];
int[] keyNumber = new int[8];
private int Rtn = 0;
SmartApp smart = new SmartApp();
private bool IsQuit = false;
private DateTime t1, t2, t11;
void Start()
{
string appid = "";
string appid2 = "AXKC";//通用秘钥,内置的
// Use this for initialization
void Start () {
t2 = DateTime.Now;
t1 = DateTime.Now;
DontDestroyOnLoad(GameObject.Find("SmartX1"));
tipStyle = new GUIStyle();
tipStyle.fontSize = 40;
tipStyle.normal.textColor = Color.red;
@ -32,22 +31,15 @@ public class SmartController : MonoBehaviour
original_filepath = Application.streamingAssetsPath + @"/xml/SmartXProject.xml";
encode_filepath = Application.streamingAssetsPath + @"/xml/enSmartXProject.xml";
decode_filepath = Application.streamingAssetsPath + @"/xml/deSmartXProject.xml";
original_filepath2 = Application.streamingAssetsPath + @"/xml/SmartXProject2.xml";
encode_filepath2 = Application.streamingAssetsPath + @"/xml/enSmartXProject2.xml";
decode_filepath2 = Application.streamingAssetsPath + @"/xml/deSmartXProject2.xml";
appid = ControlXML(original_filepath, encode_filepath, decode_filepath);
appid2 = ControlXML(original_filepath2, encode_filepath2, decode_filepath2);
//appid = GetAppID(original_filepath);
ControlXML();
//检测加密狗是否存在
FindSmartX1();
}
string appid = "AXKC";
string appid2 = "YuAnguanli";
}
public string GetAppID(string filepath)
{
//filepath = Application.dataPath + @"/xml/SmartXProject.xml";
if (File.Exists(filepath))
{
XmlDocument xmlDoc = new XmlDocument();
@ -71,56 +63,65 @@ public class SmartController : MonoBehaviour
}
return "";
}
void FindSmartX1()
bool FindSmartX1()
{
try
{
Rtn = smart.SmartX1Find(appid, keyHandles, keyNumber);
if (Rtn == 0)
{
return;
}
Rtn = smart.SmartX1Find(appid2, keyHandles, keyNumber);
if (Rtn == 0)
{
return;
Rtn = smart.SmartX1Find(appid, keyHandles, keyNumber);
if (Rtn != 0)
{
Rtn = smart.SmartX1Find(appid2, keyHandles, keyNumber);
if (Rtn != 0)
{
IsQuit = true;
t1 = DateTime.Now;
t2 = DateTime.Now;
t11 = DateTime.Now;
return false;
}
}
IsQuit = true;
t1 = DateTime.Now;
t2 = DateTime.Now;
t11 = DateTime.Now;
Debug.Log("SmartX1Find Successfully");
return true;
}
catch (Exception ex)
{
Debug.Log(keyHandles[0]);
Debug.Log("异常" + ex.Message);
//GameObject.Find("Application").GetComponent<ApplicationClose>().isSmartX1Exit = true;
Application.Quit();
return false;
}
}
void CheckExist()
bool CheckExist()
{
try
{
Rtn = smart.SmartX1CheckExist(keyHandles[0]);
if (Rtn != 0)
{
//Debug.Log("SmartX1 not exist!" + Rtn.ToString());
IsQuit = true;
}
if (IsQuit)
{
t1 = DateTime.Now;
t2 = DateTime.Now;
t11 = DateTime.Now;
return false;
}
//Debug.Log("SmartX1Exist!");
return true;
}
catch (Exception ex)
{
Debug.Log("异常" + ex.Message);
//Debug.Log(keyHandles[0]);
//Debug.Log("异常" + ex.Message);
//GameObject.Find("Application").GetComponent<ApplicationClose>().isSmartX1Exit = true;
Application.Quit();
return false;
}
}
private GUIStyle tipStyle;
private int timer = 5;
void OnGUI()
@ -128,24 +129,25 @@ public class SmartController : MonoBehaviour
if (IsQuit)
{
t2 = DateTime.Now;
if (t2 - t11 > new TimeSpan(0, 0, 1))
if(t2-t11>new TimeSpan(0,0,1))
{
if (timer > 0)
if(timer>0)
timer--;
t11 = t2;
}
GUI.Label(new Rect(Screen.width / 2 - 150, Screen.height / 2 - 75, 300, 150), "密钥验证失败,程序将在" + timer + "秒后退出!", tipStyle);
GUI.Label(new Rect(Screen.width / 2 - 150, Screen.height / 2 - 75, 300, 150), "密钥验证失败,程序将在"+timer+"秒后退出!", tipStyle);
if (t2 - t1 > new TimeSpan(0, 0, 5))
{
Debug.Log("程序退出!");
//Debug.Log("程序退出!");
// GameObject.Find("Application").GetComponent<ApplicationClose>().isSmartX1Exit = true;
Application.Quit();
}
}
}
// Update is called once per frame
void Update()
{
// Update is called once per frame
void Update () {
if (IsQuit)
return;
t2 = DateTime.Now;
@ -154,37 +156,48 @@ public class SmartController : MonoBehaviour
t1 = t2;
CheckExist();
}
}
}
//xml文件加密解密
string ControlXML(string originalFile, string encodeFile, string decodeFile)
void ControlXML()
{
var id = "";
if (File.Exists(originalFile))//证明这次是第一次运行该程序,获取当前配置文件
if (File.Exists(original_filepath))//证明这次是第一次运行该程序,获取当前配置文件
{
id = GetAppID(originalFile);
fileEncryption(originalFile, encodeFile);
if (File.Exists(encodeFile))
{
File.Delete(originalFile);
}
appid = GetAppID(original_filepath);
//StartCoroutine(GenerateEncodeXML());
GenerateEncodeXML1();
}
else
{
if (File.Exists(encodeFile))
if (File.Exists(encode_filepath))
{
fileDcryption(encodeFile, decodeFile);
if (File.Exists(decodeFile))
fileDcryption(encode_filepath);
if (File.Exists(decode_filepath))
{
id = GetAppID(decodeFile);
File.Delete(decodeFile);
appid = GetAppID(decode_filepath);
File.Delete(decode_filepath);
}
}
}
//Debug.Log("--------->" + id);
return id;
}
IEnumerator GenerateEncodeXML()
{
yield return new WaitForSeconds(1.0f);
fileEncryption(original_filepath);
if (File.Exists(encode_filepath))
{
File.Delete(original_filepath);
}
}
void GenerateEncodeXML1()
{
fileEncryption(original_filepath);
if (File.Exists(encode_filepath))
{
File.Delete(original_filepath);
}
}
//加密xml文件
@ -241,11 +254,8 @@ public class SmartController : MonoBehaviour
string encode_filepath = "";
string decode_filepath = "";
string original_filepath2 = "";
string encode_filepath2 = "";
string decode_filepath2 = "";
//举例,对某个XML文件加密
private void fileEncryption(string originalFile, string encodeFile)
private void fileEncryption(string filename)
{
RijndaelManaged key = new RijndaelManaged();
//设置密钥:key为32位=数字或字母16个=汉子8个
@ -253,28 +263,29 @@ public class SmartController : MonoBehaviour
key.Key = byteKey;
XmlDocument xmldoc = new XmlDocument();
xmldoc.PreserveWhitespace = true;
xmldoc.Load(originalFile);//想要加密的xml文件
xmldoc.Load(original_filepath);//想要加密的xml文件
Encrypt(xmldoc, "SmartX1", key);//需要加密的节点
if (key != null)
{
key.Clear();
}
xmldoc.Save(encodeFile);//生成加密后的xml文件
xmldoc.Save(encode_filepath);//生成加密后的xml文件
}
//举例,对某个xml文件解密
private void fileDcryption(string encodeFile, string decodeFile)
private void fileDcryption(string filename)
{
RijndaelManaged key = new RijndaelManaged();
byte[] byteKey = Encoding.Unicode.GetBytes("1111111111111111");
key.Key = byteKey;
XmlDocument xmldoc = new XmlDocument();
xmldoc.PreserveWhitespace = true;
xmldoc.Load(encodeFile);//加载要解密的xml文件
xmldoc.Load(encode_filepath);//加载要解密的xml文件
Decrypt(xmldoc, key);
if (key != null)
{
key.Clear();
}
xmldoc.Save(decodeFile);//生成解密后的文件
xmldoc.Save(decode_filepath);//生成解密后的文件
}
}

Loading…
Cancel
Save