Browse Source

remove redundant if checks for stage field

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

13
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 (stage == null) // If no default specified, try to get any portrait stage in the scene
{ {
stage = GameObject.FindObjectOfType<Stage>(); // 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 portrait stage does not exist, do nothing
if (stage == null) if (stage == null)
{ {
Continue(); Continue();
return; 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
{ {

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

@ -121,19 +121,16 @@ namespace Fungus
} }
// 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
{ {
stage = GameObject.FindObjectOfType<Stage>(); // 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 portrait stage does not exist, do nothing
if (stage == null) if (stage == null)
{ {
Continue(); Continue();
return; return;
}
} }
// Early out if hiding a character that's already hidden // Early out if hiding a character that's already hidden

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