zeuxgame

I'am making an animation selector for our project
To make the window can play animation and previewed, I copied some logic from SkeletonDataAssetInspector, but as the EditorWindow has no preview function by Unity, when I directly call preview.handleInteractivePrrviewGUI, It not update correctly, and It only change pose 1 frame after switch outside Unity and back to focus Unity window, very weired

do anyone can explain how to do this right?
zeuxgame
  • Сообщения: 26

Harald

Do you mean that you receive only a single update instead of e.g. 30 updates per second, and that the skeleton is therefore not moving? Or did I misunderstand your question?
Аватара пользователя
Harald

Harri
  • Сообщения: 1097

zeuxgame

Camera in preview seems keep updating, but skeleton doesn't, switch between outta window and Unity make it jump to one frame of the animation playing
zeuxgame
  • Сообщения: 26

Harald

Did you register any update call at EditorApplication.update? E.g. as the following line in the SkeletonDataAsset inspector code:
spine-runtimes/SkeletonDataAssetInspector.cs at 3.8
Аватара пользователя
Harald

Harri
  • Сообщения: 1097

zeuxgame

yes, I tried create SkeletonDataAssetInspector Editor then call OnEnable manually, it contains that

Btw, we use 3.7 and 2018.3
zeuxgame
  • Сообщения: 26

Harald

You should not create a SkeletonDataAssetInspector editor window instance. What I meant above is that you should be executing similar code in your own class.
Аватара пользователя
Harald

Harri
  • Сообщения: 1097

zeuxgame

After few days, now I copied most SkeletonDataAssetInspector code to my EditoWindow, but since method like OnInteractivePreviewGUI is not handled by EditorWindow self, so I called it in OnGUI manually, but it still not working, the preview seems keep updating but skeleton dose not
zeuxgame
  • Сообщения: 26

Harald

Sorry to hear that. How do you draw the skeleton? Is this view repainting at all if you place anything else in it?
Аватара пользователя
Harald

Harri
  • Сообщения: 1097


Вернуться в Unity