예제 #1
0
파일: CutsceneGroup.cs 프로젝트: jonntd/Xbl
        ///Duplicate the track in this group
        public CutsceneTrack DuplicateTrack(CutsceneTrack track)
        {
            if (track == null || track.GetType().RTGetAttribute <UniqueElementAttribute>(true) != null)
            {
                return(null);
            }

            var newTrack = (CutsceneTrack)Instantiate(track);

            UnityEditor.Undo.RegisterCreatedObjectUndo(newTrack.gameObject, "Duplicate Track");
            UnityEditor.Undo.SetTransformParent(newTrack.transform, this.transform, "Duplicate Track");
            UnityEditor.Undo.RegisterCompleteObjectUndo(this, "Duplicate Track");
            newTrack.transform.localPosition = Vector3.zero;
            tracks.Add(newTrack);
            root.Validate();
            CutsceneUtility.selectedObject = newTrack;
            return(newTrack);
        }
예제 #2
0
        ///----------------------------------------------------------------------------------------------
        ///---------------------------------------UNITY EDITOR-------------------------------------------
#if UNITY_EDITOR
        ///Can track be added in this group?
        public bool CanAddTrack(CutsceneTrack track)
        {
            return(track != null?CanAddTrackOfType(track.GetType()) : false);
        }