Browse Source

添加碰撞,重新导出

develop2
曹衍涛 2 years ago
parent
commit
6f301ecdad
  1. 18471
      Assets/01GuoJiJinRongZhongXin/Prefab/GuoJiJinRongZhongXin.prefab
  2. 3508
      Assets/BuildingScene.unity
  3. 615
      Assets/CloneTypesTemplate/Editor/SceneTool.cs
  4. BIN
      Assets/StreamingAssets/AssetBundles/GuoJiJinRongZhongXinAB/GuoJiJinRongZhongXinAB
  5. 2
      Assets/StreamingAssets/AssetBundles/GuoJiJinRongZhongXinAB/GuoJiJinRongZhongXinAB.manifest
  6. BIN
      Assets/StreamingAssets/AssetBundles/GuoJiJinRongZhongXinAB/buildingscene
  7. 8
      Assets/StreamingAssets/AssetBundles/GuoJiJinRongZhongXinAB/buildingscene.manifest

18471
Assets/01GuoJiJinRongZhongXin/Prefab/GuoJiJinRongZhongXin.prefab

File diff suppressed because it is too large Load Diff

3508
Assets/BuildingScene.unity

File diff suppressed because it is too large Load Diff

615
Assets/CloneTypesTemplate/Editor/SceneTool.cs

@ -73,205 +73,344 @@ public class SceneTool
for (int i = 0; i < parent.childCount; i++) for (int i = 0; i < parent.childCount; i++)
{ {
if (parent.GetChild(i).name.ToLower().Contains("_floor") if (parent.GetChild(i).name.ToLower().Contains("_floor")
|| parent.GetChild(i).name.ToLower().Contains("-floor")
|| parent.GetChild(i).name.ToLower().Contains("-floor") || parent.GetChild(i).name.ToLower().Contains("-floor")
) )
{ {
if (parent.GetChild(i).GetComponent<MeshRenderer>()) return parent.GetChild(i);
return parent.GetChild(i);
} }
} }
return parent; return parent;
} }
[MenuItem("SceneTool/SetNavLayerShiNeiFloor")]//添加寻路层(选中shinei对象设置,注:扶梯情况特殊没有包含) [MenuItem("SceneTool/Setshinei")]//添加寻路层(选中shinei对象设置,注:扶梯情况特殊没有包含)
public static void SetNavLayerShiNeiFloor() public static void SetShiNei()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
for (int i = 0; i < obj.Length; i++) for (int i = 0; i < obj.Length; i++)
{ {
if (obj[i].name.ToLower().Contains("_floor") ||//地面 if (obj[i].GetComponent<MeshRenderer>())
obj[i].name.ToLower().Contains("_floor") ||
obj[i].name.ToLower().Contains("floor") ||
obj[i].name.ToLower().Contains("chewei") ||
obj[i].name.ToLower().Contains("-floor") &&
obj[i].GetComponent<MeshRenderer>())
{ {
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); if ((obj[i].name.ToLower().Contains("floor") ||//地面
if (!obj[i].gameObject.GetComponent<MeshCollider>()) obj[i].name.ToLower().Contains("lt") ||
{ obj[i].name.ToLower().Contains("chedao") ||
obj[i].gameObject.AddComponent<MeshCollider>(); obj[i].name.ToLower().Contains("ft")) && !obj[i].name.ToLower().Contains("ltcs"))
}
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>();
}
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>();
Transform Template = GameObject.Find("TheCarRoad").transform.Find("ShiNeiFloor");
var CloneableEnums = Template.GetComponent<CloneableEnums>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes;
if (obj[i].parent.GetComponent<FloorMessage>())
{ {
FloorMessage fmg = obj[i].parent.GetComponent<FloorMessage>(); obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad");
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.StaticGameObject; if (!obj[i].gameObject.GetComponent<MeshCollider>())
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; {
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; obj[i].gameObject.AddComponent<MeshCollider>();
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; }
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].parent.parent.GetComponent<FloorMessage>()) if (obj[i].name.ToLower().Contains("wall") ||//墙面
obj[i].name.ToLower().Contains("zhuzi"))
{ {
FloorMessage fmg = obj[i].parent.parent.GetComponent<FloorMessage>(); obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad");
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.StaticGameObject; if (!obj[i].gameObject.GetComponent<NavMeshModifier>())
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; {
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; obj[i].gameObject.AddComponent<NavMeshModifier>();
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; }
NavMeshModifier mod = obj[i].gameObject.GetComponent<NavMeshModifier>();
mod.overrideArea = true;
mod.area = 1;
if (!obj[i].gameObject.GetComponent<MeshCollider>())
{
obj[i].gameObject.AddComponent<MeshCollider>();
}
} }
} }
if (obj[i].name.ToLower().Contains("_wall") ||//墙面 }
obj[i].name.ToLower().Contains("_wall") || }
obj[i].name.ToLower().Contains("wall") || [MenuItem("SceneTool/SetshineiXHS")]//设置室内消火栓属性
obj[i].name.ToLower().Contains("-wall") && 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].name.ToLower().Contains("xhs_name") &&
obj[i].GetComponent<MeshRenderer>()) obj[i].GetComponent<MeshRenderer>())
{ {
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); if (!obj[i].gameObject.GetComponent<BoxCollider>())
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>();
}
}
if (obj[i].name.ToLower().Contains("zhuzi") ||//柱子
obj[i].name.ToLower().Contains("_zhuzi") ||
obj[i].name.ToLower().Contains("-zhuzi") &&
obj[i].GetComponent<MeshRenderer>())
{
//Debug.Log(obj[i].name);
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad");
if (!obj[i].gameObject.GetComponent<NavMeshModifier>())
{ {
obj[i].gameObject.AddComponent<NavMeshModifier>(); obj[i].gameObject.AddComponent<BoxCollider>();
} }
NavMeshModifier mod = obj[i].gameObject.GetComponent<NavMeshModifier>();
mod.overrideArea = true; if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>())
mod.area = 1;
if (!obj[i].gameObject.GetComponent<MeshCollider>())
{ {
obj[i].gameObject.AddComponent<MeshCollider>(); obj[i].gameObject.AddComponent<CloneGameObjInfo>();
} }
} obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.IndoorFireHydrant;
if (obj[i].name.ToLower().Contains("lt") && if (!obj[i].gameObject.GetComponent<InDoorHydrantMessage>())
obj[i].GetComponent<MeshRenderer>() &&
!obj[i].name.ToLower().Contains("lt_name") &&
!obj[i].name.ToLower().Contains("_ltcs"))//楼梯
{
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad");
if (!obj[i].gameObject.GetComponent<MeshCollider>())
{ {
obj[i].gameObject.AddComponent<MeshCollider>(); obj[i].gameObject.AddComponent<InDoorHydrantMessage>();
} }
if (!obj[i].gameObject.GetComponent<PathFindable>()) if (!obj[i].gameObject.GetComponent<WaterSource>())
{ {
obj[i].gameObject.AddComponent<PathFindable>(); obj[i].gameObject.AddComponent<WaterSource>();
} }
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>()) if (obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjID == 0)
{ {
obj[i].gameObject.AddComponent<CloneGameObjInfo>(); long staticGameObjId = (long)GUID.NewGuid(1, 1);
obj[i].gameObject.GetComponent<CloneGameObjInfo>().SetGameObjID(staticGameObjId);
} }
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) if (!obj[i].gameObject.GetComponent<CloneableEnums>())
{ {
obj[i].gameObject.AddComponent<CloneableEnums>(); obj[i].gameObject.AddComponent<CloneableEnums>();
} }
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>(); if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>())
Transform Template = GameObject.Find("TheCarRoad").transform.Find("ShiNeiFloor");
var CloneableEnums = Template.GetComponent<CloneableEnums>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes;
if (obj[i].parent.GetComponent<FloorMessage>())
{ {
FloorMessage fmg = obj[i].parent.GetComponent<FloorMessage>(); obj[i].gameObject.AddComponent<CloneEnumsHelp>();
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].parent.parent.GetComponent<FloorMessage>()) CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>();
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiNeiXHS;
if (obj[i].GetComponentInParent<FloorMessage>())
{ {
FloorMessage fmg = obj[i].parent.parent.GetComponent<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>().buildNum = fmg.buildNum;
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum;
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum;
} }
} }
if (obj[i].name.ToLower().Contains("ft") && }
obj[i].GetComponent<MeshRenderer>() && }
!obj[i].name.ToLower().Contains("ft_name") && [MenuItem("SceneTool/DiXiaLouDing/CheNengZou")]//地面的楼顶(车能走),常见为地下建筑上的公路
!obj[i].name.ToLower().Contains("bf"))//扶梯 public static void DiXiaLouDingCheNengZou()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered);
{
for (int i = 0; i < obj.Length; i++)
{ {
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); if (obj[i].GetComponent<MeshRenderer>())
if (!obj[i].gameObject.GetComponent<MeshCollider>())
{ {
obj[i].gameObject.AddComponent<MeshCollider>(); 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 = "楼顶";
}
} }
if (!obj[i].gameObject.GetComponent<PathFindable>()) }
}
}
[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.AddComponent<PathFindable>(); 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 = "楼顶";
}
} }
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>()) }
}
}
[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.AddComponent<CloneGameObjInfo>(); 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;
} }
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) }
}
}
[MenuItem("SceneTool/CheckEmpty")]
public static void CheckEmpty()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<CloneableEnums>() && obj[i].gameObject.GetComponent<CloneableEnums>().CloneableTypes.Count > 0)
{ {
obj[i].gameObject.AddComponent<CloneableEnums>(); if (!obj[i].GetComponent<CloneEnumsHelp>())
{
Debug.Log(obj[i].name);
}
} }
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>(); if (obj[i].GetComponent<CloneEnumsHelp>())
Transform Template = GameObject.Find("TheCarRoad").transform.Find("ShiNeiFloor");
var CloneableEnums = Template.GetComponent<CloneableEnums>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes;
if (obj[i].parent.GetComponent<FloorMessage>())
{ {
FloorMessage fmg = obj[i].parent.GetComponent<FloorMessage>(); if (obj[i].GetComponent<CloneEnumsHelp>().cloneOnFloorType < CloneOnFloorType.ShiWaiCar ||
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.StaticGameObject; obj[i].GetComponent<CloneEnumsHelp>().cloneOnFloorType > CloneOnFloorType.GuanQuDiMian)
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; {
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; Debug.Log(obj[i].name);
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; }
} }
if (obj[i].parent.parent.GetComponent<FloorMessage>()) }
}
}
[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>())
{ {
FloorMessage fmg = obj[i].parent.parent.GetComponent<FloorMessage>(); obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad");
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.StaticGameObject; if (!obj[i].gameObject.GetComponent<MeshCollider>())
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum; {
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum; obj[i].gameObject.AddComponent<MeshCollider>();
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum; }
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/SetNavLayerShiWaiCarRoad")]//添加寻路层车(前提是将车的寻路层添加layer CarRoad) [MenuItem("SceneTool/PuTongLouDing/DouBuZou")]//普通的楼顶(都不能走
public static void SetNavLayerShiWaiCarRoad() public static void PuTongLouDingDouBuZou()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered);
for (int i = 0; i < obj.Length; i++) {
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);
{ {
if (obj[i].gameObject.layer == LayerMask.NameToLayer("CarRoad")) for (int i = 0; i < obj.Length; i++)
{ {
if (!obj[i].gameObject.GetComponent<NavMeshModifier>()) if (obj[i].GetComponent<MeshRenderer>())
{ {
//Debug.Log(obj[i].name); obj[i].gameObject.layer = LayerMask.NameToLayer("CarRoad");
if (!obj[i].gameObject.GetComponent<MeshCollider>()) if (!obj[i].gameObject.GetComponent<MeshCollider>())
{ {
obj[i].gameObject.AddComponent<MeshCollider>(); obj[i].gameObject.AddComponent<MeshCollider>();
@ -284,25 +423,26 @@ public class SceneTool
{ {
obj[i].gameObject.AddComponent<CloneableEnums>(); obj[i].gameObject.AddComponent<CloneableEnums>();
} }
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>(); if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>())
Transform Template = GameObject.Find("TheCarRoad").transform; {
var CloneableEnums = Template.GetComponent<CloneableEnums>(); obj[i].gameObject.AddComponent<CloneEnumsHelp>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes; }
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>();
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiWaiCar;
} }
} }
} }
} }
[MenuItem("SceneTool/SetNavLayerShiWaiSoldierRoad")]//添加寻路层车(前提是将车的寻路层添加layer SoliderRoad) [MenuItem("SceneTool/ShiWai/RenNengZou")]//地面(人能走),常见为小路
public static void SetNavLayerShiWaiSoliderRoad() public static void ShiWaiRenNengZou()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered);
for (int i = 0; i < obj.Length; i++)
{ {
if (obj[i].gameObject.layer == LayerMask.NameToLayer("SoldierRoad")) for (int i = 0; i < obj.Length; i++)
{ {
if (!obj[i].gameObject.GetComponent<NavMeshModifier>()) if (obj[i].GetComponent<MeshRenderer>())
{ {
//Debug.Log(obj[i].name); obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad");
if (!obj[i].gameObject.GetComponent<MeshCollider>()) if (!obj[i].gameObject.GetComponent<MeshCollider>())
{ {
obj[i].gameObject.AddComponent<MeshCollider>(); obj[i].gameObject.AddComponent<MeshCollider>();
@ -315,159 +455,182 @@ public class SceneTool
{ {
obj[i].gameObject.AddComponent<CloneableEnums>(); obj[i].gameObject.AddComponent<CloneableEnums>();
} }
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>(); if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>())
Transform Template = GameObject.Find("TheCarRoad").transform.Find("ShiWaiSolider"); {
var CloneableEnums = Template.GetComponent<CloneableEnums>(); obj[i].gameObject.AddComponent<CloneEnumsHelp>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes; }
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>();
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.ShiWaiMan;
} }
} }
} }
} }
[MenuItem("SceneTool/RemoveColider")]//移除碰撞器 [MenuItem("SceneTool/ShiWai/DouBuZou")]//地面(都不能走),常见为花坛
public static void RemoveColider() public static void ShiWaiDouBuZou()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered);
{ {
for (int i = 0; i < obj.Length; i++) for (int i = 0; i < obj.Length; i++)
{ {
if (obj[i].GetComponent<MeshRenderer>()) if (obj[i].GetComponent<MeshRenderer>())
{ {
if (obj[i].GetComponent<MeshCollider>()) obj[i].gameObject.layer = LayerMask.NameToLayer("CarRoad");
if (!obj[i].gameObject.GetComponent<NavMeshModifier>())
{ {
UnityEngine.Object.DestroyImmediate(obj[i].GetComponent<MeshCollider>(), true); obj[i].gameObject.AddComponent<NavMeshModifier>();
} }
NavMeshModifier mod = obj[i].gameObject.GetComponent<NavMeshModifier>();
mod.overrideArea = true;
mod.area = 1;
} }
} }
} }
} }
[MenuItem("SceneTool/AddColider")]//添加碰撞器 [MenuItem("SceneTool/TeShu/YouGuanDing")]//油罐顶
public static void AddColider() public static void YouGuanDing()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered);
{ {
for (int i = 0; i < obj.Length; i++) for (int i = 0; i < obj.Length; i++)
{ {
if (obj[i].GetComponent<MeshRenderer>()) if (obj[i].GetComponent<MeshRenderer>())
{ {
if (!obj[i].GetComponent<MeshCollider>()) if (!obj[i].gameObject.GetComponent<MeshCollider>())
{ {
obj[i].gameObject.AddComponent<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/ChangeMessage")]//添加碰撞器 [MenuItem("SceneTool/TeShu/YouGuanBi")]//油罐壁
public static void ChangeMessage() public static void YouGuanBi()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered);
{ {
for (int i = 0; i < obj.Length; i++) for (int i = 0; i < obj.Length; i++)
{ {
if (obj[i].GetComponent<CloneGameObjInfo>()) if (obj[i].GetComponent<MeshRenderer>())
{ {
if (obj[i].GetComponent<CloneGameObjInfo>().buildNum == "8XGYTC") if (!obj[i].gameObject.GetComponent<MeshCollider>())
{ {
obj[i].GetComponent<CloneGameObjInfo>().buildNum = "2XGYTC"; 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/RemoveAnimator")]//移除碰撞器 [MenuItem("SceneTool/TeShu/WeiXianPinYunShuChe")]//危险运输车
public static void RemoveAnimator() public static void WeiXianPinYunShuChe()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); Transform[] obj = Selection.GetTransforms(SelectionMode.Unfiltered);
{ {
for (int i = 0; i < obj.Length; i++) for (int i = 0; i < obj.Length; i++)
{ {
if (obj[i].GetComponent<Animator>()) if (obj[i].GetComponent<MeshRenderer>())
{ {
if (obj[i].GetComponent<Animator>()) 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>())
{ {
UnityEngine.Object.DestroyImmediate(obj[i].GetComponent<Animator>(), true); obj[i].gameObject.AddComponent<CloneEnumsHelp>();
} }
CloneEnumsHelp cloneEnumsHelp = obj[i].gameObject.GetComponent<CloneEnumsHelp>();
cloneEnumsHelp.cloneOnFloorType = CloneOnFloorType.WeiXianPinYunShuChe;
} }
} }
} }
} }
[MenuItem("SceneTool/SetshineiXHS")]//设置室内消火栓属性 [MenuItem("SceneTool/AddNewScripts")]//优化增加新的脚本
public static void SetSNXHS() public static void AddNewScripts()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
for (int i = 0; i < obj.Length; i++) for (int i = 0; i < obj.Length; i++)
{ {
if (obj[i].name.ToLower().Contains("xhs") && if (obj[i].gameObject.activeInHierarchy && obj[i].gameObject.GetComponent<CloneableEnums>() && obj[i].gameObject.GetComponent<CloneableEnums>().CloneableTypes.Count > 0)
!obj[i].name.ToLower().Contains("xhs_name") &&
!obj[i].name.ToLower().Contains("xhs_wz") &&
!obj[i].name.ToLower().Contains("xhs-wz") &&
obj[i].GetComponent<MeshRenderer>())
{ {
if (!obj[i].gameObject.GetComponent<BoxCollider>()) if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>())
{ {
obj[i].gameObject.AddComponent<BoxCollider>(); obj[i].gameObject.AddComponent<CloneEnumsHelp>();
} }
if (obj[i].GetComponent<MeshRenderer>()) var count = obj[i].GetComponent<CloneableEnums>().CloneableTypes.Count;
if (count == 80)// 室外车能走
{ {
if (obj[i].GetComponent<MeshCollider>()) obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiWaiCar;
{
UnityEngine.Object.DestroyImmediate(obj[i].GetComponent<MeshCollider>(), true);
}
} }
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>()) else if (count == 35 && hasParentByName(obj[i].gameObject, "shinei"))// 室内人能走
{ {
obj[i].gameObject.AddComponent<CloneGameObjInfo>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiNeiMan;
} }
if (obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjID == 0) else if (count == 35 && hasParentByName(obj[i].gameObject, "shiwai"))// 楼顶
{ {
long staticGameObjId = (long)GUID.NewGuid(1, 1); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.LouDing;
obj[i].gameObject.GetComponent<CloneGameObjInfo>().SetGameObjID(staticGameObjId);
} }
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.IndoorFireHydrant; else if (count == 47)// 室外人能走
if (!obj[i].gameObject.GetComponent<InDoorHydrantMessage>())
{ {
obj[i].gameObject.AddComponent<InDoorHydrantMessage>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiWaiMan;
} }
if (!obj[i].gameObject.GetComponent<WaterSource>()) else if (obj[i].gameObject.GetComponent<InDoorHydrantMessage>())// 室内消火栓
{ {
obj[i].gameObject.AddComponent<WaterSource>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiNeiXHS;
} }
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) else if (count == 35 && !obj[i].gameObject.GetComponent<CloneGameObjInfo>())// 室外人
{ {
obj[i].gameObject.AddComponent<CloneableEnums>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiWaiMan;
}
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>();
List<CloneObjType> EnumsList = new List<CloneObjType>() {
CloneObjType.FireHose
};
enumParent.CloneableTypes = EnumsList;
if (obj[i].parent.GetComponent<FloorMessage>())
{
FloorMessage fmg = obj[i].parent.GetComponent<FloorMessage>();
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.IndoorFireHydrant;
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].parent.parent.GetComponent<FloorMessage>()) else if (count == 35 && obj[i].gameObject.GetComponent<CloneGameObjInfo>())// 室内人
{ {
FloorMessage fmg = obj[i].parent.parent.GetComponent<FloorMessage>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiNeiMan;
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.IndoorFireHydrant;
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].parent.parent.parent.GetComponent<FloorMessage>()) else
{ {
FloorMessage fmg = obj[i].parent.parent.parent.GetComponent<FloorMessage>(); Debug.Log("警告,有对象没有绑定上脚本" + obj[i].name);
obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjType = CloneObjType.IndoorFireHydrant;
obj[i].gameObject.GetComponent<CloneGameObjInfo>().buildNum = fmg.buildNum;
obj[i].gameObject.GetComponent<CloneGameObjInfo>().floorNum = fmg.floorNum;
obj[i].gameObject.GetComponent<CloneGameObjInfo>().interlayerNum = fmg.interlayerNum;
} }
} }
} }
} }
private static bool hasParentByName(GameObject gameObject, string parentName)
{
if (gameObject.transform.parent)
{
if (gameObject.transform.parent.name == parentName)
{
return true;
}
else
{
return hasParentByName(gameObject.transform.parent.gameObject, parentName);
}
}
else
{
return false;
}
}
} }

BIN
Assets/StreamingAssets/AssetBundles/GuoJiJinRongZhongXinAB/GuoJiJinRongZhongXinAB

Binary file not shown.

2
Assets/StreamingAssets/AssetBundles/GuoJiJinRongZhongXinAB/GuoJiJinRongZhongXinAB.manifest

@ -1,5 +1,5 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 3002523065 CRC: 4082788301
AssetBundleManifest: AssetBundleManifest:
AssetBundleInfos: AssetBundleInfos:
Info_0: Info_0:

BIN
Assets/StreamingAssets/AssetBundles/GuoJiJinRongZhongXinAB/buildingscene

Binary file not shown.

8
Assets/StreamingAssets/AssetBundles/GuoJiJinRongZhongXinAB/buildingscene.manifest

@ -1,12 +1,12 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 3786637471 CRC: 556459544
Hashes: Hashes:
AssetFileHash: AssetFileHash:
serializedVersion: 2 serializedVersion: 2
Hash: 2a99907c5d72a1c5d2a822bb2b6b180c Hash: 02e255ed03fbe6898faecd271992910b
TypeTreeHash: TypeTreeHash:
serializedVersion: 2 serializedVersion: 2
Hash: 8913e89749549fdac0f359a468e5750a Hash: 5f07d8356a77e6610c7fbdc243e8ac27
HashAppended: 0 HashAppended: 0
ClassTypes: ClassTypes:
- Class: 1 - Class: 1
@ -53,6 +53,8 @@ ClassTypes:
Script: {fileID: 11500000, guid: 7a5ac11cc976e418e8d13136b07e1f52, type: 3} Script: {fileID: 11500000, guid: 7a5ac11cc976e418e8d13136b07e1f52, type: 3}
- Class: 114 - Class: 114
Script: {fileID: 11500000, guid: e01c388cf4175aa49b4973deb437d754, type: 3} Script: {fileID: 11500000, guid: e01c388cf4175aa49b4973deb437d754, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: b8b046bc0ab99e94cb2c70fd441b8fc7, type: 3}
- Class: 114 - Class: 114
Script: {fileID: 11500000, guid: b133d14efd54f9841a1659ef37479be7, type: 3} Script: {fileID: 11500000, guid: b133d14efd54f9841a1659ef37479be7, type: 3}
- Class: 114 - Class: 114

Loading…
Cancel
Save