Skip to content

Instantly share code, notes, and snippets.

@TheCuttlefish
TheCuttlefish / Fade.cs
Created April 25, 2023 14:50
Screen Fade
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Fade : MonoBehaviour
{
CanvasGroup group;
float timer;
float fadeOutTimer;
@TheCuttlefish
TheCuttlefish / PostControl.cs
Last active March 21, 2025 17:11
Unity URP control of post processing effects (example bloom) 2022 - works with post processing stack v2
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
public class PostControl : MonoBehaviour
{
public PostProcessVolume volume;
public Bloom myBloom ;
@TheCuttlefish
TheCuttlefish / Scroll.shader
Last active May 10, 2022 15:13
Scroll Shader in Unity Standard Rendering Pipeline
Shader "Unlit/Scroll"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_SpeedX ("_SpeedX", float) = 0.5
_SpeedY("_SpeedY", float) = 0
_Color("Color (RGBA)", Color) = (1, 1, 1, 1)
}
SubShader
@TheCuttlefish
TheCuttlefish / CollisionCheck.cs
Last active December 7, 2021 13:20
Pack Master - collision check mechanic
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CollisionCheck : MonoBehaviour
{
public bool isInside = false;
public bool isOverlapping = false;
@TheCuttlefish
TheCuttlefish / Aim.cs
Created October 21, 2021 11:35
Pool Game
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Aim : MonoBehaviour
{
Vector3 mousePos;
public GameObject whiteBall;
public float dist;//white ball to mouse pos
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
Vector3 planetDir;
float pull = 1; // away or towards planet / 1 or -1
Rigidbody2D rb;
float movement;// horizontal input
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemySpawner : MonoBehaviour
{
public List<GameObject> spawnPoints = new List<GameObject>();
public GameObject enemy;
@TheCuttlefish
TheCuttlefish / CanScript.cs
Created May 18, 2021 14:51
Can Script - sprite swap
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CanScript : MonoBehaviour
{
public int dropsNum = 0;
public GameObject water;
bool warning = false;
@TheCuttlefish
TheCuttlefish / PostScript.cs
Created May 14, 2021 13:38
Post processing control via script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
public class PostScript : MonoBehaviour
{
PostProcessVolume volume;
ChromaticAberration chroAb;
ColorGrading cGrad;
@TheCuttlefish
TheCuttlefish / Movement.cs
Created March 25, 2021 15:54
Simple agent movement using 2 triggers (left and right)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
public GameObject leftCheck;
public GameObject rightCheck;
// Update is called once per frame