private static void HandlePrefabRecordEvent(USTimelineEvent timelineEvent, string relativeScriptableObjectPath) { EditorUtility.SetDirty(timelineEvent); foreach (var eventBase in timelineEvent.Events) { if (!eventBase) { continue; } var objectsToSerialize = eventBase.GetAdditionalObjects(); if (objectsToSerialize == null || objectsToSerialize.Length == 0) { continue; } var objectPathsToSerialize = new List <string>(); foreach (var objectToSerialize in objectsToSerialize) { objectPathsToSerialize.Add(objectToSerialize.transform.GetFullHierarchyPath()); } eventBase.SetSerializedAdditionalObjectsPaths(objectPathsToSerialize.ToArray()); } }
public static void ProcessEventTimeline(USTimelineEvent eventTimeline) { foreach (var eventBase in eventTimeline.Events) { eventBase.MakeUnique(); } }
private void Start() { USTimelineContainer[] array = this.TimelineContainers; for (int i = 0; i < array.Length; i++) { USTimelineContainer uSTimelineContainer = array[i]; if (uSTimelineContainer) { USTimelineBase[] timelines = uSTimelineContainer.Timelines; for (int j = 0; j < timelines.Length; j++) { USTimelineBase uSTimelineBase = timelines[j]; USTimelineEvent uSTimelineEvent = uSTimelineBase as USTimelineEvent; if (uSTimelineEvent) { USEventBase[] events = uSTimelineEvent.Events; for (int k = 0; k < events.Length; k++) { USEventBase uSEventBase = events[k]; uSEventBase.FixupAdditionalObjects(); } } USTimelineObserver uSTimelineObserver = uSTimelineBase as USTimelineObserver; if (uSTimelineObserver) { foreach (USObserverKeyframe current in uSTimelineObserver.observerKeyframes) { if (!(current.cameraPath == string.Empty)) { GameObject gameObject = GameObject.Find(current.cameraPath); if (gameObject) { Camera component = gameObject.GetComponent <Camera>(); if (component) { current.KeyframeCamera = component; } } } } } USTimelineObjectPath uSTimelineObjectPath = uSTimelineBase as USTimelineObjectPath; if (uSTimelineObjectPath) { uSTimelineObjectPath.FixupAdditionalObjects(); } } } } }
private static List <UnityEngine.Object> CollectUsedAssetsForEvent(USTimelineEvent timelineEvent) { var usedAssets = new List <UnityEngine.Object>(); foreach (var eventBase in timelineEvent.Events) { if (!eventBase) { continue; } usedAssets.Add(eventBase); } return(usedAssets); }