Skip to content

Instantly share code, notes, and snippets.

View tblack-studio's full-sized avatar
😪

Tblack studio tblack-studio

😪
View GitHub Profile
@tblack-studio
tblack-studio / FrostedGlass.shader
Created April 11, 2018 03:40
Create blur background shader in Unity
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Unlit/FrostedGlass"
{
Properties
{
_Radius("Radius", Range(1, 255)) = 1
}
Category
@tblack-studio
tblack-studio / Round Rect.shader
Created April 11, 2018 03:37
Unity surface shader with round corners
Shader "Custom/Round Rect" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_Pos("Position", Vector) = (0,0,0,0)
_Width("Width", float) = 0.0
_Height ("Height", float) = 0.0
_Radius ("Radius", float) = 0.5
}
SubShader {
@tblack-studio
tblack-studio / PrintUnityGameObjectName.cs
Created September 29, 2017 11:06
Print Unity Game Object Name when clicking to them
if (Input.GetMouseButtonDown(0))
{
//empty RaycastHit object which raycast puts the hit details into
var hits = new RaycastHit[0];
//ray shooting out of the camera from where the mouse is
var ray = Camera.allCameras[0].ScreenPointToRay(Input.mousePosition);
if ((hits = Physics.RaycastAll(ray)).Length > 0)
{
//print out the name if the raycast hits something