Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
✅
‏‏‎

mika unitycoder

✅
‏‏‎
View GitHub Profile
@yasirkula
yasirkula / WavyImage.cs
Last active January 23, 2026 18:43
Create UI image with wave animation in Unity
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Sprites;
using UnityEngine.UI;
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER
using UnityEngine.U2D;
#endif
#if UNITY_EDITOR
using UnityEditor;
@ArieLeo
ArieLeo / Usage.cs
Created November 7, 2021 09:38 — forked from Refsa/Usage.cs
DrawMeshInstancedIndirect with ShaderGraph and URP
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
class Render : MonoBehaviour
{
struct DrawData
{
public Vector3 Pos;
public Quaternion Rot;
@alexmelyon
alexmelyon / EndToPlace.cs
Last active February 23, 2023 08:07
Unity: Press End to place object onto the surface
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
#if UNITY_EDITOR
/// <summary>
/// https://gist.github.com/alexmelyon/8f79bd08c79202d1570f26faefe47bf3
/// </summary>
[ExecuteInEditMode]
@alexmelyon
alexmelyon / MouseFinger.cs
Last active November 3, 2021 06:13
Send mouse/finger unity events
using UnityEngine;
using UnityEngine.Events;
public class MouseFingerEvent
{
public Vector2 position;
public int index;
}
public class MouseFinger : MonoBehaviour
@alexmelyon
alexmelyon / CameraEditorMovement.cs
Created November 2, 2021 20:44
Unity camera movement like Editor
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraEditorMovement : MonoBehaviour
{
[Header("Mouse")]
public float lookSpeedH = 2f;
public float lookSpeedV = 2f;
public float zoomSpeed = 2f;
using UnityEngine;
using UnityEditor;
using UnityEngine.Timeline;
using UnityEngine.Playables;
using System.Collections.Generic;
using UnityEditor.Timeline;
using uOSC;
using UnityEngine.Events;
using EVMC4U;
using VRM;
@marcusbirkeland
marcusbirkeland / CRT.hlsl
Created October 4, 2021 05:27
Unity CRT Shader
Shader "Unlit/CRT"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
[HDR] _ImageColor("Image Color", Color) = (1,1,1,1)
[HDR] _TintColor1("CRT TintColor", Color) = (1,1,1,1)
[HideInInspector][HDR] _TintColor2("TintColor2", Color) = (1,1,1,1)
_CRTAmount("CRT Amount", Range(0.0,0.5)) = 0.5
_CRTResolution("Resolution", Range(1.0,8.0)) = 1.2
@Enichan
Enichan / main.c
Last active January 19, 2025 17:27
Coroutines for C using Duff's Device based on Simon Tatham's coroutines
// coroutines for C adapted from Simon Tatham's coroutines
// https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
//
// this implementation utilizes __VA_ARGS__ and __COUNTER__
// to avoid a begin/end pair of macros.
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
// modify this if you don't like the `self->name` format
@tylermorganwall
tylermorganwall / submarine_cable_map.R
Last active May 18, 2026 00:07
Submarine Cable Map Dataviz
library(geojsonsf)
library(sf)
library(rayrender)
#Data source: https://github.com/telegeography/www.submarinecablemap.com
cables = geojson_sf("cable-geo.json")
cablescene = list()
counter = 1
for(i in 1:length(cables$geometry)) {
Shader "Test/SmoothZoomTexture"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
[KeywordEnum(Basic,Manual,Blend,Compare)]Mode("Mode", Int) = 0
_Blend("Blend", Range(0,1)) = 1
[Header(Mip Map)]
_MipMapMin("MipMap Min", Int) = 4