Created
January 3, 2015 21:02
-
-
Save jmbeach/b106c4834cbf13e464c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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