2013년 11월 28일 목요일

Texture Packer in Unity_Step4. Texture Packer Helper제어를 통한 Sprite Texture 구현

1. Step3에서 만들어놓은 Test Plane에다가 아래의 Script를 추가 Sprite.cs using UnityEngine; using System.Collections; public enum SpriteType { Once, Loop, } public class Sprite : MonoBehaviour { public SpriteType _Type; public string _TextureName; // texture Name public int _MaxFrame; // Texture Frame Length public float _Dealay; // Sprite play Dealay private TPHelper _TPH; private int _NowFrame; // now frame Num ...

Texture Packer in Unity_Step3. Unity내에 Atlas 불러오기온 뒤 Texture Plane생성하기

pre. Custom Plane Mesh를 사용하지않고 TexturePacker 자체에서 Sprite Object를 생성해주는 기능이 있긴하지만.. 스크립트상에서 접근하여 다루기가 불편하여 이런식으로 작업을 진행하였습니다. ㅎㅎ Custom Plane? -> 링크  1.이전 Step에서 만들어논 Atlas이미지를 Unity Asset/Resources폴더에 위치시킨다.  (* .txt파일포함) 2.Texture Import Setting값 조정 3. .txt파일 이름 수정 Test_data -> 생성된 Atlas material 확인   4. 게임에 사용할 Custom Plane 생성(X,Y축 사용시 Vertical로 생성) 5.생성된 Plane에 TPMesh Texture Ex...

2013년 11월 25일 월요일

Texture Packer in Unity_Step2. Texture Packer를 활용한 Texture Atlas 생성하기.

 1. Texture Packer 실행  2. Atlas를 만들 대상이 되는 Image파일들 Drag & Drop 3. TextureSettings Option 조절 Force Squared - Check [ Atlas Texture 정사각형 이미지로 제작 ] Algorithm - Basic  [ Max Rect는 Full Version Only라고 되어있더군요... 근데 Max Rect mode로 진행해도 이상이 없는? ] Trim mode - 2D texture : Trim                     3D texture : None Allow Rotation -  Check 해제 [ Allow Rotation...

Texture Packer in Unity_Step1. 준비물

 Unity내에서 Texture Packer를 활용하여 이미지 처리를 진행할경우 필요한 것들. 1. Texture Packer - 다운로드 2. Asset Store -> Texture packer Asset 다운로드 ( 저는 Free 버전을 사용하여 진행 ) ...

좋은 글_ 모든 것은 지나간다.

모든 것은 지나간다.  일출의 장엄함이 아침 내내 계속 되진 않으며 비가 영원히 내리지도 않는다. 모든 것은 지나간다. 일몰의 아름다움이 한밤중까지 이어지지도 않는다. 하지만 땅과 하늘과 천둥. 바람과 불 호수와 산과 물 이런 것들은 언제나 존재한다. 만일 그것들마저 사라진다면 인간의 꿈이 계속 될 수 있을까 인간의 환상이 당신이 살아 있는 동안 당신에게 일어나는 일들을 받아들이라. 모든 것은 지나가 버린다. -세실 프란시스 알렉산더 ...

2013년 11월 22일 금요일

[Texture Packer in Unity] Update 예정

Update 예정 texture packer를 활용한 Unity에서 sprite , animation 등으로 활용...

Unity_UCLA Mesh Creator를 이용한 2D mesh collider 만들기

1. UCLA Mesh Create Asset 다운로드.  Asset Store 접속 -> "UCLA" 검색 -> Project에 Import 2. 빈 GameObject 생성 Create->Empty Object 3. Add Component -> Mesh Creator data 4. Mesh Creator Data Property Setting 2D용 Collider 제작시 적합하게 Property Setting[사진참조] -> "Update Mesh" 버튼 클릭 [Propertys] Mesh Outline Texture : Mesh 생성 대상이될 Texture Pixel Threshold : 픽셀 임계값 설정 [ 설정한 임계값 단위로 Mesh 생성 ] Create full mesh for edge : Texture의...

Unity_PlayerPref 에 Class , Sturct형 Data 저장하기

 이번에 게임 제작진행중 Setting값을 PlayerPref를 활용해 저장할 방법을 궁리하던중 찾아낸방법. // String<->Binary format 변환시 필요한 아이 using System.Runtime.Serialization.Formatters.Binary;  //class property private SettingInfo _setValue = new SettingInfo(); //PlayerPref에 저장할 Struct SettingInfo [Serializable] public struct SettingInfo{     public bool Vibration;     public bool Sound;     public int Volume;     public bool BGM; } //...

2013년 11월 21일 목요일

Unity_ Generic Singletone 사용법

*.아래글에 코드가 잘안보여서 다시올립니다 ^^; Generic Singleton 사용법에 대해서는 수많은.. 정말 무수히 많은 방법론이 존재하지만 제가생각하기에 Unity상에서 사용하기 괜찮은(좋은방법있으면 알려주시길 ㅠㅠ) 코드이다. Singleton.cs using UnityEngine; using System.Collections; public class Singleton<T> : MonoBehaviour where T : MonoBehaviour { protected static T sInstance; public static T GetInstance { get { if (sInstance == null) { sInstance = (T)FindObjectOfType(typeof(T)); } if (sInstance == null) { ...