Skip to content

Instantly share code, notes, and snippets.

[Test]
public void DelegatesVsVanillaSubscriberList()
{
const int count = 10000;
var observerImplementation = new ObserverImplementation();
var sw = new Stopwatch();
sw.Start();
Action action = () => { };
for (int i = 0; i < count; i++)
{
[Generic Entity] Total time: 5823
[Generic Entity] Avg time: 0.5823
[Code Gen Entity] Total time: 4777
[Code Gen Entity] Avg time: 0.4777
Tests completed
[Generic Entity] Total time: 6167
[Generic Entity] Avg time: 0.6167
[Code Gen Entity] Total time: 5985
[Code Gen Entity] Avg time: 0.5985
Tests completed
// -------------------------------
// Common action invoker interface
public interface IActionInvoker
{
string InvokingActionType { get; }
void Execute(Contexts contexts);
}
// -------------------------------
using UnityEngine;
public class Gameboy : MonoBehaviour
{
public Material gameboyMaterial;
public Material identityMaterial;
private RenderTexture _downscaledRenderTexture;
private void OnEnable()
Shader "Gameboy"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Darkest ("Darkest", color) = (0.0588235, 0.21961, 0.0588235)
_Dark ("Dark", color) = (0.188235, 0.38431, 0.188235)
_Ligt ("Light", color) = (0.545098, 0.6745098, 0.0588235)
_Ligtest ("Lightest", color) = (0.607843, 0.7372549, 0.0588235)
}
Shader "Gameboy"
{
...
sampler2D _MainTex;
float4 _Darkest, _Dark, _Ligt, _Ligtest;
float4 frag (v2f i) : SV_Target
{
float4 originalColor = tex2D(_MainTex, i.uv);
Shader "Gameboy"
{
...
sampler2D _MainTex;
float4 _Darkest, _Dark, _Ligt, _Ligtest;
float4 frag (v2f i) : SV_Target
{
float4 originalColor = tex2D(_MainTex, i.uv);
Shader "Gameboy"
{
...
sampler2D _MainTex;
float4 _Darkest, _Dark, _Ligt, _Ligtest;
float4 frag (v2f i) : SV_Target
{
float4 originalColor = tex2D(_MainTex, i.uv);
Shader "Gameboy"
{
Properties
{
...
}
SubShader
{
...
Shader "Gameboy"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Darkest ("Darkest", color) = (0.0588235, 0.21961, 0.0588235)
_Dark ("Dark", color) = (0.188235, 0.38431, 0.188235)
_Ligt ("Light", color) = (0.545098, 0.6745098, 0.0588235)
_Ligtest ("Lightest", color) = (0.607843, 0.7372549, 0.0588235)
}