Skip to content

Instantly share code, notes, and snippets.

View rlewicki's full-sized avatar
🌖
Do not go gentle into that good night

Robert Lewicki rlewicki

🌖
Do not go gentle into that good night
View GitHub Profile
Shader "Custom/ImageClippingCG"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_ClipValue("Clip value", Range(0.0, 1.0)) = 0.0
}
SubShader
{
// No culling or depth
Shader "Custom/ImageInfiniteScrollingCG"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
@rlewicki
rlewicki / TextureTransition.shader
Last active December 24, 2018 22:33
Texture transition
Shader "Custom/TransitionCG"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_SecondTex("Second texture", 2D) = "white" {}
_OpacityLevel("Opacity level", Range(0.0, 1.0)) = 0.0
}
SubShader
{
public class LevelGating : MonoBehaviour
{
public void Initialize()
{
PlayerEvents.PlayerLevelUp += OnPlayerLevelUp;
}
private void OnPlayerLevelUp(int level)
{
// Example usage
public class PlayerEvents
{
public delegate void PlayerLevelUpCallback(int level);
public static event PlayerLevelUpCallback PlayerLevelUp;
}
public class Player : MonoBehaviour
{
private int _currentLevel;
public void LevelUp()
{
_currentLevel++;
PlayerLevelUp(_currentLevel);
}
}
set nocompatible " be iMproved, required
filetype off " required
set nocompatible
set nobackup
set ruler
set encoding=utf-8
set guifont=iosevka:h14
syntax enable
@rlewicki
rlewicki / .clang-format
Last active June 19, 2017 22:04
My own clang-format configuration file.
BasedOnStyle: LLVM
IndentWidth: 4
BreakBeforeBraces: Allman
BinPackArguments: false
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
SpaceBeforeParens: Always
SpacesInParentheses: true
SpacesInAngles: true
ColumnLimit: 80