Skip to content

Instantly share code, notes, and snippets.

View gkagm2's full-sized avatar
πŸ˜†
..

Sagacity Jang gkagm2

πŸ˜†
..
View GitHub Profile
@gkagm2
gkagm2 / PlayerPrefs
Created April 20, 2019 14:38
PlayerPrefs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor; // need
public class csGameManager : MonoBehaviour {
// Use this for initialization
void Start () {
@gkagm2
gkagm2 / AsyncOperation
Last active April 20, 2019 12:59
μ›Ή 톡신 ν•  λ–„μ˜ Coroutine μ‚¬μš©λ²•
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class csCoroutine2 : MonoBehaviour {
//비동기 μž‘μ—…μ΄ 끝날 λ•ŒκΉŒμ§€ λŒμ‹œ
public string url; //μ›Ή μ£Όμ†Œλ₯Ό μ €μž₯ν•  슀트링 λ³€μˆ˜λ₯Ό νΌλΈ”λ¦­μœΌλ‘œ μ„ μ–Έν•œλ‹€.
WWW www; //WWW νƒ€μž…μ˜ λ³€μˆ˜λ₯Ό μ„ μ–Έν•œλ‹€.
@gkagm2
gkagm2 / Distance
Created April 20, 2019 00:16
Uselful API(Distance, Random, FindChild
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class csDistance : MonoBehaviour {
//거리λ₯Ό κ΅¬ν•˜κΈ° μœ„ν•œ κ²Œμž„ μ˜€λΈŒμ νŠΈλ“€μ˜ νŠΈλžœμŠ€νΌμ„ μ €μž₯ν•  λ³€μˆ˜ μ„ μ–Έ.
public Transform box1;
public Transform box2;
public Transform box3;
@gkagm2
gkagm2 / KeyMovePhone
Created April 20, 2019 00:11
KeyMovePhone
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class csKeyMovePhone : MonoBehaviour {
// Use this for initialization
void Start () {
}
@gkagm2
gkagm2 / GizemoView (DrawSphere)
Created April 20, 2019 00:08
GizemoView (DrawSphere)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class csGizmoView : MonoBehaviour {
public Color _color = Color.red;
public float _radius = 0.2f;
void OnDrawGizmos()
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class csKeyMove : MonoBehaviour {
public float a;
public float x;
// Update is called once per frame
void Update () {
//Horizontal - Z axis
@gkagm2
gkagm2 / Raycast
Last active June 20, 2019 05:33
RaycastAll code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class csRaycast : MonoBehaviour {
private float speed = 5f;
// Use this for initialization
void Start () {
@gkagm2
gkagm2 / RayCast Example
Created April 17, 2019 08:23
RayCast 예제 μ½”λ“œ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RayCastEx : MonoBehaviour {
void OnCreate() { }
void OnUpdate() { }
void OnDrawGizmos()
@gkagm2
gkagm2 / Random.onUnitShere
Created April 17, 2019 02:33
Random.onUnitShere (산탄 λ§Œλ“€λ•Œ μ‚¬μš©)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MyRandomOnUnitSphere : MonoBehaviour {
// Update is called once per frame
void Update () {
Vector3 start = Random.onUnitSphere;
Debug.DrawLine(start - Vector3.forward * 0.01f, start + Vector3.forward * 0.01f, Color.green, 50.0f);
Debug.DrawLine(start - Vector3.right * 0.01f, start + Vector3.right * 0.01f, Color.green, 50.0f);
@gkagm2
gkagm2 / character move
Last active April 16, 2019 02:21
Character move
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CharacterMove : MonoBehaviour {
public Transform cameraTransform;
public float moveSpeed = 10.0f;
public float jumpSpeed = 10.0f;
public float gravity = -20.0f;