Skip to content

Instantly share code, notes, and snippets.

@ardaerbaharli
ardaerbaharli / UIBlur.shader
Created October 11, 2023 01:56 — forked from JohannesMP/UIBlur.shader
UI.Image Blur Shader with layering and masking support
Shader "Custom/UIBlur"
{
Properties
{
[Toggle(IS_BLUR_ALPHA_MASKED)] _IsAlphaMasked("Image Alpha Masks Blur", Float) = 1
[Toggle(IS_SPRITE_VISIBLE)] _IsSpriteVisible("Show Image", Float) = 1
// Internally enforced by MAX_RADIUS
_Radius("Blur Radius", Range(0, 64)) = 1
@ardaerbaharli
ardaerbaharli / EasingFunction.cs
Last active June 16, 2022 01:38 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* 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
using UnityEngine;
public static class Bootstrapper {
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
public static void Execute() {
Object.DontDestroyOnLoad(Object.Instantiate(Resources.Load("Systems")));
}
}
@ardaerbaharli
ardaerbaharli / Dragger.cs
Last active May 20, 2022 10:12 — forked from Matthew-J-Spencer/Dragger.cs
A simple drag and drop script for Unity. Follow along: https://youtu.be/Tv82HIvKcZQ
using UnityEngine;
public class Dragger : MonoBehaviour {
private Vector3 _dragOffset;
private Camera _cam;
[SerializeField] private float _speed = 10;
private void Awake() {
@ardaerbaharli
ardaerbaharli / SaveManager.cs
Created January 22, 2022 08:33 — forked from Matthew-J-Spencer/SaveManager.cs
A save manager for your Unity game. Tutorial: https://www.youtube.com/watch?v=Lt-AiGbHN9g
public class SaveManager : MonoBehaviour {
public static SaveData SaveData;
private static string SavePath => $"{Application.persistentDataPath}/save.game";
private BinaryFormatter _formatter = new BinaryFormatter();
void Start() {
Load();
}
public class NetworkManager : MonoBehaviour {
private void Start() {
StartCoroutine(MakeRequests());
}
private IEnumerator MakeRequests() {
// GET
var getRequest = CreateRequest("https://jsonplaceholder.typicode.com/todos/1");
yield return getRequest.SendWebRequest();