diff --git a/Assets/IsoTools/Editor/IsoObjectEditor.cs b/Assets/IsoTools/Editor/IsoObjectEditor.cs index d2c6af0..08278a5 100644 --- a/Assets/IsoTools/Editor/IsoObjectEditor.cs +++ b/Assets/IsoTools/Editor/IsoObjectEditor.cs @@ -1,6 +1,7 @@ using UnityEngine; using UnityEditor; using System.Linq; +using System.Reflection; using System.Collections.Generic; namespace IsoTools { @@ -29,6 +30,19 @@ namespace IsoTools { } } + void DirtyTargetPosition() { + var position_prop = serializedObject.FindProperty("_position"); + if ( position_prop != null ) { + var last_value = position_prop.vector3Value; + position_prop.vector3Value = last_value + Vector3.one; + PrefabUtility.RecordPrefabInstancePropertyModifications(target); + serializedObject.ApplyModifiedProperties(); + position_prop.vector3Value = last_value; + PrefabUtility.RecordPrefabInstancePropertyModifications(target); + serializedObject.ApplyModifiedProperties(); + } + } + bool isAnyAlignment { get { return _positions.Keys.Any(p => p.isAlignment); } } @@ -154,10 +168,33 @@ namespace IsoTools { public override void OnInspectorGUI() { DrawDefaultInspector(); + GrabPositions(); + DirtyTargetPosition(); + + /* + serializedObject.Update(); + + var position_prop = serializedObject.FindProperty("_position"); + EditorGUILayout.PropertyField(position_prop); + + var size_prop = serializedObject.FindProperty("_size"); + EditorGUILayout.PropertyField(size_prop); + + var alignment_prop = serializedObject.FindProperty("_isAlignment"); + EditorGUILayout.PropertyField(alignment_prop); + + var show_bounds_prop = serializedObject.FindProperty("_isShowBounds"); + EditorGUILayout.PropertyField(show_bounds_prop); + + var mode_prop = serializedObject.FindProperty("_mode"); + EditorGUILayout.PropertyField(mode_prop); + + serializedObject.ApplyModifiedProperties(); + if ( GUILayout.Button("Alignment selection") ) { AlignmentSelection(); - } + }*/ } } } // namespace IsoTools \ No newline at end of file diff --git a/Assets/IsoTools/Scripts/IsoObject.cs b/Assets/IsoTools/Scripts/IsoObject.cs index a2dae38..8c4caf6 100644 --- a/Assets/IsoTools/Scripts/IsoObject.cs +++ b/Assets/IsoTools/Scripts/IsoObject.cs @@ -192,10 +192,12 @@ namespace IsoTools { public bool isAlignment { get { return _isAlignment; } + set { _isAlignment = value; } } public bool isShowBounds { get { return _isShowBounds; } + set { _isShowBounds = value; } } #endif diff --git a/UnityIso-csharp.sln b/UnityIso-csharp.sln index 64b1521..62b1a2b 100644 --- a/UnityIso-csharp.sln +++ b/UnityIso-csharp.sln @@ -23,7 +23,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution + GlobalSection(MonoDevelopProperties) = preSolution StartupItem = Assembly-CSharp.csproj Policies = $0 $0.TextStylePolicy = $1 diff --git a/UnityIso.sln b/UnityIso.sln index 1b74be0..d0e694b 100644 --- a/UnityIso.sln +++ b/UnityIso.sln @@ -23,7 +23,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution + GlobalSection(MonoDevelopProperties) = preSolution StartupItem = Assembly-CSharp.csproj Policies = $0 $0.TextStylePolicy = $1 diff --git a/UnityIso.userprefs b/UnityIso.userprefs index 1fa408b..1b9d6e3 100644 --- a/UnityIso.userprefs +++ b/UnityIso.userprefs @@ -1,14 +1,16 @@  - - + + - - - + + + - + + + \ No newline at end of file