mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
NodeGraph changes should now be saving correctly. Needs improvemend.
Also improved layout of Color and AnimationCurve
This commit is contained in:
parent
6a4c29410a
commit
ac6e75668b
Binary file not shown.
@ -147,20 +147,29 @@ public class NodeEditor {
|
||||
fieldValue = EditorGUILayout.Vector4Field(fieldPrettyName, (Vector4)fieldValue);
|
||||
}
|
||||
else if (fieldType == typeof(Color)) {
|
||||
fieldValue = EditorGUILayout.ColorField(fieldPrettyName, (Color)fieldValue);
|
||||
Rect rect = EditorGUILayout.GetControlRect();
|
||||
rect.width *= 0.5f;
|
||||
EditorGUI.LabelField(rect, fieldPrettyName);
|
||||
rect.x += rect.width;
|
||||
fieldValue = EditorGUI.ColorField(rect, (Color)fieldValue);
|
||||
}
|
||||
else if (fieldType == typeof(AnimationCurve)) {
|
||||
Rect rect = EditorGUILayout.GetControlRect();
|
||||
rect.width *= 0.5f;
|
||||
EditorGUI.LabelField(rect, fieldPrettyName);
|
||||
rect.x += rect.width;
|
||||
|
||||
AnimationCurve curve = fieldValue != null ? (AnimationCurve)fieldValue : new AnimationCurve();
|
||||
curve = EditorGUILayout.CurveField(fieldPrettyName, curve);
|
||||
curve = EditorGUI.CurveField(rect, curve);
|
||||
if (fieldValue != curve) fieldInfo.SetValue(target, curve);
|
||||
}
|
||||
else if (fieldType.IsSubclassOf(typeof(UnityEngine.Object)) || fieldType == typeof(UnityEngine.Object)) {
|
||||
if (fieldName == "graph") return; //Ignore 'graph'
|
||||
fieldValue = EditorGUILayout.ObjectField(fieldPrettyName, (UnityEngine.Object)fieldValue, fieldType, true);
|
||||
}
|
||||
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
fieldInfo.SetValue(target, fieldValue);
|
||||
NodeEditorUtilities.SetDirty(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -94,11 +94,11 @@ public partial class NodeEditorWindow {
|
||||
if (draggedOutputTarget != null) {
|
||||
if (graph.nodes.Count != 0) draggedOutput.Connect(draggedOutputTarget);
|
||||
EditorUtility.SetDirty(graph);
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
//Release dragged connection
|
||||
draggedOutput = null;
|
||||
draggedOutputTarget = null;
|
||||
EditorUtility.SetDirty(graph);
|
||||
Repaint();
|
||||
}
|
||||
else if (IsDraggingNode) {
|
||||
@ -110,6 +110,7 @@ public partial class NodeEditorWindow {
|
||||
isPanning = false;
|
||||
}
|
||||
UpdateHovered();
|
||||
AssetDatabase.SaveAssets();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,9 @@ public partial class NodeEditorWindow : EditorWindow {
|
||||
public float zoom { get { return _zoom; } set { _zoom = Mathf.Clamp(value, 1f, 5f); Repaint(); } }
|
||||
private float _zoom = 1;
|
||||
|
||||
void OnFocus() {
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
|
||||
partial void OnEnable();
|
||||
/// <summary> Create editor window </summary>
|
||||
|
||||
BIN
Scripts/Editor/Resources/unec_node.png
Normal file
BIN
Scripts/Editor/Resources/unec_node.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 526e7d4dc27d75e41b5d751e4d390d8b
|
||||
timeCreated: 1506975350
|
||||
guid: 2fea1dcb24935ef4ca514d534eb6aa3d
|
||||
timeCreated: 1507454532
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
@ -12,6 +12,8 @@ TextureImporter:
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
@ -27,10 +29,13 @@ TextureImporter:
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
@ -66,14 +71,6 @@ TextureImporter:
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
@ -94,6 +91,7 @@ TextureImporter:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
Binary file not shown.
98
Scripts/Editor/Resources/unec_node_workfile.psd.meta
Normal file
98
Scripts/Editor/Resources/unec_node_workfile.psd.meta
Normal file
@ -0,0 +1,98 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2267efa6e1e349348ae0b28fb659a6e2
|
||||
timeCreated: 1507454532
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapU: 1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 2
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
- buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
x
Reference in New Issue
Block a user