This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
namespace NamedArgsSpeedTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for (int i = 0; i < 100; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Works | |
protected override Collector<GameEntity> GetTrigger(IContext<GameEntity> context) | |
{ | |
return new Collector<GameEntity>( | |
new [] | |
{ | |
context.GetGroup(GameMatcher.Machine), | |
context.GetGroup(GameMatcher.JustRepaired) | |
}, | |
new [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct appdata | |
{ | |
float4 position : POSITION; | |
float3 texcoord : TEXCOORD0; | |
}; | |
struct v2f | |
{ | |
float4 position : SV_POSITION; | |
float3 texcoord : TEXCOORD0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
public class MyWindow : EditorWindow | |
{ | |
public MySO testNode; | |
[MenuItem("TEST/OPEN WINDOW")] | |
static void Init() | |
{ |
OlderNewer