Skip to content

Instantly share code, notes, and snippets.

@belzecue
belzecue / ExtendedSkybox.shader
Created July 21, 2018 16:36 — forked from josephbk117/ExtendedSkybox.shader
A unity shader code with good skybox colour and transition control ( day/night cycle)
Shader "BitshiftProgrammer/Skybox"
{
Properties
{
_SkyColor1("Top Color Day", Color) = (0.37, 0.52, 0.73, 0)
_SkyColor2("Horizon Color Day", Color) = (0.89, 0.96, 1, 0)
_SkyColor3("Top Color Night", Color) = (0.2 ,0.4 ,0.6 , 0)
_SkyColor4("Horizon Color Night",Color) = (0.4, 0.2, 0.1, 0)
_Transition("Transition Value",Range(0.0 , 1.0)) = 0.5
_BaseLevel("Base Start Level",Range(-2.0 , 0.0)) = 0.0
@belzecue
belzecue / ParallaxMappingShader.shader
Created July 22, 2018 17:22 — forked from enghqii/ParallaxMappingShader.shader
Parallax mapping unity custom shader
Shader "Custom/ParallaxMapShader" {
Properties{
_Color("Color", Color) = (1,1,1,1)
_LightColor("LightColor", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_ParallaxMap("_ParallaxMap (RGB)", 2D) = "white" {}
_NormalMap("NormalMap", 2D) = "white" {}
_MainLightPosition("MainLightPosition", Vector) = (0,0,0,0)
_HeightScale("height scale", Float) = 0.01
}
@belzecue
belzecue / CoroutineEvent.cs
Created August 4, 2018 08:14 — forked from sebtoun/CoroutineEvent.cs
C# events like object for Unity's coroutine
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CoroutineEvent<T1, T2>
{
public delegate IEnumerator CoroutineDelegate( T1 parameter1, T2 parameter2 );
private readonly List<CoroutineDelegate> _eventHandlers = new List<CoroutineDelegate>();
private int _runningCoroutinesCount;
@belzecue
belzecue / ShakeBehaviour.cs
Created August 4, 2018 08:29 — forked from sebtoun/ShakeBehaviour.cs
Shake Behaviour for Unity
#define USE_GAMELOGIC_EXTENSION
#if USE_GAMELOGIC_EXTENSION
using Gamelogic.Extensions;
#endif
using UnityEngine;
#if USE_GAMELOGIC_EXTENSION
public class ShakeBehaviour : GLMonoBehaviour
// Adapted from java source by Herman Tulleken
// http://www.luma.co.za/labs/2008/02/27/poisson-disk-sampling/
// The algorithm is from the "Fast Poisson Disk Sampling in Arbitrary Dimensions" paper by Robert Bridson
// http://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf
using System;
using System.Collections.Generic;
using UnityEngine;
using Random = System.Random;
@belzecue
belzecue / Easing.cs
Created August 4, 2018 08:31 — forked from sebtoun/Easing.cs
Easing Functions for Unity with support for Animation Curve and Inspector
using System;
using UnityEngine;
[ Serializable ]
public class Easing
{
public enum EasingType
{
Curve,
Function
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
[InitializeOnLoad]
public class EditorCameraSpeed
: EditorWindow
@belzecue
belzecue / GravityItem.cs
Created August 21, 2018 15:33 — forked from phosphoer/GravityItem.cs
Mario Galaxy Gravity for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@belzecue
belzecue / Mathfx.cs
Created August 21, 2018 15:35 — forked from phosphoer/Mathfx.cs
My own version of the Unity Wiki Mathfx
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
@belzecue
belzecue / AudioManager.cs
Created August 21, 2018 15:39 — forked from phosphoer/AudioManager.cs
Simple Unity AudioManager
// The MIT License (MIT)
// Copyright (c) 2017 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN