Skip to content

Instantly share code, notes, and snippets.

View bzgeb's full-sized avatar

Bronson Zgeb bzgeb

View GitHub Profile
@bzgeb
bzgeb / StarterAssetsPackageChecker.cs
Last active September 3, 2022 17:53
Starter Assets Package Checker DLL source
// This file is licensed under the Unity Companion License.
// For full license terms, please see: https://unity3d.com/legal/licenses/Unity_Companion_License
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEngine;
@bzgeb
bzgeb / PlaceObjectTool.cs
Last active October 19, 2021 16:46
Quick and dirty Unity tool to place an object
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
[EditorTool("Place Object Tool")]
public class PlaceObjectTool : EditorTool
{
[SerializeField] Texture2D m_ToolIcon;
@bzgeb
bzgeb / HdrpFullscreenBlit.cs
Created April 3, 2021 00:46
HDRP Fullscreen Blit with Command Buffer
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
public class HdrpFullscreenBlit : MonoBehaviour
{
public Texture Source;
void OnEnable()
{
@bzgeb
bzgeb / CloudBuildHelper.cs
Last active January 25, 2021 16:47
Cloud Build Helper - Get Build number for Unity Cloud Build
using UnityEngine;
using UnityEditor;
using System;
public class CloudBuildHelper : MonoBehaviour
{
#if UNITY_CLOUD_BUILD
public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
{
/*
@bzgeb
bzgeb / !UnityUUIDs
Last active March 16, 2021 09:31
Uuids for Unity GameObjects
How I added UUIDs to Unity Game Objects
@bzgeb
bzgeb / Config.cs
Last active March 16, 2021 09:31
Configs and Descs
using System.Collections.Generic;
using UnityEngine;
public abstract class Config<T> : ScriptableObject where T : Desc
{
[SerializeField] protected List<T> m_Descs = new List<T>();
public List<T> Descs { get { return m_Descs; } }
public virtual T FindByUuid(string a_Uuid)
{
@bzgeb
bzgeb / Toon.shader
Created April 26, 2020 01:21
ToonLighting Shader
Shader "ToonLighting"
{
Properties
{
_Color("Color", Color) = (0.5, 0.65, 1, 1)
_Diffuse("Diffuse %", Range(0, 1)) = 1
_DiffuseThreshold("Diffuse Threshold", Range(0, 1)) = 0.1
_DiffuseWidth("Diffuse Width", Range(0, 1)) = 0.01
@bzgeb
bzgeb / Grid.shader
Last active March 16, 2021 09:31
Unity WorldSpace Grid Shader
Shader "MaskableGrid"
{
Properties
{
_Mask ("Mask", 2D) = "white" {}
_GridThickness ("Grid Thickness", Float) = 0.01
_GridSpacing ("Grid Spacing", Float) = 10.0
_GridColour ("Grid Colour", Color) = (0.5, 1.0, 1.0, 1.0)
_BaseColour ("Base Colour", Color) = (0.0, 0.0, 0.0, 0.0)
}
@bzgeb
bzgeb / Metronome.cs
Created April 16, 2015 00:41
Pretty solid metronome for Unity
using UnityEngine;
using System.Collections;
public class Metronome : MonoBehaviour
{
public double bpm = 140.0F;
double nextTick = 0.0F; // The next tick in dspTime
double sampleRate = 0.0F;
bool ticked = false;
@bzgeb
bzgeb / gist:72f7b1a5a40ec144e37d
Created October 30, 2014 17:39
Draw a head in processing
////////////////////////Draw a head//////////////////////////////
fill(100 + random(150), 100 + random(150), 100 + random(150));
for ( int i = 0; i < numLines; ++i ) {
beginShape();
for ( float angle = 0; angle < 360; angle += step ) {
float radian = radians( angle );
x = xCenter + ( headXRadius * cos( radian ) ) + random(15);
y = yCenter - ( headYRadius * sin( radian ) ) + random(20);
if ( lastx > -999 ) {