View gist:ab185883d4497e6742669cf490dcdc86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Test_ModelAnimationPath : MonoBehaviour | |
{ | |
public string positionName; | |
public MeshFilter meshFilts; | |
public List<Vector3> vecList; |
View aniamtor,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class UnityChanController06 : MonoBehaviour { | |
// parameters | |
public int speed; |
View SimpleJSON 사용 예제
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.IO; | |
using SimpleJSON; | |
public class PlayerState : MonoBehaviour | |
{ | |
public string name; | |
public int hp; |
View CSV Reader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
public class CSVReader | |
{ | |
static string SPLIT_RE = @",(?=(?:[^""]*""[^""]*"")*(?![^""]*""))"; | |
static string LINE_SPLIT_RE = @"\r\n|\n\r|\n|\r"; |
View 2D 플레이어 x축 움직임 제한 함수
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2D 플레이어 x축 움직임 제한 | |
private void ScreenCheck(){ | |
Vector3 worldPos = Camera.WorldToViewportPoint(this.transform.position); | |
if(worldPos.x < 0.05f) worldPos.x = 0.05f; | |
if(worldPos.x > 0.95f) worldPos.x = 0.95f; | |
this.transform.position = Camera.main.ViewportToWorldPoint(worldPos); | |
} |
View 쉐이더 (불필요한 부분을 지운 기본적인 코드)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/Tex" { | |
Properties { | |
/// | |
/// "Albedo (RGB)" : Albedo 텍스쳐를 넣는 곳이고, 알파는 사용하지 않고 RGB 채널만 사용하겠다는 의미. | |
/// 2D : 이 인터페이스가 2D 텍스쳐를 받는 부분이라는 의미. | |
/// "white"{} : 는 이 텍스쳐가 인터페이스가 처음 생겨서 아무것도 들어 있지 않을 때. 흰색 텍스쳐가 들어있다고 생각되도록 만들라는 의미 | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} // 텍스쳐를 입력받는 변수. | |
} | |
SubShader { |
View Shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/NewSurfaceShader" { | |
Properties { // 인스펙터 창에서 보여주는 | |
_Brightness("Change Brightness!!", Range(0,1)) = 0.5 | |
_TestFloat("Test Float!!", Float) = 0.5 | |
_TestColor("Test Color!!", Color) = (1,1,1,1) | |
_TestVector("Test Vector", Vector) = (1,1,1,1) | |
_TestTexture("Test Texture",2D) = "white" {} | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_Glossiness ("Smoothness", Range(0,1)) = 0.5 |
View touch screen1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class TouchScreenEx : MonoBehaviour { | |
//손가락을 화면에 닿은 상태에서 움직이면 물체가 움직인다 | |
void Update () { | |
if(Input.touchCount > 0 ){ |
View UISprite (change icon)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SpriteManager : MonoBehaviour { | |
public UISprite icon; | |
// Use this for initialization | |
void Start () { | |
NewerOlder