Skip to content

Instantly share code, notes, and snippets.

View inertiave's full-sized avatar
🌴
On vacation

관성 주도 개발 inertiave

🌴
On vacation
View GitHub Profile
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class RandomBox : MonoBehaviour
{
Dictionary<string, int> entry = new Dictionary<string, int>();
public void AddEntry(string _name, int amount)
{
@inertiave
inertiave / StructOwner.cs
Created August 16, 2019 07:07
Add difference between List and Array
using System.Collections.Generic;
using UnityEngine;
public class StructOwner : MonoBehaviour {
public MyStruct myStruct;
public MyStruct myStruct2;
public NestedClass nestedClass;
using System.Text;
public class MyStringExtension {
public string InjectComma(string input)
{
StringBuilder sb = new StringBuilder(input.Length * 2);
for (int i = 0; i < input.Length; i++) {
sb.Append(input[i]);
if (i % 5 == 4) {
using UnityEngine;
using UnityEngine.UI;
public class ButtonBehaviour : MonoBehaviour {
Button button;
void Awake()
{
button = GetComponent<Button>();
button.onClick.AddListener(OnButtonClick);
@inertiave
inertiave / BuildTest.cs
Created September 22, 2019 06:09
https://www.sysnet.pe.kr/2/0/12005 를 참고해 gameObject 와 transform 을 호출 할 때의 속도 차이 비교
using System;
using System.Diagnostics;
using System.Text;
using UnityEngine;
using UnityEngine.UI;
public class BuildTest : MonoBehaviour {
public Slider slider;
public Text countText;
@inertiave
inertiave / PlayerMovement.cs
Created September 23, 2019 02:40
New Input System
using UnityEngine;
using UnityEngine.InputSystem;
namespace MyNamespace {
public class PlayerMovement : MonoBehaviour, MyControl.IMovementActions {
public MyControl control;
void Awake()
{
using UnityEngine;
public class SingletonMonoBehaviour<T> : MonoBehaviour where T : SingletonMonoBehaviour<T> {
static T _inst;
public static T Instance {
get {
if (_inst == null) {
_inst = GameObject.FindObjectOfType(typeof(T)) as T;
using UnityEngine;
public class Toast : MonoBehaviour {
// Singleton
static Toast instance;
public static Toast GetInstance()
{
if (instance == null) {
instance = FindObjectOfType<Toast>();
public enum EReadOnlyType {
FULLY_DISABLED,
EDITABLE_RUNTIME,
EDITABLE_EDITOR,
}
public class ReadOnlyAttribute : UnityEngine.PropertyAttribute {
public readonly EReadOnlyType runtimeOnly;
using UnityEngine;
public class Sample : MonoBehaviour {
public string publicField;
[ReadOnly]
public string readOnlyField;
[ReadOnly(EReadOnlyType.FULLY_DISABLED)]