Browse Source

重构2.1,导出AB包

develop2.1
杨栋梁 1 year ago
parent
commit
217a2f925f
  1. 30475
      Assets/51HongJinMongFuChanPinPiFaShiChang/HongJinNongFuChanPin.prefab
  2. 661
      Assets/CloneTypesTemplate/Editor/SceneTool.cs
  3. 2
      Assets/MscPublic2
  4. 8
      Assets/MscPublic2.meta
  5. BIN
      Assets/StreamingAssets/AssetBundles/HongJinNongFuChanPinAB/HongJinNongFuChanPinAB
  6. 2
      Assets/StreamingAssets/AssetBundles/HongJinNongFuChanPinAB/HongJinNongFuChanPinAB.manifest
  7. BIN
      Assets/StreamingAssets/AssetBundles/HongJinNongFuChanPinAB/buildingscene
  8. 8
      Assets/StreamingAssets/AssetBundles/HongJinNongFuChanPinAB/buildingscene.manifest
  9. 12
      ProjectSettings/EditorBuildSettings.asset

30475
Assets/51HongJinMongFuChanPinPiFaShiChang/HongJinNongFuChanPin.prefab

File diff suppressed because it is too large Load Diff

661
Assets/CloneTypesTemplate/Editor/SceneTool.cs

@ -2,671 +2,96 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEditor; using UnityEditor;
using UnityEngine.AI;
using System.IO;
using System.Text;
using System;
public class SceneTool public class SceneTool : Editor
{ {
[MenuItem("SceneTool/SetFloorMessage")]//添加FloorMessage脚本绑定楼层信息 [MenuItem("SceneTool/AddNewScripts")]//优化增加新的脚本
public static void SetFloorMessage() public static void AddNewScripts()
{
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")
|| parent.GetChild(i).name.ToLower().Contains("-floor")
)
{
if (parent.GetChild(i).GetComponent<MeshRenderer>())
return parent.GetChild(i);
}
}
return parent;
}
[MenuItem("SceneTool/SetNavLayerShiNeiFloor")]//添加寻路层(选中shinei对象设置,注:扶梯情况特殊没有包含)
public static void SetNavLayerShiNeiFloor()
{ {
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].gameObject.activeInHierarchy && obj[i].gameObject.GetComponent<CloneableEnums>())
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].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>();
}
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.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>())
{
FloorMessage fmg = obj[i].parent.parent.GetComponent<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("_wall") ||
obj[i].name.ToLower().Contains("wall") ||
obj[i].name.ToLower().Contains("-wall") &&
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;
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>();
}
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("lt") &&
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>();
}
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.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>())
{
FloorMessage fmg = obj[i].parent.parent.GetComponent<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("ft") &&
obj[i].GetComponent<MeshRenderer>() &&
!obj[i].name.ToLower().Contains("ft_name") &&
!obj[i].name.ToLower().Contains("bf"))//扶梯
{ {
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); if (!obj[i].gameObject.GetComponent<CloneEnumsHelp>())
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>(); obj[i].gameObject.AddComponent<CloneEnumsHelp>();
} }
if (!obj[i].gameObject.GetComponent<CloneableEnums>()) var count = obj[i].GetComponent<CloneableEnums>().CloneableTypes.Count;
if (count == 81 || count == 80 || count == 82)// 室外车能走
{ {
obj[i].gameObject.AddComponent<CloneableEnums>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiWaiCar;
} }
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>(); else if (count == 35 && hasParentByName(obj[i].gameObject, "shinei"))// 室内人能走
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.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiNeiMan;
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>()) else if (count == 35 && hasParentByName(obj[i].gameObject, "shiwai"))// 楼顶
{ {
FloorMessage fmg = obj[i].parent.parent.GetComponent<FloorMessage>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.LouDing;
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;
} }
} else if (count == 46 || count == 36 || count == 47)// 室外人能走
}
}
[MenuItem("SceneTool/SetNavLayerShiWaiCarRoad")]//添加寻路层车(前提是将车的寻路层添加layer CarRoad)
public static void SetNavLayerShiWaiCarRoad()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].gameObject.layer == LayerMask.NameToLayer("CarRoad"))
{
if (!obj[i].gameObject.GetComponent<NavMeshModifier>())
{ {
//Debug.Log(obj[i].name); if (hasParentByName(obj[i].gameObject, "shinei"))
if (!obj[i].gameObject.GetComponent<MeshCollider>())
{ {
obj[i].gameObject.AddComponent<MeshCollider>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiNeiMan;
} }
if (!obj[i].gameObject.GetComponent<PathFindable>()) else
{ {
obj[i].gameObject.AddComponent<PathFindable>(); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiWaiMan;
} }
if (!obj[i].gameObject.GetComponent<CloneableEnums>())
{
obj[i].gameObject.AddComponent<CloneableEnums>();
}
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>();
Transform Template = GameObject.Find("TheCarRoad").transform;
var CloneableEnums = Template.GetComponent<CloneableEnums>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes;
} }
} else if (obj[i].gameObject.GetComponent<InDoorHydrantMessage>())// 室内消火栓
}
}
[MenuItem("SceneTool/SetNavLayerShiWaiSoldierRoad")]//添加寻路层车(前提是将车的寻路层添加layer SoliderRoad)
public static void SetNavLayerShiWaiSoliderRoad()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].gameObject.layer == LayerMask.NameToLayer("SoldierRoad"))
{
if (!obj[i].gameObject.GetComponent<NavMeshModifier>())
{
//Debug.Log(obj[i].name);
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>();
}
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>();
Transform Template = GameObject.Find("TheCarRoad").transform.Find("ShiWaiSolider");
var CloneableEnums = Template.GetComponent<CloneableEnums>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes;
}
}
}
}
[MenuItem("SceneTool/RemoveColider")]//移除碰撞器
public static void RemoveColider()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{
if (obj[i].GetComponent<MeshCollider>())
{
UnityEngine.Object.DestroyImmediate(obj[i].GetComponent<MeshCollider>(), true);
}
}
}
}
}
[MenuItem("SceneTool/AddColider")]//添加碰撞器
public static void AddColider()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{
if (!obj[i].GetComponent<MeshCollider>())
{
obj[i].gameObject.AddComponent<MeshCollider>();
}
}
}
}
}
[MenuItem("SceneTool/SetGuanDing")]
public static void SetGuanDing()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{ {
if (!obj[i].gameObject.GetComponent<MeshCollider>()) obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiNeiXHS;
{
obj[i].gameObject.AddComponent<MeshCollider>();
}
if (!obj[i].gameObject.GetComponent<CloneableEnums>())
{
obj[i].gameObject.AddComponent<CloneableEnums>();
}
if (!obj[i].gameObject.GetComponent<FireOnTank>())
{
obj[i].gameObject.AddComponent<FireOnTank>();
}
if (!obj[i].gameObject.GetComponent<PathFindable>())
{
obj[i].gameObject.AddComponent<PathFindable>();
}
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad");
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>();
Transform Template = GameObject.Find("Guanding").transform;
var CloneableEnums = Template.GetComponent<CloneableEnums>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes;
} }
} else if (count == 3)//罐顶
}
}
[MenuItem("SceneTool/SetGuanBi")]
public static void SetGuanBi()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{ {
if (!obj[i].gameObject.GetComponent<MeshCollider>()) obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.YouGuanDing;
{
obj[i].gameObject.AddComponent<MeshCollider>();
}
if (!obj[i].gameObject.GetComponent<CloneableEnums>())
{
obj[i].gameObject.AddComponent<CloneableEnums>();
}
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;
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>();
Transform Template = GameObject.Find("GuanBi").transform;
var CloneableEnums = Template.GetComponent<CloneableEnums>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes;
} }
} else if (count == 1 && hasParentByName(obj[i].gameObject, "GuanQu"))//罐壁
}
}
[MenuItem("SceneTool/SetGuanDi")]
public static void SetGuanDi()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{ {
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.YouGuanBi;
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>();
}
} }
} else if (count == 27)//罐区地面
}
}
[MenuItem("SceneTool/SetTeamTargetItemName")]
public static void SetTeamTargetItemName()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<TeamTargetItem>())
{ {
obj[i].gameObject.GetComponent<TeamTargetItem>().TankName = obj[i].gameObject.name; obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.GuanQuDiMian;
} }
} else if (count == 1 && hasParentByName(obj[i].gameObject, "syk"))//试压口
}
}
[MenuItem("SceneTool/SetGuanLouTi")]
public static void SetGuanLouTi()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{ {
obj[i].gameObject.layer = LayerMask.NameToLayer("SoldierRoad"); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiYaKou;
if (!obj[i].gameObject.GetComponent<CloneableEnums>())
{
obj[i].gameObject.AddComponent<CloneableEnums>();
}
if (!obj[i].gameObject.GetComponent<MeshCollider>())
{
obj[i].gameObject.AddComponent<MeshCollider>();
}
if (!obj[i].gameObject.GetComponent<PathFindable>())
{
obj[i].gameObject.AddComponent<PathFindable>();
}
CloneableEnums enumParent = obj[i].gameObject.GetComponent<CloneableEnums>();
Transform Template = GameObject.Find("GuanLouTi").transform;
var CloneableEnums = Template.GetComponent<CloneableEnums>();
enumParent.CloneableTypes = CloneableEnums.CloneableTypes;
} }
} else if (count == 1 && hasParentByName(obj[i].gameObject, "CubeParent"))//半固定接口
}
}
[MenuItem("SceneTool/SetDouBuZou")]
public static void SetDouBuZou()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{ {
obj[i].gameObject.layer = LayerMask.NameToLayer("CarRoad"); obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.SemiFixedInterface;
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>();
}
} }
} else if (count == 1 && hasParentByName(obj[i].gameObject, "Normal"))//半固定分水器
}
}
[MenuItem("SceneTool/ChangDingName")]
public static void ChangDingName()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{ {
if (obj[i].gameObject.GetComponent<FireOnTank>()) obj[i].gameObject.GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.SemiFixedWaterSegregator;
{
obj[i].gameObject.name = "GuanDing";
}
} }
} else
}
}
[MenuItem("SceneTool/ChangBiName")]
public static void ChangBiName()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{
if (obj[i].GetComponent<MeshRenderer>())
{ {
if (obj[i].gameObject.GetComponent<CloneableEnums>() && obj[i].gameObject.GetComponent<CloneableEnums>().CloneableTypes.Count == 1) Debug.Log("警告,有对象没有绑定上脚本" + obj[i].name);
{
if (obj[i].gameObject.GetComponent<CloneableEnums>().CloneableTypes[0] == CloneObjType.FireBreakThough)
obj[i].gameObject.name = "GuanBi";
}
} }
} }
} }
} }
[MenuItem("SceneTool/ChangeMessage")]//添加碰撞器 private static bool hasParentByName(GameObject gameObject, string parentName)
public static void ChangeMessage()
{ {
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); if (gameObject.transform.parent)
{ {
for (int i = 0; i < obj.Length; i++) if (gameObject.transform.parent.name == parentName)
{ {
if (obj[i].GetComponent<CloneGameObjInfo>()) return true;
{
if (obj[i].GetComponent<CloneGameObjInfo>().buildNum == "8XGYTC")
{
obj[i].GetComponent<CloneGameObjInfo>().buildNum = "2XGYTC";
}
}
} }
} else
}
[MenuItem("SceneTool/RemoveAnimator")]//移除碰撞器
public static void RemoveAnimator()
{
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep);
{
for (int i = 0; i < obj.Length; i++)
{ {
if (obj[i].GetComponent<Animator>()) return hasParentByName(gameObject.transform.parent.gameObject, parentName);
{
if (obj[i].GetComponent<Animator>())
{
UnityEngine.Object.DestroyImmediate(obj[i].GetComponent<Animator>(), true);
}
}
} }
} }
} else
[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") && return false;
!obj[i].name.ToLower().Contains("xhs_name") &&
!obj[i].name.ToLower().Contains("xhs_wz") &&
!obj[i].name.ToLower().Contains("xhs-wz") &&
!obj[i].name.ToLower().Contains("xhs-zi") &&
!obj[i].name.ToLower().Contains("xhs_zi") &&
!obj[i].name.ToLower().Contains("xhstm") &&
obj[i].GetComponent<MeshRenderer>())
{
if (!obj[i].gameObject.GetComponent<BoxCollider>())
{
obj[i].gameObject.AddComponent<BoxCollider>();
}
if (obj[i].GetComponent<MeshRenderer>())
{
if (obj[i].GetComponent<MeshCollider>())
{
UnityEngine.Object.DestroyImmediate(obj[i].GetComponent<MeshCollider>(), true);
}
}
if (!obj[i].gameObject.GetComponent<CloneGameObjInfo>())
{
obj[i].gameObject.AddComponent<CloneGameObjInfo>();
}
if (obj[i].gameObject.GetComponent<CloneGameObjInfo>().gameObjID == 0)
{
long staticGameObjId = (long)GUID.NewGuid(1, 1);
obj[i].gameObject.GetComponent<CloneGameObjInfo>().SetGameObjID(staticGameObjId);
}
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<CloneableEnums>())
{
obj[i].gameObject.AddComponent<CloneableEnums>();
}
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>())
{
FloorMessage fmg = obj[i].parent.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.parent.GetComponent<FloorMessage>())
{
FloorMessage fmg = obj[i].parent.parent.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;
}
}
} }
} }
} }

2
Assets/MscPublic2

@ -1 +1 @@
Subproject commit 8cf275dfd2efd7d3950b74077ad21ef5265fffc8 Subproject commit f1d8242dfae536deadfeec9a2b86ea2d2a5e5725

8
Assets/MscPublic2.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c2acc0c1509bfe848a3b0448fb2b2315
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/StreamingAssets/AssetBundles/HongJinNongFuChanPinAB/HongJinNongFuChanPinAB

Binary file not shown.

2
Assets/StreamingAssets/AssetBundles/HongJinNongFuChanPinAB/HongJinNongFuChanPinAB.manifest

@ -1,5 +1,5 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 2143801280 CRC: 3054588021
AssetBundleManifest: AssetBundleManifest:
AssetBundleInfos: AssetBundleInfos:
Info_0: Info_0:

BIN
Assets/StreamingAssets/AssetBundles/HongJinNongFuChanPinAB/buildingscene

Binary file not shown.

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

@ -1,12 +1,12 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 1488284680 CRC: 887062361
Hashes: Hashes:
AssetFileHash: AssetFileHash:
serializedVersion: 2 serializedVersion: 2
Hash: 88a2b35c856881dd13ec43242194a3c6 Hash: e4a579d77db6db9b2ae6579b9af25f83
TypeTreeHash: TypeTreeHash:
serializedVersion: 2 serializedVersion: 2
Hash: ea4e8cba38025d862cc7e81ba3c00ef3 Hash: 70fef1eac82899e616ebd3edb7c56b25
HashAppended: 0 HashAppended: 0
ClassTypes: ClassTypes:
- Class: 1 - Class: 1
@ -55,6 +55,8 @@ ClassTypes:
Script: {fileID: 11500000, guid: b133d14efd54f9841a1659ef37479be7, type: 3} Script: {fileID: 11500000, guid: b133d14efd54f9841a1659ef37479be7, type: 3}
- Class: 114 - Class: 114
Script: {fileID: 11500000, guid: 49a6ba4f46ec21b4c8a83dce618eda97, type: 3} Script: {fileID: 11500000, guid: 49a6ba4f46ec21b4c8a83dce618eda97, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: b8b046bc0ab99e94cb2c70fd441b8fc7, type: 3}
- Class: 115 - Class: 115
Script: {instanceID: 0} Script: {instanceID: 0}
- Class: 123 - Class: 123

12
ProjectSettings/EditorBuildSettings.asset

@ -6,21 +6,21 @@ EditorBuildSettings:
serializedVersion: 2 serializedVersion: 2
m_Scenes: m_Scenes:
- enabled: 1 - enabled: 1
path: Assets/MscPublic/Assets/Scenes/StartScene.unity path: Assets/MscPublic2/Assets/Scenes/StartScene.unity
guid: 37300393dbb336140841b54477ad48e2 guid: 37300393dbb336140841b54477ad48e2
- enabled: 1 - enabled: 1
path: Assets/MscPublic/Assets/Scenes/Login.unity path: Assets/MscPublic2/Assets/Scenes/Login.unity
guid: 951c5d21caa1164428c832c3e9a9de44 guid: 951c5d21caa1164428c832c3e9a9de44
- enabled: 1 - enabled: 1
path: Assets/MscPublic/Assets/Scenes/Administrator.unity path: Assets/MscPublic2/Assets/Scenes/Administrator.unity
guid: 98a59c6747c23314a8c2be3943b8f882 guid: 98a59c6747c23314a8c2be3943b8f882
- enabled: 1 - enabled: 1
path: Assets/MscPublic/Assets/Scenes/Examiner.unity path: Assets/MscPublic2/Assets/Scenes/Examiner.unity
guid: 9f5b02a7be06a3845a20da86c9f9f2ec guid: 9f5b02a7be06a3845a20da86c9f9f2ec
- enabled: 1 - enabled: 1
path: Assets/MscPublic/Assets/Scenes/Examinee.unity path: Assets/MscPublic2/Assets/Scenes/Examinee.unity
guid: cbd9062f507eac74780a1da70b6a3381 guid: cbd9062f507eac74780a1da70b6a3381
- enabled: 1 - enabled: 1
path: Assets/MscPublic/Assets/Scenes/Main.unity path: Assets/MscPublic2/Assets/Scenes/Main.unity
guid: 91cc03ee5fa98f6429a0d238c4602d50 guid: 91cc03ee5fa98f6429a0d238c4602d50
m_configObjects: {} m_configObjects: {}

Loading…
Cancel
Save