From 42f0e6a8fc60db24ecb9a81ac822a63e2217dc02 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 25 Sep 2014 20:22:47 +0100 Subject: [PATCH] Can now make prefabs from legacy FungusScripts If you have a FungusScript from an earlier beta release that has child Sequence objects, you can now make a prefab from that FungusScript. --- Assets/Fungus/FungusScript/Scripts/Sequence.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/FungusScript/Scripts/Sequence.cs b/Assets/Fungus/FungusScript/Scripts/Sequence.cs index 6f4b06bc..4676c434 100644 --- a/Assets/Fungus/FungusScript/Scripts/Sequence.cs +++ b/Assets/Fungus/FungusScript/Scripts/Sequence.cs @@ -27,7 +27,10 @@ namespace Fungus if (fungusScript == null) { // Legacy support for earlier system where Sequences were children of the FungusScript - fungusScript = GetComponentInParent(); + if (transform.parent != null) + { + fungusScript = transform.parent.GetComponent(); + } } return fungusScript;