using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace Framework.Cinematics {
///
/// Assists the user in editing tracks for individual characters in cinematics
///
[CustomEditor(typeof(Track))]
public class TrackEditor : Editor {
/// Name of the layer on which the cinematics objects will reside
private const string CinematicsLayerName = "Narration";
/// Creates a new ground assigned to the right layer and all
[MenuItem("GameObject/Create Other/Track (Cinematics)")]
public static void CreateTrack() {
int layerIndex = LayerMask.NameToLayer(CinematicsLayerName);
if(layerIndex == -1) {
Debug.LogWarning(
"Could not find the '" + CinematicsLayerName + "' layer. You should add " +
"a custom layer with this name and configure Unity's physics settings so " +
"that it doesn't collide with anything. Falling back to 'Default' layer " +
"for this Ground object."
);
layerIndex = 0;
}
GameObject trackGameObject = new GameObject("CinematicsTrack");
if(layerIndex != -1) {
trackGameObject.layer = layerIndex;
}
// Create a new track with a single instruction as a starting point
Track track = trackGameObject.AddComponent