Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / BoxColliderFitChildren.cs
Created April 23, 2024 08:38
fit box collider to children
// https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Scripts/Editor/ContextMenu/BoxColliderFitChildren.cs
// Adjust Box Collider to fit child meshes inside
// Usage: You have empty parent transform, with child meshes inside, add box collider to parent then use this
// NOTE: Doesnt work if root transform is rotated
using UnityEngine;
using UnityEditor;
namespace UnityLibrary
@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 / MouseWorldSceneWindow.cs
Created April 22, 2024 10:05
2D mouse world coordinates in scene view (unity)
// https://forum.unity.com/threads/2d-mouse-world-coordinates-in-scene-view.1581912/
#nullable enable
#if UNITY_EDITOR
 
using System.Globalization;
 
using UnityEditor;
 
using UnityEngine;
using UnityEngine.InputSystem;
@unitycoder
unitycoder / Youtube blocked music.md
Last active April 20, 2024 15:25
Youtube blocked music / songs (blacklist)

Blocked songs (fully blocked every country)

  • Partyline : Brass Construction
  • Freedom : DJ Bobo
  • Strut Your Funky Stuff (UK 12" Version) : Frantique
  • Free (Mood II Swing Dub Mix) : Ultra Naté
  • Moving on Up : M People

Limited in some countries

  • Flawless (Go to the City) : George Michael
@unitycoder
unitycoder / blender.md
Created April 9, 2024 18:03
Blender Issues

general

  • file save as dialog doesnt remember last position (i had it in another screen, but it still appears on main screen)
@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 / CustomThumbnail.cs
Created April 7, 2024 09:18
Save Thumbnails for Scenes (unity editor script)
using System.IO;
using UnityEditor;
using UnityEngine;
namespace UnityLibrary
{
[CustomEditor(typeof(SceneAsset))]
public class CustomThumbnail : Editor
{
public override bool HasPreviewGUI() => true;
@unitycoder
unitycoder / TSVImporter.cs
Created April 7, 2024 08:15
import non .txt file as TextAsset with OnImportAsset
// https://forum.unity.com/threads/tsv-file-as-textassets.495244/#post-9754270
using System.IO;
using UnityEditor;
 
using UnityEngine;
 
[UnityEditor.AssetImporters.ScriptedImporter(1, "tsv")]
public class TSVImporter : UnityEditor.AssetImporters.ScriptedImporter
{
    public override void OnImportAsset(UnityEditor.AssetImporters.AssetImportContext ctx)
@unitycoder
unitycoder / Squid Proxy Notes.md
Created April 2, 2024 13:09
Squid Proxy Notes

Cannot connect from IRC client

You need to allow CONNECT, from that port, default is this line (which is for 443 port only)
http_access deny CONNECT !SSL_ports