Skip to content

Instantly share code, notes, and snippets.

View Fenikkel's full-sized avatar

Pau Fenollosa Fenikkel

View GitHub Profile
@Fenikkel
Fenikkel / !nfo.md
Last active April 14, 2025 11:16
Unity singleton

Singleton for Unity

Singleton example

 

Notes

Simple tu use and foolproof. It uses abstraction to make it almost invisible on your code and easy to reuse it.

@keijiro
keijiro / setup_scoped_registry.md
Last active January 3, 2025 12:59
How to add "Keijiro" scoped registry to your Unity project

How to add "Keijiro" scoped registry to your Unity project

  1. Open the Project Settings window and navigate to the Package Manager page.

  2. Add the following entry to the Scoped Registries list:

    • Name: Keijiro
    • URL: https://registry.npmjs.com
    • Scope: jp.keijiro
@mandarinx
mandarinx / Outline.shader
Created March 28, 2022 07:48 — forked from ScottJDaley/Outline.shader
Wide Outlines Renderer Feature for URP and ECS/DOTS/Hybrid Renderer
// 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
@ScottJDaley
ScottJDaley / Outline.shader
Last active February 18, 2025 06:05
Wide Outlines Renderer Feature for URP and ECS/DOTS/Hybrid Renderer
// 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
@hasanbayatme
hasanbayatme / GlobalVariables.cs
Last active November 17, 2023 09:14
A simple C# static class to get and set globally accessible variables through a key-value approach (C#, Unity, .NET)
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
@IJEMIN
IJEMIN / GoogleTranslator.cs
Last active November 22, 2024 18:12
Simple Unity Google Translator
/* Credit */
// Inspired by grimmdev's code - https://gist.github.com/grimmdev/979877fcdc943267e44c
/* Dependency */
// Import SimpleJSON Scripts : http://wiki.unity3d.com/index.php/SimpleJSON
// You can use your own JSON Parser if you want.
/* Limitations */
// translate.googleapis.com is free, but it only allows about 100 requests per one hour.
// After that, you will receive 429 error response.
@JohannesMP
JohannesMP / UIBlur.shader
Last active February 24, 2025 11:32
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
@mandarinx
mandarinx / ScreenShake.cs
Created January 21, 2016 08:11 — forked from insominx/gist:f3acce17108d0a2e4619
Screen shake in Unity
IEnumerator Shake() {
float elapsed = 0.0f;
Vector3 originalCamPos = Camera.main.transform.position;
while (elapsed < duration) {
elapsed += Time.deltaTime;
@frozax
frozax / DrawBounds.cs
Last active September 23, 2024 11:06
Unity component to show object bounds (in editor and in-game)
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];