Browse Source

merged with fungus changes for character image size

master
Lynxelia 10 years ago
parent
commit
3482314fa3
  1. 2
      .gitignore
  2. 7
      Assets/Fungus/Dialog/Editor/AddOptionEditor.cs
  3. 6
      Assets/Fungus/Dialog/Editor/ChooseEditor.cs
  4. 4
      Assets/Fungus/Dialog/Editor/SayEditor.cs
  5. 5
      Assets/Fungus/Portrait.meta
  6. 5
      Assets/FungusExamples/Tutorial.meta

2
.gitignore vendored

@ -10,3 +10,5 @@
*.sln *.sln
*.userprefs *.userprefs
.gitignore

7
Assets/Fungus/Dialog/Editor/AddOptionEditor.cs

@ -35,13 +35,14 @@ namespace Fungus
new GUIContent("Target Sequence", "Sequence to execute when this option is selected by the player."), new GUIContent("Target Sequence", "Sequence to execute when this option is selected by the player."),
new GUIContent("<Continue>"), new GUIContent("<Continue>"),
t.GetFungusScript()); t.GetFungusScript());
base.DrawCommandGUI();
EditorGUILayout.PropertyField(hideOnSelectedProp, new GUIContent("Hide On Selected", "Hide this option forever once the player has selected it."));
serializedObject.ApplyModifiedProperties(); serializedObject.ApplyModifiedProperties();
base.DrawCommandGUI();
serializedObject.Update();
EditorGUILayout.PropertyField(hideOnSelectedProp, new GUIContent("Hide On Selected", "Hide this option forever once the player has selected it."));
serializedObject.ApplyModifiedProperties();
} }
} }

6
Assets/Fungus/Dialog/Editor/ChooseEditor.cs

@ -32,8 +32,6 @@ namespace Fungus
{ {
serializedObject.Update(); serializedObject.Update();
CommandEditor.ObjectField<Character>(characterProp, CommandEditor.ObjectField<Character>(characterProp,
new GUIContent("Character", "Character to display in dialog"), new GUIContent("Character", "Character to display in dialog"),
new GUIContent("<None>"), new GUIContent("<None>"),
@ -79,7 +77,9 @@ namespace Fungus
Texture2D characterTexture = t.character.profileSprite.texture; Texture2D characterTexture = t.character.profileSprite.texture;
float aspect = (float)characterTexture.width / (float)characterTexture.height; float aspect = (float)characterTexture.width / (float)characterTexture.height;
Rect previewRect = GUILayoutUtility.GetAspectRect(aspect, GUILayout.Width(250), GUILayout.ExpandWidth(true));
Rect previewRect = GUILayoutUtility.GetAspectRect(aspect, GUILayout.Width(100), GUILayout.ExpandWidth(true));
CharacterEditor characterEditor = Editor.CreateEditor(t.character) as CharacterEditor; CharacterEditor characterEditor = Editor.CreateEditor(t.character) as CharacterEditor;
characterEditor.DrawPreview(previewRect, characterTexture); characterEditor.DrawPreview(previewRect, characterTexture);
DestroyImmediate(characterEditor); DestroyImmediate(characterEditor);

4
Assets/Fungus/Dialog/Editor/SayEditor.cs

@ -105,7 +105,9 @@ namespace Fungus
Texture2D characterTexture = t.character.profileSprite.texture; Texture2D characterTexture = t.character.profileSprite.texture;
float aspect = (float)characterTexture.width / (float)characterTexture.height; float aspect = (float)characterTexture.width / (float)characterTexture.height;
Rect previewRect = GUILayoutUtility.GetAspectRect(aspect, GUILayout.Width(250), GUILayout.ExpandWidth(true));
Rect previewRect = GUILayoutUtility.GetAspectRect(aspect, GUILayout.Width(100), GUILayout.ExpandWidth(true));
CharacterEditor characterEditor = Editor.CreateEditor(t.character) as CharacterEditor; CharacterEditor characterEditor = Editor.CreateEditor(t.character) as CharacterEditor;
characterEditor.DrawPreview(previewRect, characterTexture); characterEditor.DrawPreview(previewRect, characterTexture);
DestroyImmediate(characterEditor); DestroyImmediate(characterEditor);

5
Assets/Fungus/Portrait.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 0018d8c9e4d14f043af5b7e5b48e7b50
folderAsset: yes
DefaultImporter:
userData:

5
Assets/FungusExamples/Tutorial.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: febb44a1ff0963a4ab2049cd9139fbaa
folderAsset: yes
DefaultImporter:
userData:
Loading…
Cancel
Save