Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / FileWatcher.cs
Created August 23, 2024 06:59 — forked from elringus/FileWatcher.cs
Allows executing an editor behaviour in response to file modificatons, even when editor application is not in focus.
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
/// <summary>
/// Uses file system watcher to track changes to specific files in the project directory.
@unitycoder
unitycoder / compress_video
Created August 22, 2024 19:35 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
@unitycoder
unitycoder / .gitignore
Created August 20, 2024 12:08 — forked from Vixxd/.gitignore
Bakery Lightmapper .gitignore for Unity
########################################
# Bakery .gitignore
# Ignore: https://geom.io/bakery/wiki/index.php?title=How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F
# Never ignore: https://geom.io/bakery/wiki/index.php?title=How_do_I...#How_do_I_share_a_scene_with_someone_who_doesn.E2.80.99t_have_Bakery_installed.3F
########################################
############# BAKERY ASSETS ############
# Ignore Bakery Assets folder
/[Aa]ssets/Bakery/*
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 {