Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / CircularMenu.cs
Created April 28, 2023 12:45 — forked from alexanderameye/CircularMenu.cs
Circular menu for the Unity Editor
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Ameye.EditorUtilities.CircularMenu;
using Ameye.EditorUtilities.Editor.RadialMenu;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
@unitycoder
unitycoder / GameHost.cs
Created April 25, 2023 14:23 — forked from Vanlalhriata/GameHost.cs
Host Unity game in WPF
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
namespace KinectRun.Host.Controls
{
// GameHost is a FrameworkElement and can be added to controls like so:
// var gameHost = new GameHost(container.ActualWidth, container.ActualHeight);
@unitycoder
unitycoder / MeshCut.cs
Created April 3, 2023 16:27 — forked from alexcmd/MeshCut.cs
Mesh cut algorithm for Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MeshCut
{
private static Plane blade;
private static Transform victim_transform;
private static Mesh victim_mesh;
@unitycoder
unitycoder / orthodoxc++.md
Created April 1, 2023 19:19 — forked from bkaradzic/orthodoxc++.md
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@unitycoder
unitycoder / SpatialHash.cs
Created March 11, 2023 12:18 — forked from gamemachine/SpatialHash.cs
Spatial Hash
using Unity.Mathematics;
namespace GameCommon.Spatial
{
public struct SpatialHash
{
public const int Goffset = 10000;
public const int Max = 20480;
public int CellSize;
@unitycoder
unitycoder / HideFlagsUtility.cs
Created March 7, 2023 12:15 — forked from FlaShG/HideFlagsUtility.cs
Shows all GameObjects in the scene with hideFlags, so you can debug them.
using UnityEngine;
using UnityEditor;
public static class HideFlagsUtility
{
[MenuItem("Help/Hide Flags/Show All Objects")]
private static void ShowAll()
{
var allGameObjects = Object.FindObjectsOfType<GameObject>();
foreach (var go in allGameObjects)
@unitycoder
unitycoder / PrefabDetector.cs
Created March 5, 2023 09:43 — forked from idbrii/PrefabDetector.cs
A Unity editor window to show you the prefab-ness of an object
// public domain
// Add to Scripts/Editor/PrefabDetector.cs
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System;
using UnityEditor.Experimental.SceneManagement;
using UnityEditor.SceneManagement;
using UnityEditor;
using UnityEngine;
@unitycoder
unitycoder / DoomGlow.cs
Created February 17, 2023 10:37 — forked from TiliSleepStealer/DoomGlow.cs
Doom glow - fake volumetric light glow effect in Unity by Tili_us
// This file is in the public domain. Where
// a public domain declaration is not recognized, you are granted
// a license to freely use, modify, and redistribute this file in
// any way you choose.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity remake of a fake volumetric light glow effect
@unitycoder
unitycoder / VTRequest.cs
Created February 12, 2023 09:25 — forked from NanyiJiang/VTRequest.cs
Unity Streaming Virtual Texture Request improvement
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
#if ENABLE_VIRTUALTEXTURES
using VT = UnityEngine.Rendering.VirtualTexturing;
#endif
// [ExecuteInEditMode]
public class VTRequester : MonoBehaviour
@unitycoder
unitycoder / CC-Glass.shader
Created February 9, 2023 08:00 — forked from cs-altshift/CC-Glass.shader
Crying Suns Command-Center Glass Shader
Shader "Crying Suns/Command Center Glass"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture (ignored)", 2D) = "white" {}
[NoScaleOffset] _ReflectionTex ("Reflection Texture", 2D) = "black" {}
_ReflectionAlpha ("Reflection Alpha", Range(0, 1)) = 0.25
_ReflectionScale ("Reflection Scale", Range(0, 1)) = 1
[HideInInspector] _SunCenteredViewportPos ("Sun Centered Viewport Position", Vector) = (0, 0, 0, 0)
[HideInInspector] _SunAngle ("Sun Angle", Float) = 0