Skip to content

Instantly share code, notes, and snippets.

View GameDevTeacher's full-sized avatar

Markus Lange GameDevTeacher

View GitHub Profile
@Fonserbc
Fonserbc / Easing.cs
Last active June 16, 2024 23:00
Compact and simple easing functions for Unity
using UnityEngine;
/*
* Most functions taken from Tween.js - Licensed under the MIT license
* at https://github.com/sole/tween.js
* Quadratic.Bezier by @fonserbc - Licensed under WTFPL license
*/
public delegate float EasingFunction(float k);
public class Easing
@cjddmut
cjddmut / EasingFunctions.cs
Last active July 16, 2024 08:20
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
@vybstat
vybstat / ds_store_removal
Last active July 2, 2024 13:23
How to remove .DS_Store file from GitHub that Mac OS X creates
# remove .DS_Store file from GitHub that MAC OS X creates
# find and remove .DS_Store
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
# create .gitignore file, if needed
touch .gitignore
echo .DS_Store > .gitignore
# push changes to GitHub
// 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
@delphic
delphic / AnimationController.cs
Last active January 18, 2024 07:17
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 May 31, 2024 14:38
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 June 3, 2024 03:35 — 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 June 24, 2024 10:05
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;