This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class WTLabel : FLabel { | |
protected Color[] quadColors_; | |
public WTLabel(string fontName, string text) : base(fontName, text) { | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class WTLabel : FLabel { | |
protected Color[] quadColors_; | |
public WTLabel(string fontName, string text) : base(fontName, text) { | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class SpriteAnimator : MonoBehaviour | |
{ | |
[System.Serializable] | |
public class AnimationTrigger | |
{ | |
public int frame; | |
public string name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Projector/Light" { | |
Properties { | |
_Color ("Main Color", Color) = (1,1,1,1) | |
_ShadowTex ("Cookie", 2D) = "" {} | |
_FalloffTex ("FallOff", 2D) = "" {} | |
} | |
Subshader { | |
Pass { | |
ZWrite Off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
OlderNewer