Browse Source

Fixed View prefabs settings overriding

master
chrisgregan 10 years ago
parent
commit
3f356c331c
  1. BIN
      Assets/Example/Dialogs/ChooseDialog.prefab
  2. BIN
      Assets/Example/Dialogs/NarratorDialog.prefab
  3. BIN
      Assets/Example/Dialogs/SayDialog.prefab
  4. BIN
      Assets/Example/Scenes/Example.unity
  5. 5
      Assets/Fungus/Animation/Commands.meta
  6. 0
      Assets/Fungus/Animation/Commands/SetAnimBool.cs
  7. 0
      Assets/Fungus/Animation/Commands/SetAnimBool.cs.meta
  8. 0
      Assets/Fungus/Animation/Commands/SetAnimFloat.cs
  9. 0
      Assets/Fungus/Animation/Commands/SetAnimFloat.cs.meta
  10. 0
      Assets/Fungus/Animation/Commands/SetAnimInteger.cs
  11. 0
      Assets/Fungus/Animation/Commands/SetAnimInteger.cs.meta
  12. 0
      Assets/Fungus/Animation/Commands/SetAnimTrigger.cs
  13. 0
      Assets/Fungus/Animation/Commands/SetAnimTrigger.cs.meta
  14. 32
      Assets/Fungus/Camera/Editor/ViewEditor.cs
  15. 1
      Assets/Fungus/Dialog/Editor/CharacterEditor.cs

BIN
Assets/Example/Dialogs/ChooseDialog.prefab

Binary file not shown.

BIN
Assets/Example/Dialogs/NarratorDialog.prefab

Binary file not shown.

BIN
Assets/Example/Dialogs/SayDialog.prefab

Binary file not shown.

BIN
Assets/Example/Scenes/Example.unity

Binary file not shown.

5
Assets/Fungus/Animation/Commands.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 3e8003ca74cfb4a99983b0084a826c72
folderAsset: yes
DefaultImporter:
userData:

0
Assets/Fungus/Animation/SetAnimBool.cs → Assets/Fungus/Animation/Commands/SetAnimBool.cs

0
Assets/Fungus/Animation/SetAnimBool.cs.meta → Assets/Fungus/Animation/Commands/SetAnimBool.cs.meta

0
Assets/Fungus/Animation/SetAnimFloat.cs → Assets/Fungus/Animation/Commands/SetAnimFloat.cs

0
Assets/Fungus/Animation/SetAnimFloat.cs.meta → Assets/Fungus/Animation/Commands/SetAnimFloat.cs.meta

0
Assets/Fungus/Animation/SetAnimInteger.cs → Assets/Fungus/Animation/Commands/SetAnimInteger.cs

0
Assets/Fungus/Animation/SetAnimInteger.cs.meta → Assets/Fungus/Animation/Commands/SetAnimInteger.cs.meta

0
Assets/Fungus/Animation/SetAnimTrigger.cs → Assets/Fungus/Animation/Commands/SetAnimTrigger.cs

0
Assets/Fungus/Animation/SetAnimTrigger.cs.meta → Assets/Fungus/Animation/Commands/SetAnimTrigger.cs.meta

32
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 = { "<None>", "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 ()

1
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");

Loading…
Cancel
Save