Skip to content

Instantly share code, notes, and snippets.

View ByronMayne's full-sized avatar

Byron Mayne ByronMayne

View GitHub Profile
@LotteMakesStuff
LotteMakesStuff / PlayerLoop.cs
Last active March 25, 2024 02:38
Player Loop Visualizer: Built to explore the new PlayerLoopSystem api in Unity 2018.1b2. This tool shows you all the PlayerLoop systems that unity uses to update a frame, and demos how to add your own and even remove systems from the player loop. For more info see the patreon post https://www.patreon.com/posts/unity-2018-1-16336053
// Put this in an editor folder
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Experimental.LowLevel;
using UnityEngine.Profiling;
#if UNITY_EDITOR
using System.Reflection;
using UnityEngine;
using UnityEditor;
public class FontSwitcher : EditorWindow
{
[MenuItem("Font/Show Window")]
public static void ShowFontWindow()
{
@kimsama
kimsama / WebViewEditorWindow.cs
Created February 16, 2017 05:28
Open WebView window within Unity editor. It runs fine with Unity 5.5.x and no crash when closing Unity editor.
using UnityEngine;
using UnityEditor;
using System;
using System.Reflection;
/// <summary>
/// Open a webview within Unity editor. (similar as AssetStore window)
/// </summary>
public class WebViewEditorWindow : EditorWindow
{
@ByronMayne
ByronMayne / Point
Last active May 5, 2018 16:01
A int version of a Vector2 in Unity. Supports explicit conversion between the two types as well as a few helpful helper functions. The second script is a property drawer that supports panning of values and right clicking to reset the value to zero (taking from 3Ds Max).
using UnityEngine;
using System;
[Serializable]
public struct Point
{
[SerializeField]
public int x;
[SerializeField]
public int y;
@ByronMayne
ByronMayne / Injector.cs
Last active April 30, 2020 13:35
This code is used to inject a callback into Unity's internal build system. They should have this but if you really want to you can just make your own. This only needs Mono.Cecil #Magic
public class Injector
{
[MenuItem("Hacks/Inject Build Callback")]
public static void BuildCallback()
{
Assembly.BeginEditingAssembly(AssemblyTypes.UnityEditor, editAlreadyModifed:true);
{
TypeDefinition buildPiplelineType = Assembly.GetType<BuildPipeline>();
MethodDefinition buildInternalMethod = buildPiplelineType.GetMethod("BuildPlayerInternal");
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@masa795
masa795 / UnityTextures.cs
Created June 17, 2013 14:12
Unityが持っているアイコンを表示する。 Unityのバージョンによってはパスが使えなくなるかもしれないので使用時は注意。
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
//Unity 4.1.5
public class UnityTextures : EditorWindow
{