Skip to content

Instantly share code, notes, and snippets.

Avatar

Bronson Zgeb bzgeb

View GitHub Profile
@bzgeb
bzgeb / StarterAssetsPackageChecker.cs
Last active Sep 3, 2022
Starter Assets Package Checker DLL source
View StarterAssetsPackageChecker.cs
// 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 Oct 19, 2021
Quick and dirty Unity tool to place an object
View PlaceObjectTool.cs
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 Apr 3, 2021
HDRP Fullscreen Blit with Command Buffer
View HdrpFullscreenBlit.cs
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
public class HdrpFullscreenBlit : MonoBehaviour
{
public Texture Source;
void OnEnable()
{
@bzgeb
bzgeb / CloudBuildHelper.cs
Last active Jan 25, 2021
Cloud Build Helper - Get Build number for Unity Cloud Build
View CloudBuildHelper.cs
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 Mar 16, 2021
Uuids for Unity GameObjects
View !UnityUUIDs
How I added UUIDs to Unity Game Objects
@bzgeb
bzgeb / Config.cs
Last active Mar 16, 2021
Configs and Descs
View Config.cs
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 Apr 26, 2020
ToonLighting Shader
View Toon.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 Mar 16, 2021
Unity WorldSpace Grid Shader
View 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 Apr 16, 2015
Pretty solid metronome for Unity
View Metronome.cs
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 Oct 30, 2014
Draw a head in processing
View gist:72f7b1a5a40ec144e37d
////////////////////////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 ) {