|
|
|
@ -56,10 +56,10 @@ public class DeleteMissingScripts : EditorWindow
|
|
|
|
|
{ |
|
|
|
|
types.Add(CloneObjType.LiveBuildCar); |
|
|
|
|
} |
|
|
|
|
if (!types.Contains(CloneObjType.EmergencyVehicle)) |
|
|
|
|
{ |
|
|
|
|
types.Add(CloneObjType.EmergencyVehicle); |
|
|
|
|
} |
|
|
|
|
//if (!types.Contains(CloneObjType.EmergencyVehicle)) |
|
|
|
|
//{ |
|
|
|
|
// types.Add(CloneObjType.EmergencyVehicle); |
|
|
|
|
//} |
|
|
|
|
if (!types.Contains(CloneObjType.Cruiser)) |
|
|
|
|
{ |
|
|
|
|
types.Add(CloneObjType.Cruiser); |
|
|
|
@ -68,4 +68,107 @@ public class DeleteMissingScripts : EditorWindow
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[MenuItem("Tools/添加克隆类型帮助类(非油罐类型)")] |
|
|
|
|
public static void AddCloneTypesHelper() |
|
|
|
|
{ |
|
|
|
|
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); |
|
|
|
|
for (int i = 0; i < obj.Length; i++) |
|
|
|
|
{ |
|
|
|
|
if (obj[i].GetComponent<CloneableEnums>()) |
|
|
|
|
{ |
|
|
|
|
if (obj[i].gameObject.layer == LayerMask.NameToLayer("SoldierRoad")) |
|
|
|
|
{ |
|
|
|
|
if (FindShiNei(obj[i])) |
|
|
|
|
{ |
|
|
|
|
Debug.Log("室内人能走:" + obj[i].name); |
|
|
|
|
if (!obj[i].GetComponent<CloneEnumsHelp>()) |
|
|
|
|
{ |
|
|
|
|
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
|
|
|
|
} |
|
|
|
|
obj[i].GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiNeiMan; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Debug.Log("室外人能走:" + obj[i].name); |
|
|
|
|
if (!obj[i].GetComponent<CloneEnumsHelp>()) |
|
|
|
|
{ |
|
|
|
|
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
|
|
|
|
} |
|
|
|
|
obj[i].GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiWaiMan; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (obj[i].gameObject.layer == LayerMask.NameToLayer("CarRoad")) |
|
|
|
|
{ |
|
|
|
|
if (FindShiNei(obj[i])) |
|
|
|
|
{ |
|
|
|
|
Debug.Log("室内车能走:" + obj[i].name); |
|
|
|
|
if (!obj[i].GetComponent<CloneEnumsHelp>()) |
|
|
|
|
{ |
|
|
|
|
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
|
|
|
|
} |
|
|
|
|
obj[i].GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiWaiCar; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
Debug.Log("室外车能走:" + obj[i].name); |
|
|
|
|
if (!obj[i].GetComponent<CloneEnumsHelp>()) |
|
|
|
|
{ |
|
|
|
|
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
|
|
|
|
} |
|
|
|
|
obj[i].GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiWaiCar; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (obj[i].GetComponent<CloneGameObjInfo>()) |
|
|
|
|
{ |
|
|
|
|
if (obj[i].GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.IndoorFireHydrant) |
|
|
|
|
{ |
|
|
|
|
Debug.Log("室内消火栓:" + obj[i].name); |
|
|
|
|
if (!obj[i].GetComponent<CloneEnumsHelp>()) |
|
|
|
|
{ |
|
|
|
|
obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
|
|
|
|
} |
|
|
|
|
obj[i].GetComponent<CloneEnumsHelp>().cloneOnFloorType = CloneOnFloorType.ShiNeiXHS; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[MenuItem("Tools/检查是否有没有添加的克隆类型")] |
|
|
|
|
public static void CheckEmptyCloneTypes() |
|
|
|
|
{ |
|
|
|
|
Transform[] obj = Selection.GetTransforms(SelectionMode.Deep); |
|
|
|
|
for (int i = 0; i < obj.Length; i++) |
|
|
|
|
{ |
|
|
|
|
if (obj[i].GetComponent<CloneableEnums>()) |
|
|
|
|
{ |
|
|
|
|
if (!obj[i].GetComponent<CloneEnumsHelp>()) |
|
|
|
|
{ |
|
|
|
|
Debug.Log(obj[i].name); |
|
|
|
|
// obj[i].gameObject.AddComponent<CloneEnumsHelp>(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private static bool FindShiNei(Transform p) |
|
|
|
|
{ |
|
|
|
|
if (p.name.ToLower() == "shinei") |
|
|
|
|
{ |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (p.parent != null) |
|
|
|
|
{ |
|
|
|
|
return FindShiNei(p.parent); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|