Skip to content

Instantly share code, notes, and snippets.

View stramit's full-sized avatar

Tim Cooper stramit

View GitHub Profile
#if ENABLE_HYBRID_RENDERER_V2 && URP_9_0_0_OR_NEWER
using Unity.Burst;
using Unity.Entities;
using Unity.Mathematics;
using static Unity.Mathematics.math;
using UnityEngine;
using UnityEngine.Rendering;
namespace Unity.Rendering
{
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
[ImageEffectAllowedInSceneView]
public class WaterFXPass : MonoBehaviour, DefaultRendererSetup.IAfterSkyboxPass
{
private WaterFXPassImpl m_WaterFXPass;
using System;
using UnityEngine.Rendering;
namespace UnityEngine.Experimental.Rendering.LightweightPipeline
{
/// <summary>
/// A Custom tweaking of the LWRP using the passes system, in this example a 'WaterFXPass' is added
/// </summary>
public class MyLWRenderer : MonoBehaviour, IRendererSetup
{
@stramit
stramit / package.json
Created June 1, 2018 09:33
Example Project Manifest
{
"dependencies": {
"com.unity.postprocessing": "file:../ScriptableRenderPipeline/com.unity.postprocessing",
"com.unity.render-pipelines.core": "file:../ScriptableRenderPipeline/com.unity.render-pipelines.core",
"com.unity.shadergraph": "file:../ScriptableRenderPipeline/com.unity.shadergraph",
"com.unity.render-pipelines.lightweight": "file:../ScriptableRenderPipeline/com.unity.render-pipelines.lightweight"
}
}
@stramit
stramit / SpecialEventClass.cs
Last active November 21, 2018 06:36
SpecialEventClass
/*
* When developing the UI system we came across a bunch of things we were not happy
* with with regards to how certain events and calls could be sent in a loosely coupled
* way. We had this requirement because with a UI you tend to implement widgets that receive
* certain events, but you don't really want to have lots of glue code to manage them
* and keep track of them. The eventing interfaces we developed helped with this. One of
* the interesting things, is that they are not justfor the UI system! You can use this as
* a type-safe, fast, and simple alternative to SendMessage (never use SendMessage!).
* So how does it all work?
@stramit
stramit / TouchInputModule.cs
Created September 23, 2014 09:48
TouchInputModule (b19)
using System.Text;
namespace UnityEngine.EventSystems
{
[AddComponentMenu("Event/Touch Input Module")]
public class TouchInputModule : PointerInputModule
{
protected TouchInputModule()
{}
@stramit
stramit / Text.cs
Created September 22, 2014 12:55
Text Element
using System;
using System.Collections.Generic;
using System.Text;
namespace UnityEngine.UI
{
/// <summary>
/// Labels are graphics that display text.
/// </summary>
@stramit
stramit / ScrollRect.cs
Created September 22, 2014 09:55
Scroll Rect
using System;
using UnityEngine.Events;
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
[AddComponentMenu ("UI/Scroll Rect", 33)]
[SelectionBase]
[ExecuteInEditMode]
@stramit
stramit / Shadow.cs
Created September 18, 2014 13:37
Vertex Effect Example
using System.Collections.Generic;
namespace UnityEngine.UI
{
[AddComponentMenu ("UI/Effects/Shadow", 14)]
public class Shadow : BaseVertexEffect
{
[SerializeField]
private Color m_EffectColor = new Color (0f, 0f, 0f, 0.5f);
@stramit
stramit / CustomEvents.cs
Created September 4, 2014 06:16
Sending Custom Events via the EvenSystem
using System;
using System.Collections.Generic;
using UnityEngine.Events;
// interface you implement in your MB to receive events
public interface ICustomHandler : IEventSystemHandler
{
void OnCustomCode(CustomEventData eventData);
}