Skip to content

Instantly share code, notes, and snippets.

@SugoiDev
SugoiDev / update-unity-compiler.cmd
Created July 24, 2018 08:26 — forked from zoon/update-unity-compiler.cmd
Latest version of Roslyn for unity.incrementalcompiler
@rem update-unity-compiler.cmd
@rem start in */com.unity.incrementalcompiler@X.Y.ZZ folder
@echo off
@rem NOTE: FIND.EXE can clash with git/msys/cygwin's find
for %%a in (%ComSpec%) do set __system=%%~dpa
%__system%FIND.EXE /i "com.unity.incrementalcompiler" package.json 1> NUL
if %errorlevel% neq 0 goto :not_found
nuget install Microsoft.Net.Compilers -verbosity quiet
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active April 4, 2024 13:42
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@joethephish
joethephish / Exp_for_zooming.md
Last active March 12, 2018 01:36
Using Mathf.Exp for zooming

Using Exp for zooming

One of the things I’m happiest to have learned in the past few months is a great use for Log + Exp in games when zooming in and out.

You may have already know that linear speeds work horribly for zooming, e.g.:

void Update() {
    scale = scale + speed * Time.deltaTime;
}
@tomkail
tomkail / DefaultAssetEditor.cs
Last active September 16, 2022 15:02
Draws inspectors for any file type Unity doesn't draw by default
/// Used to draw custom inspectors for unrecognised file types, which Unity imports as "DefaultAsset"
/// To do this, create a new editor class extending DefaultAssetInspector
/// Return true in the IsValid function if the file extension of the file matches the type you'd like to draw.
/// The DefaultAssetEditor class will then hold a reference to the new instance of your editor class and call the appropriate methods for drawing.
/// An example can be found at the bottom of the file.
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
@lbruder
lbruder / lbForth.c
Created April 6, 2014 15:21
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*