Skip to content

Instantly share code, notes, and snippets.

View Bradshaw's full-sized avatar
🚀
Lost in space

Gaeel Bradshaw-Rodriguez Bradshaw

🚀
Lost in space
View GitHub Profile
@Bradshaw
Bradshaw / GetMainTextureThing.cs
Last active August 30, 2022 14:33
Example of detection of terrain texture at position
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GetMainTextureThing : MonoBehaviour
{
TerrainData mTerrainData;
int alphamapWidth;
int alphamapHeight;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NicknameGenerator : MonoBehaviour
{
public TextAsset examples;
public int segmentLength = 3;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Maze : MonoBehaviour
{
Node[,] maze;
public int width;
public int height;
@Bradshaw
Bradshaw / pictoselect.cs
Created March 6, 2019 14:17
🤷‍♀️
string PrintMe(){
Dictionary<string,string> pictos = new Dictionary<string,string>();
pictos.Add("ur", "└");
pictos.Add("ulr", "┴");
pictos.Add("dlr", "┬");
pictos.Add("udr", "├");
pictos.Add("lr", "─");
pictos.Add("udlr", "┼");
pictos.Add("dr", "┌");
pictos.Add("dl", "┐");
@Bradshaw
Bradshaw / PulseOnBeat.cs
Last active January 29, 2019 10:12
Simple beat follower script demo
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class PulseOnBeat : MonoBehaviour {
public float minScale;
public float maxScale;
@Bradshaw
Bradshaw / horriblesort.lua
Created November 20, 2018 15:58
Horrible Sort in Lua
-- Creates a table containing the values 1 through num
function tableOf(num)
local t = {}
for i=1,num do
t[i] = i
end
return t
end
-- Shuffles a table
@Bradshaw
Bradshaw / Blob.shader
Last active November 16, 2018 16:03
Unity move vertex shader thing
Shader "Custom/Blob" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_PushTex ("Thing", 2D) = "white" {}
_Push ("Push", Range(-1,1)) = 0.0
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
@Bradshaw
Bradshaw / Walkabout.cs
Created November 12, 2018 16:58
BG1-A
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Walkabout : MonoBehaviour {
public float acceleration = 1;
public float friction;
public float radius;
Vector3 velocity;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FPS : MonoBehaviour {
Text text;
float smootheddt = 1 / 60;
float smoothvel;
List<float> last100;
@Bradshaw
Bradshaw / StretchProject.cs
Created October 30, 2018 14:36
Use this with a Unity camera set to orthographic projection in an oblique top-down view
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StretchProject : MonoBehaviour {
public Matrix4x4 originalProjection;
Camera cam;
[Range(1,2)]
public float stretch = 1;