一、基础介绍;二、基础属性

原文地址 :http://blog.csdn.net/dingkun520wy/article/details/50836780

一、基础介绍

ShakePosition: 根据提供的amount衰减其值随机摇动游戏物体的位置,其晃动大小和方向由提供的amount决定

ShakeRotation:

根据提供的amount衰减其值随机摆动旋转游戏物体的角度,其转动角度就是X,Y,Z的值的大小.

ShakeScale:根据提供的amount衰减其值随机摆动改变游戏物体的大小,其大小比例变化方向和大小由提供的Vector3决定.

 

二、基础属性

基础属性比较简单直接上代码

1,ShakePosition

  1. void Start () {
  2. //键值对儿的形式保存iTween所用到的参数
  3. Hashtable args = new Hashtable();
  4. //摇摆的幅度
  5. //args.Add("amount", new Vector3(5, 5, 5));
  6. //args.Add("x", 20);
  7. args.Add("y",100);
  8. //args.Add("z", 2);
  9. //是世界坐标系还是局部坐标系
  10. args.Add("islocal", true);
  11. //游戏对象是否将面向其方向
  12. args.Add("orienttopath", true);
  13. //面朝的对象
  14. //args.Add("looktarget", new Vector3(1, 1, 1));
  15. //args.Add("looktime", 5.0f);
  16. //动画的整体时间。如果与speed共存那么优先speed
  17. args.Add("time", 1f);
  18. //延迟执行时间
  19. //args.Add("delay", 0.1f);
  20. //三个循环类型 none loop pingPong (一般 循环 来回)
  21. //args.Add("loopType", "none");
  22. //args.Add("loopType", "loop");
  23. args.Add("loopType", iTween.LoopType.pingPong);
  24. //处理动画过程中的事件。
  25. //开始动画时调用AnimationStart方法,5.0表示它的参数
  26. args.Add("onstart", "AnimationStart");
  27. args.Add("onstartparams", 5.0f);
  28. //设置接受方法的对象,默认是自身接受,这里也可以改成别的对象接受,
  29. //那么就得在接收对象的脚本中实现AnimationStart方法。
  30. args.Add("onstarttarget", gameObject);
  31. //动画结束时调用,参数和上面类似
  32. args.Add("oncomplete", "AnimationEnd");
  33. args.Add("oncompleteparams", "end");
  34. args.Add("oncompletetarget", gameObject);
  35. //动画中调用,参数和上面类似
  36. args.Add("onupdate", "AnimationUpdate");
  37. args.Add("onupdatetarget", gameObject);
  38. args.Add("onupdateparams", true);
  39. iTween.ShakePosition(btnBegin, args);
  40. }
  41. //动画开始时调用
  42. void AnimationStart(float f)
  43. {
  44. Debug.Log("start :" + f);
  45. }
  46. //动画结束时调用
  47. void AnimationEnd(string f)
  48. {
  49. Debug.Log("end : " + f);
  50. }
  51. //动画中调用
  52. void AnimationUpdate(bool f)
  53. {
  54. Debug.Log("update :" + f);
  55. }

2,ShakeRotation

  1. void Start () {
  2. //键值对儿的形式保存iTween所用到的参数
  3. Hashtable args = new Hashtable();
  4. //摇摆的幅度
  5. args.Add("amount", new Vector3(20, 100,0));
  6. //args.Add("x", 20);
  7. //args.Add("y",100);
  8. //args.Add("z", 2);
  9. //是世界坐标系还是局部坐标系
  10. args.Add("space", Space.Self);
  11. //动画的整体时间。如果与speed共存那么优先speed
  12. args.Add("time", 1f);
  13. //延迟执行时间
  14. //args.Add("delay", 0.1f);
  15. //三个循环类型 none loop pingPong (一般 循环 来回)
  16. //args.Add("loopType", "none");
  17. //args.Add("loopType", "loop");
  18. args.Add("loopType", iTween.LoopType.pingPong);
  19. //处理动画过程中的事件。
  20. //开始动画时调用AnimationStart方法,5.0表示它的参数
  21. args.Add("onstart", "AnimationStart");
  22. args.Add("onstartparams", 5.0f);
  23. //设置接受方法的对象,默认是自身接受,这里也可以改成别的对象接受,
  24. //那么就得在接收对象的脚本中实现AnimationStart方法。
  25. args.Add("onstarttarget", gameObject);
  26. //动画结束时调用,参数和上面类似
  27. args.Add("oncomplete", "AnimationEnd");
  28. args.Add("oncompleteparams", "end");
  29. args.Add("oncompletetarget", gameObject);
  30. //动画中调用,参数和上面类似
  31. args.Add("onupdate", "AnimationUpdate");
  32. args.Add("onupdatetarget", gameObject);
  33. args.Add("onupdateparams", true);
  34. iTween.ShakeRotation(btnBegin, args);
  35. }
  36. //动画开始时调用
  37. void AnimationStart(float f)
  38. {
  39. Debug.Log("start :" + f);
  40. }
  41. //动画结束时调用
  42. void AnimationEnd(string f)
  43. {
  44. Debug.Log("end : " + f);
  45. }
  46. //动画中调用
  47. void AnimationUpdate(bool f)
  48. {
  49. Debug.Log("update :" + f);
  50. }

3,ShakeScale

  1. void Start () {
  2. //键值对儿的形式保存iTween所用到的参数
  3. Hashtable args = new Hashtable();
  4. //摇摆的幅度
  5. args.Add("amount", new Vector3(2,0,0));
  6. //args.Add("x", 20);
  7. //args.Add("y",100);
  8. //args.Add("z", 2);
  9. //动画的整体时间。如果与speed共存那么优先speed
  10. args.Add("time", 1f);
  11. //延迟执行时间
  12. //args.Add("delay", 0.1f);
  13. //三个循环类型 none loop pingPong (一般 循环 来回)
  14. //args.Add("loopType", "none");
  15. //args.Add("loopType", "loop");
  16. args.Add("loopType", iTween.LoopType.pingPong);
  17. //处理动画过程中的事件。
  18. //开始动画时调用AnimationStart方法,5.0表示它的参数
  19. args.Add("onstart", "AnimationStart");
  20. args.Add("onstartparams", 5.0f);
  21. //设置接受方法的对象,默认是自身接受,这里也可以改成别的对象接受,
  22. //那么就得在接收对象的脚本中实现AnimationStart方法。
  23. args.Add("onstarttarget", gameObject);
  24. //动画结束时调用,参数和上面类似
  25. args.Add("oncomplete", "AnimationEnd");
  26. args.Add("oncompleteparams", "end");
  27. args.Add("oncompletetarget", gameObject);
  28. //动画中调用,参数和上面类似
  29. args.Add("onupdate", "AnimationUpdate");
  30. args.Add("onupdatetarget", gameObject);
  31. args.Add("onupdateparams", true);
  32. iTween.ShakeScale(btnBegin, args);
  33. }
  34. //动画开始时调用
  35. void AnimationStart(float f)
  36. {
  37. Debug.Log("start :" + f);
  38. }
  39. //动画结束时调用
  40. void AnimationEnd(string f)
  41. {
  42. Debug.Log("end : " + f);
  43. }
  44. //动画中调用
  45. void AnimationUpdate(bool f)
  46. {
  47. Debug.Log("update :" + f);
  48. }

更多unity3d动画基础 http://blog.csdn.net/dingkun520wy/article/details/50550529

iTween基础之Shake(摆动)的更多相关文章

  1. iTween基础之功能简介

    一.iTween 介绍 .二.iTween 原理.三.iTween 下载.四.iTween 类介绍.五.主要功能介绍 原文地址:http://blog.csdn.net/dingkun520wy/ar ...

  2. iTween基础之Color(变换颜色)

    一.基础介绍:二.基础属性 原文地址: http://blog.csdn.net/dingkun520wy/article/details/51065275 一.基础介绍 ColorTo:从当前颜色变 ...

  3. iTween基础之Fade(淡入淡出)

    一.基础介绍:二.基础属性 原文地址: http://blog.csdn.net/dingkun520wy/article/details/50923665 一.基础介绍 FadeTo:从当前透明度变 ...

  4. iTween基础之CameraFade(摄像机淡入淡出)

    一.基础介绍:二.基础属性 原文地址: http://blog.csdn.net/dingkun520wy/article/details/50896420 一.基础介绍 CameraTexture: ...

  5. iTween基础之Punch(摇晃)

    一.基础介绍:二.基础属性 原文地址 : http://blog.csdn.net/dingkun520wy/article/details/50828042 一.基础介绍 PunchPosition ...

  6. iTween基础之Audio(音量和音调的变化)

    一.基础介绍:二.基础属性 原文地址 : http://blog.csdn.net/dingkun520wy/article/details/50826033 一.基础介绍 AudioTo:改变声音的 ...

  7. iTween基础之Rotate(旋转角度)

    一.基础介绍:二.基础属性 原文地址 :http://blog.csdn.net/dingkun520wy/article/details/50696489 一.基础介绍 RotateTo:旋转游戏物 ...

  8. iTween基础之Scale(缩放大小)

    一.基础介绍:二.基础属性 原文地址:http://blog.csdn.net/dingkun520wy/article/details/50684392 一.基础介绍 ScaleTo:改变游戏对象的 ...

  9. iTween基础之Look(使对象面朝指定位置)

    一.基础介绍:二.基础属性 原文地址:http://blog.csdn.net/dingkun520wy/article/details/50578142 一.基础介绍 LookTo:旋转游戏对象使其 ...

随机推荐

  1. 委托delegate使用方法

    允许传递一个类A的方法m给另一个类B的对象,使得类B的对象能够调用这个方法m,说白了就是可以把方法当作参数传递. class Program { //delegate的使用方法一 public del ...

  2. 【MVC】ASP.NET MVC HtmlHelper用法大全

    1.ActionLink <%=Html.ActionLink("这是一个连接", "Index", "Home")%>   带 ...

  3. EnCase v7 search hits in compound files?

    I used to conduct raw search in EnCase v6, and I'd like to see if EnCase v7 raw search could hit key ...

  4. SQL Server 遇到 Automation服务器不能创建对象

    Windows 2003  安装SQL Server出现Automation问题  如下:  ######安装SQL Server 遇到 Automation服务器不能创建对象问题 解决办法: 1.1 ...

  5. MongoDB(3):小的细节问题

    1.文档 {“greeting”:“hello,world”,“foo”: 3} 文档中的键/值对是有序的,下面的文档与上面的文档是完全不同的两个文档. {“foo”: 3 ,“greeting”:“ ...

  6. php获取图片宽高等属性

    <?php function getImageInfo($image) {     $imageInfo = getimagesize($image);     if ($imageInfo ! ...

  7. 【PHP】文件上传限制

    上传文件,只判断后缀,貌似还不是很严谨; /** * 判断文件是否合法 * @param $files * @param $arrCode * @return number|boolean */ fu ...

  8. Mongodb的索引--学习笔记(未完)

    全文索引 建立方法: --在articles集合的key字段上创建全文索引 db.articles.ensureIndex({key:"text"}) --在articles集合的 ...

  9. iPhone图标及启动画面大小 xcode5

    启动画面 文件名   大小px Default.png 320*480 Default@2x.png 640*960 Default-568h@2x.png 640*1136 图标 文件名  大小px ...

  10. cygwin

    setup-x86_64 -q -P wget,tar,qawk,bzip2,subversion,vim wget rawgit.com/transcode-open/apt-cyg/master/ ...