Browse Source

remove redundant if checks for stage field

master
Pavel Kvas 9 years ago
parent
commit
20cd537eb6
  1. 25
      Assets/Fungus/Narrative/Scripts/Commands/ControlStage.cs
  2. 27
      Assets/Fungus/Narrative/Scripts/Commands/Portrait.cs
  3. 9
      Assets/FungusExamples/FungusLua/Scripts.meta

25
Assets/Fungus/Narrative/Scripts/Commands/ControlStage.cs

@ -49,20 +49,21 @@ namespace Fungus
Continue();
return;
}
// Selected "use default Portrait Stage"
if (stage == null) // Default portrait stage selected
{
if (stage == null) // If no default specified, try to get any portrait stage in the scene
{
stage = GameObject.FindObjectOfType<Stage>();
}
}
// If portrait stage does not exist, do nothing
if (stage == null)
if (stage == null)
{
Continue();
return;
}
// If no default specified, try to get any portrait stage in the scene
stage = FindObjectOfType<Stage>();
// If portrait stage does not exist, do nothing
if (stage == null)
{
Continue();
return;
}
}
// Selected "use default Portrait Stage"
if (display == StageDisplayType.Swap) // Default portrait stage selected
{

27
Assets/Fungus/Narrative/Scripts/Commands/Portrait.cs

@ -120,21 +120,18 @@ namespace Fungus
return;
}
// Selected "use default Portrait Stage"
if (stage == null) // Default portrait stage selected
{
if (stage == null) // If no default specified, try to get any portrait stage in the scene
{
stage = GameObject.FindObjectOfType<Stage>();
}
}
// If portrait stage does not exist, do nothing
if (stage == null)
{
Continue();
return;
}
// Selected "use default Portrait Stage"
if (stage == null)
{
// If no default specified, try to get any portrait stage in the scene
stage = FindObjectOfType<Stage>();
// If portrait stage does not exist, do nothing
if (stage == null)
{
Continue();
return;
}
}
// Early out if hiding a character that's already hidden
if (display == DisplayType.Hide &&

9
Assets/FungusExamples/FungusLua/Scripts.meta

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: e2e93e4a664384c7592b4692703284e3
folderAsset: yes
timeCreated: 1462350061
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save