Skip to content

Commit f813f4b

Browse files
committed
compatibility fixes for Unity 5.6.7f1 (and maybe earlier?)... still some errors from serialization ("Unknown API compatibility level: 6") from making everything in Unity 2019, but that's to be expected since everything breaks from Unity 2018.2 > Unity 2018.3... anyway, probably won't be fixing this, and no one else uses 5.6 anyway except me so whatever
1 parent c46703b commit f813f4b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

Editor/Scripts/IvyCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ public static bool IsPartOfPrefab(GameObject go) {
719719
return false;
720720
}
721721
#else // uses old prefab workflow
722-
return PrefabUtility.GetPrefabType(go) =! PrefabType.None;
722+
return PrefabUtility.GetPrefabType(go) != PrefabType.None;
723723
#endif
724724
}
725725

Editor/Scripts/IvyEditor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,9 @@ public override void OnInspectorGUI()
444444

445445
if ( choice == 0 || choice == 2) {
446446
var prefab = AssetDatabase.LoadAssetAtPath<Object>( "Assets" + filename.Substring( Application.dataPath.Length ) );
447-
var newObj = (GameObject)PrefabUtility.InstantiatePrefab( prefab, ivyBehavior.transform );
447+
var newObj = (GameObject)PrefabUtility.InstantiatePrefab( prefab );
448448
Undo.RegisterCreatedObjectUndo( newObj, "Hedera > Instantiate OBJ" );
449+
newObj.transform.SetParent( ivyBehavior.transform );
449450
newObj.transform.position = ivyGraphObjJob.seedPos;
450451

451452
var renders = newObj.GetComponentsInChildren<Renderer>();

Editor/Scripts/IvyProfileEditor.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,15 @@ public override void OnInspectorGUI () {
150150
content = new GUIContent("Vertex Colors", "Randomize leaf mesh's vertex colors, based on a gradient. Make sure your leaf material's shader supports vertex colors, and the default Hedera foliage shader supports vertex colors. If disabled then no vertex colors will be generated, which saves memory.\n(default: true)");
151151
ivyProfile.useVertexColors = EditorGUILayout.Toggle(content, ivyProfile.useVertexColors );
152152
if ( ivyProfile.useVertexColors ) {
153-
EditorGUI.indentLevel++;
154153
content = new GUIContent("Leaf Colors", "Leaves will pick random vertex colors anywhere along this gradient.\n(default: white > green > yellow)");
154+
#if UNITY_2017_1_OR_NEWER
155+
EditorGUI.indentLevel++;
155156
ivyProfile.leafVertexColors = EditorGUILayout.GradientField( content, ivyProfile.leafVertexColors );
156-
EditorGUI.indentLevel--;
157+
EditorGUI.indentLevel--;
158+
#else
159+
EditorGUILayout.HelpBox("Can't display gradient editor in Unity 5.6 or earlier, for boring reasons. You'll have to edit the gradient in debug inspector.", MessageType.Error);
160+
// ivyProfile.leafVertexColors.colorKeys[0].color = EditorGUILayout.ColorField( content, ivyProfile.leafVertexColors.colorKeys[0].color );
161+
#endif
157162
}
158163

159164
content = new GUIContent("Branch Material", "Unity material to use for branches. It doesn't need to be very high resolution or detailed, unless you set your Branch Thickness to be very wide. Example materials can be found in /Hedera/Runtime/Materials/");

0 commit comments

Comments
 (0)