Esempio n. 1
0
        public void AddNewTimeline(USTimelineContainerHierarchyItem hierarchyItem, USCustomTimelineHierarchyItem timelineAttribute)
        {
            var timelineObject = new GameObject(timelineAttribute.FriendlyName);

            USUndoManager.RegisterCreatedObjectUndo(timelineObject, "Add New Timeline");

            timelineObject.transform.parent   = hierarchyItem.TimelineContainer.transform;
            timelineObject.transform.position = Vector3.zero;
            timelineObject.transform.rotation = Quaternion.identity;

            var timeline = timelineObject.AddComponent(timelineAttribute.InspectedType) as USTimelineBase;

            USUndoManager.RegisterCreatedObjectUndo(timeline, "Add New Timeline");

            USUndoManager.PropertyChange(hierarchyItem.TimelineContainer.Sequence, "Add New Timeline");
            hierarchyItem.TimelineContainer.Sequence.ResetCachedData();

            USUndoManager.RegisterCompleteObjectUndo(hierarchyItem, "Add New Timeline");
            hierarchyItem.AddTimeline(timeline);
        }
Esempio n. 2
0
 private void UpdateAffectedObject(USTimelineContainerHierarchyItem timelineContainerHierarchyItem, GameObject newAffectedObject)
 {
     timelineContainerHierarchyItem.TimelineContainer.AffectedObject = newAffectedObject.transform;
     timelineContainerHierarchyItem.Children.Clear();
     timelineContainerHierarchyItem.SetupWithTimelineContainer(timelineContainerHierarchyItem.TimelineContainer);
 }