Skip to content

Instantly share code, notes, and snippets.

View wakeup5's full-sized avatar
🐔
I like Fried chicken

Park Jin Han wakeup5

🐔
I like Fried chicken
  • Republic of Korea
View GitHub Profile
@wakeup5
wakeup5 / UnitIntegerExtensions.cs
Last active December 26, 2020 16:18
BigInteger를 유닛 문자열로 변환하는 함수
using System.Numerics;
using UnityEngine;
public static class UnitIntegerExtensions
{
public static string ToUnitString(this BigInteger b)
{
if (b < 1000)
{
return b.ToString();
@wakeup5
wakeup5 / DragAndDropManager.cs
Created November 10, 2020 15:20
Unity UGUI Drag and Drop
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UniRx;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Waker.UI.DragAndDrop
{
@wakeup5
wakeup5 / Page.cs
Last active October 12, 2020 01:27
C# IEnumerable<T>를 페이징 하는 확장 메서드
public struct Page<T> : IEnumerable<T>
{
private IEnumerable<T> source;
private IEnumerable<T> items;
private int pageIndex;
private int countPerPage;
private int maxPage;
public Page(IEnumerable<T> source, int pageIndex, int countPerPage)
{
@wakeup5
wakeup5 / RepeatButton.cs
Last active June 16, 2022 08:43
Unity에서 꾹 누르면 이벤트 반복 발생하는 버튼
using System;
using UnityEngine.Events;
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
public class RepeatButton : Selectable, IPointerDownHandler, IPointerUpHandler, IPointerExitHandler, IPointerClickHandler
{
[SerializeField] private float interval = 0.1f;
[SerializeField] private float delay = 1.0f;
@wakeup5
wakeup5 / BackEndJsonUtility.cs
Created July 27, 2020 10:35
특이한 뒤끝서버 Json 구조를 Object로 바로 파싱하는 코드(차트만 사용 가능). Newtonsoft.Json 라이브러리를 이용해 사용
public static class BackEndJsonUtility
{
public static readonly JsonConverter[] BackEndJsonConverters =
{
new ObjectToIntConverter(),
new ObjectToFloatConverter(),
new ObjectToDoubleConverter(),
new ObjectToStringConverter()
};
@wakeup5
wakeup5 / SpriteSwitcher.cs
Last active January 30, 2020 05:28
SpriteSwitcher is a component that lets you easily change textures in sprite swap based animations in Unity3D.
using Sirenix.OdinInspector;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
[ExecuteInEditMode]
public class SpriteSwitcher : MonoBehaviour
{
[HideInInspector]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ParticleSystemLifetime : MonoBehaviour
{
public enum Action
{
Disable,
Destroy
@wakeup5
wakeup5 / AudioData.cs
Created August 23, 2019 06:58
How to Serialize and Deserialize Sprite and AudioClip to Binary.
[System.Serializable]
public class AudioData
{
public string name;
public int channels;
public int samples;
public int frequency;
public float[] data;
public static AudioData FromAudioClip(AudioClip audioClip)