public static Example.MapAnimation ExportMapAnimation(MapAnimation mapAnimation, AnimationFrameAppendPolicy appendPolicy) { if (mapAnimation == null) { return(null); } Example.MapAnimation anim = new Example.MapAnimation(); List <Example.MapAnimationFrame> frames = new List <Example.MapAnimationFrame> (); foreach (var mapFrame in mapAnimation.GetComponentsInChildren <MapAnimationFrame>()) { var frame = ExportFrame(mapFrame); frames.Add(frame); } /*frames.Sort (delegate(Example.MapAnimationFrame x, Example.MapAnimationFrame y) { * return x.Time - y.Time; * });*/ if (frames.Count > 0) { var lastFrame = frames [frames.Count - 1]; if (appendPolicy == AnimationFrameAppendPolicy.AFTER) { var frame = CreateFrame(mapAnimation.transform, 0, lastFrame.RotationType == Example.MapAnimationFrame.RelativeType.RELATIVE, lastFrame.Navigation); frames.Add(frame); } } anim.Id = mapAnimation.id; anim.Frames = frames; anim.Duration = mapAnimation.duration; return(anim); }
public IEnumerator initialization() { if (instance == null) { instance = this; } Cursor.visible = false; Screen.SetResolution(1920, 1200, false); readJson = FindObjectOfType <ReadJson>(); cameraMovement_Hemisphere = FindObjectOfType <CameraMovement_hemisphere>(); sendUPDData = FindObjectOfType <SendUPDData>(); getUDPMessage = FindObjectOfType <GetUDPMessage>(); meshVideo = FindObjectOfType <MeshVideo>(); mapAnimation = FindObjectOfType <MapAnimation>(); canvasCtr = FindObjectOfType <CanvasCtr>(); yield return(StartCoroutine(readJson.initialization())); yield return(StartCoroutine(LoadImage())); CreateInfoObject(); yield return(StartCoroutine(cameraMovement_Hemisphere.initialization())); getUDPMessage.InitializationUdp(); sendUPDData.initialization(); mapAnimation.initialization(); meshVideo.initialization(); canvasCtr.initialization();//播放视频事件会会在其中被添加,之后在开始视频 MeshVideo.instance.LoadVideo(MeshVideo.instance.path); }
private void AnimationPlayer_Load(object sender, EventArgs e) { if (_ShellService == null) { _ShellService = MyAppManager.Instance.CompositionContainer.GetExportedValue <IShellService>(); } MapAnimation map = new MapAnimation(); map.CurrentChanged += map_CurrentChanged; _Animators.Add(map); SurfaceAnimation surf = new SurfaceAnimation() { SurfacePlot = _ShellService.SurfacePlot }; surf.CurrentChanged += map_CurrentChanged; _Animators.Add(surf); cmbAnimators.ComboBox.DisplayMember = "Name"; cmbAnimators.ComboBox.DataSource = _Animators.ToArray(); cmbAnimators.ComboBox.SelectedIndex = 0; }