<div style="padding:15px 15px 2px 20px; border-radius:2px; margin-bottom:20px; border:1px solid #ddd">

<callout>
<p style="margin-bottom:0.75em"><b>Licensing</b></p>!!
A Spine license is [required](/git/spine-runtimes/spine-unity#licensing) to integrate the Spine Runtimes into your applications.
</callout>

<div style="font-size: 1.6em; margin: 0 0 .5em;">spine-unity Runtime Documentation</div>!!
* [Installation](/spine-unity-installation)
* [Examples](/spine-unity-examples)
* [Assets](/spine-unity-assets)
* [Main Components](/spine-unity-main-components)
* [Utility Components](/spine-unity-utility-components)
* [Rendering](/spine-unity-rendering)
* [Timeline Extension UPM Package](/spine-unity-timeline)
* [On-Demand Loading Extension UPM Packages](/spine-unity-on-demand-loading)
* [FAQ](/spine-unity-faq)
</div>!!

# Example Scenes

The spine-unity runtime includes example scenes to demonstrate the most important components and usage of the C# API for common use cases. You can find them in the `Spine Examples` top level directory. Each scene includes a description text that will help you to quickly discover and understand the relevant parts. This video provides an overview of the example scenes included in the spine-unity runtime.

<iframe width="560" height="315" src="https://www.youtube.com/embed/DxDZtTK2nlE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>!!

If you are using the spine-unity runtime for the first time, it is highly recommended to check out at least the example scenes in the `Spine Examples/Getting Started`.

## Spine Examples / Getting Started

The example scenes in the `Spine Examples/Getting Started` demonstrate the fundamental components and basic use cases.

### 1 The Spine GameObject

This scene demonstrates the [SkeletonAnimation component](/spine-unity-main-components#SkeletonAnimation-Component) and [SkeletonRenderer component](/spine-unity-main-components#SkeletonRenderer-Component) with the referenced SkeletonDataAsset providing the necessary data.

### 2 Controlling Animation

This scene demonstrates basic animation code using the C# API - starting animations and reacting to animation events.

When pressing play, Spineboy will sequentially play animations walk, run, idle, and turn. Footstep events will trigger a sound accordingly.

You can inspect the example script `SpineBeginnerTwo` component which is attached at the `spineboy` GameObject. It demonstrates usage of `SkeletonAnimation.AnimationState.SetAnimation()` and `SkeletonAnimation.AnimationState.AddAnimation()`.
The script `HandleEventWithAudioExample` attached at the `sound` GameObject shows how you can hook up your own event method callback by registering it at `SkeletonAnimation.AnimationState.Event`.

### 3 Controlling Animation Continued

This scene demonstrates how you can play animations simultaneously by using multiple animation tracks. It also shows how to use `AnimationReferenceAssets` as an alternative to using animation name strings.

When pressing play, the `walk` animation will start to play in a loop. At the same time, and in its own timeframe, the `gungrab` and `gunkeep` animations are playing as a secondary animation.

You can inspect the example script `Raptor` attached at the `raptor Skeleton` GameObject. It shows [how to expose AnimationReferenceAsset](https://github.com/EsotericSoftware/spine-runtimes/blob/4.2/spine-unity/Assets/Spine%20Examples/Scripts/Getting%20Started%20Scripts/Raptor.cs#L38-L40) properties at a component and assign it as animation [by calling the `SkeletonAnimation.AnimationState.SetAnimation()`](https://github.com/EsotericSoftware/spine-runtimes/blob/4.2/spine-unity/Assets/Spine%20Examples/Scripts/Getting%20Started%20Scripts/Raptor.cs#L57) method, on tracks 0 and 1.

### 4 Object Oriented Sample

This scene demonstrates how you can setup a platformer character following the [Model-View-Controller](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) object oriented software design pattern. Please note that while this setup might not be the most suitable for your projects, it shall serve as inspiration on how input, game logic and visualization may be separated into components.

When pressing play, you can control the Spineboy character with WASD (move), Spacebar (jump) and mouse input (aim and fire). Alternatively you can control it via an XBOX Controller.

You can inspect the example script `SpineboyBeginnerInput` attached at the `PLAYER INPUT` GameObject, acting as `controller`. It modifies the state of the `model` represented by the `SpineboyBeginnerModel` component attached at the `PLAYER Spineboy` GameObject. Visualization of this state is performed by the `SpineboyBeginnerView` component, attached at the `VIEW Spineboy` GameObject, acting as `view`. It starts the respective animations at the [SkeletonAnimation](/spine-unity-main-components#SkeletonAnimation-Component) component which is attached at the same GameObject.

### 5 Basic Platformer

This scene demonstrates the use case of a platformer with typical animations such as jump, run, fall, land, complete with particles and sound effects.
It also shows how Spine meshes can be used to cast shadows in Unity.
> **Note:** If you do not see any cast shadows, please enable shadows via `Edit - Preferences - Quality - Shadows` (`Unity - Preferences` on Mac).

When pressing play, you can control the Hero character with WASD (move) and Spacebar (jump). Alternatively you can control it via an XBOX Controller.

You can inspect the example script `BasicPlatformerController` attached at the `Player` GameObject. It shows how you can use Unity input to change between a character's states which are tracked in a newly created [`CharacterState`](https://github.com/EsotericSoftware/spine-runtimes/blob/4.2/spine-unity/Assets/Spine%20Examples/Scripts/Getting%20Started%20Scripts/BasicPlatformerController.cs#L39-L48) attribute. When states change, the `SkeletonAnimationHandleExample` example script is used to transition to the new animation, while the `HeroEffectsHandlerExample` example script is used to play a sound and spawn particle systems.

### 6 SkeletonGraphic

This scene demonstrates the [SkeletonGraphic component](/spine-unity-main-components#SkeletonGraphic-Component) and how it can be integrated into an existing Unity UI. It also shows how `BoneFollowerGraphic` components can be used to attach text labels to follow bone positions. They can be found at the `Detached BoneFollowerGraphic` and `Child BoneFollowerGraphic` GameObjects.

When pressing play, you will see a Canvas-based user interface where Doi and Spineboy are integrated into a scrollable panel. Both play looping animations just as a [SkeletonAnimation](/spine-unity-main-components#SkeletonAnimation-Component) component while being part of the UI.

[Next: Assets](/spine-unity-assets)
[Previous: Installation](/spine-unity-installation)