Skip to content

Instantly share code, notes, and snippets.

@pharan
pharan / LayersToPNG.jsx
Created January 27, 2016 01:26 — forked from nzhul/LayersToPNG.jsx
Spine 2D - LayersToPNG.jsx fix for Photoshop CC
// This script exports photoshop layers as individual PNGs. It also
// writes a JSON file that can be imported into Spine where the images
// will be displayed in the same positions and draw order.
// Setting defaults.
var writePngs = true;
var writeTemplate = false;
var writeJson = true;
var ignoreHiddenLayers = true;
var pngScale = 1;
@pharan
pharan / AnimationState.cs
Last active September 16, 2018 07:53
Mix-compatible Resetting AnimationState for Spine-C#
/******************************************************************************
* 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 / SkeletonAutoreset.cs
Last active August 11, 2020 22:20
An autoresetting script for Spine-Unity that prevents animations from inheriting changes from previously played animations, by resetting the skeleton back to its setup pose before playing a new animation.
using UnityEngine;
using System.Collections;
public class SkeletonAutoreset : MonoBehaviour {
void Start () {
var skeletonAnimation = GetComponent<SkeletonAnimation>();
if (skeletonAnimation == null) {
Debug.Log("SkeletonAutoreset uses GetComponent and needs to be attached on the same GameObject as the SkeletonAnimation component.");
return;
@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