diff --git a/Assets/Example/Dialogs/ChooseDialog.prefab b/Assets/Example/Dialogs/ChooseDialog.prefab index 5c1d6742..51d347e7 100644 Binary files a/Assets/Example/Dialogs/ChooseDialog.prefab and b/Assets/Example/Dialogs/ChooseDialog.prefab differ diff --git a/Assets/Example/Dialogs/NarratorDialog.prefab b/Assets/Example/Dialogs/NarratorDialog.prefab index 5c1d6742..ae3c139a 100644 Binary files a/Assets/Example/Dialogs/NarratorDialog.prefab and b/Assets/Example/Dialogs/NarratorDialog.prefab differ diff --git a/Assets/Example/Dialogs/SayDialog.prefab b/Assets/Example/Dialogs/SayDialog.prefab index 5c1d6742..082e7802 100644 Binary files a/Assets/Example/Dialogs/SayDialog.prefab and b/Assets/Example/Dialogs/SayDialog.prefab differ diff --git a/Assets/Example/Scenes/Example.unity b/Assets/Example/Scenes/Example.unity index 472728cc..b23bba79 100644 Binary files a/Assets/Example/Scenes/Example.unity and b/Assets/Example/Scenes/Example.unity differ diff --git a/Assets/Fungus/Animation/Commands.meta b/Assets/Fungus/Animation/Commands.meta new file mode 100644 index 00000000..17b1b807 --- /dev/null +++ b/Assets/Fungus/Animation/Commands.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 3e8003ca74cfb4a99983b0084a826c72 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Assets/Fungus/Animation/SetAnimBool.cs b/Assets/Fungus/Animation/Commands/SetAnimBool.cs similarity index 100% rename from Assets/Fungus/Animation/SetAnimBool.cs rename to Assets/Fungus/Animation/Commands/SetAnimBool.cs diff --git a/Assets/Fungus/Animation/SetAnimBool.cs.meta b/Assets/Fungus/Animation/Commands/SetAnimBool.cs.meta similarity index 100% rename from Assets/Fungus/Animation/SetAnimBool.cs.meta rename to Assets/Fungus/Animation/Commands/SetAnimBool.cs.meta diff --git a/Assets/Fungus/Animation/SetAnimFloat.cs b/Assets/Fungus/Animation/Commands/SetAnimFloat.cs similarity index 100% rename from Assets/Fungus/Animation/SetAnimFloat.cs rename to Assets/Fungus/Animation/Commands/SetAnimFloat.cs diff --git a/Assets/Fungus/Animation/SetAnimFloat.cs.meta b/Assets/Fungus/Animation/Commands/SetAnimFloat.cs.meta similarity index 100% rename from Assets/Fungus/Animation/SetAnimFloat.cs.meta rename to Assets/Fungus/Animation/Commands/SetAnimFloat.cs.meta diff --git a/Assets/Fungus/Animation/SetAnimInteger.cs b/Assets/Fungus/Animation/Commands/SetAnimInteger.cs similarity index 100% rename from Assets/Fungus/Animation/SetAnimInteger.cs rename to Assets/Fungus/Animation/Commands/SetAnimInteger.cs diff --git a/Assets/Fungus/Animation/SetAnimInteger.cs.meta b/Assets/Fungus/Animation/Commands/SetAnimInteger.cs.meta similarity index 100% rename from Assets/Fungus/Animation/SetAnimInteger.cs.meta rename to Assets/Fungus/Animation/Commands/SetAnimInteger.cs.meta diff --git a/Assets/Fungus/Animation/SetAnimTrigger.cs b/Assets/Fungus/Animation/Commands/SetAnimTrigger.cs similarity index 100% rename from Assets/Fungus/Animation/SetAnimTrigger.cs rename to Assets/Fungus/Animation/Commands/SetAnimTrigger.cs diff --git a/Assets/Fungus/Animation/SetAnimTrigger.cs.meta b/Assets/Fungus/Animation/Commands/SetAnimTrigger.cs.meta similarity index 100% rename from Assets/Fungus/Animation/SetAnimTrigger.cs.meta rename to Assets/Fungus/Animation/Commands/SetAnimTrigger.cs.meta diff --git a/Assets/Fungus/Camera/Editor/ViewEditor.cs b/Assets/Fungus/Camera/Editor/ViewEditor.cs index 764bdbb0..49b7c15e 100644 --- a/Assets/Fungus/Camera/Editor/ViewEditor.cs +++ b/Assets/Fungus/Camera/Editor/ViewEditor.cs @@ -10,6 +10,9 @@ public class ViewEditor : Editor { static Color viewColor = Color.yellow; + SerializedProperty primaryAspectRatioProp; + SerializedProperty secondaryAspectRatioProp; + // Draw Views when they're not selected [DrawGizmo(GizmoType.NotSelected | GizmoType.SelectedOrChild)] static void RenderCustomGizmo(Transform objectTransform, GizmoType gizmoType) @@ -53,47 +56,52 @@ public class ViewEditor : Editor } } + void OnEnable() + { + primaryAspectRatioProp = serializedObject.FindProperty ("primaryAspectRatio"); + secondaryAspectRatioProp = serializedObject.FindProperty ("secondaryAspectRatio"); + } + public override void OnInspectorGUI() { - View t = target as View; + serializedObject.Update(); EditorGUI.BeginChangeCheck(); string[] ratios = { "", "Landscape / 4:3", "Landscape / 3:2", "Landscape / 16:10", "Landscape / 17:10", "Landscape / 16:9", "Landscape / 2:1", "Portrait / 3:4", "Portrait / 2:3", "Portrait / 10:16", "Portrait / 10:17", "Portrait / 9:16", "Portrait / 1:2" }; - Vector2 primaryAspectRatio = EditorGUILayout.Vector2Field(new GUIContent("Primary Aspect Ratio", "Width and height values that define the primary aspect ratio (e.g. 4:3)"), t.primaryAspectRatio); + EditorGUILayout.PropertyField(primaryAspectRatioProp, new GUIContent("Primary Aspect Ratio", "Width and height values that define the primary aspect ratio (e.g. 4:3)")); int primaryIndex = EditorGUILayout.Popup("Select Aspect Ratio", 0, ratios); if (primaryIndex > 0) { - primaryAspectRatio = LookupAspectRatio(primaryIndex); + primaryAspectRatioProp.vector2Value = LookupAspectRatio(primaryIndex); } EditorGUILayout.Separator(); - Vector2 secondaryAspectRatio = EditorGUILayout.Vector2Field(new GUIContent("Secondary Aspect Ratio", "Width and height values that define the primary aspect ratio (e.g. 4:3)"), t.secondaryAspectRatio); + EditorGUILayout.PropertyField(secondaryAspectRatioProp, new GUIContent("Secondary Aspect Ratio", "Width and height values that define the primary aspect ratio (e.g. 4:3)")); int secondaryIndex = EditorGUILayout.Popup("Select Aspect Ratio", 0, ratios); if (secondaryIndex > 0) { - secondaryAspectRatio = LookupAspectRatio(secondaryIndex); + secondaryAspectRatioProp.vector2Value = LookupAspectRatio(secondaryIndex); } EditorGUILayout.Separator(); if (EditorGUI.EndChangeCheck()) { // Avoid divide by zero errors - if (primaryAspectRatio.y == 0) + if (primaryAspectRatioProp.vector2Value.y == 0) { - primaryAspectRatio.y = 1; + primaryAspectRatioProp.vector2Value = new Vector2(primaryAspectRatioProp.vector2Value.x, 1f); } - if (secondaryAspectRatio.y == 0) + if (secondaryAspectRatioProp.vector2Value.y == 0) { - secondaryAspectRatio.y = 1; + secondaryAspectRatioProp.vector2Value = new Vector2(secondaryAspectRatioProp.vector2Value.x, 1f); } - t.primaryAspectRatio = primaryAspectRatio; - t.secondaryAspectRatio = secondaryAspectRatio; - SceneView.RepaintAll(); } + + serializedObject.ApplyModifiedProperties(); } void OnSceneGUI () diff --git a/Assets/Fungus/Dialog/Editor/CharacterEditor.cs b/Assets/Fungus/Dialog/Editor/CharacterEditor.cs index 486c4070..9a998105 100644 --- a/Assets/Fungus/Dialog/Editor/CharacterEditor.cs +++ b/Assets/Fungus/Dialog/Editor/CharacterEditor.cs @@ -17,7 +17,6 @@ namespace Fungus.Script void OnEnable() { - // Setup the SerializedProperties nameTextProp = serializedObject.FindProperty ("nameText"); nameColorProp = serializedObject.FindProperty ("nameColor"); profileSpriteProp = serializedObject.FindProperty ("profileSprite");