블로그 이미지
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-20 00:00

GameObject.active = true;

  • StartCoroutine : OK
  • Coroutine Method : OK
  • StopAllCoroutine : OK
  • Invoke : OK
  • InvokeRepeating : OK
  • CancelInvoke : OK


GameObject.active = false;

  • StartCoroutine : Error
  • Coroutine Method : Stop (active 상태에서 돌고 있는 상태였다면 정지된다.)
  • StopAllCoroutine : OK
  • Invoke : OK
  • InvokeRepeating : OK
  • CancelInvoke : OK

** 결론

  • StartCoroutine 으로 코루틴 메소드를 열심히 돌리다가 해당 GameObject 의 active 가 꺼지면 돌던 코루틴 메소드는 정지되고 다시 active 가 켜지더라도 재실행되지 않는다.....
  • 코루틴을 많이 사용하는 로직(Async 로 돌리는 함수들..(WWW, ... 같은...))에서는 꼭 염두해 두어야 한다..
  • OnDisable() {} 에서 관련 처리를 해 주는게 좋다.
  • Invoke 관련은 GameObject 의 active 유무랑 관계없이 돌아간다..


출처 : http://limchaeng.tistory.com/34

반응형

'Unity3D > Script' 카테고리의 다른 글

[펌] Root Motion in Legacy Animation  (0) 2016.03.28
BigNumber  (0) 2016.02.04
임의시간 받아서 시간 표현하기  (0) 2015.10.28
Control ParticleSystem RenderQueue  (0) 2015.09.24
[공유] UnityBoot 프로젝트  (0) 2015.08.30
Posted by blueasa
, |