using System;
using System.Collections.Generic;
// Cinema Suite
using UnityEngine;
namespace CinemaDirector
{
///
/// The base class for all cinema events
///
[ExecuteInEditMode]
public abstract class CinemaActorAction : TimelineAction
{
///
/// Called when the running time of the cutscene hits the firetime of the action
///
public abstract void Trigger(GameObject Actor);
///
/// Called at each update when the action is to be played.
///
public virtual void UpdateTime(GameObject Actor, float time, float deltaTime) { }
///
/// Called when the running time of the cutscene exceeds the duration of the action
///
public abstract void End(GameObject Actor);
///
/// Called when the cutscene exists preview/play mode. Return properties to pre-cached state if necessary.
///
public virtual void Stop(GameObject Actor) { }
///
/// Called when the cutscene time is set/skipped manually.
///
/// The actor to target for this event.
/// The new running time.
/// The deltaTime since the last update call.
public virtual void SetTime(GameObject Actor, float time, float deltaTime) { }
///
/// Reverse trigger. Called when scrubbing backwards.
///
public virtual void ReverseTrigger(GameObject Actor) { }
///
/// Reverse End. Called when scrubbing backwards.
///
public virtual void ReverseEnd(GameObject Actor) { }
///
/// Pause any action as necessary
///
public virtual void Pause(GameObject Actor) { }
///
/// Resume from paused.
///
public virtual void Resume(GameObject Actor) { }
public int CompareTo(object other)
{
CinemaGlobalAction otherAction = (CinemaGlobalAction)other;
return (int)(otherAction.Firetime - this.Firetime);
}
///
/// Get the actors associated with this Actor Action. Can return null.
///
/// A set of actors related to this actor event.
public virtual List GetActors()
{
IMultiActorTrack track = (TimelineTrack as IMultiActorTrack);
if (track != null)
{
return track.Actors;
}
return null;
}
///
/// Called when the cutscene time is set/skipped manually.
///
[Obsolete("Use SetTime with Actor")]
public virtual void SetTime(float time, float deltaTime) { }
///
/// Reverse trigger. Called when scrubbing backwards.
///
[Obsolete("Use ReverseTrigger with Actor")]
public virtual void ReverseTrigger() { }
///
/// Reverse End. Called when scrubbing backwards.
///
[Obsolete("Use ReverseEnd with Actor")]
public virtual void ReverseEnd() { }
}
}