Skip to content

Instantly share code, notes, and snippets.

View lukasreuter's full-sized avatar
🗿
Focusing

Lukas Reuter lukasreuter

🗿
Focusing
  • Honigstudios
  • Berlin, Germany
View GitHub Profile
@keijiro
keijiro / FpsCapper.cs
Last active December 17, 2024 05:52
FpsCapper - Limits the frame rate of the Unity Editor in Edit Mode
using UnityEditor;
using UnityEngine;
using UnityEngine.LowLevel;
using System.Linq;
using System.Threading;
namespace EditorUtils {
//
// Serializable settings
@ScottJDaley
ScottJDaley / Outline.shader
Last active February 18, 2025 06:05
Wide Outlines Renderer Feature for URP and ECS/DOTS/Hybrid Renderer
// Original shader by @bgolus, modified slightly by @alexanderameye for URP, modified slightly more
// by @gravitonpunch for ECS/DOTS/HybridRenderer.
// https://twitter.com/bgolus
// https://medium.com/@bgolus/the-quest-for-very-wide-outlines-ba82ed442cd9
// https://alexanderameye.github.io/
// https://twitter.com/alexanderameye/status/1332286868222775298
Shader "Hidden/Outline"
{
Properties
@rodolforubens
rodolforubens / PlaceOnGroundEditor.cs
Last active March 25, 2023 11:12
Unity Editor script to drop objects on the ground using collider, renderer or its pivot point as a base.
using UnityEditor;
using UnityEngine;
public static class PlaceOnGroundEditor
{
[MenuItem("Tools/Snap to ground %&D")]
public static void PlaceOnGround()
{
var transforms = new Transform[Selection.gameObjects.Length];
for(int i = 0; i < transforms.Length; i++) transforms[i] = Selection.gameObjects[i].transform;
@bestknighter
bestknighter / DebugNode.hlsl
Last active April 22, 2025 10:54 — forked from aras-p/DebugNode.hlsl
"Print a value" custom function node code for Unity ShaderGraph, aware of +Inf/-Inf and nan
// This gist can be found at https://gist.github.com/bestknighter/660e6a53cf6a6643618d8531f962be2c
// I modified Aras Pranckevičius's awesome shader code to be able to handle Infinite and Not A Number numbers
// Tested on Unity 2023.1.0a15 with ShaderGraph 15.0.1.
// Quick try at doing a "print value" node for Unity ShaderGraph.
//
// Use with CustomFunction node, with two inputs:
// - Vector1 Value, the value to display,
// - Vector2 UV, the UVs of area to display at.
@xoofx
xoofx / BuildtimeOptimizedRoslynSourceGenerator.cs
Last active December 10, 2022 14:03
Roslyn Source Generator optimized for build time only usage
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using Microsoft.CodeAnalysis.Text;
namespace SourceGenLib
@ScottJDaley
ScottJDaley / Components.cs
Created July 8, 2021 16:21
Save and Load for Unity ECS using SerializeUtility
[Serializable]
public struct SaveTag : IComponentData { }
[Serializable]
public struct MissingRenderMeshTag : IComponentData { }
[Serializable]
public struct MissingPhysicsColliderTag : IComponentData { }
[Serializable]
@simonauner
simonauner / pre-commit
Last active September 9, 2023 16:42 — forked from EtherZa/pre-commit
Format c# with dotnet-format with pre-commit hook
#!/bin/sh
# Modified from https://gist.github.com/EtherZa/581d9276336353838b2c939f9554d479
#
# This script finds the files that are about to be committed,
# and runs dotnet format on them before adding them back to staging
#
# install dotnet-format: dotnet tool install -g dotnet-format
# make sure installed dotnet tools are on your path:
# export PATH="$PATH:$HOME/.dotnet/tools/"
# copy to .git/hooks/pre-commit and make executable
@Kleptine
Kleptine / ConstructionScript.cs
Last active April 26, 2024 07:53
A Construction Script is a system to help generate procedural Gameobjects at Edit-Time in a Unity scene.
using System.Linq;
using UnityEngine;
#if UNITY_EDITOR
using System;
using UnityEditor;
#endif
namespace Global.Scripts.ConstructionScript
{
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 6, 2025 14:21
crack activate Office on mac with license file