Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / Varoitus Cheap Energy Finland.md
Created September 14, 2026 19:57
Varoitus Cheap Energy Finland

Varoitus Cheap Energy Finland

Älä osta täältä spot sähkösopimusta!

@unitycoder
unitycoder / Hunyuan3DEditor.cs
Created September 12, 2026 15:25
Unity Editor script to generate models in locally running Hunyuan3D
// first run the launcher and texturing mode enabled.
// https://github.com/YanWenKun/Hunyuan3D-2-WinPortable
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@unitycoder
unitycoder / selectsimilarpoly.ms
Created September 8, 2026 12:23
3ds max select similar polygons from current editable poly polygon selection
// chatgpt
(
-- SETTINGS
local tolerance = 0.001
local ignoreSize = false
fn compareFloat a b =
(
if a < b then -1
else if a > b then 1
@unitycoder
unitycoder / EditorDockIcon.cs
Created September 2, 2026 05:47
Unity Editor (mac) Add opened project’s icon to the Unity icon in OS Taskbar / Dock
// https://discussions.unity.com/t/add-opened-projects-icon-to-the-unity-icon-in-os-taskbar-dock-feature-request/790177/6
#if UNITY_EDITOR_OSX
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using UnityEditor;
using UnityEditor.Build;
using UnityEngine;
@unitycoder
unitycoder / TogglePassthrough.cs
Last active September 1, 2026 08:31 — forked from dilmerv/TogglePassthrough.cs
TogglePassthrough.cs - For AR Foundation With Meta OpenXR Support
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.XR.ARFoundation;
public class TogglePassthrough : MonoBehaviour
{
[SerializeField]
private InputActionProperty toggleAction;
private ARCameraManager arCameraManager;
@unitycoder
unitycoder / AnchorCreatorV2.cs
Created September 1, 2026 08:31 — forked from dilmerv/AnchorCreatorV2.cs
AnchorCreatorV2.cs - For AR Foundation With Meta OpenXR Support
using System.Collections.Generic;
using Unity.XR.CoreUtils;
using UnityEngine.InputSystem;
using UnityEngine.XR.ARSubsystems;
namespace UnityEngine.XR.ARFoundation.Samples
{
[RequireComponent(typeof(ARAnchorManager))]
[RequireComponent(typeof(ARRaycastManager))]
public class AnchorCreatorV2 : MonoBehaviour
@unitycoder
unitycoder / How To Reduce Token Usage in VSCode Github Copilot.md
Last active August 25, 2026 07:00
How To Reduce Token Usage in Visual Studio Github Copilot or VSCode

Use %USERPROFILE%\copilot-instructions.md

See above, same as visual studio.

Settings

Press CTRL+P to opens settings.json

Can adjust or add these values (you might want autofix enabled though)

"chat.agent.maxRequests": 8,
@unitycoder
unitycoder / RvoGridGraph.cs
Created June 17, 2026 21:07 — forked from hymerman/RvoGridGraph.cs
RVO grid graph for A* Pathfinding Project Pro
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using Pathfinding.RVO;
/** Adds a GridGraph as RVO obstacles.
* Add this to a scene in which has a GridGraph based graph, when scanning (or loading from cache) the graph
* it will be added as RVO obstacles to the RVOSimulator (which must exist in the scene).
*
@unitycoder
unitycoder / EditorWindowDeselect.cs
Created June 15, 2026 09:11
Editor Window Deselect textarea element on click
// if mouse click anywhere on window
var theWholeWindowRect = new Rect(0, 0, position.width, position.height);
if (GUI.Button(theWholeWindowRect, "", GUIStyle.none))
{
GUI.FocusControl(null);
}
@unitycoder
unitycoder / Unity-ReferenceChecker.cs
Created May 29, 2026 06:36 — forked from noisecrime/Unity-ReferenceChecker.cs
WIP - Simple editor script to provide options in dropdown menu when clicking on an asset in the project browser to discover what other assets/scenes reference it.
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
/// <summary>
/// NoiseCrimeStudio OneShots are single scripts that provide specific funactionality.
/// </summary>
namespace NoiseCrimeStudios.OneShot.Editor