Skip to content

Instantly share code, notes, and snippets.

@dacaes
dacaes / CameraFade.cs
Last active April 25, 2024 18:50
Unity Camera Fader. Tested with default render. Just add CameraFade component to the camera and call CameraFade.In and CameraFade.Out from anywhere using the namespace CameraFading.
using UnityEngine;
using System.Collections;
namespace CameraFading
{
/// <summary>
/// Simple class to fade camera view to a color. Must be attached to camera.
/// Author: Daniel Castaño Estrella (daniel.c.estrella@gmail.com)
/// Based on this example: https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnPostRender.html
///
@dacaes
dacaes / SimplePool.cs
Last active April 25, 2024 18:51 — forked from Draugor/SimplePool.cs
Simple pool for Unity. Change Stack to Queue to avoid reuse last used prefab (useful with active despawned GameObjects);
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Extended: Simon "Draugor" Wagner (https://www.twitter.com/Draugor_/)
/// Extended: Daniel Castaño Estrella (daniel.c.estrella@gmail.com)
/// Latest Version: https://gist.github.com/danielcestrella/b1b45999da9cec063f9c381e296693a8
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2019-07-15 by Daniel Castaño Estrella: - Change Stack to Queue to avoid reuse last used prefab (useful with active despawned GameObjects);
/// 2019-01-24 by Daniel Castaño Estrella: - Added possibility of delayed Despawn;