Skip to content

Instantly share code, notes, and snippets.

View IJEMIN's full-sized avatar

I_Jemin IJEMIN

View GitHub Profile
@runevision
runevision / Text2.cs
Last active December 15, 2022 10:01
Text2 extends the Unity UI Text class and makes hyphens and soft hypens work
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
// Text2 extends the Text component in Unity UI.
// It makes hyphens and soft hyphens work.
// Inserting soft hyphens in text can be tricky and confusing, given they are invisible,
// so you can instead also insert Hyphenation Point characters, which will be replaced by soft hyphens:
// https://www.compart.com/en/unicode/U+2027
public class Text2 : Text {
@unitycoder
unitycoder / UnityForumBoardSearchHelper.js
Last active June 15, 2023 16:52
Unity Forum Search : AutoSelect current board item inside Search select list (based on referrer url)
// ==UserScript==
// @name Unity Forum Search : AutoSelect current board item inside Search select list (based on referrer url)
// @namespace https://unitycoder.com
// @version 1
// @include https://forum.unity.com/search/?type=post
// @grant none
// ==/UserScript==
// more info https://unitycoder.com/blog/2021/05/26/unity-forums-auto-select-current-subforum-in-search-greasemonkey-script/
// get referring board url
@RFullum
RFullum / UnityMicInputValues.cs
Created June 26, 2020 10:43
Unity Objects React to Microphone Input Values
/**
* Check your Microphone Permissions, especially on Mac.
* I had to delete Unity Hub, run the unity project, allow mic access when the warning pops up,
* and then reinstall Unity Hub or restore it from the trash after mic access is granted.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@unitycoder
unitycoder / D3D11.hlsl
Created May 9, 2019 06:54
Unity Shader Macros
// https://github.com/Unity-Technologies/ScriptableRenderPipeline/blob/master/com.unity.render-pipelines.core/ShaderLibrary/API/D3D11.hlsl
// This file assume SHADER_API_D3D11 is defined
#define UNITY_UV_STARTS_AT_TOP 1
#define UNITY_REVERSED_Z 1
#define UNITY_NEAR_CLIP_VALUE (1.0)
// This value will not go through any matrix projection conversion
#define UNITY_RAW_FAR_CLIP_VALUE (0.0)
#define VERTEXID_SEMANTIC SV_VertexID
#define INSTANCEID_SEMANTIC SV_InstanceID
@sokcuri
sokcuri / remove-missing-script.py
Created March 21, 2019 07:07
유니티 프리팹에서 Missing Script를 일괄 삭제하는 파이썬 스크립트입니다
# remove-missing-script.py
# A Python script that removes the disconnected script file "Missing Script" in Unity Prefab files
# - Author: github.com/sokcuri
#
# usage:
# > python Tools/remove-missing-script.py [Target Folder]
#
import re, sys
from pathlib import Path
@20chan
20chan / prime.mbl
Created May 2, 2018 05:56
Prime number algorithm written in marbelous
}0
Pr
Re
:Re
}0
=1
ip np
:ip
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@20chan
20chan / contract.py
Created July 2, 2017 13:50
The Fun Of Reinvention - Contract 중간 코드
class Contract:
@classmethod
def check(cls, value):
pass
class Typed(Contract):
@classmethod
def check(cls, value):
assert isinstance(value, cls.type), f'Expected {cls.type}'
@cobbpg
cobbpg / Unity-hotswapping-notes.md
Last active February 17, 2024 19:04
Unity hotswapping notes

Unity hotswapping notes

Unity has built-in support for hotswapping, which is a huge productivity booster. This feature works not only with graphics assets like bitmaps and meshes, but also with code: if you edit the source and save it, the editor will save the state of the running game, compile and load the new code, then load the saved state and continue where it left off. Unfortunately, this feature is very easy to break, and most available 3rd party plugins have little regard for it.

It looks like there’s a lot of confusion about hotswapping in Unity, and many developers are not even aware of its existence – which is no wonder if their only experience is seeing lots of errors on the console when they forget to stop the game before recompiling... This document is an attempt to clear up some of this confusion.

Nota bene, I’m not a Unity developer, so everything below is based on blog posts and experimentation. Corrections are most welcome!

The basic flow of hotswapping