Skip to content

Instantly share code, notes, and snippets.

View beardordie's full-sized avatar

Beard or Die beardordie

View GitHub Profile
@JoseMiguelPizarro
JoseMiguelPizarro / LICENSE
Created November 9, 2019 12:27 — forked from JohannesMP/LICENSE
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
@m039
m039 / BT.cs
Created August 11, 2019 16:46
The Behavior Tree source code file from Unity's 2D Game Kit project.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BTAI
{
public enum BTState
{
Failure,
Success,
using UnityEngine;
using UnityEditor;
/// <summary>
/// Hierarchy Window Group Header
/// http://diegogiacomelli.com.br/unitytips-hierarchy-window-group-header
/// </summary>
[InitializeOnLoad]
public static class HierarchyWindowGroupHeader
{
using System.Linq;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Easing2Curve: An editor window to create animation curve from easing functions
/// http://diegogiacomelli.com.br/easing-2-curve-an-editor-window-to-create-animation-curve-from-easing-functions/
/// </summary>
public class Easing2CurveEditorWindow : EditorWindow
{
@KenneyNL
KenneyNL / CircularMenu.cs
Last active June 23, 2022 19:41
Circular menu sample code for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CircularMenu : MonoBehaviour{
public float radius = 100.0f;
public float offset = 0.0f;
void Start(){
@Kenoshen
Kenoshen / SpriteSheetPostProcessor.cs
Created May 5, 2019 00:29
Unity AssetPostProcessor for 2D Spritesheets
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;
public class SpriteSheetPostProcessor : AssetPostprocessor {
private const string SPRITE_SHEET_FOLDER_CONTAINS = "SpriteSheets";
private const string ANIMATION_FOLDER = "Assets/Anim";
@ditzel
ditzel / PhysicsHelper.cs
Created January 20, 2019 16:54
Unity Helper for Physic Functions
using UnityEngine;
namespace Ditzelgames
{
public static class PhysicsHelper
{
public static void ApplyForceToReachVelocity(Rigidbody rigidbody, Vector3 velocity, float force = 1, ForceMode mode = ForceMode.Force)
{
if (force == 0 || velocity.magnitude == 0)
@capnslipp
capnslipp / DisableWhenAttribute.cs
Last active June 18, 2023 19:47
ShowWhen, HideWhen, EnableWhen, & DisableWhen Attributes for #Unity3D
/// @creator: Slipp Douglas Thompson
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>.
/// @purpose: Shows a field as disabled in Unity's Inspector only when a different method/property/field in the same MonoBehaviour returns/is-equal-to a given value or values.
/// @why: Because this functionality should be built-into Unity.
/// @usage: Add `[DisableWhen(typeof(«MonoBehaviour-sub-type-name»), "«trigger-member-name»", «value-that-the-trigger-member-returns»)]` attribute to a (serializable public) field on your `MonoBehaviour`-class.
/// @intended project path: Assets/Plugins/EditorUtils/DisableWhenAttribute.cs
/// @interwebsouce: https://gist.github.com/capnslipp/9b99f83aa7b80dfb589a5b23e8e0cfa0
using System;
using UnityEngine;
Shader "VertexRotation"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" "DisableBatching" = "True"}
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.Collections.Generic;
using System.IO;
// Scene selection