Skip to content

Instantly share code, notes, and snippets.

View darndz's full-sized avatar
💭
гит хуита

Влад darndz

💭
гит хуита
View GitHub Profile
@khadzhynov
khadzhynov / UiDistortion.shader
Created February 15, 2023 20:16
A simple shader to apply distortion (normal map) to UI Image in unity. Featured with map UV scrolling and blend mask.
Shader "GG/UiDistortion"
{
Properties
{
[NoScaleOffset] [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
[NoScaleOffset] _DistortionMask ("Distortion mask", 2D) = "white" {}
[Normal] _Distortion ("Distortion", 2D) = "white" {}
_DistortionAmount ("Distortion Amount", Range(-1, 1)) = 0.05
_DistortionScrollH ("Distortion Horizontal scroll", Range(-0.5, 0.5)) = 0.5
@rogue6800
rogue6800 / CameraOrbit.cs
Last active January 7, 2024 23:13
Smooth Mouse Orbit Camera
//Adapted from: https://wiki.unity3d.com/index.php/MouseOrbitImproved
//License: Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
//https://creativecommons.org/licenses/by-sa/3.0/
//Link to demo: https://youtu.be/I_7PyyzziTY
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraOrbit : MonoBehaviour
@ogxd
ogxd / Screenshot.cs
Last active December 10, 2024 10:33
Unity Editor tool to take high quality screenshots with transparent background, high resolution and auto cropping.
using System.IO;
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public static class Screenshot
{
static Screenshot()
{
EditorApplication.delayCall += () => {