mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
[unity] Fixed some compiler warnings when building for platforms instead of editor. Closes #1604.
This commit is contained in:
parent
e62c42c041
commit
d252df7ece
@ -38,6 +38,9 @@ namespace Spine {
|
|||||||
public const float RadDeg = 180f / PI;
|
public const float RadDeg = 180f / PI;
|
||||||
public const float DegRad = PI / 180;
|
public const float DegRad = PI / 180;
|
||||||
|
|
||||||
|
static Random random = new Random();
|
||||||
|
|
||||||
|
#if USE_FAST_SIN_COS_ATAN2_APPROXIMATIONS
|
||||||
const int SIN_BITS = 14; // 16KB. Adjust for accuracy.
|
const int SIN_BITS = 14; // 16KB. Adjust for accuracy.
|
||||||
const int SIN_MASK = ~(-1 << SIN_BITS);
|
const int SIN_MASK = ~(-1 << SIN_BITS);
|
||||||
const int SIN_COUNT = SIN_MASK + 1;
|
const int SIN_COUNT = SIN_MASK + 1;
|
||||||
@ -47,9 +50,6 @@ namespace Spine {
|
|||||||
const float DegToIndex = SIN_COUNT / DegFull;
|
const float DegToIndex = SIN_COUNT / DegFull;
|
||||||
static float[] sin = new float[SIN_COUNT];
|
static float[] sin = new float[SIN_COUNT];
|
||||||
|
|
||||||
static Random random = new Random();
|
|
||||||
|
|
||||||
#if USE_FAST_SIN_COS_ATAN2_APPROXIMATIONS
|
|
||||||
static MathUtils () {
|
static MathUtils () {
|
||||||
for (int i = 0; i < SIN_COUNT; i++)
|
for (int i = 0; i < SIN_COUNT; i++)
|
||||||
sin[i] = (float)Math.Sin((i + 0.5f) / SIN_COUNT * RadFull);
|
sin[i] = (float)Math.Sin((i + 0.5f) / SIN_COUNT * RadFull);
|
||||||
|
|||||||
@ -36,7 +36,7 @@ namespace Spine.Unity.Examples {
|
|||||||
|
|
||||||
[SpineBone(dataField:"skeletonAnimation")]
|
[SpineBone(dataField:"skeletonAnimation")]
|
||||||
public string boneName;
|
public string boneName;
|
||||||
public new Camera camera;
|
public Camera cam;
|
||||||
|
|
||||||
Bone bone;
|
Bone bone;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ namespace Spine.Unity.Examples {
|
|||||||
|
|
||||||
void Update () {
|
void Update () {
|
||||||
var mousePosition = Input.mousePosition;
|
var mousePosition = Input.mousePosition;
|
||||||
var worldMousePosition = camera.ScreenToWorldPoint(mousePosition);
|
var worldMousePosition = cam.ScreenToWorldPoint(mousePosition);
|
||||||
var skeletonSpacePoint = skeletonAnimation.transform.InverseTransformPoint(worldMousePosition);
|
var skeletonSpacePoint = skeletonAnimation.transform.InverseTransformPoint(worldMousePosition);
|
||||||
skeletonSpacePoint.x *= skeletonAnimation.Skeleton.ScaleX;
|
skeletonSpacePoint.x *= skeletonAnimation.Skeleton.ScaleX;
|
||||||
skeletonSpacePoint.y *= skeletonAnimation.Skeleton.ScaleY;
|
skeletonSpacePoint.y *= skeletonAnimation.Skeleton.ScaleY;
|
||||||
|
|||||||
@ -36,10 +36,12 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
public static class SkeletonDataCompatibility {
|
public static class SkeletonDataCompatibility {
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
static readonly int[][] compatibleBinaryVersions = { new[] { 3, 8, 0 } };
|
static readonly int[][] compatibleBinaryVersions = { new[] { 3, 8, 0 } };
|
||||||
static readonly int[][] compatibleJsonVersions = { new[] { 3, 8, 0 } };
|
static readonly int[][] compatibleJsonVersions = { new[] { 3, 8, 0 } };
|
||||||
|
|
||||||
static bool wasVersionDialogShown = false;
|
static bool wasVersionDialogShown = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
public enum SourceType {
|
public enum SourceType {
|
||||||
Json,
|
Json,
|
||||||
@ -110,7 +112,6 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string primaryRuntimeVersionDebugString = compatibleBinaryVersions[0][0] + "." + compatibleBinaryVersions[0][1];
|
|
||||||
if (string.IsNullOrEmpty(fileVersion.rawVersion)) {
|
if (string.IsNullOrEmpty(fileVersion.rawVersion)) {
|
||||||
// very likely not a Spine skeleton json file at all.
|
// very likely not a Spine skeleton json file at all.
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -487,6 +487,10 @@ namespace Spine.Unity.AttachmentTools {
|
|||||||
this.i = i;
|
this.i = i;
|
||||||
this.region = region;
|
this.region = region;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode () {
|
||||||
|
return i.GetHashCode() * 23 ^ region.GetHashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
static Dictionary<IntAndAtlasRegionKey, Texture2D> CachedRegionTextures = new Dictionary<IntAndAtlasRegionKey, Texture2D>();
|
static Dictionary<IntAndAtlasRegionKey, Texture2D> CachedRegionTextures = new Dictionary<IntAndAtlasRegionKey, Texture2D>();
|
||||||
static List<Texture2D> CachedRegionTexturesList = new List<Texture2D>();
|
static List<Texture2D> CachedRegionTexturesList = new List<Texture2D>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user