본문 바로가기

Programming

(89)
UGUI - UI Button OnClick 리스너 스크립트에서 지정하기 inspector에서 버튼에 호출함수를 넣기 어려운 상황이라면 스크립트에서 호출함수를 AddListener를 통하여 연결시켜 줄수있다. 주의할점 : 초기화 RemoveAllListeners (); RemoveListener(callFunction); 를 통해서 추가되었던 호출함수를 제거해줄수있다. 예시) using UnityEngine.UI; Button _bt; //호출함수 추가 _bt.onClick.AddListener (()=>callFunction(0.3f);};); //호출함수 제거 .onClick.RemoveListener(callFunction); //호출될 함수 void callFunction (float _param) {}
바이너리 파일 읽어오기(read a file as binaryreader) re:2019.05.11 바이너리 읽기 (read a file data) string _filename; => (resource폴더 이하의 경로 / 파일 확장자명 제외) TextAsset _textAsset = Resources.Load (filename) as TextAsset; Stream _s = new MemoryStream (_textAsset.bytes); BinaryReader br = new BinaryReader (_s); Debug.Log( br.ReadByte ()); Debug.Log( br.ReadInt32()); Debug.Log( br.ReadSingle()); ... 모든 바이트배열 얻기 (get all bytes) byte[] _all = br.ReadBytes ((int)br.BaseStream...
Cannot create FMOD::Sound instance for resource in Webgl Build/Editor 씬을 에셋번들로 만들고 씬에 링크되어있던 사운드를 재생시 문제가 발행때가 있는데 위의 사진처럼 셋팅값을 변경해주면 문제없다. 유니티(Unity) 애드몹 부업 프로젝트 : [1] 시작 목표 아주 단순한 점프게임을 만들어서 광고를 붙이고 광고수익을 발생 시켜보는 것이 이 프로젝트의 목표입니다. 서버도 없고 단지 클라이언트로 로그라이크형의 게임을 만들것이기 때문에 moblieandlife.tistory.com 유니티 무한의 발판 만들기 (Unity - Infinity Vertical Jump Platform) 목표 (Subject) 무한으로 생성되는 점프 플렛폼을 만들어보자. (Creating an infinitely generated jumping platform) Platform 발판의 스크립트를 아래와 ..
litjson 사용시 주의사항 (re:2019.05.07) - erro log JsonException: Max allowed object depth reached while trying to export from type System.Single LitJson.JsonMapper.WriteValue (System.Object obj, LitJson.JsonWriter writer, Boolean writer_is_private, Int32 depth) - 해결법(solution) float를 사용하지 않는다. do not use float type ---- ---- - erro log JsonException: Can't assign value '0' (type System.Int32) to type System.Int64 LitJson.JsonMapper.R..
webplayer 에서 assetbundle 다운시 셋팅 웹플레이어에서 Assetbundle을 다운받을 때 접근안된다 하면서 crossdomain.xml 어쩌고라고 뜰때가 있다. 해결법 1. 웹서버의 index.html이 있는 폴더에 crossdomain.xml 을 생성해주자 내용은 다음과 같다 ---- ---- 2. 웹서버에 mime 타입이라는게 있는데 그곳에 unity3d 타입을 추가해야한다. conf폴더의 httpd.conf 파일을 열어서 ... .. AddType application/unity3d .unity3d
유니티 텍스트에 색 넣기 (unity color text on script or Inspector) NGUI "[FFFFFF]" + text + "[-]" UGUI "" + text + ""
Ftp 사용시 Anonymous 접근법 ftp User에 anonymous 를 추가한다. 패스워드는 작성하지 않는다.
Lit json 파라메타(Param) Basic Dictionary param; List ListString; object _paramData = jsonMapper.toObject(jsonMapper.ToJson(ListString)); param.add(key, _paramData);