Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / FogComponent.cs
Created February 9, 2023 07:59 — forked from cs-altshift/FogComponent.cs
Simple Fog Shader
using UnityEngine;
[RequireComponent(typeof(Camera))]
public class FogComponent : MonoBehaviour
{
public Shader myFogShader;
public Color fogColor = Color.red;
private Material myFogMaterial;
//PIXELBOY BY @WTFMIG EAT A BUTT WORLD BAHAHAHAHA POOP MY PANTS
// - edited by @Nothke to use screen height for #LOWREZJAM
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
[AddComponentMenu("Image Effects/PixelBoy")]
public class PixelBoy : MonoBehaviour
{
public int h = 64;
@unitycoder
unitycoder / PixelDot.shader
Created January 10, 2023 09:47 — forked from EntranceJew/PixelDot.shader
Renders a screen-aligned, distance-independent, resolution-independent, pixel-perfect quad in Unity. Use it with the built-in quad mesh. You don't have to rotate or scale the mesh renderer, the shader will take care of it.
Shader "FX/PixelDot"
{
Properties
{
[NoScaleOffset] _MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1, 1, 1, 1)
_Size ("Pixel Size", Range(1, 64)) = 1
}
SubShader
{
@unitycoder
unitycoder / ExampleInterface.cs
Created January 9, 2023 13:01 — forked from James-Frowen/ExampleInterface.cs
Unity3d, How to show an interface field in Inspector
namespace JamesFrowen
{
public interface ISomeInterface
{
void SomeMethod();
}
[System.Serializable]
public class SomeInterfaceWrapper : InterfaceWrapper<ISomeInterface>
{
# Simulator for depth comparison error (i.e. z-fighting)
# Nathan Reed, June 2015
# Written for Python 3.4; requires numpy
import math
import numpy as np
import optparse
# Parse command-line options
parser = optparse.OptionParser()
@unitycoder
unitycoder / ScriptFileWatcher.cs
Created January 8, 2023 11:09 — forked from Asuta/ScriptFileWatcher.cs
Modify the version to be directly available, monitor all folders containing C# scripts under assets, and directly copy them to any directory under assets
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
namespace Naninovel
@unitycoder
unitycoder / main.js
Created December 24, 2022 14:39 — forked from woxtu/main.js
Twitter インプレッション アクセスカウンター
const id = "kiriban-fuminige-kinshi";
const conversions = [
{ unit: "K", rate: 1000 },
{ unit: "M", rate: 1000000 },
{ unit: "B", rate: 1000000000 },
{ unit: "万", rate: 10000 },
];
function run(target) {
@unitycoder
unitycoder / GeneralSpriteShader.shader
Created December 17, 2022 13:44 — forked from Antoshidza/GeneralSpriteShader.shader
unity instanced sprite shader
Shader "Universal Render Pipeline/2D/SimpleSpriteShader"
{
Properties
{
_MainTex("_MainTex", 2D) = "white" {}
}
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
@unitycoder
unitycoder / DancePad.cs
Created December 12, 2022 12:32 — forked from mathiassoeholm/DancePad.cs
Unity dance pad input
using System;
using System.Collections.Generic;
using UnityEngine;
using Object = UnityEngine.Object;
namespace DancePadInput
{
public enum Player
{
Any,
@unitycoder
unitycoder / GLSL-Noise.md
Created December 4, 2022 20:39 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}