Skip to content

Instantly share code, notes, and snippets.

@pharan
pharan / SkeletonGraphic.cs
Last active March 5, 2021 05:50
SkeletonGraphic is a self-contained UnityEngine.UI.Graphic version of Spine's SkeletonAnimation component.
/******************************************************************************
* Spine Runtimes Software License
* Version 2.3
*
* Copyright (c) 2013-2015, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable and
* non-transferable license to use, install, execute and perform the Spine
* Runtimes Software (the "Software") and derivative works solely for personal
@pharan
pharan / Spine-Special-Skeleton-Grayscale.shader
Last active February 10, 2022 14:27
"Spine/Special/Skeleton Grayscale" shader
// - Unlit
// - Premultiplied Alpha Blending (Optional straight alpha input)
// - Double-sided, no depth
Shader "Spine/Special/Skeleton Grayscale" {
Properties {
_GrayPhase ("Phase", Range(0, 1)) = 1
[NoScaleOffset] _MainTex ("MainTex", 2D) = "white" {}
_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
[Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
@pharan
pharan / SampleManualUpdate.cs
Created January 9, 2017 22:04
A sample MonoBehaviour for Spine-Unity that holds a collection of SkeletonAnimation components and updates their animation at a certain limited rate.
using UnityEngine;
using System.Collections.Generic;
namespace Spine.Unity.Examples {
public class SampleManualUpdate : MonoBehaviour {
[Range(0f, 1/8f)]
[Tooltip("To specify a framerate, type 1/framerate in the inspector text box.")]
public float timeBetweenFrames = 1f/24f; //24 fps
public List<SkeletonAnimation> components;
@pharan
pharan / ArraysMeshGenerator.cs
Created June 17, 2016 04:30
A version of Spine-Unity ArraysMeshGenerator.cs that can disallow degenerate triangles and extra verts.
/******************************************************************************
* Spine Runtimes Software License
* Version 2.3
*
* Copyright (c) 2013-2015, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable and
* non-transferable license to use, install, execute and perform the Spine
* Runtimes Software (the "Software") and derivative works solely for personal