Browse Source

[FEATURE] CreateSequence now calls an virtual CreateSequenceComponent method that handles Sequence component instantiation. This allows for a custom Sequence class to be instantiated .

master
Kéven Boily 10 years ago
parent
commit
2a2461a4ee
  1. 8
      Assets/Fungus/FungusScript/Scripts/FungusScript.cs

8
Assets/Fungus/FungusScript/Scripts/FungusScript.cs

@ -111,6 +111,12 @@ namespace Fungus
} }
} }
protected virtual Sequence CreateSequenceComponent(GameObject parent)
{
Sequence s = parent.AddComponent<Sequence>();
return s;
}
/** /**
* Create a new sequence node which you can then add commands to. * Create a new sequence node which you can then add commands to.
*/ */
@ -119,7 +125,7 @@ namespace Fungus
GameObject go = new GameObject("Sequence"); GameObject go = new GameObject("Sequence");
go.transform.parent = transform; go.transform.parent = transform;
go.transform.hideFlags = HideFlags.HideInHierarchy; go.transform.hideFlags = HideFlags.HideInHierarchy;
Sequence s = go.AddComponent<Sequence>(); Sequence s = CreateSequenceComponent(go);
s.nodeRect.x = position.x; s.nodeRect.x = position.x;
s.nodeRect.y = position.y; s.nodeRect.y = position.y;
return s; return s;

Loading…
Cancel
Save