Skip to content

Instantly share code, notes, and snippets.

using System;
using UnityEngine;
#if UNITY_2020_1_OR_NEWER
// good to go
#else
#error "Optional<T> plugin requires Unity 2020.1 or above for it to work. On below versions serializing fields of generic types was not possible."
#endif
[Serializable]
@FlaShG
FlaShG / ConsoleAccessAttribute.cs
Created April 1, 2019 01:19
A simple, easy-to-use console for Unity.
using System;
[AttributeUsage(AttributeTargets.Method)]
public class ConsoleAccessAttribute : Attribute
{
}
@unitycoder
unitycoder / DrawBounds.cs
Last active June 13, 2024 06:58
Draw Bounds with Debug.DrawLine , Draw Box, Draw Runtime Gizmos
void DrawBounds(Bounds b, float delay=0)
{
// bottom
var p1 = new Vector3(b.min.x, b.min.y, b.min.z);
var p2 = new Vector3(b.max.x, b.min.y, b.min.z);
var p3 = new Vector3(b.max.x, b.min.y, b.max.z);
var p4 = new Vector3(b.min.x, b.min.y, b.max.z);
Debug.DrawLine(p1, p2, Color.blue, delay);
Debug.DrawLine(p2, p3, Color.red, delay);