• Unity
  • The type or namespace name 'Editor' does not exist

  • Изменено
Related Discussions
...

Hi Harald

I'm getting this error when trying to make a build. :wounded:

error CS0234: The type or namespace name 'Editor' does not exist in the namespace 'Spine.Unity' (are you missing an assembly reference?)

I'm using this namespace to access:

using Spine.Unity.Editor;
SpineEditorUtilities.ReloadSkeletonDataAssetAndComponent(_graphic);

Do you have any ideas ?

I presume the .Editor means it only works in the editor.. is there a runtime equivalent I can use?

I installed the latest runtimes

  1. spine-unity-4.0-2022-06-09.unitypackage
    Unity 2021.1.28f1

I can play the game perfectly fine in the editor.

Thanks for your help!

In general you can always have a look at the code that is executed in the editor method and just inline the required parts where you need them:

// if you also want to clear and re-load the atlas assets
foreach (AtlasAssetBase aa in skeletonDataAsset.atlasAssets) {
    if (aa != null) aa.Clear();
}

skeletonDataAsset.Clear();
skeletonDataAsset.GetSkeletonData(true);

skeletonGraphic.Initialize(true);
skeletonGraphic.LateUpdate();
22 дня спустя

Ok thanks Harald I'll give it a shot!

Harald написал

In general you can always have a look at the code that is executed in the editor method and just inline the required parts where you need them:

// if you also want to clear and re-load the atlas assets
foreach (AtlasAssetBase aa in skeletonDataAsset.atlasAssets) {
    if (aa != null) aa.Clear();
}

skeletonDataAsset.Clear();
skeletonDataAsset.GetSkeletonData(true);

skeletonGraphic.Initialize(true);
skeletonGraphic.LateUpdate();