Skip to content

Instantly share code, notes, and snippets.

@jmbeach
Created January 3, 2015 21:02
Show Gist options
  • Save jmbeach/b106c4834cbf13e464c0 to your computer and use it in GitHub Desktop.
Save jmbeach/b106c4834cbf13e464c0 to your computer and use it in GitHub Desktop.
void Start()
{
// for each node
foreach (var node in Nodes)
{
// get point class and assign your custom trigger function to it
var point = node.GetComponent<PathPoint>();
point.TriggerEnterAction = OnPathPointEnter;
// let it know to only call trigger if this is the object collided
point.ObjectToDetect = gameObject;
}
// move
iTween.MoveTo(gameObject, iTween.Hash("path", Nodes.ToArray(), "time", _totalPathTime, "oncomplete", "PathComplete", "onupdate", "OnUpdate"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment