Open the Package Manager page in the Project Settings window and add the following entry to the "Scoped Registries" list:
- Name:
Keijiro
- URL:
https://registry.npmjs.com
- Scope:
jp.keijiro
using UnityEngine; | |
public abstract class Singleton<T> : MonoBehaviour where T : MonoBehaviour | |
{ | |
public static T Instance { get; private set; } | |
protected virtual void Awake() | |
{ | |
CheckSingleton(); | |
} |
// Original shader by @bgolus, modified slightly by @alexanderameye for URP, modified slightly more | |
// by @gravitonpunch for ECS/DOTS/HybridRenderer. | |
// https://twitter.com/bgolus | |
// https://medium.com/@bgolus/the-quest-for-very-wide-outlines-ba82ed442cd9 | |
// https://alexanderameye.github.io/ | |
// https://twitter.com/alexanderameye/status/1332286868222775298 | |
Shader "Hidden/Outline" | |
{ | |
Properties |
// Original shader by @bgolus, modified slightly by @alexanderameye for URP, modified slightly more | |
// by @gravitonpunch for ECS/DOTS/HybridRenderer. | |
// https://twitter.com/bgolus | |
// https://medium.com/@bgolus/the-quest-for-very-wide-outlines-ba82ed442cd9 | |
// https://alexanderameye.github.io/ | |
// https://twitter.com/alexanderameye/status/1332286868222775298 | |
Shader "Hidden/Outline" | |
{ | |
Properties |
using System.Collections.Generic; | |
/// <summary> | |
/// A simple static class to get and set globally accessible variables through a key-value approach. | |
/// </summary> | |
/// <remarks> | |
/// <para>Uses a key-value approach (dictionary) for storing and modifying variables.</para> | |
/// <para>It also uses a lock to ensure consistency between the threads.</para> | |
/// </remarks> | |
public static class GlobalVariables |
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 |
IEnumerator Shake() { | |
float elapsed = 0.0f; | |
Vector3 originalCamPos = Camera.main.transform.position; | |
while (elapsed < duration) { | |
elapsed += Time.deltaTime; | |
using UnityEngine; | |
public static class RendererArrayExtension | |
{ | |
public static Bounds ComputeBounds(this Renderer[] renderers) | |
{ | |
Bounds bounds = new Bounds(); | |
for (int ir = 0; ir < renderers.Length; ir++) | |
{ | |
Renderer renderer = renderers[ir]; |