Skip to content

Instantly share code, notes, and snippets.

View Eriard's full-sized avatar

Markus Lange Eriard

View GitHub Profile
@delphic
delphic / AnimationController.cs
Last active February 14, 2025 02:51
Unity3D Playables API Based Character Animation Controller
using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Playables;
[RequireComponent(typeof(Animator))]
public class AnimationController : MonoBehaviour
{
const string ANIMATION = "Animation";
PlayableGraph _playableGraph;
@FreyaHolmer
FreyaHolmer / FlyCamera.cs
Last active January 15, 2026 01:09
A camera controller for easily flying around a scene in Unity smoothly. WASD for lateral movement, Space & Ctrl for vertical movement, Shift to move faster. Add this script to an existing camera, or an empty game object, hit play, and you're ready to go~
using UnityEngine;
[RequireComponent( typeof(Camera) )]
public class FlyCamera : MonoBehaviour {
public float acceleration = 50; // how fast you accelerate
public float accSprintMultiplier = 4; // how much faster you go when "sprinting"
public float lookSensitivity = 1; // mouse look sensitivity
public float dampingCoefficient = 5; // how quickly you break to a halt after you stop your input
public bool focusOnEnable = true; // whether or not to focus and lock cursor immediately on enable
@spaghettiSyntax
spaghettiSyntax / 2DUnityScreenShake.cs
Created March 12, 2020 01:37
A simple 2D screen shake built in Unity.
using UnityEngine;
public class ScreenShakeController : MonoBehaviour
{
// This is a singleton
public static ScreenShakeController _instance;
public float shakeTimeRemaining = 1f;
private float shakePower = 0.5f;
private float shakeFadeTime;
@ManeFunction
ManeFunction / EasingFunctions.cs
Last active March 23, 2026 04:31 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
* Refactored by Mane Function
*
* The MIT License (MIT)
*
* Copyright (c) 2019-2023
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@saturngamesss
saturngamesss / GrapplingGunRaycasthit2D.cs
Created July 1, 2020 15:09
Grappling gun with raycasthit2D code for Unity.
//************** REAL GAMES STUDIO ***************
//************************************************
//realgamesss.weebly.com
//gamejolt.com/@Real_Game
//realgamesss.newgrounds.com/
//real-games.itch.io/
//youtube.com/channel/UC_Adg-mo-IPg6uLacuQCZCQ
//************************************************
using UnityEngine;
@yasirkula
yasirkula / DuplicateAssetDetector.cs
Last active March 31, 2026 08:44
Find duplicate assets in Unity
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine;
using Object = UnityEngine.Object;
@Starpelly
Starpelly / SimpleSquashStretch.cs
Last active November 20, 2023 13:30
Simple Squash Stretch, can be used for pretty much anything. (Celeste-like effect)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleSquashStretch : MonoBehaviour {
public Vector3 wallSquash = new Vector3(1.66f, 0.7f, 0.1f);
public Sprite m_SpriteRenderer;
void Start()
@andrew-raphael-lukasik
andrew-raphael-lukasik / .TextureColorFillCalculator.cs.md
Last active September 28, 2023 18:52
Texture Color Fill Calculator

test1 test2 test3 test4

@Barina
Barina / EasingFunctions.cs
Last active July 9, 2022 16:18 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@totallyRonja
totallyRonja / MovingParticleContext.cs
Last active December 25, 2022 07:53
This script allows you to display movement of particle systems without them moving for tweaking them in the editor. This script is CC0, but I'd be happy if you credit me as Ronja(https://twitter.com/totallyRonja) and maybe give me some money for what I do (https://www.patreon.com/RonjaTutorials) (https://ko-fi.com/ronjatutorials)
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using UnityEngine;
using UnityEditor;
using UnityEditor.EditorTools;
// Tagging a class with the EditorTool attribute and no target type registers a global tool. Global tools are valid for any selection, and are accessible through the top left toolbar in the editor.
[EditorTool("Moving Particle Context")]