杨栋梁
5 months ago
27 changed files with 110990 additions and 81670 deletions
@ -0,0 +1,6 @@
|
||||
{ |
||||
"version": "1.0", |
||||
"components": [ |
||||
"Microsoft.VisualStudio.Workload.ManagedGame" |
||||
] |
||||
} |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 50a2952a7d98ea243849612828e01aa7 |
||||
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; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2 |
||||
guid: fb694aca67be94b448fefb1cff8ea1ea |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 8a929a4e30f83e94590ae1d6e3a18551 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 7cea3a5eeec518f4b86134ce387a3b68 |
||||
NativeFormatImporter: |
||||
externalObjects: {} |
||||
mainObjectFileID: 23800000 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: afc50e18e82112a429586bfd64351a4b |
||||
NativeFormatImporter: |
||||
externalObjects: {} |
||||
mainObjectFileID: 23800000 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 895e7d1d41193b74aa9970b6399b9cf7 |
||||
PrefabImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -1 +1 @@
|
||||
Subproject commit 96baeb6a141fe2d8c041252d78eba2c7f03c6dfd |
||||
Subproject commit 076146f55103cf0e744940e2adbec5d6ff7ecc6f |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 669cceedbe988f94ba839f0d2b64978f |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2 |
||||
guid: f817d78d71cb69249ad328bcf4304483 |
||||
folderAsset: yes |
||||
DefaultImporter: |
||||
externalObjects: {} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -1,4 +1,41 @@
|
||||
{ |
||||
"dependencies": { |
||||
} |
||||
"dependencies": { |
||||
"com.unity.ads": "2.0.8", |
||||
"com.unity.analytics": "3.2.3", |
||||
"com.unity.assetbundlebrowser": "1.7.0", |
||||
"com.unity.collab-proxy": "1.2.15", |
||||
"com.unity.package-manager-ui": "2.0.13", |
||||
"com.unity.purchasing": "2.1.1", |
||||
"com.unity.textmeshpro": "1.4.1", |
||||
"com.unity.modules.ai": "1.0.0", |
||||
"com.unity.modules.animation": "1.0.0", |
||||
"com.unity.modules.assetbundle": "1.0.0", |
||||
"com.unity.modules.audio": "1.0.0", |
||||
"com.unity.modules.cloth": "1.0.0", |
||||
"com.unity.modules.director": "1.0.0", |
||||
"com.unity.modules.imageconversion": "1.0.0", |
||||
"com.unity.modules.imgui": "1.0.0", |
||||
"com.unity.modules.jsonserialize": "1.0.0", |
||||
"com.unity.modules.particlesystem": "1.0.0", |
||||
"com.unity.modules.physics": "1.0.0", |
||||
"com.unity.modules.physics2d": "1.0.0", |
||||
"com.unity.modules.screencapture": "1.0.0", |
||||
"com.unity.modules.terrain": "1.0.0", |
||||
"com.unity.modules.terrainphysics": "1.0.0", |
||||
"com.unity.modules.tilemap": "1.0.0", |
||||
"com.unity.modules.ui": "1.0.0", |
||||
"com.unity.modules.uielements": "1.0.0", |
||||
"com.unity.modules.umbra": "1.0.0", |
||||
"com.unity.modules.unityanalytics": "1.0.0", |
||||
"com.unity.modules.unitywebrequest": "1.0.0", |
||||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0", |
||||
"com.unity.modules.unitywebrequestaudio": "1.0.0", |
||||
"com.unity.modules.unitywebrequesttexture": "1.0.0", |
||||
"com.unity.modules.unitywebrequestwww": "1.0.0", |
||||
"com.unity.modules.vehicles": "1.0.0", |
||||
"com.unity.modules.video": "1.0.0", |
||||
"com.unity.modules.vr": "1.0.0", |
||||
"com.unity.modules.wind": "1.0.0", |
||||
"com.unity.modules.xr": "1.0.0" |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue