Browse Source

remove redundant if checks for stage field

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

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

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

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

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