From 945d642b103013b3ab7e8034eca2451f5a20795a Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Fri, 28 Nov 2014 13:34:11 +0000 Subject: [PATCH] Removed legacy support for Sequences as child game objects --- .../Fungus/FungusScript/Editor/FungusScriptWindow.cs | 3 --- Assets/Fungus/FungusScript/Scripts/FungusScript.cs | 5 ++--- Assets/Fungus/FungusScript/Scripts/Sequence.cs | 11 ----------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs index 8171ae89..8c32c3dd 100755 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs +++ b/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; diff --git a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs index ca78c532..06332c82 100644 --- a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs +++ b/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; } diff --git a/Assets/Fungus/FungusScript/Scripts/Sequence.cs b/Assets/Fungus/FungusScript/Scripts/Sequence.cs index 2d07ea85..324684f0 100644 --- a/Assets/Fungus/FungusScript/Scripts/Sequence.cs +++ b/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() == null) - { - sequenceName = gameObject.name; - } - } } }