블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2737)
Unity3D (817)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-26 17:51

'InvokeRepeating'에 해당되는 글 2건

  1. 2013.07.03 Invoke, InvokeRepeating, CancelInvoke
  2. 2012.12.07 InvokeRepeating

유니티엔진에서 일반적인 Timer()함수 대신에 MonoBehaviour 가 제공하는Invoke() 함수가 있습니다. 
Invoke(methodName:string, time:float) 
- methodName 메소드를 time 초 후 호출합니다. 

InvokeRepeating(methodName:string, time:float, repeatRate:float) 
- methodName 메소드를 time 초 후 호출합니다. 첫 호출 후 repeatRate 초 마다 반복 호출합니다. 
 InvokeRepeating 는 repeatRate 값이 0 보다 클때만 반복 호출됩니다. repeatRate 값이 0 일때는 최초 한번 호출 후 반복호출되지 않습니다.   ( 출처 : http://devkorea.co.kr/bbs/board.php?bo_table=m03_qna&wr_id=50255#c_50287 )


CancelInvoke() 
- 이 스크립트에 있는 모든 Invoke 를 취소합니다. 

CancelInvoke(methodName:string) 
- 이 스크립트에 있는 methodName 을 호출하는 모든 Invoke 를 취소합니다. 



출처 : http://devkorea.co.kr/bbs/board.php?bo_table=m03_qna&wr_id=31893&sca=&sfl=wr_subject%7C%7Cwr_content&stx=InvokeRepeating&sop=and&currentId=44



[참조]

http://blog.naver.com/bluefallsky/140190280479

http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.Invoke.html

http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.InvokeRepeating.html

http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.CancelInvoke.html

http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.IsInvoking.html

반응형
Posted by blueasa
, |

InvokeRepeating

Unity3D/Script / 2012. 12. 7. 16:09
반복 실행하기에 유용한 함수 같아서 체크..

InvokeRepeating (함수명, 시작 시간, 함수호출 후 반복 간격); 


MonoBehaviour.InvokeRepeating

function InvokeRepeating (methodName : String, time : float, repeatRate : float) : void

Description

Invokes the method methodName in time seconds.

After the first invocation repeats calling that function every repeatRate seconds.

JavaScript
// Starting in 2 seconds.
// a projectile will be launched every 0.3 seconds

var projectile : Rigidbody;

InvokeRepeating("LaunchProjectile", 2, 0.3);

function LaunchProjectile () {
var instance : Rigidbody = Instantiate(projectile);
instance.velocity = Random.insideUnitSphere * 5;
}

관련 함수 : http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.CancelInvoke.html

참조 : http://devkorea.co.kr/bbs/board.php?bo_table=m03_qna&wr_id=23031&sca=UNITY&currentId=44



출처 : http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.InvokeRepeating.html

반응형
Posted by blueasa
, |