• Unity
  • Spine Unity code compile error on 2018.1 beta

Related Discussions
...

From https://unity3d.com/unity/beta-download I think the problem is because :

Graphics: Texture is now abstract.

The line with new Texture() now does not work because the constructor is now protected. Here's a list of all errors so far.

Assets/Spine/spine-unity/Editor/SkeletonDataAssetInspector.cs(660,26): error CS1540: Cannot access protected member UnityEngine.Texture.Texture()' via a qualifier of typeUnityEngine.Texture'. The qualifier must be of type `Spine.Unity.Editor.SkeletonDataAssetInspector' or derived from it

Assets/Spine/spine-unity/Editor/SkeletonDataAssetInspector.cs(660,26): error CS0122: `UnityEngine.Texture.Texture()' is inaccessible due to its protection level

Do you have a quick fix that would not cause problem somewhere else? I just replace it with Texture2D m_previewTex = new Texture2D(0, 0, TextureFormat.RGBA32, false); and cast Texture to Texture2D a bit below that line so that it compiles.

Thanks for reporting!

Are you using the latest runtime? That doesn't seem to match the current line numbers.

Unity has been kind of inconsistent about what it expects on that part of the API over the past few versions. We'll review and and see a good fix or workaround. That line is actually supposed to be pretty inconsequential.