Open GoogleCodeExporter opened 8 years ago
One more bit of code, if you'd like it. Don't know if you do the
iTweenEvent.cs visual editor as well, but I could not find a way to get the
parameters from the iTween event, so I wrote this snippet to do it:
/// <summary>
/// Returns a parameter for this iTweenEvent as set in the visual editor. Returns an object that needs to be converted to the appropriate type (float, string, etc.).
/// For instance, to get the event time, use (float)movement.getEventParameter("time");
/// </summary>
/// <param name="nameOfParameter">The name of the parameter, e.g. 'time' or 'orienttopath'</param>
/// <returns>The value of the parameter as an object</returns>
public object getEventParameter(string nameOfParameter)
{
if (Values.ContainsKey(nameOfParameter))
return Values[nameOfParameter];
else
throw new System.ArgumentException("No parameter with the name '" + nameOfParameter + "' could be found in the iTweenEvent named '" + tweenName + "'");
}
BTW, I just wanted to let you know that I don't come from a programming
background (I'm an engineer), and I learn more reading through your scripts
than I did in a semester of programming in school. Awesome stuff.
Original comment by brandon....@gmail.com
on 10 Aug 2011 at 5:22
Original issue reported on code.google.com by
brandon....@gmail.com
on 9 Aug 2011 at 7:11