Skip to content

Instantly share code, notes, and snippets.

@TheCuttlefish
TheCuttlefish / SpawnObject.cs
Created May 9, 2024 10:47
spawn things (once!)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpawnObject : MonoBehaviour
{
public List<Transform> possiblePositions = new List<Transform>();
public List<GameObject> allThings = new List<GameObject>();
@TheCuttlefish
TheCuttlefish / Ripple.cs
Created October 31, 2023 12:45
Ripple effect in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ripple : MonoBehaviour
{
//preset
@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
Created June 22, 2022 18:40
Unity URP control of post processing effects (example aberration) 2019
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class PostControl : MonoBehaviour
{
public Volume volume;
@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;