private static extern string Speak( string text, string voice, StartDelegate startCallback, EndDelegate endCallback, BoundaryDelegate boundaryCallback, PauseDelegate pauseCallback, ResumeDelegate resumeCallback, string lang );
public void InitForUse(UpdateDelegate updateCallback, float delay, BeginDelegate beginCallback) { IsActive = true; m_Progress = 0.0f; m_Delay = delay; m_EaseType = EasingFunction.Ease.Linear; m_Speed = 1; m_UpdateCallback = updateCallback; m_BeginCallback = beginCallback; m_EndCallback = null; }
// return false if finished (inactive) public bool Update(float timeStep) { if (m_Delay > 0.0f) { m_Delay -= timeStep; if (m_Delay < 0.0f) { if (m_BeginCallback != null) { m_BeginCallback(); } if (m_UpdateCallback != null) { m_UpdateCallback(0); } } } else { m_Progress += timeStep * m_Speed; float tvalue = m_Progress; if (m_Progress > 1.0f) { tvalue = 1.0f; } float xvalue = EasingFunction.GetEasingFunction(m_EaseType)(0, 1, tvalue); if (m_UpdateCallback != null) { m_UpdateCallback(xvalue); } if (m_Progress > 1.0f) { if (m_EndCallback != null) { m_EndCallback(); } OnTerminateCallback.Invoke(); IsActive = false; m_UpdateCallback = null; m_EndCallback = null; m_BeginCallback = null; } } return(IsActive); }
public void InitForUse(UpdateDelegate updateCallback) { IsActive = true; m_Progress = 0.0f; m_Delay = -0.1f; m_EaseType = EasingFunction.Ease.Linear; m_Speed = 1; m_UpdateCallback = updateCallback; m_BeginCallback = null; m_EndCallback = null; OnTerminateCallback = delegate { }; OnAbort = delegate { }; }
/// <summary> /// Sets up a message for streaming consumption. /// </summary> /// <param name="onData">Called whenever new data is available</param> /// <param name="onEnd">Called at the end of the message</param> public void Consume(DataDelegate onData, EndDelegate onEnd) { if (Consumed) { throw new InvalidOperationException("consumption already started"); } if (onData == null) { throw new ArgumentNullException("onData"); } if (onEnd == null) { throw new ArgumentNullException("onEnd"); } this.onData = onData; this.onEnd = onEnd; }
public void Play(bool forceFinish = false, EndDelegate callback = null) { if (forceFinish == true) { Stop(); } if (IsPlaying) { if (callback != null) { callback(this); } return; } WaittingProcessAnimators = new List <Description>(Playlist); ActiveAnimators = new List <Description>(); IsPlaying = true; CurrentTime = 0.0f; ListenEnd += callback; }
public Tweener SetEndCallback(EndDelegate callback) { m_EndCallback = callback; return(this); }
public IAsyncCall And(EndDelegate <R> end) { return(_call.EndWait(end)); }
private IAsyncCall EndWait(EndDelegate <R> end) { _end = end; return(new IAsyncCall(this.Invoke)); }