|
|
|
@ -36,17 +36,6 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
Choose t = target as Choose; |
|
|
|
|
|
|
|
|
|
bool showPortraits = false; |
|
|
|
|
// Only show portrait selection if... |
|
|
|
|
if (t.character != null && // Character is selected |
|
|
|
|
t.character.portraits != null && // Character has a portraits field |
|
|
|
|
t.character.portraits.Count > 0 && // Selected Character has at least 1 portrait |
|
|
|
|
t.chooseDialog != null && // Say Dialog is selected |
|
|
|
|
t.chooseDialog.characterImage != null) // Selected Say Dialog has a character image e |
|
|
|
|
{ |
|
|
|
|
showPortraits = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CommandEditor.ObjectField<Character>(characterProp, |
|
|
|
|
new GUIContent("Character", "Character to display in dialog"), |
|
|
|
|
new GUIContent("<None>"), |
|
|
|
@ -57,6 +46,26 @@ namespace Fungus
|
|
|
|
|
new GUIContent("<Default>"), |
|
|
|
|
ChooseDialog.activeDialogs); |
|
|
|
|
|
|
|
|
|
bool showPortraits = false; |
|
|
|
|
// Only show portrait selection if... |
|
|
|
|
if (t.character != null && // Character is selected |
|
|
|
|
t.character.portraits != null && // Character has a portraits field |
|
|
|
|
t.character.portraits.Count > 0 ) // Selected Character has at least 1 portrait |
|
|
|
|
{ |
|
|
|
|
ChooseDialog cd = t.chooseDialog; |
|
|
|
|
if (t.chooseDialog == null) // If default box selected |
|
|
|
|
{ |
|
|
|
|
cd = t.character.chooseDialogBox; // Try to get character's default choose dialog box |
|
|
|
|
if (t.chooseDialog == null) // If no default specified, Try to get any ChooseDialog in the scene |
|
|
|
|
{ |
|
|
|
|
cd = GameObject.FindObjectOfType<ChooseDialog>(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (cd != null && cd.characterImage != null) // Check that selected choose dialog has a character image |
|
|
|
|
{ |
|
|
|
|
showPortraits = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (showPortraits) |
|
|
|
|
{ |
|
|
|
|
CommandEditor.ObjectField<Sprite>(portraitProp, |
|
|
|
|