Skip to content

Instantly share code, notes, and snippets.

View louisvalet's full-sized avatar

Louis Valet louisvalet

  • Canada
View GitHub Profile
@smkplus
smkplus / UnityShaderCheatSheet.md
Last active May 7, 2024 07:34
Controlling fixed function states from materials/scripts in Unity

16999105_467532653370479_4085466863356780898_n

Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
 
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
@dvddarias
dvddarias / SingletonScriptableObject.cs
Last active December 20, 2021 14:29
Better Unity Singleton Class
/************************************************************
* Better Singleton by David Darias
* Use as you like - credit where due would be appreciated :D
* Licence: WTFPL V2, Dec 2014
* Tested on Unity v5.6.0 (should work on earlier versions)
* 03/02/2017 - v1.1
* **********************************************************/
using System;
using UnityEngine;
anonymous
anonymous / ReferenceExchange.cs
Created June 11, 2017 17:29
Enables easier use of external class libraries and other VS projects with Unity.
/// <summary>
/// Trying to reference another Visual Studio project (for example a class library with core functionality) in your Unity3D project usually does not work.
/// You can add the project to your VS solution, but you still need to copy the compiled DLL to Unity in order to use it. An exemplary copy instruction in the post-build event command line might look like this:
///
/// xcopy /C /Y /R "$(ProjectDir)bin\Debug\MyProjectName.dll" "$(ProjectDir)..\MyProjectUnityFolder\Assets\"
///
/// When Unity autogenerates its project files for Visual Studio, it only adds a reference to the compiled dll that you have built and copied.
/// Unity does not care about the original project and neither does Visual Studio when you make changes to the Unity3D project itself.
/// This means you cannot use various meta related editor actions like go to definition, refactor etc. in the class library. The Unity3D source files will not be affected.
///
@keijiro
keijiro / ToggleTest.shader
Last active March 24, 2023 00:43
Shows how to use the Toggle material property drawer in a shader. See the reference manual for further details: http://docs.unity3d.com/ScriptReference/MaterialPropertyDrawer.html
Shader "ToggleTest"
{
Properties
{
[Toggle(FILL_WITH_RED)]
_FillWithRed ("Fill With Red", Float) = 0
}
SubShader
{
Pass
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive