From 2a2461a4ee17e3efba637dfd4eea5b255ed0c890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9ven=20Boily?= Date: Wed, 24 Sep 2014 15:27:35 -0400 Subject: [PATCH] [FEATURE] CreateSequence now calls an virtual CreateSequenceComponent method that handles Sequence component instantiation. This allows for a custom Sequence class to be instantiated . --- Assets/Fungus/FungusScript/Scripts/FungusScript.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs index 2869f53f..a1f69be5 100644 --- a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs +++ b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs @@ -111,6 +111,12 @@ namespace Fungus } } + protected virtual Sequence CreateSequenceComponent(GameObject parent) + { + Sequence s = parent.AddComponent(); + return s; + } + /** * Create a new sequence node which you can then add commands to. */ @@ -119,7 +125,7 @@ namespace Fungus GameObject go = new GameObject("Sequence"); go.transform.parent = transform; go.transform.hideFlags = HideFlags.HideInHierarchy; - Sequence s = go.AddComponent(); + Sequence s = CreateSequenceComponent(go); s.nodeRect.x = position.x; s.nodeRect.y = position.y; return s;