Skip to content

Instantly share code, notes, and snippets.

View BeautyfullCastle's full-sized avatar
🐍

Hyunsoo Kim BeautyfullCastle

🐍
View GitHub Profile
@BeautyfullCastle
BeautyfullCastle / FontApplier.cs
Last active August 31, 2018 18:08
EditorWindow what can apply one font to all of components that uses font in the currently opened scene and assets.
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
public class FontApplier : EditorWindow
{
private static FontApplier assetReferenceFinder = null;
private Vector2 scrollPosition;
private List<Object> references = new List<Object>();
@BeautyfullCastle
BeautyfullCastle / ScriptReferencesFinder.cs
Last active September 3, 2018 15:41
Unity editor window to find referenced game objects of selected script in currently opened scene.
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class ScriptReferencesFinder : EditorWindow
{
private Vector2 scrollPosition;
private List<MonoBehaviour> references = new List<MonoBehaviour>();
private static MonoScript field = null;
@BeautyfullCastle
BeautyfullCastle / TransparentAlpha.shader
Created February 25, 2019 06:08
Unlit transparent shader with alpha property.
Shader "Unlit/Transparent Alpha" {
Properties{
_Alpha("Alpha", Range(0.0, 1.0)) = 1.0
_MainTex("Texture", 2D) = "white" {}
}
SubShader{
Tags {"Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent"}
LOD 100
using System;
namespace CSharpPractice
{
class Program
{
static void Main(string[] args)
{
/*
https://www.geeksforgeeks.org/cutting-a-rod-dp-13/
using System;
namespace CSharpPractice
{
class Program
{
static void Main(string[] args)
{
int[,] arr = new int[2, 4]
{
@BeautyfullCastle
BeautyfullCastle / AnimAssetDuplicator.cs
Created November 12, 2019 09:50
Copy clip assets from selected multiple model assets. Select assets and right click and find menu Model/Duplicate animation assets. Hotkey is Alt+D.
using System.IO;
using UnityEditor;
using UnityEngine;
namespace Assets.Editor
{
public class AnimAssetDuplicator
{
[MenuItem("Assets/Model/Duplicate Animation Assets &d")]
public static void DuplicateAnimationAssetsInThisFolder()
@BeautyfullCastle
BeautyfullCastle / UnityEditorExtension.AssertCheckNullWithSerializeFields.cs
Created November 27, 2019 05:51
Null check member fields using SerializeField attribute.
using UnityEngine;
using System.Reflection;
using System;
public static class UnityEditorExtension
{
public static void AssertCheckNullWithSerializeFields(this MonoBehaviour behaviour)
{
if (Application.isEditor == false)
{
@BeautyfullCastle
BeautyfullCastle / ObjectPool.cs
Created December 2, 2019 09:44
Generic ObjectPool class can use in Unity.
using System.Collections.Generic;
public class ObjectPool<T> where T : UnityEngine.Object
{
private Queue<T> queue = null;
private T original = null;
private int capacity = 0;
public ObjectPool(T original, int capacity = 10)
{
@BeautyfullCastle
BeautyfullCastle / Tree.cs
Created August 26, 2020 16:23
Array to Binary Search Tree
using System;
using System.Text;
namespace PracticeAlgorithmCSharp
{
public class Tree
{
private readonly Node root;
public Tree(int[] arr)
using System;
using System.Linq;
namespace PracticeAlgorithmCSharp
{
internal class Program
{
private static void Main(string[] args)
{
Solution();