public override void OnNodeGUI() { if (obj != null) { if (!firstRender && e.type != EventType.Layout) { return; } firstRender = true; Type objType = obj.GetType(); EditorGUILayout.LabelField(obj.ToString()); if (objType.IsGenericType && objType.GetGenericTypeDefinition() == typeof(PWArray <>)) { var pwv = obj as PWArray <object>; for (int i = 0; i < pwv.Count; i++) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("[" + i + "] " + pwv.NameAt(i) + ": " + pwv.At(i), GUILayout.Width(300)); EditorGUILayout.EndHorizontal(); } } else if (objType == typeof(Vector2)) { EditorGUILayout.Vector2Field("vec2", (Vector2)obj); } else if (objType == typeof(Vector3)) { EditorGUILayout.Vector2Field("vec3", (Vector3)obj); } else if (objType == typeof(Vector4)) { EditorGUILayout.Vector2Field("vec4", (Vector4)obj); } else if (objType == typeof(Sampler2D)) { PWGUI.Sampler2DPreview(obj as Sampler2D); } else if (objType == typeof(Sampler3D)) { } else if (objType == typeof(BiomeData)) { BiomeUtils.DrawBiomeInfos(rect, obj as BiomeData); } } else { EditorGUILayout.LabelField("null"); } }
public override void OnNodeGUI() { if (obj != null) { Type objType = obj.GetType(); EditorGUILayout.LabelField(obj.ToString()); if (objType == typeof(PWValues)) { var pwv = obj as PWValues; for (int i = 0; i < pwv.Count; i++) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("[" + i + "] " + pwv.NameAt(i) + ": " + pwv.At(i), GUILayout.Width(300)); EditorGUILayout.EndHorizontal(); } } else if (objType == typeof(Vector2)) { EditorGUILayout.Vector2Field("vec2", (Vector2)obj); } else if (objType == typeof(Vector3)) { EditorGUILayout.Vector2Field("vec3", (Vector3)obj); } else if (objType == typeof(Vector4)) { EditorGUILayout.Vector2Field("vec4", (Vector4)obj); } else if (objType == typeof(Sampler2D)) { //TODO } else if (objType == typeof(Sampler3D)) { //TODO } else if (objType == typeof(BiomeData)) { BiomeUtils.DrawBiomeInfos(obj as BiomeData); } } else { EditorGUILayout.LabelField("null"); } }
public override void OnNodeGUI() { GUILayout.Space(14); PWGUI.PWArrayField(outputValues); EditorGUILayout.LabelField("Preview graph"); previewGraph = EditorGUILayout.ObjectField(previewGraph, typeof(PWMainGraph), false) as PWMainGraph; if (previewGraph == null) { EditorGUILayout.HelpBox("Can't process the graph without a preview graph ", MessageType.Error); } if (outputPartialBiome != null) { BiomeUtils.DrawBiomeInfos(rect, outputPartialBiome.biomeDataReference); } calls = 0; }