Skip to content

Instantly share code, notes, and snippets.

pharan pharan

Block or report user

Report or block pharan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pharan
pharan / LayersToPNG.jsx
Created Jan 27, 2016 — forked from nzhul/LayersToPNG.jsx
Spine 2D - LayersToPNG.jsx fix for Photoshop CC
View LayersToPNG.jsx
// 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 / AtlasAssetInspector.cs
Last active Mar 18, 2016
AtlasAssetInspector with BakeAll
View AtlasAssetInspector.cs
/******************************************************************************
* 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 / VertexHelperSpineMeshGenerator.cs
Created Apr 13, 2016
Sample ISimpleMeshGenerator implementation using Unity's VertexHelper. Very slow.
View VertexHelperSpineMeshGenerator.cs
/******************************************************************************
* 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 / EventTimelineExtensions.cs
Last active May 23, 2016
spine-csharp EventTimelineExtensions
View EventTimelineExtensions.cs
/******************************************************************************
* 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 / AnimationState.cs
Created Jun 6, 2016
A hyper-simplified version of Spine's AnimationState.cs
View AnimationState.cs
/******************************************************************************
* 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 / ArraysMeshGenerator.cs
Created Jun 17, 2016
A version of Spine-Unity ArraysMeshGenerator.cs that can disallow degenerate triangles and extra verts.
View ArraysMeshGenerator.cs
/******************************************************************************
* 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 / LinkedMeshSample.cs
Last active Jun 21, 2016
[spine-unity] Sample code for how to dynamically create and image-swap a linked MeshAttachment.
View LinkedMeshSample.cs
/*****************************************************************************
* LinkedMeshSample code created by John Dy
* Full irrevocable rights and permissions granted to Esoteric Software
*****************************************************************************/
using UnityEngine;
using System.Collections;
using Spine;
using Spine.Unity;
public class LinkedMeshSample : MonoBehaviour {
@pharan
pharan / SimpleCommand.cpp
Created Apr 1, 2016
Sample for subclassing cocos2d::Node with basic rendering through a (batchable) TriangleCommand
View SimpleCommand.cpp
#include "SimpleCommand.h"
USING_NS_CC;
using namespace std;
Scene* SimpleCommand::scene () {
Scene *scene = Scene::create();
scene->addChild(SimpleCommand::create());
return scene;
}
@pharan
pharan / SkeletonAutoreset.cs
Last active Aug 17, 2016
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.
View SkeletonAutoreset.cs
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 / ParallaxFaker2D.cs
Created Aug 26, 2016
Simplified (derived) formula for faking the parallax of an object given a camera position, in the form of a Unity component. This may not work for VR??
View ParallaxFaker2D.cs
using UnityEngine;
public class ParallaxFaker2D : MonoBehaviour {
// The Transform of the camera to fake the parallax for.
public Transform cameraTransform;
// The world position to mimick the parallax of.
public Vector3 fakePosition;
// The Transform's target (actual) distance from the camera.
You can’t perform that action at this time.