Skip to content

Instantly share code, notes, and snippets.

@grimmdev
grimmdev / TextureTest.cs
Created May 16, 2015 03:42
Small Texture Utility for some texture functions in Unity
using UnityEngine;
using System.Collections;
public class TextureTest : MonoBehaviour {
public Renderer rend;
// Use this for initialization
private void Awake () {
rend.material.mainTexture = TextureUtility.CamToText ();
@grimmdev
grimmdev / ServerScripter.js
Last active August 29, 2015 14:21
Server Side Scripting (JS Only)
#pragma strict
var url = "url to script";
function Start () {
// Start a download of the given URL
var www : WWW = new WWW (url);
// Wait for download to complete
yield www;
#pragma strict
import System;
var start : DateTime;
var stop : DateTime;
var repetitions : int = 5000000;
function Start () {
start = DateTime.Now;
@grimmdev
grimmdev / Translate.cs
Last active January 31, 2025 18:25
Translate method/api using Unity 3D. Completely Free with no Restrictions, by using Google's Internal API, we cut out the need for any api keys.
// We need this for parsing the JSON, unless you use an alternative.
// You will need SimpleJSON if you don't use alternatives.
// It can be gotten hither. http://wiki.unity3d.com/index.php/SimpleJSON
using SimpleJSON;
using UnityEngine;
using System.Collections;
public class Translate : MonoBehaviour {
// Should we debug?
@grimmdev
grimmdev / AnimatedGifDrawer.cs
Created June 23, 2015 01:12
Play Gifs in Unity 3D using System Drawing
/*
Copy the "System.Drawing.dll" file in the "*\Unity\Editor\Data\Mono\lib\mono\2.0" folder into your "Assets" folder.
2) Attach this script to any object in your scene.
3) Change the "loadingGifPath" field of the script, (in the Inspector view), to the path of your Gif file. (this can be relative, from the root project folder (i.e. the parent of the "Assets" folder), or absolute
*/
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using UnityEngine;
@grimmdev
grimmdev / HSBColor.cs
Created July 4, 2015 06:16
HSB Color for Unity 3D!
using System;
using UnityEngine;
[Serializable]
public struct HSBColor
{
public float H;
public float S;
public float B;
public float A;
@grimmdev
grimmdev / GUIManager.cs
Last active August 29, 2015 14:24
I modified the default PowerUI Manager to accept a design resolution, so you can design for one resolution that better fits all.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using PowerUI;
/// <summary>
/// This is the default PowerUIManager with a much needed design resolution.
/// </summary>
public class GUIManager : MonoBehaviour {
@grimmdev
grimmdev / MoveController.cs
Created July 16, 2015 01:21
Pokemon Move Controller in Unity 3d with 2D!
// Sean Loper
// 2015
// Also supports complete controller input!
// Pokemon Styled Movement Controller for Unity of course!
using UnityEngine;
using System.Collections;
public class MoveController : MonoBehaviour {
@grimmdev
grimmdev / DialoguePowerUI.cs
Created July 16, 2015 05:11
Custom PowerUI Live HTML with a small mod/edit to add support for NodeCanvas's Dialogue Trees.
using UnityEngine;
using System.Collections;
using PowerUI;
using NodeCanvas.DialogueTrees;
public class DialoguePowerUI : UnityEngine.MonoBehaviour {
public TextAsset HtmlFile;
#if UNITY_EDITOR
private LiveHtml Reloader;
@grimmdev
grimmdev / Curved.shader
Created July 17, 2015 05:32
Subway Surfer like Curved World Shader for Unity
Shader "Custom/Curved" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_QOffset ("Offset", Vector) = (0,0,0,0)
_Dist ("Distance", Float) = 100.0
}
SubShader {
Tags { "RenderType"="Opaque" }
Pass
{