Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
// This is just an example of how to use the polygon sprite
public class WTDrawingPolygonsScene : MonoBehaviour {
void Start () {
FutileParams fp = new FutileParams(true, true, false, false);
fp.AddResolutionLevel(480f, 1.0f, 1.0f, "-res1");
fp.backgroundColor = Color.black;
fp.origin = Vector2.zero;
@jcx
jcx / WTLabel
Created April 3, 2014 13:58 — forked from wtrebella/WTLabel
using UnityEngine;
using System.Collections;
public class WTLabel : FLabel {
protected Color[] quadColors_;
public WTLabel(string fontName, string text) : base(fontName, text) {
}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
public class WTPulsator {
public List<WTPulsatorObject> objects = new List<WTPulsatorObject>();
public float totalTime = 0;
public float bpm;
bool isPulsating = false;
@jcx
jcx / WTPath.cs
Created April 3, 2014 13:58 — forked from wtrebella/WTPath.cs
override public void PopulateRenderLayer()
{
if(_isOnStage && _firstFacetIndex != -1 && pathPointsToRender_ != null) // if this is false, the sprite hasn't been initiated correctly yet
{
_isMeshDirty = false;
int vertexIndex0 = _firstFacetIndex * 4;
int quadVerticeCount = (pathPointsToRender_.Length - 1) * 4;
Vector3[] quadVertices = _renderLayer.vertices;
using UnityEngine;
using System.Collections;
public class WTAbstractSceneContainer : FContainer {
public SceneType sceneType;
public SceneType nextSceneType;
public bool isActive = true;
public FContainer everythingContainer = new FContainer();
public FSprite backgroundLayer;
@jcx
jcx / WTLabel
Created April 3, 2014 13:59 — forked from wtrebella/WTLabel
using UnityEngine;
using System.Collections;
public class WTLabel : FLabel {
protected Color[] quadColors_;
public WTLabel(string fontName, string text) : base(fontName, text) {
}
using UnityEngine;
using System.Collections;
// Line segment intersection based on this: http://www.pdas.com/lineint.html
// Intersect circle/polygon algorithm based on this: http://gamedev.stackexchange.com/questions/7735/how-to-find-if-circle-and-concave-polygon-intersect
public static class WTUtils {
public static bool IntersectLineSegments(Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3) {
Vector2 s1 = p1 - p0;
Vector2 s2 = p3 - p2;
using UnityEngine;
using System.Collections;
public class SpriteAnimator : MonoBehaviour
{
[System.Serializable]
public class AnimationTrigger
{
public int frame;
public string name;
Shader "Projector/Light" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Cookie", 2D) = "" {}
_FalloffTex ("FallOff", 2D) = "" {}
}
Subshader {
Pass {
ZWrite Off
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
struct Triangle {
public int p1;
public int p2;
public int p3;
public Triangle(int point1, int point2, int point3) {