Skip to content

Instantly share code, notes, and snippets.

View BeautyfullCastle's full-sized avatar
🐍

Hyunsoo Kim BeautyfullCastle

🐍
View GitHub Profile
@BeautyfullCastle
BeautyfullCastle / Observer.cpp
Created January 8, 2022 08:10
C++ Observer Pattern Example (Easy and simple to understand)
#include "Observer.h"
Observer::Observer() : function(nullptr)
{
}
Observer::~Observer()
{
function = nullptr;
}
using System;
using System.Linq;
namespace PracticeAlgorithmCSharp
{
internal class Program
{
private static void Main(string[] args)
{
Solution();
@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)
@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 / 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 / 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()
using System;
namespace CSharpPractice
{
class Program
{
static void Main(string[] args)
{
int[,] arr = new int[2, 4]
{
using System;
namespace CSharpPractice
{
class Program
{
static void Main(string[] args)
{
/*
https://www.geeksforgeeks.org/cutting-a-rod-dp-13/
@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
@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;