회원 로그인
|
![](http://dvframes.com/rb/_var/simbol/artsone.jpg)
NGUI & PlayMaker - Counter Button
NGUI & PlayMaker - Counter Button
![](http://dvframes.com/rb/files/2014/01/26/839afdc8a6028784792b7e5aacb018d5025759.png)
![](http://dvframes.com/rb/files/2014/01/26/ebee42806a072e6661dadf36c8fc3f48030603.png)
2. Button에 UIEventsToPlaymakerFSM.cs 스크립트 적용한다.
![](http://dvframes.com/rb/files/2014/01/26/bca8f87f87a7bf561e1be6a1859550db030617.png)
![](http://dvframes.com/rb/files/2014/01/26/d34395e747e342295112506f19880336031007.png)
![](http://dvframes.com/rb/files/2014/01/26/acfd51d9ea8c20a33a508f146a5f8b72031232.png)
![](http://dvframes.com/rb/files/2014/01/26/dd788a0037662d377782b4a61c27dd68034321.png)
![](http://dvframes.com/rb/files/2014/01/26/e39cb6790f635cf6e86da432b6c15dda032510.png)
![](http://dvframes.com/rb/files/2014/01/26/5f7e23c62509c76542769b61270f3f84032955.png)
![](http://dvframes.com/rb/files/2014/01/26/ea10aadcb45f1b4e682f6ff683ffc45f033212.png)
NGUI로 만든 Button과 Label과 PlayMaker를 이용한 카운트 되는 버튼 만들기
![](http://dvframes.com/rb/files/2014/01/26/839afdc8a6028784792b7e5aacb018d5025759.png)
![](http://dvframes.com/rb/files/2014/01/26/ebee42806a072e6661dadf36c8fc3f48030603.png)
![](http://dvframes.com/rb/files/2014/01/26/bca8f87f87a7bf561e1be6a1859550db030617.png)
3. 'listen click' 상태 생성(1), OnClick 이벤트 생성(2) 후 'listen click'상태에 이벤트 추가(3)한다.
![](http://dvframes.com/rb/files/2014/01/26/d34395e747e342295112506f19880336031007.png)
4. 'create random string' 상태 생성(1), FINISHED 이벤트를 추가(2)한다.
![](http://dvframes.com/rb/files/2014/01/26/acfd51d9ea8c20a33a508f146a5f8b72031232.png)
5. Variables탭(1)에 카운트 할 정수형 변수 'displayInt'와 출력을 위한 문자열형으로 바꿀 변수 'displayString' 명 변수 생성(2)한다.
![](http://dvframes.com/rb/files/2014/01/26/dd788a0037662d377782b4a61c27dd68034321.png)
6. Math > Int Add(1), Convert > Convert Int To String(2), Time > Wait(3) 액션 추가한다.
Int Add의 Int Variable에 displayInt 변수 선택, Add에 1 입력(4)
Convert Int To String의 Int Variable에 displayInt 변수 선택, String Variable에 displayString 변수 선택(5)
Wait의 Time에 0.1, Finish Event에 FINISHED 선택(6)
![](http://dvframes.com/rb/files/2014/01/26/e39cb6790f635cf6e86da432b6c15dda032510.png)
7. 'show the string' 상태 생성, FINISHED 이벤트를 추가한다.
![](http://dvframes.com/rb/files/2014/01/26/5f7e23c62509c76542769b61270f3f84032955.png)
8. UnityObject > Set Property 액선 추가(1)한다.
(2)Target Object에 Label의 UILabel(Script)를 드래그해서 넣는다.
Property에 text 선택
String에 displayString 변수 선택
![](http://dvframes.com/rb/files/2014/01/26/ea10aadcb45f1b4e682f6ff683ffc45f033212.png)
9. 연결
![]() 1. 버튼의 이벤트로 마우스 버튼을 클릭하면(OnClick) displayInt 변수에 Int Add 액션을 이용하여 1씩 더해준다. (displayInt = displayInt + 1) 2. Convert Int To String 액션으로 정수형 변수 displayInt를 문자열 변수 displayString로 형 변환한다.((string) displayInt) 3. Wait 액션으로 0.1초 기다림 4. 최종으로 담은 displayString 변수를 Set Property 액션을 통해 Label text에 입력하여 출력해준다. |
![](/rb/modules/bbs/theme/_pc/list01/image/ico_comment.gif)
146개(1/8페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
![]() |
유니티 강좌 모음(영문) | 푸딩뱃살 | 61749 | 2013.08.28 12:02 |
![]() |
유니티 경고, 에러 모음 (재정리 예정)
![]() |
푸딩뱃살 | 73187 | 2013.08.12 00:09 |
144 |
[콘솔] 오류 : ~ multicast group
![]() |
푸딩뱃살 | 1130 | 2019.09.04 00:23 |
143 |
[콘솔] 오류 : NullReferenceException
![]() |
푸딩뱃살 | 1142 | 2019.07.23 00:26 |
142 | [유니티] Unite Seoul 2019 다시보기 | 푸딩뱃살 | 1285 | 2019.06.28 10:00 |
141 | [정보] GDC 2019 유니티 키노트 하이라이트 | 푸딩뱃살 | 1390 | 2019.03.26 10:45 |
140 |
[유니티] Unite Seoul 2018 아젠다 & 세션 다시보기
![]() ![]() |
푸딩뱃살 | 2775 | 2018.05.25 10:32 |
139 |
[VR/AR] Stereo 360 Image and Video Capture
![]() ![]() |
푸딩뱃살 | 2067 | 2018.02.02 10:53 |
138 | [VR/AR] ARKit - Face Tracking | 푸딩뱃살 | 1811 | 2018.01.17 16:57 |
137 | [참고] ADAM :Making 참고 | 푸딩뱃살 | 2059 | 2017.12.04 11:14 |
136 |
[정보] ARKit Face Tracking on iPhone X
![]() |
푸딩뱃살 | 3170 | 2017.11.08 09:59 |
135 | [VR/AR] Vive Full Body Tracking Demo | 푸딩뱃살 | 2172 | 2017.10.31 18:54 |
134 |
[애셋] 유니티 모델링 - UModeler
![]() ![]() |
푸딩뱃살 | 2214 | 2017.10.20 14:02 |
133 |
[유니티] 맥에서 안드로이드/자바 SDK 경로
![]() ![]() |
푸딩뱃살 | 3358 | 2017.10.04 23:58 |
132 |
[콘솔] 오류 : Fatal Error! The project is on case sensitive file
![]() ![]() |
푸딩뱃살 | 2817 | 2017.10.01 19:59 |
131 | [참고] Adam (Made with Unity) | 푸딩뱃살 | 2537 | 2017.10.01 18:33 |
130 | [정보] 보안 패치 | 푸딩뱃살 | 1946 | 2017.08.21 15:59 |
129 |
[콘솔] 오류: Failed to load '.dll', ......
![]() |
푸딩뱃살 | 2129 | 2017.08.20 00:57 |
128 |
[콘솔] 오류: [VRDevice] Initialization of device oculus failed.
![]() |
푸딩뱃살 | 1970 | 2017.08.19 03:05 |
127 |
[콘솔] 오류: MissingComponentException
![]() |
푸딩뱃살 | 3002 | 2017.08.19 02:05 |
126 |
[콘솔] 오류: Android Manifests
![]() |
푸딩뱃살 | 2772 | 2017.08.18 03:01 |
125 | [VR/AR] Google VR SDK for Unity | 푸딩뱃살 | 3589 | 2017.08.18 00:10 |