Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
using CodeSmile.Components.Registry;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace CodeSmile.Components.Pool
{
[DisallowMultipleComponent]
@unitycoder
unitycoder / OptimalSpatialHashing.cs
Created October 6, 2024 14:16 — forked from adammyhre/OptimalSpatialHashing.cs
Unity Spatial Hashing with Jobs and Burst
using System;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class OptimalSpatialHashing : MonoBehaviour {
@unitycoder
unitycoder / countries.json
Created September 21, 2024 12:33 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@unitycoder
unitycoder / README.md
Created September 17, 2024 19:50 — forked from jamiephan/README.md
A script to automatically add ALL items to your account in quixel

Script to add all items from quixel

As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874 items)

Note: This script only tested in the latest version of Chrome.

How to use

  1. Copy the script from below (run.js)
  2. Login into https://quixel.com
@unitycoder
unitycoder / FpsCapper.cs
Created September 16, 2024 09:52 — forked from keijiro/FpsCapper.cs
FpsCapper - Limits the frame rate of the Unity Editor in Edit Mode
using UnityEditor;
using UnityEngine;
using UnityEngine.LowLevel;
using System.Linq;
using System.Threading;
namespace EditorUtils {
//
// Serializable settings
@unitycoder
unitycoder / VertexBillboard.shader
Created September 4, 2024 21:49 — forked from camnewnham/VertexBillboard.shader
Point cloud shaders
Shader "Points/Billboard"
{
Properties
{
_PointSize("PointSize", Range(0, 0.1)) = 0.01
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Source Blend", Float) = 1 // "One"
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Destination Blend", Float) = 0 // "Zero"
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("Depth Test", Float) = 4 // "LessEqual"
[Enum(DepthWrite)] _ZWrite("Depth Write", Float) = 1 // "On"
}
@unitycoder
unitycoder / generate-points.ts
Created September 4, 2024 19:36 — forked from donmccurdy/generate-points.ts
Generate a point cloud in glTF format, using glTF Transform.
import { Document, NodeIO, Primitive } from '@gltf-transform/core';
const document = new Document();
const buffer = document.createBuffer();
const position = document.createAccessor()
.setType('VEC3')
.setBuffer(buffer)
.setArray(new Float32Array([
0, 0, 0, // ax,ay,az
@unitycoder
unitycoder / convert-glb.mjs
Created September 3, 2024 20:58 — forked from wallabyway/convert-glb.mjs
convert 3D-Tiles v1 to v1.1 (3D-Tiles-Next) for point clouds
// PURPOSE: convert draco-pnts to glb (ie. 3dTiles v1.0 to v1.1)
// INSTALL: npm install draco3d gltfpack
// RUN:
// > node infolderPNTS outfolderGLB
import fs from 'fs';
import draco3d from 'draco3d';
import gltfpack from 'gltfpack';
const inFolder = process.argv.slice(2)[0] || 'infolder';
hader "Unlit/GridOverlay"
{
Properties
{
_GridSize("Grid Size", Float) = 10
_Grid2Size("Grid 2 Size", Float) = 160
_Grid3Size("Grid 3 Size", Float) = 320
_Alpha ("Alpha", Range(0,1)) = 1
}
SubShader
@unitycoder
unitycoder / UnityShaderFFS.md
Created September 2, 2024 10:51 — forked from Leopotam/UnityShaderFFS.md
Controlling fixed function states from materials/scripts in Unity

16999105_467532653370479_4085466863356780898_n

Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
 
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}