Skip to content

Instantly share code, notes, and snippets.

View gkagm2's full-sized avatar
😆
..

Sagacity Jang gkagm2

😆
..
View GitHub Profile
@gkagm2
gkagm2 / Unity AudioManager.cs (singleton)
Last active April 13, 2019 10:24
Unity AudioManager.cs singleton Instance
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AudioManager : MonoBehaviour {
static AudioManager _instance = null;
public static AudioManager Instance()
{
return _instance;
}
@gkagm2
gkagm2 / mouseLook
Created April 15, 2019 01:49
mouseLook
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class csMouseLook : MonoBehaviour {
public float sensitivity = 500.0f;
public float rotationX;
public float rotationY;
@gkagm2
gkagm2 / MouseLook
Created April 16, 2019 01:51
my MouseLook
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseLook : MonoBehaviour {
public float sensitivity = 700.0f;
public float rotationX;
public float rotationY;
// Use this for initialization
@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;
@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 / 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 / Quaternion 예제
Created April 19, 2019 23:49
Quaternion
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 / 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()
@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 / 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;