Skip to content

Instantly share code, notes, and snippets.

View staggartcreations's full-sized avatar

staggartcreations

View GitHub Profile
@staggartcreations
staggartcreations / LightCircle.cs
Created December 21, 2022 10:24
Unity component for creating a set of animated point lights
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
using UnityEngine.Rendering;
[ExecuteInEditMode]
public class LightCircle : MonoBehaviour {
[Header("Lights")]
@staggartcreations
staggartcreations / GlobalShaderParams.cs
Last active January 18, 2024 08:40
Component for passing values through Shader.SetGlobalXXX
using System;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
[ExecuteInEditMode]
public class GlobalShaderParams : MonoBehaviour
{
@staggartcreations
staggartcreations / Rope.cs
Last active March 6, 2024 12:58
HingeJoint-based rope building component
using System;
using UnityEngine;
using UnityEngine.Serialization;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class RopeGenerator : MonoBehaviour
{
public Rigidbody attachementBody;
@staggartcreations
staggartcreations / SpriteWaterShape.cs
Last active January 18, 2024 08:50
Sprite shape animated water volume
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.U2D;
[ExecuteInEditMode]
public class SpriteWaterShape : MonoBehaviour
{
public SpriteShapeController controller;
@staggartcreations
staggartcreations / CinemachinePathShape.cs
Created January 5, 2020 08:51
Unity script for creating a circular, arched or spiraling cinemachine path
using UnityEngine;
using Cinemachine;
using Waypoint = Cinemachine.CinemachineSmoothPath.Waypoint;
public class CinemachinePathShape : MonoBehaviour
{
public CinemachineSmoothPath path;
[Space]
@staggartcreations
staggartcreations / CreatePlaneStack.cs
Created December 31, 2019 12:02
Unity script for creating a stacked plane mesh
using UnityEngine;
[ExecuteInEditMode]
public class CreatePlaneStack : MonoBehaviour
{
public MeshFilter meshFilter;
[Range(1, 64)]
public int layers = 4;
[Space]
@staggartcreations
staggartcreations / HeightmapToMesh.cs
Created June 27, 2019 18:05
Convert heightmap to mesh
// Staggart Creations
// http://staggart.xyz
using UnityEngine;
[ExecuteInEditMode]
public class HeightmapToMesh : MonoBehaviour
{
public MeshFilter meshFilter;
public Texture2D heightmap;
@staggartcreations
staggartcreations / WorldSpaceTexel.cs
Last active February 28, 2022 18:33
World-space texel sampling in Unity
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
[ExecuteInEditMode]
public class WorldSpaceTexel : MonoBehaviour
{