#if HAVE_NODECANVAS && HAVE_SLATE
using System;
using ParadoxNotion.Design;
using NodeCanvas.Framework;
using Slate;
using Framework.Cameras;
namespace Framework.Cinematics {
/// Plays a cutscene using
[ParadoxNotion.Design.Category("Cinematics")]
[ParadoxNotion.Design.Description("Plays a cutscene using a specific camera")]
public class PlayCutscneOnCameraTask : ActionTask {
/// Cutscene that will be played back
[RequiredField]
public BBParameter Cutscene;
/// Camera from which the cutscene will be played back
[RequiredField]
public BBParameter Camera;
/// Whether to let Slate switch to its director camera
public bool AllowDirectorCamera = false;
/// Summary of what this action does
protected override string info {
get {
return
"Play '" + this.Cutscene.ToString() + "' " +
"on '" + this.Camera.ToString() + "'";
}
}
/// Called once when the action is executed
protected override void OnExecute() {
if(this.AllowDirectorCamera) {
CutsceneHelper.PlayCutsceneOnDirectorCamera(
this.Cutscene.value, this.Camera.value, EndAction
);
} else {
CutsceneHelper.PlayCutsceneOnCamera(
this.Cutscene.value, this.Camera.value, EndAction
);
}
}
}
} // namespace Framework.Cinematics
#endif // HAVE_NODECANVAS && HAVE_SLATE