Skip to content

Instantly share code, notes, and snippets.

View AndrewDavid's full-sized avatar
🌭
Making dumb content

Andrew-David J. AndrewDavid

🌭
Making dumb content
View GitHub Profile
@staggartcreations
staggartcreations / HeightmapToMesh.cs
Created June 27, 2019 18:05
Convert heightmap to mesh
// Staggart Creations
// http://staggart.xyz
using UnityEngine;
[ExecuteInEditMode]
public class HeightmapToMesh : MonoBehaviour
{
public MeshFilter meshFilter;
public Texture2D heightmap;
@LotteMakesStuff
LotteMakesStuff / AutohookAttribute.cs
Last active March 18, 2025 14:51
[Autohook] property drawer for unity - Add this [Autohook] attribute to a property to and the inspector will automagically hook up a valid reference for you if it can find a component attached to the same game object that matches the field you put it on. You can watch a demo of this in action here https://youtu.be/faVt09NGzws <3
// NOTE DONT put in an editor folder!
using UnityEngine;
public class AutohookAttribute : PropertyAttribute
{
}
@staggartcreations
staggartcreations / WorldSpaceTexel.cs
Last active February 28, 2022 18:33
World-space texel sampling in Unity
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
[ExecuteInEditMode]
public class WorldSpaceTexel : MonoBehaviour
{
@kaiware007
kaiware007 / billboard.shader
Created January 19, 2018 09:28
Simple Billboard shader for Unity
Shader "Unlit/Billboard"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" "DisableBatching" = "True" }
@LotteMakesStuff
LotteMakesStuff / PlayerLoop.cs
Last active September 24, 2024 06:38
Player Loop Visualizer: Built to explore the new PlayerLoopSystem api in Unity 2018.1b2. This tool shows you all the PlayerLoop systems that unity uses to update a frame, and demos how to add your own and even remove systems from the player loop. For more info see the patreon post https://www.patreon.com/posts/unity-2018-1-16336053
// Put this in an editor folder
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Experimental.LowLevel;
using UnityEngine.Profiling;
// c# companion script
// SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- //
// Save you your project, add to your SpriteRenderer gameObject
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[ExecuteInEditMode]
@CodeMyUI
CodeMyUI / index.html
Created October 30, 2017 10:33
SVG Gooey Hover Menu Concept
<div id="menu">
<div class="hamburger">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
<div class="menu-inner">
<ul>
<li>Menu Item</li>
@keithweaver
keithweaver / open-private-s3-file.php
Last active May 29, 2023 11:05
Open AWS S3 File Privately with PHP
<?php
$BUCKET_NAME = '';
$IAM_KEY = '';
$IAM_SECRET = '';
require '/vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
// Get the access code
@EntranceJew
EntranceJew / OBSChecker.cs
Created August 5, 2017 00:19
check for that obs
using System.Collections.Generic;
using System.Linq;
using BeeCode.Extensions;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
namespace BBallCode.Engine {
public static class IListBee {
@LotteMakesStuff
LotteMakesStuff / TrafficLightAttribute.cs
Last active April 8, 2025 21:13
TrafficLight control/layout/property drawer: Adds a new editor control that draws lil Traffic Lights in the inspector. its really useful for visualizing state. For example, checkboxes can be hard to read at a glace, but a Red or Green status light is easy! Recommend you use the attached package, as it has all the icon image files.
// Non Editor code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class TrafficLightAttribute : PropertyAttribute
{
public bool DrawLabel = true;
public string CustomLabel;
public bool AlsoDrawDefault;