#if HAVE_SLATE
using System;
using UnityEngine;
using Slate;
using Framework.Services;
namespace Framework.Cinematics {
///
/// Automatically starts a Slate cutscene to which the script is attached
///
public class AutoPlayCutscene : ScriptComponent {
///
/// Called once after the GameObject the script is attached to is created
///
protected void Start() {
Cutscene cutscene = GetComponent();
if(cutscene == null) {
Debug.LogWarning(
"AutoPlayCutscene script has been added to a GameObject that " +
"is not a Slate cutscene. Cutscene will not be played."
);
return;
}
cutscene.Play();
}
}
} // namespace Framework.Cinematics
#endif // HAVE_SLATE