Skip to content

Instantly share code, notes, and snippets.

View networm's full-sized avatar

狂飙 networm

View GitHub Profile
@networm
networm / CustomGraphicRaycaster.cs
Last active December 11, 2019 02:13
Unity UGUI EventSystem Optimization | Unity UGUI EventSystem 优化 - 狂飙 https://networm.me/2019/10/06/unity-ugui-eventsystem-optimization/
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class CustomGraphicRaycaster : GraphicRaycaster
{
public Camera TargetCamera;
@networm
networm / BitmapFontExporter.cs
Created September 9, 2018 17:05
Convert BMFont txt file to Unity font. XML version: Create UGUI Customize Font – 建立 UGUI 自定義字型 – 阿祥的開發日常 https://tedsieblog.wordpress.com/2016/07/11/create-ugui-customize-font/
using System;
using System.IO;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
public class BitmapFontExporter : ScriptableWizard
{
public TextAsset fontFile;
public Texture2D textureFile;
@networm
networm / UnityPlaymodeHook.cs
Created March 19, 2017 12:57
To do something before and after Unity play
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
public class PlaymodeHook
{
static PlaymodeHook()
{
EditorApplication.update += Update;
EditorApplication.playmodeStateChanged += PlaymodeStateChanged;
@networm
networm / TestUnityConnectionLimit.cs
Last active February 8, 2020 06:53
C# API WebRequest default connection limit is 2. Use the request.ServicePoint.ConnectionLimit to unlock this limitation
using UnityEngine;
using System.Net;
using System.Threading;
public class TestConnectionLimit : MonoBehaviour
{
void Download(object arg)
{
var sw = new System.Diagnostics.Stopwatch();
sw.Start();