Skip to content

Instantly share code, notes, and snippets.

View Anthelmed's full-sized avatar

Anthelme Dumont Anthelmed

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)
@CynicatPro
CynicatPro / OutlineShader.shader
Last active October 21, 2020 12:57
A simple outline shader for unity
Shader "Unlit/OutlineShader" {
Properties {
[HDR] _OutlineColor ("Outline Color", Color) = (1,1,1,1)
_OutlineRadius ("Outline Radius", Float) = 0.1
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 100
Pass {
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
public static class AddPlayerLoopCallback
{
// Add a callback to the PreUpdate phase
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void Setup()
{
using UnityEditor;
using UnityEngine.LowLevel;
using UnityEngine.UIElements;
public class ShowPlayerLoopWindow : EditorWindow
{
[MenuItem("Window/Player Loop")]
static void ShowWindow()
{
var wind = GetWindow<ShowPlayerLoopWindow>(false, "Player Loop");
@TheAllenChou
TheAllenChou / Seek.cs
Last active August 26, 2019 10:15
Value Seeking
// example of how to move a current value towards a target value at a constant speed
// without going over the target value
// formula is the same for vectors of any dimension
Vector3 Seek(Vector3 currentValue, Vector3 targetValue, float maxSpeed, float dt)
{
// delta/difference from current value to target value
Vector3 delta = targetValue - currentValue;
// don't take the square root of magnitude yet
// so we can potentially early out on degenerate case of currenvValue ~= targetValue
@favoyang
favoyang / BuildAddressables.cs
Last active August 14, 2023 06:29
Build addressable bundles when clicking the build button
/// <summary>
/// The script gives you choice to whether to build addressable bundles when clicking the build button.
/// For custom build script, call PreExport method yourself.
/// For cloud build, put BuildAddressablesProcessor.PreExport as PreExport command.
/// Discussion: https://forum.unity.com/threads/how-to-trigger-build-player-content-when-build-unity-project.689602/
///
/// License: The MIT License https://opensource.org/licenses/MIT
/// </summary>
using UnityEditor;
using UnityEditor.AddressableAssets;
@StigOlavsen
StigOlavsen / arproxy.shader
Last active November 10, 2021 08:01
Unity shader for LWRP and AR Foundation, renders as transparent with occlusion and shadows. Put this on AR planes to get shadows and occlusion for 3D objects.
Shader "AR Proxy"
{
Properties
{
}
SubShader
{
Tags
{
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@zcyemi
zcyemi / JsonHelper.cs
Created March 14, 2018 13:51
Json.Net.JsonConverter for Unity Vector struct.
using UnityEngine;
using Newtonsoft.Json;
using System;
public class Vec4Conv : JsonConverter
{
public override bool CanConvert(Type objectType)
{
if (objectType == typeof(Vector4))
@yumayanagisawa
yumayanagisawa / CurlNoise.compute
Last active August 18, 2021 01:35
Unity3D | Curl Noise x Compute Shader
// https://github.com/keijiro/NoiseShader
#include "HLSL/SimplexNoise3D.hlsl"
#pragma kernel CSParticle
// Particle's data
struct Particle
{
float3 position;
float3 velocity;