Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using NHibernate;
using NHibernate.Engine;
using NHibernate.Persister.Entity;
using NHibernate.Proxy;
namespace Bars.Energo
using System;
using System.Diagnostics;
namespace NamedArgsSpeedTest
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 100; i++)
// Works
protected override Collector<GameEntity> GetTrigger(IContext<GameEntity> context)
{
return new Collector<GameEntity>(
new []
{
context.GetGroup(GameMatcher.Machine),
context.GetGroup(GameMatcher.JustRepaired)
},
new []
struct appdata
{
float4 position : POSITION;
float3 texcoord : TEXCOORD0;
};
struct v2f
{
float4 position : SV_POSITION;
float3 texcoord : TEXCOORD0;
half4 frag(v2f i) : COLOR
{
half p = i.texcoord.y;
// Moving [-1, 1] range to [0, 1]
half normP = p * 0.5 + 0.5;
half3 color = lerp(_GroundColor,_SkyTint, p);;
return half4(color, 1.0);
}
half4 frag(v2f i) : COLOR
{
half p = i.texcoord.y;
float p1 = pow(min(1.0f, 1.0f - p), _Exponent);
half3 color = lerp(_GroundColor, _SkyTint, p1);
}
#define HARDNESS_EXPONENT_BASE 0.125
half calcSunSpot(half3 sunDirPos, half3 skyDirPos)
{
half3 delta = sunDirPos - skyDirPos;
half dist = length(delta);
half spot = 1.0 - smoothstep(0.0, _SunSize, dist);
return 1.0 - pow(HARDNESS_EXPONENT_BASE, spot * _SunHardness);
}
half4 frag(v2f i) : COLOR
{
half p = i.texcoord.y;
float p1 = pow(min(1.0f, 1.0f - p), _Exponent);
float p2 = 1.0f - p1;
// Our moon circle
half3 mie = calcSunSpot(_SunPosition.xyz, i.texcoord.xyz) * _SunColor;
// Blend ground fog with the moon
Shader "KumoKairo/Gradient Moon Skybox"
{
Properties
{
_SkyTint("Sky Tint", Color) = (.5, .5, .5, 1)
_GroundColor("Ground", Color) = (.369, .349, .341, 1)
_Exponent("Exponent", Range(0, 15)) = 1.0
_SunPosition("Sun Position", Vector) = (0.0, 0.0, 1.0)
_SunColor("Sun Color", Color) = (1.0, 1.0, 1.0, 1.0)
using UnityEditor;
using UnityEngine;
public class MyWindow : EditorWindow
{
public MySO testNode;
[MenuItem("TEST/OPEN WINDOW")]
static void Init()
{