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

카테고리

분류 전체보기 (2794)
Unity3D (852)
Programming (478)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (234)
협업 (11)
3DS Max (3)
Game (12)
Utility (68)
Etc (98)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (55)
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

Well, just take the example from the GUI slider reference and from Animation.Sample and you're done.

  1. private var hSliderValue : float = 0.0;
  2. private var myAnimation : AnimationState;
  3.  
  4. function Start(){
  5. myAnimation = animation["MyClip"];
  6. }
  7.  
  8. function LateUpdate() {
  9. myAnimation.time = hSliderValue;
  10. myAnimation.enabled = true;
  11.  
  12. animation.Sample();
  13. myAnimation.enabled = false;
  14. }
  15.  
  16. function OnGUI() {
  17. hSliderValue = GUILayout.HorizontalSlider (hSliderValue, 0.0, myAnimation.length,GUILayout.Width(100.0f));
  18. }



출처 : http://answers.unity3d.com/questions/59406/using-gui-slider-to-control-animation-on-object.html

반응형

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

마우스 휠 스크롤 확인  (0) 2013.01.31
오브젝트 카메라 프러스텀 안에 가두기  (0) 2013.01.29
InGame Button  (0) 2012.12.14
InvokeRepeating  (0) 2012.12.07
DisplayWizard(에디터로 쓸모가 많을 듯 한..)  (0) 2012.12.04
Posted by blueasa
, |