mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
Updated sample scenes.
This commit is contained in:
parent
cc95db8e6c
commit
129a92afec
Binary file not shown.
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
[RequireComponent(typeof(CharacterController))]
|
[RequireComponent(typeof(CharacterController))]
|
||||||
public class BasicPlatformerController : MonoBehaviour {
|
public class BasicPlatformerController : MonoBehaviour {
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
public class Raptor : MonoBehaviour {
|
public class Raptor : MonoBehaviour {
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
public class SpineBeginnerTwo : MonoBehaviour {
|
public class SpineBeginnerTwo : MonoBehaviour {
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
public class SpineBlinkPlayer : MonoBehaviour {
|
public class SpineBlinkPlayer : MonoBehaviour {
|
||||||
const int BlinkTrack = 1;
|
const int BlinkTrack = 1;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
public class SpineboyBeginnerView : MonoBehaviour {
|
public class SpineboyBeginnerView : MonoBehaviour {
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 65ea82f2322d63247a1ee886ef3ba820
|
||||||
|
timeCreated: 1458684353
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -5,7 +5,7 @@
|
|||||||
* Full irrevocable rights and permissions granted to Esoteric Software
|
* Full irrevocable rights and permissions granted to Esoteric Software
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using Spine.Unity;
|
||||||
|
|
||||||
public class Chimera : MonoBehaviour {
|
public class Chimera : MonoBehaviour {
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
public class FootSoldierExample : MonoBehaviour {
|
public class FootSoldierExample : MonoBehaviour {
|
||||||
[SpineAnimation("Idle")]
|
[SpineAnimation("Idle")]
|
||||||
|
|||||||
@ -32,6 +32,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using Spine;
|
using Spine;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
public class Goblins : MonoBehaviour {
|
public class Goblins : MonoBehaviour {
|
||||||
private bool girlSkin;
|
private bool girlSkin;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
public class RaggedySpineboy : MonoBehaviour {
|
public class RaggedySpineboy : MonoBehaviour {
|
||||||
|
|
||||||
@ -7,12 +8,12 @@ public class RaggedySpineboy : MonoBehaviour {
|
|||||||
public float restoreDuration = 0.5f;
|
public float restoreDuration = 0.5f;
|
||||||
public Vector2 launchVelocity = new Vector2(50,100);
|
public Vector2 launchVelocity = new Vector2(50,100);
|
||||||
|
|
||||||
SkeletonRagdoll2D ragdoll;
|
Spine.Unity.Modules.SkeletonRagdoll2D ragdoll;
|
||||||
Collider2D naturalCollider;
|
Collider2D naturalCollider;
|
||||||
|
|
||||||
void Start () {
|
void Start () {
|
||||||
|
|
||||||
ragdoll = GetComponent<SkeletonRagdoll2D>();
|
ragdoll = GetComponent<Spine.Unity.Modules.SkeletonRagdoll2D>();
|
||||||
naturalCollider = GetComponent<Collider2D>();
|
naturalCollider = GetComponent<Collider2D>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
[ExecuteInEditMode]
|
[ExecuteInEditMode]
|
||||||
[RequireComponent(typeof(SkeletonRenderer))]
|
[RequireComponent(typeof(SkeletonRenderer))]
|
||||||
|
|||||||
@ -33,6 +33,7 @@ using UnityEngine;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using Spine;
|
using Spine;
|
||||||
using System;
|
using System;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
public class Spineboy : MonoBehaviour {
|
public class Spineboy : MonoBehaviour {
|
||||||
SkeletonAnimation skeletonAnimation;
|
SkeletonAnimation skeletonAnimation;
|
||||||
|
|||||||
52
spine-unity/Assets/Examples/Scripts/SpineboyPole.cs
Normal file
52
spine-unity/Assets/Examples/Scripts/SpineboyPole.cs
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
using Spine.Unity;
|
||||||
|
|
||||||
|
using Spine.Unity.Modules;
|
||||||
|
|
||||||
|
public class SpineboyPole : MonoBehaviour {
|
||||||
|
public SkeletonAnimation skeletonAnimation;
|
||||||
|
public SkeletonRenderSeparator separator;
|
||||||
|
|
||||||
|
[Space]
|
||||||
|
[SpineAnimation]
|
||||||
|
public string run;
|
||||||
|
[SpineAnimation]
|
||||||
|
public string pole;
|
||||||
|
public float startX;
|
||||||
|
public float endX;
|
||||||
|
|
||||||
|
const float Speed = 18f;
|
||||||
|
const float RunTimeScale = 1.5f;
|
||||||
|
|
||||||
|
IEnumerator Start () {
|
||||||
|
var state = skeletonAnimation.state;
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
// Run phase
|
||||||
|
SetXPosition(startX);
|
||||||
|
separator.enabled = false; // Disable Separator during run.
|
||||||
|
state.SetAnimation(0, run, true);
|
||||||
|
state.TimeScale = RunTimeScale;
|
||||||
|
|
||||||
|
while (transform.localPosition.x < endX) {
|
||||||
|
transform.Translate(Vector3.right * Speed * Time.deltaTime);
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hit phase
|
||||||
|
SetXPosition(endX);
|
||||||
|
separator.enabled = true; // Enable Separator when hit
|
||||||
|
var poleTrack = state.SetAnimation(0, pole, false);
|
||||||
|
yield return new WaitForSpineAnimationComplete(poleTrack);
|
||||||
|
yield return new WaitForSeconds(1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetXPosition (float x) {
|
||||||
|
var tp = transform.localPosition;
|
||||||
|
tp.x = x;
|
||||||
|
transform.localPosition = tp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
12
spine-unity/Assets/Examples/Scripts/SpineboyPole.cs.meta
Normal file
12
spine-unity/Assets/Examples/Scripts/SpineboyPole.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 66b573446c3300f45b950b243338b97c
|
||||||
|
timeCreated: 1458684804
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
BIN
spine-unity/Assets/Examples/Spine/square32.png
Normal file
BIN
spine-unity/Assets/Examples/Spine/square32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 950 B |
57
spine-unity/Assets/Examples/Spine/square32.png.meta
Normal file
57
spine-unity/Assets/Examples/Spine/square32.png.meta
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 718074e4e56a5404e824bf8e6571ea7d
|
||||||
|
timeCreated: 1458684538
|
||||||
|
licenseType: Free
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 8
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
x
Reference in New Issue
Block a user