Skip to content

Instantly share code, notes, and snippets.

View GameDevTeacher's full-sized avatar

Markus Lange GameDevTeacher

View GitHub Profile
@passivestar
passivestar / Editor.tres
Last active April 10, 2024 20:07
Godot editor theme
[gd_resource type="Theme" load_steps=12 format=3 uid="uid://7bvxnk5n5imx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h42l"]
content_margin_left = 10.5
content_margin_top = 8.75
content_margin_right = 10.5
content_margin_bottom = 8.75
bg_color = Color(0.117647, 0.117647, 0.117647, 1)
draw_center = false
border_color = Color(1, 1, 1, 0.137255)
@VictorHHT
VictorHHT / VTMinMaxSlider.cs
Last active March 5, 2023 13:11
Unity MinMaxSlider Property Attribute, with carefully crafted OnGUI drawing to achieve a similar interaction logic like the piano key velocity MinMaxSlider in Apple's GarageBand
using System;
using UnityEditor;
using UnityEngine;
namespace Victor.Tools
{
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public sealed class VTMinMaxSlider : PropertyAttribute
{
internal Vector2 m_MinmaxLimit;
@VictorHHT
VictorHHT / VTRangeStep.cs
Last active April 19, 2024 23:30
Unity Range Step Slider Property Attribute, allow the user to increase a float value or int value by step, like 0.25f or 3 or 100.15f
using System;
using UnityEditor;
using UnityEngine;
// Use Example 1: [VTRangeStep(0f, 10f, 0.25f)]
// Use Example 2: [VTRangeStep(100, 1000, 25)]
namespace Victor.Tools
{
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public sealed class VTRangeStep : PropertyAttribute
@Matthew-J-Spencer
Matthew-J-Spencer / PlayerAnimator.cs
Created July 6, 2022 11:30
Control unity animations using code. Video: https://youtu.be/ZwLekxsSY3Y
using System;
using UnityEngine;
using UnityEngine.Tilemaps;
using Random = UnityEngine.Random;
public class PlayerAnimator : MonoBehaviour {
[SerializeField] private float _minImpactForce = 20;
// Anim times can be gathered from the state itself, but
// for the simplicity of the video...
@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")]
@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
@andrew-raphael-lukasik
andrew-raphael-lukasik / .TextureColorFillCalculator.cs.md
Last active September 28, 2023 18:52
Texture Color Fill Calculator

test1 test2 test3 test4

@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()
@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;
@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;