Browse Source

Removed legacy support for Sequences as child game objects

master
chrisgregan 10 years ago
parent
commit
945d642b10
  1. 3
      Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs
  2. 5
      Assets/Fungus/FungusScript/Scripts/FungusScript.cs
  3. 11
      Assets/Fungus/FungusScript/Scripts/Sequence.cs

3
Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs

@ -225,9 +225,6 @@ namespace Fungus
{
Sequence sequence = sequences[i];
// Hack to support legacy design where sequences were child gameobjects (will be removed soon)
sequence.UpdateSequenceName();
float nodeWidth = nodeStyle.CalcSize(new GUIContent(sequence.sequenceName)).x + 10;
sequence.nodeRect.width = Mathf.Max(120, nodeWidth);
sequence.nodeRect.height = 30;

5
Assets/Fungus/FungusScript/Scripts/FungusScript.cs

@ -152,10 +152,9 @@ namespace Fungus
*/
public virtual bool ExecuteSequence(Sequence sequence)
{
// Sequence must be a child of the parent Fungus Script
// Sequence must be a component of the Fungus Script game object
if (sequence == null ||
sequence.transform.parent != transform &&
sequence.transform != transform)
sequence.gameObject != gameObject)
{
return false;
}

11
Assets/Fungus/FungusScript/Scripts/Sequence.cs

@ -159,16 +159,5 @@ namespace Fungus
}
return connectedSequences;
}
// Force set the sequence name for any legacy child sequences.
// This is a temporary hack to make it easier to upgrade from earlier versions and will be removed soon.
public virtual void UpdateSequenceName()
{
if (sequenceName == "New Sequence" &&
GetComponent<FungusScript>() == null)
{
sequenceName = gameObject.name;
}
}
}
}

Loading…
Cancel
Save