Skip to content

Instantly share code, notes, and snippets.

View cocodding0723's full-sized avatar

cocodding0723

View GitHub Profile
@cocodding0723
cocodding0723 / KeyboardUtil.kt
Created November 8, 2022 06:54
Keyboard show and hide
package com.coco.commoneditor.util
import android.content.Context
import android.view.View
import android.view.inputmethod.InputMethodManager
class KeyboardUtil {
companion object {
fun showKeyboard(context: Context, view: View) {
view.requestFocus()
@cocodding0723
cocodding0723 / CanvasSizeToMobilePointSize.cs
Last active May 12, 2022 04:55 — forked from IJEMIN/CanvasSizeToMobilePointSize.cs
유니티에서 안드로이드의 DP, iOS의 포인트 해상도를 사용하기
using UnityEngine;
using UnityEngine.UI;
public class CanvasSizeToMobilePointSize : MonoBehaviour
{
private CanvasScaler _canvasScaler;
private void Awake()
{
_canvasScaler = GetComponent<CanvasScaler>();
@cocodding0723
cocodding0723 / .gitattributes
Created September 18, 2021 01:28 — forked from nemotoo/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@cocodding0723
cocodding0723 / how-to-write-by-markdown.md
Created July 1, 2021 12:20 — forked from ihoneymon/how-to-write-by-markdown.md
마크다운(Markdown) 사용법

[공통] 마크다운 markdown 작성법

1. 마크다운에 관하여

1.1. 마크다운이란?

Markdown은 텍스트 기반의 마크업언어로 2004년 존그루버에 의해 만들어졌으며 쉽게 쓰고 읽을 수 있으며 HTML로 변환이 가능하다. 특수기호와 문자를 이용한 매우 간단한 구조의 문법을 사용하여 웹에서도 보다 빠르게 컨텐츠를 작성하고 보다 직관적으로 인식할 수 있다. 마크다운이 최근 각광받기 시작한 이유는 깃헙(https://github.com) 덕분이다. 깃헙의 저장소Repository에 관한 정보를 기록하는 README.md는 깃헙을 사용하는 사람이라면 누구나 가장 먼저 접하게 되는 마크다운 문서였다. 마크다운을 통해서 설치방법, 소스코드 설명, 이슈 등을 간단하게 기록하고 가독성을 높일 수 있다는 강점이 부각되면서 점점 여러 곳으로 퍼져가게 된다.

1.2. 마크다운의 장-단점

1.2.1. 장점

@cocodding0723
cocodding0723 / NetworkingTools.cs
Created July 1, 2021 09:00 — forked from LotteMakesStuff/NetworkingTools.cs
Since Unity 2018.3 we've had this cool new tool called [SettingsProvider] that we can use to add custom settings menu into Unitys settings screens. This short example shows how i use [SettingsProvider] and some [MenuItems] to help build and run test clients when im developing a multiplayer game. My usecase is that i want a quick way to build and…
using System.Collections.Generic;
using System.Diagnostics;
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine;
using Debug = UnityEngine.Debug;
public static class NetworkingTools
{
@cocodding0723
cocodding0723 / TrafficLightAttribute.cs
Created July 1, 2021 08:58 — forked from LotteMakesStuff/TrafficLightAttribute.cs
TrafficLight control/layout/property drawer: Adds a new editor control that draws lil Traffic Lights in the inspector. its really useful for visualizing state. For example, checkboxes can be hard to read at a glace, but a Red or Green status light is easy! Recommend you use the attached package, as it has all the icon image files.
// Non Editor code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class TrafficLightAttribute : PropertyAttribute
{
public bool DrawLabel = true;
public string CustomLabel;
public bool AlsoDrawDefault;
@cocodding0723
cocodding0723 / InspectorButtonsTest.cs
Created July 1, 2021 08:51 — forked from LotteMakesStuff/InspectorButtonsTest.cs
Code running pack! two property drawing scripts that make it super easy to trigger code via buttons in the inspector, and get feedback! [TestButton] draws you little buttons that call a method on your MonoBehaviour, and [ProgressBar] give you a great way to show feedback from long running methods. These are *super* helpful for things like proced…
using UnityEngine;
using System.Collections;
public class InspectorButtonsTest : MonoBehaviour
{
[TestButton("Generate world", "DoProcGen", isActiveInEditor = false)]
[TestButton("Clear world", "ClearWorld", 2, isActiveInEditor = false)]
[ProgressBar(hideWhenZero = true, label = "procGenFeedback")]
public float procgenProgress = -1;
// LoadingScreenManager
// --------------------------------
// built by Martin Nerurkar (http://www.martin.nerurkar.de)
// for Nowhere Prophet (http://www.noprophet.com)
//
// Licensed under GNU General Public License v3.0
// http://www.gnu.org/licenses/gpl-3.0.txt
using UnityEngine;
using UnityEngine.UI;
@cocodding0723
cocodding0723 / MeshDestroy.cs
Created July 1, 2021 08:50 — forked from ditzel/MeshDestroy.cs
MeshDestroy => Put it on a game object with a mesh filter and renderer. Make sure to have read/write enabled on fbx import
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeshDestroy : MonoBehaviour
{
private bool edgeSet = false;
private Vector3 edgeVertex = Vector3.zero;
private Vector2 edgeUV = Vector2.zero;
@cocodding0723
cocodding0723 / ScreenRecorder.cs
Created July 1, 2021 08:42 — forked from DashW/ScreenRecorder.cs
ScreenRecorder - High Performance Unity Video Capture Script
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
class BitmapEncoder
{
public static void WriteBitmap(Stream stream, int width, int height, byte[] imageData)