// Only show optional portrait fields once required fields have been filled...
// Only show optional portrait fields once required fields have been filled...
if(t.character!=null)// Character is selected
if(t.character!=null)// Character is selected
{
{
@ -99,14 +99,14 @@ namespace Fungus
EditorGUILayout.HelpBox("This character has no portraits. Please add portraits to the character's prefab before using this command.",MessageType.Error);
EditorGUILayout.HelpBox("This character has no portraits. Please add portraits to the character's prefab before using this command.",MessageType.Error);
showOptionalFields=false;
showOptionalFields=false;
}
}
if(t.portraitStage==null)// If default portrait stage selected
if(t.stage==null)// If default portrait stage selected
{
{
if(t.portraitStage==null)// If no default specified, try to get any portrait stage in the scene
if(t.stage==null)// If no default specified, try to get any portrait stage in the scene
{
{
ps=GameObject.FindObjectOfType<PortraitStage>();
s=GameObject.FindObjectOfType<Stage>();
}
}
}
}
if(ps==null)
if(s==null)
{
{
EditorGUILayout.HelpBox("No portrait stage has been set. Please create a new portrait stage using [Game Object > Fungus > Portrait > Portrait Stage].",MessageType.Error);
EditorGUILayout.HelpBox("No portrait stage has been set. Please create a new portrait stage using [Game Object > Fungus > Portrait > Portrait Stage].",MessageType.Error);
newGUIContent(replaceLabel,"Stage to display the character portraits on"),
newGUIContent(replaceLabel,"Stage to display the character portraits on"),
newGUIContent("<Default>"),
newGUIContent("<Default>"),
PortraitStage.activePortraitStages);
Stage.activeStages);
}
}
boolshowOptionalFields=true;
boolshowOptionalFields=true;
PortraitStageps=t.portraitStage;
Stages=t.stage;
// Only show optional portrait fields once required fields have been filled...
// Only show optional portrait fields once required fields have been filled...
if(t.portraitStage!=null)// Character is selected
if(t.stage!=null)// Character is selected
{
{
if(t.portraitStage==null)// If no default specified, try to get any portrait stage in the scene
if(t.stage==null)// If no default specified, try to get any portrait stage in the scene
{
{
ps=GameObject.FindObjectOfType<PortraitStage>();
s=GameObject.FindObjectOfType<Stage>();
}
}
if(ps==null)
if(s==null)
{
{
EditorGUILayout.HelpBox("No portrait stage has been set. Please create a new portrait stage using [Game Object > Fungus > Portrait > Portrait Stage].",MessageType.Error);
EditorGUILayout.HelpBox("No portrait stage has been set. Please create a new portrait stage using [Game Object > Fungus > Portrait > Portrait Stage].",MessageType.Error);