private bool ExtractMethod(string methodName, VideoClipEvent clipEvent, MethodInfo info, Component component, Type argumentType) { if (methodName != clipEvent.MethodName) { return(true); } UnityReifiedMethod method = new UnityReifiedMethod(info, component, clipEvent.GetAppropriateValue(argumentType)); TimeMethod timeMethod = new TimeMethod(clipEvent.Time, method); methods.Add(timeMethod); return(false); }
private bool ExtractParamaterlessMethod(string methodName, VideoClipEvent clipEvent, MethodInfo info, Component component) { if (methodName != clipEvent.MethodName) { return(true); } Debug.Log("Method: " + info.GetType()); UnityReifiedMethod method = new UnityReifiedMethod(info, component, null); TimeMethod timeMethod = new TimeMethod(clipEvent.Time, method); methods.Add(timeMethod); return(false); }
/// <summary> /// Invokes the method closest to the time (before the time) /// </summary> public void InvokeClosestMethodByTime(double time) { TimeMethod selected = default(TimeMethod); foreach (TimeMethod timeMethod in methods) { if (timeMethod.Time < time) { selected = timeMethod; } else { break; } } if (selected != null) { selected.Invoke(); } }
// for times (e.g. 19:30) public JobTime(List <JobTimeHandler> jobTimes) { this.type = TimeMethod.Absolute; this.jobTimes = jobTimes; }
// for delay (e.g. 2000ms) public JobTime(JobDelayHandler jobDelay) { this.type = TimeMethod.Relative; this.jobDelay = jobDelay; }