public static float FindPrevKeyframeTime(USSequencer sequence) { float num = 0f; USTimelineContainer[] timelineContainers = sequence.TimelineContainers; for (int i = 0; i < timelineContainers.Length; i++) { USTimelineContainer uSTimelineContainer = timelineContainers[i]; USTimelineBase[] timelines = uSTimelineContainer.Timelines; for (int j = 0; j < timelines.Length; j++) { USTimelineBase uSTimelineBase = timelines[j]; USTimelineProperty uSTimelineProperty = uSTimelineBase as USTimelineProperty; if (uSTimelineProperty) { foreach (USPropertyInfo current in uSTimelineProperty.Properties) { foreach (USInternalCurve current2 in current.curves) { float num2 = current2.FindPrevKeyframeTime(sequence.RunningTime); if (num2 > num) { num = num2; } } } } } } return(num); }
static bool RunUpgradePath1_171To1_174(USSequencer sequence) { sequence.Version = 9; var count = 0; foreach (var timelineContainer in sequence.TimelineContainers) { var hasObserver = false; foreach (var timelineBase in timelineContainer.Timelines) { var observerTimeline = timelineBase as USTimelineObserver; if (observerTimeline) { hasObserver = true; } } if (hasObserver) { timelineContainer.Index = -1; } else { timelineContainer.Index = count; count++; } } return(true); }
public static float FindPrevKeyframeTime(USSequencer sequence) { var keyframeTime = 0.0f; foreach (var timelineContainer in sequence.TimelineContainers) { foreach (var timelineBase in timelineContainer.Timelines) { var timelineProperty = timelineBase as USTimelineProperty; if (!timelineProperty) { continue; } foreach (var property in timelineProperty.Properties) { foreach (var curve in property.curves) { var time = curve.FindPrevKeyframeTime(sequence.RunningTime); if (time > keyframeTime) { keyframeTime = time; } } } } } return(keyframeTime); }
static bool RunUpgradePath1_16To1_17(USSequencer sequence) { sequence.Version = 7; foreach (var timelineContainer in sequence.TimelineContainers) { foreach (var timelineBase in timelineContainer.Timelines) { var timeline = timelineBase as USTimelineObserver; if (timeline == null) { continue; } foreach (var keyframe in timeline.observerKeyframes) { if (keyframe.observer == null) { keyframe.observer = timeline; } } } } return(true); }
public static float FindPrevVisibleKeyframeTime(USHierarchy hierarchy, USSequencer sequence) { var previousKeyframeTime = 0.0f; foreach (var rootItems in hierarchy.RootItems) { if (!rootItems.IsExpanded) { continue; } foreach (var rootChild in rootItems.Children) { var propertyTimelineContainer = rootChild as USPropertyTimelineHierarchyItem; if (propertyTimelineContainer == null || !propertyTimelineContainer.IsExpanded) { continue; } var componentPreviousKeyframeTime = propertyTimelineContainer.GetPreviousShownKeyframeTime(sequence.RunningTime); if (componentPreviousKeyframeTime > previousKeyframeTime) { previousKeyframeTime = componentPreviousKeyframeTime; } } } return(previousKeyframeTime); }
public static float FindNextKeyframeTime(USSequencer sequence) { float keyframeTime = sequence.Duration; foreach (USTimelineContainer timelineContainer in sequence.TimelineContainers) { foreach (USTimelineBase timelineBase in timelineContainer.Timelines) { USTimelineProperty timelineProperty = timelineBase as USTimelineProperty; if (!timelineProperty) { continue; } foreach (var property in timelineProperty.Properties) { foreach (USInternalCurve curve in property.curves) { float time = curve.FindNextKeyframeTime(sequence.RunningTime); if (time < keyframeTime) { keyframeTime = time; } } } } } return(keyframeTime); }
private void LoadBundle() { try { if (this.Loader.DoneLoadBundle()) { this._destObj = this.Loader.InstantiateFromLoad(false, null); if (this._destObj == null) { this.DestroyByNull("_destObj"); } else { this._destObj.name = this._destObj.name.Replace("(Clone)", string.Empty); this._sequencer = this._destObj.GetComponentInChildren <USSequencer>(); if (this._sequencer == null) { UnityEngine.Object.DestroyImmediate(this._destObj); this.DestroyByNull("_sequencer"); } else { this.sequenceProgress = UsequenceController.LoadProgress.BUNDLE_EDIT; } } } } catch (Exception arg) { this.Loader.Dispose(true); Debug.Log("로드 오브젝트 처리 실패: " + arg); } }
public void RecordAdditionalObjects() { if (LookAtTarget != null) { lookAtTargetPath = USSequencer.GetFullHierarchyPath(LookAtTarget); } }
private void OnGUI() { var helpStyle = new GUIStyle(GUI.skin.label); helpStyle.wordWrap = true; helpStyle.alignment = TextAnchor.UpperLeft; GUILayout.Label("Use this window when you have duplicated cutscenes in your scene and you would like to make them unique.", helpStyle, GUILayout.ExpandWidth(true)); SequenceToDetach = EditorGUILayout.ObjectField(SequenceToDetach, typeof(USSequencer), true) as USSequencer; if (SequenceToDetach) { if (GUILayout.Button(string.Format("Detach : {0}", SequenceToDetach.name))) { ProcessSequence(SequenceToDetach); } } else { if (GUILayout.Button("Detach All in Hierarchy")) { var objects = FindObjectsOfType(typeof(USSequencer)) as USSequencer[]; foreach (var sequence in objects) { ProcessSequence(sequence); } } } }
public static float FindNextVisibleKeyframeTime(USHierarchy hierarchy, USSequencer sequence) { var nextKeyframeTime = sequence.Duration; foreach (var rootItems in hierarchy.RootItems) { if (!rootItems.IsExpanded) { continue; } foreach (var rootChild in rootItems.Children) { var propertyTimelineContainer = rootChild as USPropertyTimelineHierarchyItem; if (propertyTimelineContainer == null || !propertyTimelineContainer.IsExpanded) { continue; } var componentNextKeyframeTime = propertyTimelineContainer.GetNextShownKeyframeTime(sequence.RunningTime); if (componentNextKeyframeTime < nextKeyframeTime) { nextKeyframeTime = componentNextKeyframeTime; } } } return(nextKeyframeTime); }
static bool RunUpgradePath1_11To1_15(USSequencer sequence) { sequence.Version = 5; USRuntimeUtility.CreateAndAttachObserver(sequence); return(true); }
public void Play() { if (m_SequencerGameObject != null) { WellFired.USSequencer sequencer = m_SequencerGameObject.GetComponent <WellFired.USSequencer>(); sequencer.Play(); } }
private void RunningTimeUpdated(USSequencer sequence) { Button component = base.GetComponent <Button>(); bool flag = USRuntimeUtility.CanPlaySequence(sequence); component.interactable = flag; Debug.Log(flag); }
private void RunningTimeUpdated(USSequencer sequence) { var button = GetComponent <Button>(); var canPlay = USRuntimeUtility.CanPlaySequence(sequence); button.interactable = canPlay; Debug.Log(canPlay); }
public void ResetCachedData() { sequence = null; timelines = null; foreach (var timeline in Timelines) { timeline.ResetCachedData(); } }
public static bool CanSkipSequence(USSequencer sequence) { if (sequence.RunningTime >= sequence.Duration) { return(false); } return(true); }
public static bool CanStopSequence(USSequencer sequence) { if (sequence.RunningTime <= 0.0f) { return(false); } return(true); }
public static void DuplicateSequence(USSequencer currentSequence) { var duplicateObject = Object.Instantiate(currentSequence.gameObject) as GameObject; USDetachScriptableObjects.ProcessSequence(duplicateObject.GetComponent <USSequencer>()); Selection.activeGameObject = duplicateObject; USUndoManager.RegisterCreatedObjectUndo(duplicateObject, "Duplicate Sequence"); }
public static void StartRecordingSequence(USSequencer sequence, string capturePath, int captureFramerate, int upScaleAmount) { USRecordSequence orSpawnRecorder = USRuntimeUtility.GetOrSpawnRecorder(); orSpawnRecorder.StartRecording(); orSpawnRecorder.RecordOnStart = true; orSpawnRecorder.CapturePath = capturePath; orSpawnRecorder.CaptureFrameRate = captureFramerate; orSpawnRecorder.UpscaleAmount = upScaleAmount; }
//停止剧情 public void StopSequencer() { if (m_SequencerGameObject != null) { WellFired.USSequencer sequencer = m_SequencerGameObject.GetComponent <WellFired.USSequencer>(); sequencer.Stop(); PlaybackFinished(sequencer); } }
private void SequenceSwitch(USSequencer nextSequence) { USUndoManager.RegisterCompleteObjectUndo(this, "Select new sequence"); CurrentSequence = nextSequence; USUndoManager.RegisterCompleteObjectUndo(ContentRenderer, "Select new sequence"); ContentRenderer.OnSequenceChange(CurrentSequence); TryToFixPropertyTimelines(CurrentSequence); TryToFixObserverTimelines(CurrentSequence); }
public void ResetCachedData() { this.sequence = null; this.timelines = null; USTimelineBase[] array = this.Timelines; for (int i = 0; i < array.Length; i++) { USTimelineBase uSTimelineBase = array[i]; uSTimelineBase.ResetCachedData(); } }
/// <summary> /// Starts recording the passed sequence. /// </summary> public static void StartRecordingSequence(USSequencer sequence, string capturePath, int captureFramerate, int upScaleAmount) { var recorder = GetOrSpawnRecorder(); recorder.StartRecording(); recorder.RecordOnStart = true; recorder.CapturePath = capturePath; recorder.CaptureFrameRate = captureFramerate; recorder.UpscaleAmount = upScaleAmount; }
public static bool HasTimelineContainerWithAffectedObject(USSequencer sequence, Transform affectedObject) { foreach (var timelineContainers in sequence.TimelineContainers) { if (timelineContainers.AffectedObject == affectedObject) { return(true); } } return(false); }
public static bool HasTimelineContainerWithAffectedObject(USSequencer sequence, Transform affectedObject) { USTimelineContainer[] timelineContainers = sequence.TimelineContainers; for (int i = 0; i < timelineContainers.Length; i++) { USTimelineContainer uSTimelineContainer = timelineContainers[i]; if (uSTimelineContainer.AffectedObject == affectedObject) { return(true); } } return(false); }
public static bool CanPlaySequence(USSequencer sequence) { if (sequence.IsPlaying) { return(false); } if (sequence.RunningTime >= sequence.Duration) { return(false); } return(true); }
static bool RunUpgradePath1_35To1_4(USSequencer sequence) { sequence.Version = 15; foreach (var timelineContainer in sequence.TimelineContainers) { if (timelineContainer.AffectedObject != null) { // This forces the internal string to be updated timelineContainer.AffectedObject = timelineContainer.AffectedObject.transform; } } return(true); }
private void Start() { Button button = base.GetComponent <Button>(); if (!button) { Debug.LogError("The component Play Sequence button must be added to a Unity UI Button"); return; } if (!this.sequenceToPlay) { Debug.LogError("The Sequence to play field must be hooked up in the Inspector"); return; } button.onClick.AddListener(delegate { this.PlaySequence(); }); button.interactable = !this.sequenceToPlay.IsPlaying; if (this.manageInteractiveState) { USSequencer expr_95 = this.sequenceToPlay; expr_95.OnRunningTimeSet = (USSequencer.PlaybackDelegate) Delegate.Combine(expr_95.OnRunningTimeSet, new USSequencer.PlaybackDelegate(delegate(USSequencer sequence) { button.interactable = USRuntimeUtility.CanPlaySequence(sequence); })); USSequencer expr_BC = this.sequenceToPlay; expr_BC.PlaybackStarted = (USSequencer.PlaybackDelegate) Delegate.Combine(expr_BC.PlaybackStarted, new USSequencer.PlaybackDelegate(delegate(USSequencer sequence) { button.interactable = false; })); USSequencer expr_E3 = this.sequenceToPlay; expr_E3.PlaybackPaused = (USSequencer.PlaybackDelegate) Delegate.Combine(expr_E3.PlaybackPaused, new USSequencer.PlaybackDelegate(delegate(USSequencer sequence) { button.interactable = true; })); USSequencer expr_10A = this.sequenceToPlay; expr_10A.PlaybackFinished = (USSequencer.PlaybackDelegate) Delegate.Combine(expr_10A.PlaybackFinished, new USSequencer.PlaybackDelegate(delegate(USSequencer sequence) { button.interactable = false; })); USSequencer expr_131 = this.sequenceToPlay; expr_131.PlaybackStopped = (USSequencer.PlaybackDelegate) Delegate.Combine(expr_131.PlaybackStopped, new USSequencer.PlaybackDelegate(delegate(USSequencer sequence) { button.interactable = true; })); } }
private void MaintainHierarchyFor(USSequencer sequence) { USHierarchy.OnItemClicked -= OnItemClicked; USHierarchy.OnItemClicked += OnItemClicked; USHierarchy.OnItemContextClicked -= OnItemContextClicked; USHierarchy.OnItemContextClicked += OnItemContextClicked; USHierarchy.EditorWindow = SequenceWindow; USHierarchy.CurrentXMarkerDist = zoomInfo.currentXMarkerDist; USHierarchy.FloatingWidth = FloatingWidth; USHierarchy.Scrollable = true; USHierarchy.ScrollPos = ScrollInfo.currentScroll; USHierarchy.XScale = (totalPixelWidthOfTimeline / ScrubArea.width); USHierarchy.CheckConsistency(); }
private void TryToFixPropertyTimelines(USSequencer sequence) { foreach (var timelineContainers in sequence.TimelineContainers) { foreach (var timeline in timelineContainers.Timelines) { var propertyTimeline = timeline as USTimelineProperty; if (!propertyTimeline) { continue; } propertyTimeline.TryToFixComponentReferences(); } } }