diff --git a/spine-unity/Assets/Examples/Scenes/SpineGauge.unity b/spine-unity/Assets/Examples/Scenes/SpineGauge.unity new file mode 100644 index 000000000..5a8f1c3d8 Binary files /dev/null and b/spine-unity/Assets/Examples/Scenes/SpineGauge.unity differ diff --git a/spine-unity/Assets/Examples/Scenes/SpineGauge.unity.meta b/spine-unity/Assets/Examples/Scenes/SpineGauge.unity.meta new file mode 100644 index 000000000..80946af3f --- /dev/null +++ b/spine-unity/Assets/Examples/Scenes/SpineGauge.unity.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: b9ae310595c646944a1268f51fb389a4 +DefaultImporter: + userData: diff --git a/spine-unity/Assets/Examples/Scripts/SpineGauge.cs b/spine-unity/Assets/Examples/Scripts/SpineGauge.cs new file mode 100644 index 000000000..7aedb3c35 --- /dev/null +++ b/spine-unity/Assets/Examples/Scripts/SpineGauge.cs @@ -0,0 +1,38 @@ +using UnityEngine; +using System.Collections; + +[ExecuteInEditMode] +[RequireComponent(typeof(SkeletonRenderer))] +public class SpineGauge : MonoBehaviour{ + + [Range(0,1)] + public float fill = 0; + + [SpineAnimation] + public string fillAnimationName; + Spine.Animation fillAnimation; + + SkeletonRenderer skeletonRenderer; + + void Start () { + skeletonRenderer = GetComponent(); + } + + void Update () { + + var skeleton = skeletonRenderer.skeleton; + + if (skeleton == null) + return; + + if (fillAnimation == null) { + fillAnimation = skeleton.Data.FindAnimation(fillAnimationName); + if (fillAnimation == null) + return; + } + + fillAnimation.Apply(skeleton, 0, fill, false, null); + skeleton.Update(Time.deltaTime); + skeleton.UpdateWorldTransform(); + } +} diff --git a/spine-unity/Assets/Examples/Scripts/SpineGauge.cs.meta b/spine-unity/Assets/Examples/Scripts/SpineGauge.cs.meta new file mode 100644 index 000000000..7000f17e7 --- /dev/null +++ b/spine-unity/Assets/Examples/Scripts/SpineGauge.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c888ce38da699d143a68153f26379a37 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/spine-unity/Assets/Examples/Spine/Gauge.meta b/spine-unity/Assets/Examples/Spine/Gauge.meta new file mode 100644 index 000000000..4b861b6f6 --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 850ff16a039121a48a7cf86e301ef1fa +folderAsset: yes +DefaultImporter: + userData: diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge.atlas.txt b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.atlas.txt new file mode 100644 index 000000000..65905464f --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.atlas.txt @@ -0,0 +1,27 @@ + +Gauge.png +size: 1024,64 +format: RGBA8888 +filter: Linear,Linear +repeat: none +Background + rotate: false + xy: 254, 30 + size: 224, 32 + orig: 224, 32 + offset: 0, 0 + index: -1 +Bar + rotate: false + xy: 480, 30 + size: 224, 32 + orig: 224, 32 + offset: 0, 0 + index: -1 +Border + rotate: false + xy: 2, 2 + size: 250, 60 + orig: 250, 60 + offset: 0, 0 + index: -1 diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge.atlas.txt.meta b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.atlas.txt.meta new file mode 100644 index 000000000..cf6355bec --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.atlas.txt.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 6afa4952627478a44995c3cdf2e96a24 +TextScriptImporter: + userData: diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge.json b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.json new file mode 100644 index 000000000..cad689354 --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.json @@ -0,0 +1,42 @@ +{ +"skeleton": { "hash": "IKLl/62j+Y1bsQ8rdHoVK9PDip8", "spine": "2.1.27", "width": 250, "height": 60, "images": "./images/" }, +"bones": [ + { "name": "root" }, + { "name": "Bar", "parent": "root", "x": -112.29 } +], +"slots": [ + { "name": "Background", "bone": "root", "attachment": "Background" }, + { "name": "Bar", "bone": "Bar", "attachment": "Bar" }, + { "name": "Border", "bone": "root", "attachment": "Border" } +], +"skins": { + "default": { + "Background": { + "Background": { "width": 224, "height": 32 } + }, + "Bar": { + "Bar": { "x": 112.29, "width": 224, "height": 32 } + }, + "Border": { + "Border": { "width": 250, "height": 60 } + } + } +}, +"animations": { + "Fill": { + "bones": { + "Bar": { + "scale": [ + { + "time": 0, + "x": 0.002, + "y": 1, + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { "time": 1, "x": 1, "y": 1 } + ] + } + } + } +} +} \ No newline at end of file diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge.json.meta b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.json.meta new file mode 100644 index 000000000..44784c8ac --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.json.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: af5e86c10d52bad43b0b62542815f199 +TextScriptImporter: + userData: diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge.png b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.png new file mode 100644 index 000000000..a15e857d2 Binary files /dev/null and b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.png differ diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge.png.meta b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.png.meta new file mode 100644 index 000000000..ad72c705a --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge/Gauge.png.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: a11301aad15ed6b4995485a02a81b132 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 5 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Atlas.asset b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Atlas.asset new file mode 100644 index 000000000..8459768c9 Binary files /dev/null and b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Atlas.asset differ diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Atlas.asset.meta b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Atlas.asset.meta new file mode 100644 index 000000000..471fc2038 --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Atlas.asset.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: e888132736b335e4c88bc0a283b474c6 +NativeFormatImporter: + userData: diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Material.mat b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Material.mat new file mode 100644 index 000000000..ca7165be3 Binary files /dev/null and b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Material.mat differ diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Material.mat.meta b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Material.mat.meta new file mode 100644 index 000000000..7b7b3aaa2 --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_Material.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 9ab9bdbda020b3e46b5a3b0558ef591d +NativeFormatImporter: + userData: diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge_SkeletonData.asset b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_SkeletonData.asset new file mode 100644 index 000000000..089e29b45 Binary files /dev/null and b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_SkeletonData.asset differ diff --git a/spine-unity/Assets/Examples/Spine/Gauge/Gauge_SkeletonData.asset.meta b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_SkeletonData.asset.meta new file mode 100644 index 000000000..bc8aafee8 --- /dev/null +++ b/spine-unity/Assets/Examples/Spine/Gauge/Gauge_SkeletonData.asset.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 22b19a38b21c15a48854f0db86b0b7d3 +NativeFormatImporter: + userData: diff --git a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs index 19991c208..36dc47ae3 100644 --- a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs +++ b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs @@ -727,6 +727,7 @@ public class SpineEditorUtilities : AssetPostprocessor { Texture2D texture = (Texture2D)AssetDatabase.LoadAssetAtPath(texturePath, typeof(Texture2D)); TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); + texImporter.textureType = TextureImporterType.Advanced; texImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor; texImporter.mipmapEnabled = false; texImporter.alphaIsTransparency = false;