internal void ToggleRecording() { Recording = !Recording; Timeline.Play = !Timeline.Play; if (Selector.CurrentSelection != null) { LiveObjectScript liveObject = Selector.CurrentSelection.GetComponent <LiveObjectScript>(); Selector.Recording = !Selector.Recording; } }
private void UpdateLiveObject(LiveObjectScript liveObject, float rawTime, int keyframeIndex) { if (Recording && Selector.CurrentSelection == liveObject) { bool wasRecordingLastFrame = lastRecordedObject == liveObject; liveObject.Record(keyframeIndex, wasRecordingLastFrame, ColorPicking); } else { liveObject.UpdateFramePlayback(rawTime, keyframeIndex, TimeBetweenKeyframes); } }
public void Load() { XmlDocument document = new XmlDocument(); document.Load(SaveFilePath); foreach (XmlElement objectData in document.DocumentElement.ChildNodes) { string name = objectData.Attributes.GetNamedItem("Name").InnerText; LiveObjectScript sceneAsset = LiveObjects.First(item => item.gameObject.name == name); sceneAsset.Load(objectData); } Timeline.MaxTime = Convert.ToSingle(document.DocumentElement.Attributes.GetNamedItem("MaxTime").InnerText); }
private void Update() { Outliner.OutlineColor = GetOulinerColor(); if (Recording) { return; } if (Selecting) { RaycastHit rayInfo; Ray ray = new Ray(SelectionWand.position, SelectionWand.forward); bool hit = Physics.Raycast(ray, out rayInfo, RayDistance); if (hit) { CurrentSelection = rayInfo.transform.gameObject.GetComponent <LiveObjectScript>(); } else { CurrentSelection = null; } UpdateWandVisual(rayInfo, hit); } if (CurrentSelection != lastSelection) { if (CurrentSelection == null) { Outliner.ClearOutlineTarget(); } else { Outliner.UpdateOutlineTarget(CurrentSelection.gameObject); } } wandRayVisiual.SetActive(Selecting); lastSelection = CurrentSelection; Outliner.DoBlit = CurrentSelection != null; }
private void Update() { UpdateColorPicker(); float time = Timeline.CurrentTime; if (Mathf.Abs(time - lastTimeProcessed) > TimeBetweenKeyframes) { int keyframeIndex = (int)(time / TimeBetweenKeyframes); foreach (LiveObjectScript liveObject in LiveObjects) { UpdateLiveObject(liveObject, time, keyframeIndex); } lastTimeProcessed = time; } lastRecordedObject = Recording ? Selector.CurrentSelection : null; if (DoTheLoad) { DoTheLoad = false; Load(); } }