Skip to content

Instantly share code, notes, and snippets.

View bzgeb's full-sized avatar

Bronson Zgeb bzgeb

View GitHub Profile
@bzgeb
bzgeb / TriggerContainerEditor.cs
Created September 28, 2012 14:52
Example Drag & Drop area in a custom inspector for the Unity editor
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor (typeof(TriggerContainer))]
public class TriggerContainerEditor : Editor
{
private SerializedObject obj;
@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 / 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 / StoneControls.cs
Created September 14, 2012 18:39
Stone flick controls
using UnityEngine;
using System.Collections;
public class StoneControls : MonoBehaviour {
public Object stone_prefab;
public Vector2 sensitivity;
public Collider lake_collider;
private Vector3 r_start;
@bzgeb
bzgeb / TriggerEditor.cs
Created September 21, 2012 15:50
Template for Custom Inspector Script in Unity3d
using UnityEngine;
using UnityEditor;
[CustomEditor (typeof(Trigger))]
[CanEditMultipleObjects()]
public class TriggerEditor : Editor
{
private SerializedObject obj;
private SerializedProperty radius;
@bzgeb
bzgeb / TriggerEditor2.cs
Created September 21, 2012 17:42
Custom inspector with a dropdown
using UnityEngine;
using UnityEditor;
[CustomEditor (typeof(Trigger))]
[CanEditMultipleObjects()]
public class TriggerEditor : Editor
{
private SerializedObject obj;
private SerializedProperty radius;
private SerializedProperty priority;
@bzgeb
bzgeb / TriggerContainerEditor2.cs
Created September 28, 2012 15:19
Slightly more elaborate example Drag & Drop area in a custom inspector for the Unity editor
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor (typeof(TriggerContainer))]
public class TriggerContainerEditor : Editor
{
private SerializedObject obj;
@bzgeb
bzgeb / PhysicsCharacterMotor.cs
Created March 13, 2013 16:27
PhysicsCharacterMotor
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(CapsuleCollider))]
public class PhysicsCharacterMotor : CharacterMotor {
public float maxRotationSpeed = 270;
public bool useCentricGravity = false;
public LayerMask groundLayers;