/// <summary>
 /// Raised when a block finishes playing.
 /// </summary>
 /// <param name='block'>
 /// The block that finished playing.
 /// </param>
 public void OnBlockFinished(PlayableBlock block)
 {
     if (!IsPlaying())
     {
         if (OnPlayingFinished != null && typeof(PlayableController).IsInstanceOfType(this))
         {
             OnPlayingFinished((PlayableController)this);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Should be called when the playing child finishes playing.
 /// </summary>
 protected void OnChildPlayingFinished(PlayableBlock block)
 {
     if (continueParse)
     {
         PlayNextChild();
     }
     else
     {
         if (OnPlayingFinished != null)
         {
             OnPlayingFinished(this);
         }
         SendEvents("OnPlayingFinished");
     }
 }
Ejemplo n.º 3
0
    /// <summary>
    /// Raised when the give flow block finishes playing. Used to test if all flow blocks finished playing and, if true, to raise the corresponding event.
    /// </summary>
    /// <param name='block'>
    /// The block that finished playing.
    /// </param>
    public void OnFlowBlockFinished(PlayableBlock block)
    {
        finishedBlocks++;

        if (finishedBlocks == blocks.Length)
        {
            // All finished, raise corresponding event
            FlowBlock.FlowState state = (block as FlowBlock).State;

            Debug.Log("Finished flow: " + state + " on scene: " + name);

            switch (state)
            {
            case FlowBlock.FlowState.Intro:
                if (OnIntroFinished != null)
                {
                    OnIntroFinished(this);
                }
                break;

            case FlowBlock.FlowState.Idle:
                if (OnIdleFinished != null)
                {
                    OnIdleFinished(this);
                }
                break;

            case FlowBlock.FlowState.Outro:
                if (OnOutroFinished != null)
                {
                    OnOutroFinished(this);
                }
                break;
            }
        }
    }
Ejemplo n.º 4
0
 /// <summary>
 /// Called when the current animation finishes playing.
 /// </summary>
 public void OnAnimationFinished(PlayableBlock block)
 {
     // TODO: Remove if not useful
 }
Ejemplo n.º 5
0
	/// <summary>
	/// Should be called when the playing child finishes playing.
	/// </summary>
	protected void OnChildPlayingFinished(PlayableBlock block)
	{
		if (continueParse) {
			PlayNextChild();
		} else {
			if (OnPlayingFinished != null) {
				OnPlayingFinished(this);
			}
			SendEvents("OnPlayingFinished");
		}
	}
Ejemplo n.º 6
0
	/// <summary>
	/// Called when the current animation finishes playing.
	/// </summary>
	public void OnAnimationFinished(PlayableBlock block)
	{
		// TODO: Remove if not useful
	}
 /// <summary>
 /// Registers this controller to be notified when the given block finishes playing.
 /// </summary>
 /// <param name='block'>
 /// The block.
 /// </param>
 public void RegisterFinishedEvent(PlayableBlock block)
 {
     block.OnPlayingFinished += OnBlockFinished;
 }