Skip to content

Instantly share code, notes, and snippets.

View beardordie's full-sized avatar

Beard or Die beardordie

View GitHub Profile
@capnslipp
capnslipp / .gitignore
Created January 30, 2016 23:30
Unity3D .gitignore
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.booproj
*.sln
*.user
@capnslipp
capnslipp / NonDrawingGraphic.cs
Last active April 22, 2025 11:17
A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing.
/// @creator: Slipp Douglas Thompson
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>.
/// @purpose: A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing.
/// @why: Because this functionality should be built-into Unity.
/// @usage: Add a `NonDrawingGraphic` component to the GameObject you want clickable, but without its own image/graphics.
/// @intended project path: Assets/Plugins/UnityEngine UI Extensions/NonDrawingGraphic.cs
/// @interwebsouce: https://gist.github.com/capnslipp/349c18283f2fea316369
using UnityEngine;
using UnityEngine.UI;
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@mrowdy
mrowdy / RotationPivot.cs
Last active May 23, 2019 06:56
Rotate by pivot inside Unity editor
using UnityEngine;
public class RotationPivot: MonoBehaviour
{
/**
* The transform of the object you want to rotate with this pivot
*/
public Transform target;
@AliFlux
AliFlux / FluentAnimation.md
Last active December 17, 2017 01:46
Fluent Animation documentation

Fluent.Animation Documentation

A Unity3D plugin that makes it incredibly easy animate almost anything using fluent functions. Fluent Animation takes a procedural/functional way of solving the decade old animation queue and callback hell problem.

Download Now

Features

  • Move, rotate, scale almost anything
  • Execute animations in parallel
@ffyhlkain
ffyhlkain / ReferenceFinder.cs
Last active February 19, 2025 05:48
A reference finder for assets in a #Unity3d project.
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
namespace FoundationEditor.Editor.ReferenceFinder
{
@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;
@darkon76
darkon76 / OrtographicDrag.cs
Last active April 3, 2023 19:54
Unity Drag.
using UnityEngine;
using UnityEngine.EventSystems;
public class OrtographicDrag: MonoBehaviour, IDragHandler
{
private Camera _mainCamera;
public float DistanceToCamera;
public void OnDrag(PointerEventData eventData)
{
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.Collections.Generic;
using System.IO;
// Scene selection
Shader "VertexRotation"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" "DisableBatching" = "True"}