Skip to content

Instantly share code, notes, and snippets.

@Kink3d
Kink3d / MainLightNode.cs
Created May 8, 2018 00:13
A custom lighting node example for Shader Graph and Lightweight Render Pipeline
using UnityEngine;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
{
[Title("Input", "Lighting", "Main Light")]
public class MainLightNode : AbstractMaterialNode, IGeneratesBodyCode
{
public MainLightNode()
{
@valyard
valyard / Jobs_and_ecs.cs
Created July 10, 2017 20:20
"Slides" about C# Job System and ESC in Unity.
// ######################################################################
//
// We want you to write more efficient code
//
// ######################################################################
But, we teach the opposite...
You know, GameObjects and Components.
...
@ffyhlkain
ffyhlkain / ReferenceFinder.cs
Last active October 18, 2023 00:54
A reference finder for assets in a #Unity3d project.
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
namespace FoundationEditor.Editor.ReferenceFinder
{
@bkaradzic
bkaradzic / why_i_think_immediate_mode_gui_is_way_to_go_for_gamedev_tools.md
Last active April 5, 2024 05:40
Why I think Immediate Mode GUI is way to go for GameDev tools

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@frideal
frideal / PlayVideo.cs
Last active June 22, 2016 15:18
Unity3d Play video on IOS and android
using UnityEngine;
using System.Collections;
using System.IO;
public class PlayVideo : MonoBehaviour
{
private string streamingPath = string.Empty;
private string urlStreamPath = string.Empty;
private string streamingFileMp4Name = "test001.mp4";
@bkaradzic
bkaradzic / orthodoxc++.md
Last active April 23, 2024 13:59
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@galek
galek / pbr.glsl
Created November 4, 2015 11:10
PBR GLSL SHADER
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
{
mat4x4 world_matrix; // object's world position
@AngryAnt
AngryAnt / MoveComponentContext.cs
Last active July 5, 2017 05:44
Adds "Move to Top" and "Move to Bottom" items to the inspector context menu of components.
using UnityEngine;
using UnityEditor;
public class MoveComponentContext
{
enum Destination
{
Top,
Bottom
@liortal53
liortal53 / DecoratorEditor.cs
Last active April 2, 2024 17:10
Extend Unity's built-in inspectors
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// A base class for creating editors that decorate Unity's built-in editor types.
/// </summary>
public abstract class DecoratorEditor : Editor
@KeyMaster-
KeyMaster- / spriteGlitch.shader
Last active March 28, 2024 22:25
A glitch effect shader for Sprites in Unity3D
//Copyright (c) 2014 Tilman Schmidt (@KeyMaster_)
//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
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in