fix detached inspector

This commit is contained in:
2016-12-19 03:29:05 +07:00
parent 985274a710
commit cc08f1e2c7
5 changed files with 51 additions and 44 deletions

View File

@@ -74,7 +74,6 @@ MonoBehaviour:
_position: {x: -1, y: -2, z: 0}
_mode: 0
_cacheRenderers: 1
_isShowBounds: 0
--- !u!212 &21210794
SpriteRenderer:
m_ObjectHideFlags: 1

View File

@@ -190,7 +190,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.z
value: 1.8000002
value: 1.9000002
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalRotation.x
@@ -252,7 +252,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 2.0000002
value: 1.5000001
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -334,7 +334,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 1.2
value: 1.6000001
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -416,7 +416,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 1.4000001
value: 1.3000001
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -498,7 +498,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 1.8000002
value: 1.4000001
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -662,7 +662,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: d564723f17e5b453ab3cf2ba1886790d, type: 2}
propertyPath: m_LocalPosition.z
value: 1.4000001
value: 1
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: d564723f17e5b453ab3cf2ba1886790d, type: 2}
propertyPath: m_LocalRotation.x
@@ -805,7 +805,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 1.6000001
value: 1.8000002
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -887,7 +887,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 1.3000001
value: 1.2
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -1090,11 +1090,11 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.y
value: -1.8623698
value: -1.8623695
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.z
value: 2.3
value: 2.1000001
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalRotation.x
@@ -1122,7 +1122,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 11482466, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: _position.y
value: -0.6797
value: -0.67969996
objectReference: {fileID: 0}
- target: {fileID: 11482466, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: _position.z
@@ -1156,7 +1156,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 452998, guid: a8efaa982fcfd42a495b3649618fac91, type: 2}
propertyPath: m_LocalPosition.z
value: 1.2
value: 1.3000001
objectReference: {fileID: 0}
- target: {fileID: 452998, guid: a8efaa982fcfd42a495b3649618fac91, type: 2}
propertyPath: m_LocalRotation.x
@@ -1296,7 +1296,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.z
value: 2.0000002
value: 1.4000001
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalRotation.x
@@ -1429,7 +1429,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: d564723f17e5b453ab3cf2ba1886790d, type: 2}
propertyPath: m_LocalPosition.z
value: 1
value: 1.5000001
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: d564723f17e5b453ab3cf2ba1886790d, type: 2}
propertyPath: m_LocalRotation.x
@@ -1485,11 +1485,11 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.y
value: -1.8623698
value: -1.8623695
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.z
value: 2.1000001
value: 2.2
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalRotation.x
@@ -1517,7 +1517,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 11482466, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: _position.y
value: -0.6797
value: -0.67969996
objectReference: {fileID: 0}
- target: {fileID: 11482466, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: _position.z
@@ -1719,7 +1719,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: dd0c4026a6d694c3dade62fd46e77651, type: 2}
propertyPath: m_LocalPosition.z
value: 2.2
value: 2.0000002
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: dd0c4026a6d694c3dade62fd46e77651, type: 2}
propertyPath: m_LocalRotation.x
@@ -1822,7 +1822,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 2.3
value: 2.3999999
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -1904,7 +1904,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 1.9000002
value: 2.0000002
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -1986,7 +1986,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: dd0c4026a6d694c3dade62fd46e77651, type: 2}
propertyPath: m_LocalPosition.z
value: 1.5000001
value: 1.6000001
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: dd0c4026a6d694c3dade62fd46e77651, type: 2}
propertyPath: m_LocalRotation.x
@@ -2050,7 +2050,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: d564723f17e5b453ab3cf2ba1886790d, type: 2}
propertyPath: m_LocalPosition.z
value: 1.1
value: 1.2
objectReference: {fileID: 0}
- target: {fileID: 439388, guid: d564723f17e5b453ab3cf2ba1886790d, type: 2}
propertyPath: m_LocalRotation.x
@@ -2259,6 +2259,10 @@ Prefab:
propertyPath: m_Name
value: TileA (18)
objectReference: {fileID: 0}
- target: {fileID: 180122, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
m_IsPrefabParent: 0
@@ -2283,7 +2287,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 1.5000001
value: 1.7000002
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -2365,7 +2369,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 452998, guid: ea8ddc148e2f840a193a04b875d3b436, type: 2}
propertyPath: m_LocalPosition.z
value: 1.9000002
value: 1.7000002
objectReference: {fileID: 0}
- target: {fileID: 452998, guid: ea8ddc148e2f840a193a04b875d3b436, type: 2}
propertyPath: m_LocalRotation.x
@@ -2419,11 +2423,11 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.y
value: -1.8623698
value: -1.8623695
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.z
value: 1.6000001
value: 2.3
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalRotation.x
@@ -2451,7 +2455,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 11482466, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: _position.y
value: -0.6797
value: -0.67969996
objectReference: {fileID: 0}
- target: {fileID: 11482466, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: _position.z
@@ -2567,7 +2571,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 452998, guid: c0f50e2db7b084147b02788fcd9b9e0d, type: 2}
propertyPath: m_LocalPosition.z
value: 1.7000002
value: 1.8000002
objectReference: {fileID: 0}
- target: {fileID: 452998, guid: c0f50e2db7b084147b02788fcd9b9e0d, type: 2}
propertyPath: m_LocalRotation.x
@@ -2621,11 +2625,11 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.y
value: -1.8703203
value: -1.8703198
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalPosition.z
value: 1.3000001
value: 1.1
objectReference: {fileID: 0}
- target: {fileID: 467434, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: m_LocalRotation.x
@@ -2653,7 +2657,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 11482466, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: _position.y
value: -1.6797
value: -1.6796999
objectReference: {fileID: 0}
- target: {fileID: 11482466, guid: 724acce3e28b04f4ab4302d47fe5429d, type: 2}
propertyPath: _position.z
@@ -2687,7 +2691,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 2.3999999
value: 2.3
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x
@@ -2769,7 +2773,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalPosition.z
value: 1.7000002
value: 1.9000002
objectReference: {fileID: 0}
- target: {fileID: 417424, guid: 185575a05f87743c0b2ddb83dd39c6cd, type: 2}
propertyPath: m_LocalRotation.x

View File

@@ -46,7 +46,7 @@ namespace IsoTools.Internal {
}
}
public static void DrawSelfWorldProperty(IsoWorld[] iso_worlds, string type_name) {
public static void DrawSelfWorldProperty(IsoWorld[] iso_worlds) {
if ( iso_worlds.Length > 0 ) {
var mixed_world = iso_worlds.GroupBy(p => p).Count() > 1;
EditorGUILayout.Space();
@@ -59,13 +59,6 @@ namespace IsoTools.Internal {
true);
});
});
} else {
EditorGUILayout.HelpBox(
string.Format(
"Detached {0}\nNeed to be a child of IsoWorld",
type_name),
MessageType.Warning,
true);
}
}

View File

@@ -43,7 +43,18 @@ namespace IsoTools.Internal {
void DrawCustomInspector() {
var iso_worlds = _isoObjects.Keys.ToArray();
IsoEditorUtils.DrawWorldProperties(iso_worlds);
IsoEditorUtils.DrawSelfWorldProperty(iso_worlds, "IsoObject");
IsoEditorUtils.DrawSelfWorldProperty(iso_worlds);
DrawDetachedInspector();
}
void DrawDetachedInspector() {
var single_iso_object = targets.Length == 1 ? target as IsoObject : null;
if ( single_iso_object && single_iso_object.IsActive() && !single_iso_object.isoWorld ) {
EditorGUILayout.HelpBox(
"Detached IsoObject\nNeed to be a child of IsoWorld",
MessageType.Warning,
true);
}
}
// ---------------------------------------------------------------------

View File

@@ -46,7 +46,7 @@ namespace IsoTools.Internal {
void DrawCustomInspector() {
var iso_worlds = _isoParents.Keys.ToArray();
IsoEditorUtils.DrawWorldProperties(iso_worlds);
IsoEditorUtils.DrawSelfWorldProperty(iso_worlds, "IsoParent");
IsoEditorUtils.DrawSelfWorldProperty(iso_worlds);
}
// ---------------------------------------------------------------------