- 수정됨
Runtime 3.5 Unity
Hi!,
Is it ready the Spine-Unity runtime for Spine 3.5?
Thanks!
(Where can I know if the runtimes are updated or not? in your website I can't find any where to know that, other than tutorials on how to install or use runtimes.)
You can see the status of Spine-Unity here: Spine Unity Download
You can download the 3.5 beta there. People have been testing it.
The instructions on how to install/use runtimes are in the README.md of each runtime folder in the git repository. GitHub - EsotericSoftware/spine-runtimes: 2D skeletal animation runtimes for Spine.
3.5 is now released.
Hi, please can you update us how to do "FLIP" in runtime in 3.5?
I'm missing any information on it and seems like a lot changed in runtimes.
Flip? Like skeleton flip? That hasn't changed since it was introduced.
Just set the flipX or flipY field on the skeleton object.
Hi Pharan, I'm talking about SkeletonUtilityBone.
foriero wrote
change the scale of the bone to x=-1
Ok thanks. One thing. Can you please update this line in SkeletonRenderer
if (vertexCount > 0 && (lastMaterial.GetInstanceID() != material.GetInstanceID() || forceSeparate))
to this
if (lastMaterial && vertexCount > 0 && (lastMaterial.GetInstanceID() != material.GetInstanceID() || forceSeparate))
When we enable gameobject that was disabled from the beginning of the scene we get errors that lastMateriasl is null.
Thank you.
Spine[guys] doesn't like to add these type of checks because it highlights when something went wrong, i.e. things should always have materials. What we do is enable everything on start, but set it on an invisible layer , then a frame or two later disable it.
The other reason in this particular case is that UnityEngine.Object has an overloaded null check which has a rather... meaty performance hit.
That and yes, skipping the null check here surfaces an error that should be caught higher up.
I'll try to reproduce that bug though. It shouldn't care if the GameObject was disabled from the beginning of the scene.
Couldn't repro.
Hi Pharan, I see this happening when we instantiate PREFAB with Spine in it. I will try to dig deeper why this is happening.
NullReferenceException: Object reference not set to an instance of an object
Spine.Unity.SkeletonRenderer.LateUpdate () (at Assets/Spine/spine-unity/SkeletonRenderer.cs:320)
Spine.Unity.SkeletonRenderer.Initialize (Boolean overwrite) (at Assets/Spine/spine-unity/SkeletonRenderer.cs:222)
Spine.Unity.SkeletonAnimation.Initialize (Boolean overwrite) (at Assets/Spine/spine-unity/SkeletonAnimation.cs:139)
Spine.Unity.SkeletonRenderer.Awake () (at Assets/Spine/spine-unity/SkeletonRenderer.cs:160)
UnityEngine.Object:Instantiate(GameObject, Transform, Boolean)
TypingFingers:set_background(BackgroundEnum) (at Assets/Projects/TypingFingers/Scripts/TypingFingers.GUI.cs:518)
TypingFingersnBackgroundSpaceClick() (at Assets/Projects/TypingFingers/Scripts/TypingFingers.GUI.cs:547)
UnityEngine.EventSystems.EventSystem:Update()
Ok found it. It was connected to Unity 5.5 new importing texture pipeline. Our texture had wrong settings so was not included in the material itself which resulted in that error.
Strange.
I had a quick look at the texture import settings of 5.5
Seems like a few things could change. I pushed some updated code the other day that lets Spine's auto-importer handle it using the new API, but I don't know what about it would break.
Hi Pharan, this is our postprocess import. See at the bottom.
void OnPreprocessTexture ()
{
if (!isOn) {
return;
}
if (item == null) {
return;
}
Debug.Log ("Illustrator import : " + assetImporter.assetPath);
TextureImporter textureImport = (TextureImporter)assetImporter;
textureImport.textureFormat = TextureImporterFormat.AutomaticTruecolor;
textureImport.maxTextureSize = 2048;
List<IntegratorTool2DCompressionPreset.TextureOverride> textureOverrides = null;
if (item.compressionIndex > 0) {
textureOverrides = IntegratorTool2DCompressionPreset.presets [item.compressionIndex - 1].textureOverrides;
} else {
textureOverrides = item.textureOverrides;
}
foreach (IntegratorTool2DCompressionPreset.TextureOverride textureOverride in textureOverrides) {
string buildTargetGroup = BuildTargetGroup.Unknown.ToString ();
switch (textureOverride.buildTargetGroup) {
case BuildTargetGroup.iOS:
buildTargetGroup = "iPhone";
break;
case BuildTargetGroup.Metro:
//case BuildTargetGroup.WSA:
case BuildTargetGroup.WP8:
buildTargetGroup = "Windows Store Apps";
break;
default:
buildTargetGroup = textureOverride.buildTargetGroup.ToString ();
break;
}
TextureImporterPlatformSettings pSettings = textureImport.GetPlatformTextureSettings (buildTargetGroup);
pSettings.maxTextureSize = int.Parse (IntegratorTool2DCompressionPreset.textureMaxSizes [textureOverride.textureMaxSizeIndex]);
pSettings.compressionQuality = (int)textureOverride.compression;
pSettings.allowsAlphaSplitting = false;
pSettings.format = textureOverride.textureImporterFormat;
textureImport.SetPlatformTextureSettings (pSettings);
textureImport.textureType = item.textureImporterType;
textureImport.spritePackingTag = item.spritePackingTag;
}
textureImport.spritePixelsPerUnit = item.lastExportResolution.y / (item.orthographicsSize * 2f);
textureImport.mipmapEnabled = false;
textureImport.npotScale = TextureImporterNPOTScale.None;
string path = Path.Combine (Application.dataPath, textureImport.assetPath.Remove (0, 7));
string[] files = Directory.GetFiles (Path.GetDirectoryName (path), "*.atlas.txt", SearchOption.TopDirectoryOnly);
if (files.Length > 0) {
Debug.Log ("Importing Spine Atlas Texture : " + textureImport.assetPath);
textureImport.textureType = TextureImporterType.Default;
textureImport.spriteImportMode = SpriteImportMode.None;
textureImport.alphaIsTransparency = false;
}
}
Ah, so it was your stuff.
Pharan wroteYou can see the status of Spine-Unity here: Spine Unity Download
You can download the 3.5 beta there. People have been testing it.
3.5 is now released.
THANKS!!! for the response, sorry for not checking the forums again for the answer