杨栋梁
2 years ago
25 changed files with 7051 additions and 875 deletions
@ -0,0 +1,6 @@
|
||||
{ |
||||
"version": "1.0", |
||||
"components": [ |
||||
"Microsoft.VisualStudio.Workload.ManagedGame" |
||||
] |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 89fa00787f44eff4d9d3877a3e16e08d |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: df1725f47b5255242bd32e779f35c608 |
||||
NativeFormatImporter: |
||||
externalObjects: {} |
||||
mainObjectFileID: 23800000 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: efc2ad9148c56184b92a0f52e7d593ff |
||||
NativeFormatImporter: |
||||
externalObjects: {} |
||||
mainObjectFileID: 23800000 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: e461da297b7929b49b2ebd18af9272d5 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 18bd83e7ead479445b941b6b734cf7df |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: a293b0a451b174e4fb394291c249f14c |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: befb203dd6eb99844be9c8187f30c743 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Binary file not shown.
@ -0,0 +1,7 @@
|
||||
ManifestFileVersion: 0 |
||||
CRC: 3827883197 |
||||
AssetBundleManifest: |
||||
AssetBundleInfos: |
||||
Info_0: |
||||
Name: buildingscene |
||||
Dependencies: {} |
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 6433baba71ee5724fb554d1c8d4ac980 |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 8d02802fdbd3b204baf2760daa7da221 |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Binary file not shown.
@ -0,0 +1,74 @@
|
||||
ManifestFileVersion: 0 |
||||
CRC: 469771162 |
||||
Hashes: |
||||
AssetFileHash: |
||||
serializedVersion: 2 |
||||
Hash: d2a26bd5f67192cd3eaa7c1929de0b32 |
||||
TypeTreeHash: |
||||
serializedVersion: 2 |
||||
Hash: 2353adc51596df781e9743e4c602a23e |
||||
HashAppended: 0 |
||||
ClassTypes: |
||||
- Class: 1 |
||||
Script: {instanceID: 0} |
||||
- Class: 4 |
||||
Script: {instanceID: 0} |
||||
- Class: 21 |
||||
Script: {instanceID: 0} |
||||
- Class: 23 |
||||
Script: {instanceID: 0} |
||||
- Class: 28 |
||||
Script: {instanceID: 0} |
||||
- Class: 33 |
||||
Script: {instanceID: 0} |
||||
- Class: 43 |
||||
Script: {instanceID: 0} |
||||
- Class: 48 |
||||
Script: {instanceID: 0} |
||||
- Class: 64 |
||||
Script: {instanceID: 0} |
||||
- Class: 65 |
||||
Script: {instanceID: 0} |
||||
- Class: 89 |
||||
Script: {instanceID: 0} |
||||
- Class: 104 |
||||
Script: {instanceID: 0} |
||||
- Class: 108 |
||||
Script: {instanceID: 0} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: 1e3fdca004f2d45fe8abbed571a8abd5, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: a30477d3d23f2bc4a8924ffb4b1b7e62, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: c03a1a14af66ddc4b9f0f18b89b0d053, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: 0b9c305761a78ca41b5f94428fa22b82, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: 7a5ac11cc976e418e8d13136b07e1f52, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: e01c388cf4175aa49b4973deb437d754, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: b8b046bc0ab99e94cb2c70fd441b8fc7, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: 138657bd20cc99148b95741de3a954f1, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: 4302e11eb254e4548aed561b2bbc99d4, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: b133d14efd54f9841a1659ef37479be7, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: c6c3bcee76738264da0b700ac7402719, type: 3} |
||||
- Class: 114 |
||||
Script: {fileID: 11500000, guid: 49a6ba4f46ec21b4c8a83dce618eda97, type: 3} |
||||
- Class: 115 |
||||
Script: {instanceID: 0} |
||||
- Class: 123 |
||||
Script: {instanceID: 0} |
||||
- Class: 157 |
||||
Script: {instanceID: 0} |
||||
- Class: 238 |
||||
Script: {instanceID: 0} |
||||
- Class: 258 |
||||
Script: {instanceID: 0} |
||||
Assets: |
||||
- Assets/BuildingScene.unity |
||||
Dependencies: [] |
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2 |
||||
guid: df0b1594e4fba9b44a2027b725f2a052 |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2 |
||||
guid: f2cd7615ccc2c9a40b4422c191d2d4a2 |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: b91d69e07d78d4043a1d30ae549897ca |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 395078d1b843b504ab133c23e82e252e |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,544 @@
|
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using UnityEngine; |
||||
using UnityEditor; |
||||
using UnityEngine.AI; |
||||
using System.IO; |
||||
using System.Text; |
||||
using System; |
||||
|
||||
public class SceneTool |
||||
{ |
||||
[MenuItem("SceneTool/SetFloorMessage")]//添加FloorMessage脚本绑定楼层信息 |
||||
public static void SetFloorMessage() |
||||
{ |
||||
Transform neiParent = GameObject.Find("shinei").transform.GetChild(0); |
||||
for (int i = 0; i < neiParent.childCount; i++) |
||||
{ |
||||
//Debug.Log(neiParent.GetChild(i).name); |
||||
if (!neiParent.GetChild(i).GetComponent<FloorMessage>()) |
||||
{ |
||||
neiParent.GetChild(i).gameObject.AddComponent<FloorMessage>(); |
||||
} |
||||
FloorMessage msg = neiParent.GetChild(i).GetComponent<FloorMessage>(); |
||||
msg.targetTrans = GetTarget(neiParent.GetChild(i)); |
||||
msg.buildNum = neiParent.name; |
||||
if (!neiParent.GetChild(i).name.ToLower().Contains("m")) |
||||
{ |
||||
string floornum = neiParent.GetChild(i).name.Substring |
||||
(neiParent.GetChild(i).name.ToLower().IndexOf("nei") + 3, neiParent.GetChild(i).name.Length - 3); |
||||
msg.floorNum = int.Parse(floornum); |
||||
msg.interlayerNum = 0; |
||||
} |
||||
else |
||||
{ |
||||
msg.floorNum = int.Parse(neiParent.GetChild(i).name.Substring |
||||
(neiParent.GetChild(i).name.ToLower().IndexOf("nei") + 3, neiParent.GetChild(i).name.ToLower().IndexOf("m") |
||||
- neiParent.GetChild(i).name.ToLower().IndexOf("nei") - 3)); |
||||
msg.interlayerNum = int.Parse(neiParent.GetChild(i).name.Substring |
||||
(neiParent.GetChild(i).name.ToLower().IndexOf("m") + 1, neiParent.GetChild(i).name.Length - |
||||
neiParent.GetChild(i).name.ToLower().IndexOf("m") - 1)); |
||||
} |
||||
} |
||||
Transform waiParent = GameObject.Find("shiwai").transform.GetChild(0); |
||||
for (int i = 0; i < waiParent.childCount; i++) |
||||
{ |
||||
//Debug.Log(waiParent.GetChild(i).name); |
||||
if (!waiParent.GetChild(i).GetComponent<FloorMessage>()) |
||||
{ |
||||
waiParent.GetChild(i).gameObject.AddComponent<FloorMessage>(); |
||||
} |
||||
FloorMessage msg = waiParent.GetChild(i).GetComponent<FloorMessage>(); |
||||
msg.buildNum = waiParent.name; |
||||
if (!waiParent.GetChild(i).name.ToLower().Contains("m")) |
||||
{ |
||||
string floornum = waiParent.GetChild(i).name.Substring |
||||
(waiParent.GetChild(i).name.ToLower().IndexOf("wai") + 3, waiParent.GetChild(i).name.Length - 3); |
||||
msg.floorNum = int.Parse(floornum); |
||||
msg.interlayerNum = 0; |
||||
} |
||||
else |
||||
{ |
||||
msg.floorNum = int.Parse(waiParent.GetChild(i).name.Substring |
||||
(waiParent.GetChild(i).name.ToLower().IndexOf("wai") + 3, waiParent.GetChild(i).name.ToLower().IndexOf("m") |
||||
- waiParent.GetChild(i).name.ToLower().IndexOf("wai") - 3)); |
||||
msg.interlayerNum = int.Parse(waiParent.GetChild(i).name.Substring |
||||
(waiParent.GetChild(i).name.ToLower().IndexOf("m") + 1, waiParent.GetChild(i).name.Length - |
||||
waiParent.GetChild(i).name.ToLower().IndexOf("m") - 1)); |
||||
} |
||||
} |
||||
} |
||||
static Transform GetTarget(Transform parent) |
||||
{ |
||||
for (int i = 0; i < parent.childCount; i++) |
||||
{ |
||||
if (parent.GetChild(i).name.ToLower().Contains("_floor") |
||||
|| parent.GetChild(i).name.ToLower().Contains("-floor") |
||||
) |
||||
{ |
||||
return parent.GetChild(i); |
||||
} |
||||
} |
||||
|
||||
return parent; |
||||
} |
||||
[MenuItem("SceneTool/Setshinei")]//添加寻路层(选中shinei对象设置,注:扶梯情况特殊没有包含) |
||||
public static void SetShiNei() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
if ((obj[i].name.ToLower().Contains("floor") ||//地面 |
||||
obj[i].name.ToLower().Contains("lt") || |
||||
obj[i].name.ToLower().Contains("chedao") || |
||||
obj[i].name.ToLower().Contains("ft")) && !obj[i].name.ToLower().Contains("ltcs")) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<PathFindable>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<PathFindable>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneGameObjInfo>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiNeiMan; |
||||
if (obj[i].GetComponentInParent<FloorMessage>()) |
||||
{ |
||||
FloorMessage fmg = obj[i].GetComponentInParent<FloorMessage>(); |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.StaticGameObject; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; |
||||
} |
||||
} |
||||
if (obj[i].name.ToLower().Contains("wall") ||//墙面 |
||||
obj[i].name.ToLower().Contains("zhuzi")) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); |
||||
if (!obj[i].gameObject.GetComponent<NavMeshModifier>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<NavMeshModifier>(); |
||||
} |
||||
NavMeshModifier mod = obj[i].gameObject.GetComponent<NavMeshModifier>(); |
||||
mod.overrideArea = true; |
||||
mod.area = 1; |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/SetshineiXHS")]//设置室内消火栓属性 |
||||
public static void SetSNXHS() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].name.ToLower().Contains("xhs") && |
||||
obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
if (!obj[i].gameObject.GetComponent<BoxCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<BoxCollider>(); |
||||
} |
||||
|
||||
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneGameObjInfo>(); |
||||
} |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.IndoorFireHydrant; |
||||
if (!obj[i].gameObject.GetComponent<InDoorHydrantMessage>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<InDoorHydrantMessage>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<WaterSource>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<WaterSource>(); |
||||
} |
||||
if (obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjID == 0) |
||||
{ |
||||
long staticGameObjId = (long)GUID.NewGuid(1, 1); |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().SetGameObjID(staticGameObjId); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiNeiXHS; |
||||
if (obj[i].GetComponentInParent<FloorMessage>()) |
||||
{ |
||||
FloorMessage fmg = obj[i].GetComponentInParent<FloorMessage>(); |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/DiXiaLouDing/CheNengZou")]//地面的楼顶(车能走),常见为地下建筑上的公路 |
||||
public static void DiXiaLouDingCheNengZou() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("CarRoad"); |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<PathFindable>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<PathFindable>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneGameObjInfo>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiWaiCar; |
||||
if (obj[i].GetComponentInParent<FloorMessage>()) |
||||
{ |
||||
FloorMessage fmg = obj[i].GetComponentInParent<FloorMessage>(); |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.StaticGameObject; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().SpecialTag = "楼顶"; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/DiXiaLouDing/RenNengZou")]//地面的楼顶(人能走),常见为地下建筑上的小路 |
||||
public static void DiXiaLouDingRenNengZou() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<PathFindable>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<PathFindable>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneGameObjInfo>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiWaiMan; |
||||
if (obj[i].GetComponentInParent<FloorMessage>()) |
||||
{ |
||||
FloorMessage fmg = obj[i].GetComponentInParent<FloorMessage>(); |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.StaticGameObject; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().SpecialTag = "楼顶"; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/DiXiaLouDing/DouBuZou")]//地面的楼顶(都不能走),常见为地下建筑上的花坛 |
||||
public static void DiXiaLouDingDouBuZou() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("CarRoad"); |
||||
if (!obj[i].gameObject.GetComponent<NavMeshModifier>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<NavMeshModifier>(); |
||||
} |
||||
NavMeshModifier mod = obj[i].gameObject.GetComponent<NavMeshModifier>(); |
||||
mod.overrideArea = true; |
||||
mod.area = 1; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/PuTongLouDing/RenNengZou")]//普通的楼顶(人能走),常见为地上建筑的楼顶地板 |
||||
public static void PuTongLouDingRenNengZou() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<PathFindable>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<PathFindable>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneGameObjInfo>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.LouDing; |
||||
if (obj[i].GetComponentInParent<FloorMessage>()) |
||||
{ |
||||
FloorMessage fmg = obj[i].GetComponentInParent<FloorMessage>(); |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.StaticGameObject; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; |
||||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().SpecialTag = "楼顶"; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/PuTongLouDing/DouBuZou")]//普通的楼顶(都不能走) |
||||
public static void PuTongLouDingDouBuZou() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); |
||||
if (!obj[i].gameObject.GetComponent<NavMeshModifier>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<NavMeshModifier>(); |
||||
} |
||||
NavMeshModifier mod = obj[i].gameObject.GetComponent<NavMeshModifier>(); |
||||
mod.overrideArea = true; |
||||
mod.area = 1; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/ShiWai/CheNengZou")]//地面(车能走),常见为公路 |
||||
public static void ShiWaiCheNengZou() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("CarRoad"); |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<PathFindable>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<PathFindable>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiWaiCar; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/ShiWai/RenNengZou")]//地面(人能走),常见为小路 |
||||
public static void ShiWaiRenNengZou() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<PathFindable>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<PathFindable>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiWaiMan; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/ShiWai/DouBuZou")]//地面(都不能走),常见为花坛 |
||||
public static void ShiWaiDouBuZou() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
obj[i].gameObject.layer = LayerMask.NameToLayer("CarRoad"); |
||||
if (!obj[i].gameObject.GetComponent<NavMeshModifier>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<NavMeshModifier>(); |
||||
} |
||||
NavMeshModifier mod = obj[i].gameObject.GetComponent<NavMeshModifier>(); |
||||
mod.overrideArea = true; |
||||
mod.area = 1; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/TeShu/YouGuanDing")]//油罐顶 |
||||
public static void YouGuanDing() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.YouGuanDing; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/TeShu/YouGuanBi")]//油罐壁 |
||||
public static void YouGuanBi() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.YouGuanBi; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
[MenuItem("SceneTool/TeShu/WeiXianPinYunShuChe")]//危险运输车 |
||||
public static void WeiXianPinYunShuChe() |
||||
{ |
||||
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered); |
||||
{ |
||||
for (int i = 0; i < obj.Length; i++) |
||||
{ |
||||
if (obj[i].GetComponent<MeshRenderer>()) |
||||
{ |
||||
if (!obj[i].gameObject.GetComponent<MeshCollider>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<MeshCollider>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneableEnums>(); |
||||
} |
||||
if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>()) |
||||
{ |
||||
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
||||
} |
||||
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>(); |
||||
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.WeiXianPinYunShuChe; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue