Skip to content

Instantly share code, notes, and snippets.

View hon454's full-sized avatar

Jihun Jeon hon454

View GitHub Profile
@hon454
hon454 / UnetHelloWorld
Created November 6, 2017 02:52 — forked from linadk/UnetHelloWorld
Using the Unity3d Unet LLAPI this will establish a connection and send data. There aren't many examples out there for this currently so I thought I'd write this up.
/// <summary>
/// UNet LLAPI Hello World
/// This will establish a connection to a server socket from a client socket, then send serialized data and deserialize it.
/// </summary>
using UnityEngine;
using System.Collections;
using UnityEngine.Networking;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
@hon454
hon454 / SteamVR_TrackingWithoutHMD.cs
Last active October 2, 2023 19:06
[SteamVR][Unity] Tracker tracking without HMD
using UnityEngine;
using Valve.VR;
public class SteamVR_TrackingWithoutHMD : MonoBehaviour
{
private CVRSystem _vrSystem;
private TrackedDevicePose_t[] _poses = new TrackedDevicePose_t[OpenVR.k_unMaxTrackedDeviceCount];
// initialize
void Awake()

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

1. 마크다운에 관하여

1.1. 마크다운이란?

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

1.2. 마크다운의 장-단점

1.2.1. 장점

@hon454
hon454 / SteamVR_GetTrackedObjectSerialNumber.cs
Created November 6, 2017 16:01
[SteamVR][Unity] Get tracked object serial number
using UnityEngine;
using Valve.VR;
public class SteamVR_GetTrackedObjectSerialNumber : MonoBehaviour
{
private void Start()
{
uint index = 0;
ETrackedPropertyError error = new ETrackedPropertyError();
for (uint i = 0; i < 16; i++)
@hon454
hon454 / SteamVR_GetTrackedObjectName.cs
Created November 6, 2017 16:02
[SteamVR][Unity] Get tracked object name
using UnityEngine;
using Valve.VR;
public class SteamVR_GetTrackedObjectName : MonoBehaviour
{
private void Start()
{
uint index = 0;
ETrackedPropertyError error = new ETrackedPropertyError();
for (uint i = 0; i < 16; i++)
@hon454
hon454 / AndroidWebview.cs
Created November 27, 2017 16:38
Android VR Webview Texture for Unity (more information at: https://jerome.gangneux.net/projects/2017-02-android-vr-webview/)
using UnityEngine;
using UnityEngine.EventSystems;
using System;
using System.Collections;
using System.Runtime.InteropServices;
[RequireComponent(typeof(Renderer))]
public class AndroidWebview : MonoBehaviour, IPointerExitHandler, IPointerClickHandler, IBeginDragHandler, IDragHandler, IEndDragHandler {
@hon454
hon454 / PlayCloudDataManager.cs
Created December 3, 2017 04:35 — forked from IJEMIN/PlayCloudDataManager.cs
Unity Google Cloud Saved Game Data Manager Script
// code reference: http://answers.unity3d.com/questions/894995/how-to-saveload-with-google-play-services.html
// you need to import https://github.com/playgameservices/play-games-plugin-for-unity
using UnityEngine;
using System;
using System.Collections;
//gpg
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using GooglePlayGames.BasicApi.SavedGame;
//for encoding
@hon454
hon454 / SteamVR_GetControllerTriggerFullDown.cs
Last active December 28, 2017 11:57
[SteamVR][Unity] Get vive controller trigger full down/click
using UnityEngine;
using Valve.VR;
public class SteamVR_GetControllerTriggerFullDown : MonoBehaviour
{
public SteamVR_TrackedObject Controller;
private void Update ()
{
SteamVR_Controller.Device controllerDevice = null;
@hon454
hon454 / PlayerFSM.cs
Created February 8, 2018 05:13
Good Coroutine Example 1/2
using System.Collections;
using UnityEngine;
public partial class PlayerFSM : MonoBehaviour
{
public enum PlayerState
{
Idle,
Run,
}
@hon454
hon454 / PlayerFSMPeace.cs
Created February 8, 2018 05:14
Good Coroutine Example 2/2
using System.Collections;
using UnityEngine;
public partial class PlayerFSM : MonoBehaviour
{
private IEnumerator Idle()
{
do
{
yield return null;