Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker
//
// This is to take any continuous quantity and change it from one value
// to another over time. This code is for floats. It can be adapted to work for:
//
// Vector2, Vector3, Vector3
@unitycoder
unitycoder / TriangleTexturePlugin.cs
Created April 28, 2024 09:17 — forked from daniel-ilett/TriangleTexturePlugin.cs
A Unity editor script which takes a mesh and generates a texture based on the UVs where each triangle is assigned a random greyscale color (place the script inside a folder named Editor).
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor;
using UnityEditor.UIElements;
// Based on: https://forum.unity.com/threads/save-rendertexture-or-texture2d-as-image-file-utility.1325130/
public class TriangleTexturePluginWindow : EditorWindow

(Unity) vertex color importer for MeshLab's OBJ files

@unitycoder
unitycoder / block_tik_tok.txt
Created April 23, 2024 13:34 — forked from RupGautam/block_tik_tok.txt
TikTok domains to DNSBL Feeds
api30.tiktokv.com
api21.tiktokv.com
webcast21.tiktokv.com
api31.tiktokv.com
api-t1.tiktokv.com
webcast1.tiktokv.com
api32.tiktokv.com
api30-h2.tiktokv.com
api21-h2.tiktokv.com
api-s1-h2.tiktokv.com
@unitycoder
unitycoder / .VoxelCollisionGenerator.cs.md
Created April 22, 2024 10:36 — forked from andrew-raphael-lukasik/.VoxelCollisionGenerator.cs.md
Tool to voxelize a Mesh Collider into multiple Box Colliders

GIF 21 01 2024 01-20-34

note: This is toy implementation, output is sub-optimal.

@unitycoder
unitycoder / Capture.cs
Created April 8, 2024 18:22 — forked from hinaloe/Capture.cs
Capture transparent screen on unity editor.
using System;
using System.Collections;
using System.IO;
using UnityEngine;
namespace Net.Hinaloe.ScreenCapture
{
public class Capture : MonoBehaviour
{
// Start is called before the first frame update
@unitycoder
unitycoder / Blur.cs
Created April 8, 2024 18:09 — forked from jimfleming/Blur.cs
A simple class to perform image blurring by overriding the main RenderTexture.
using UnityEngine;
using UnityEditor;
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public class Blur {
@unitycoder
unitycoder / PhotoshopBlendModes
Created March 13, 2024 18:58 — forked from miketucker/PhotoshopBlendModes
photoshop blending modes
/*
** Copyright (c) 2012, Romain Dura romain@shazbits.com
**
** Permission to use, copy, modify, and/or distribute this software for any
** purpose with or without fee is hereby granted, provided that the above
** copyright notice and this permission notice appear in all copies.
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
** WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
@unitycoder
unitycoder / BurstMethodTester.cs
Created March 1, 2024 20:42 — forked from runevision/BurstMethodTester.cs
Using Unity Burst directly on methods without jobs - unofficial example code
using Unity.Burst;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using UnityEngine;
// This example code demonstrates using Unity Burst directly on a static method without jobs.
// Unity NativeArrays can't be used directly in Unity Burst methods (only in Burst jobs),
// so we have to pass pointers to arrays instead.
@unitycoder
unitycoder / invokeAi-api-gist
Created February 25, 2024 10:54 — forked from ausbitbank/invokeAi-api-gist
This is a simplified version of whats needed to connect to InvokeAI websocket api, submit requests, upload init_images and recieve results
const io = require("socket.io-client")
const socket = io("http://127.0.0.1:9090",{reconnect: true})
const log = console.log.bind(console)
socket.on("connect", (socket) => {
log(socket) // Connected to api
})
socket.on("progressUpdate", (data) => {
log(data) // Returns current steps, status etc