private OnionSkinObject SetFrame(int frame, float time) { OnionSkinObject oso; if (!onionSkinObjects.TryGetValue(frame, out oso)) { oso = new OnionSkinObject(vaw.gameObject); { const int StartOffset = 20; var offset = Math.Abs(frame * 2) + (frame > 0 ? 0 : 1); oso.SetRenderQueue((int)RenderQueue.GeometryLast - (StartOffset - offset)); } onionSkinObjects.Add(frame, oso); } oso.active = true; if (!oso.dummyObject.gameObject.activeSelf) { oso.dummyObject.gameObject.SetActive(true); } oso.dummyObject.UpdateState(); oso.dummyObject.SetTransformStart(); oso.dummyObject.SampleAnimation(va.currentClip, time); if (EditorApplication.isPlaying && EditorApplication.isPaused) //Is there a bug that will not be updated while pausing? Therefore, it forcibly updates it. { oso.dummyObject.RendererForceUpdate(); } return(oso); }
private OnionSkinObject SetFrame(int frame, float time) { OnionSkinObject oso; if (!onionSkinObjects.TryGetValue(frame, out oso)) { oso = new OnionSkinObject(va.editGameObject); { const int StartOffset = 20; var offset = Math.Abs(frame * 2) + (frame > 0 ? 0 : 1); oso.SetRenderQueue((int)RenderQueue.GeometryLast - (StartOffset - offset)); } onionSkinObjects.Add(frame, oso); } oso.active = true; oso.dummyObject.SetSource(); oso.dummyObject.UpdateState(); oso.dummyObject.SampleAnimation(va.currentClip, time); return(oso); }