mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-14 17:09:31 +07:00
always dirty property test
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<Properties>
|
||||
<MonoDevelop.Ide.Workspace />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Scripts/IsoWorld.cs">
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Editor/IsoObjectEditor.cs">
|
||||
<Files>
|
||||
<File FileName="Assets/IsoTools/Scripts/IsoCollision.cs" Line="20" Column="24" />
|
||||
<File FileName="Assets/IsoTools/Scripts/IsoWorld.cs" Line="535" Column="39" />
|
||||
<File FileName="Assets/IsoTools/Scripts/IsoObject.cs" Line="234" Column="17" />
|
||||
<File FileName="Assets/IsoTools/Scripts/IsoObject.cs" Line="1" Column="1" />
|
||||
<File FileName="Assets/IsoTools/Editor/IsoObjectEditor.cs" Line="29" Column="27" />
|
||||
<File FileName="Assets/IsoTools/Scripts/IsoWorld.cs" Line="534" Column="1" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore />
|
||||
<BreakpointStore>
|
||||
<Breakpoint file="/Users/blackmat/Programming/Projects/UnityIso/Assets/IsoTools/Editor/IsoObjectEditor.cs" line="34" />
|
||||
</BreakpointStore>
|
||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||
</Properties>
|
||||
Reference in New Issue
Block a user