vci:sample:ongrab:no1

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン 両方とも次のリビジョン
vci:sample:ongrab:no1 [2022/09/05 18:02]
pastatto ↷ 移動操作に合わせてリンクを書き換えました。
vci:sample:ongrab:no1 [2023/10/03 20:14]
pastatto ↷ 移動操作に合わせてリンクを書き換えました。
ライン 1: ライン 1:
 ====== 風車をつかんだら回りはじめ_放すと止まる ====== ====== 風車をつかんだら回りはじめ_放すと止まる ======
-**onGrab(target)**を使用してオブジェクトをつかむとアニメーションを開始し、\\ +**[[https://​developer.virtualcast.jp/​vci-docs/​api/​events/​onGrab.html | onGrab]]**を使用してオブジェクトをつかむとアニメーションを開始し、\\ 
-**onUngrab(target)**を使用して手を離すとアニメーションが停止するVCIを作成します。+**[[https://​developer.virtualcast.jp/​vci-docs/​api/​events/​onUngrab.html | onUngrab]]**を使用して手を離すとアニメーションが停止するVCIを作成します。
  
-サンプルデータ:\\ +=== サンプルデータ ​=== 
-https://seed.online/items/546192bcc54c09c25d329f6d3cf5047fce7a5e8bb844b8fa4811863e7430224f+https://virtualcast.jp/products/f6415cfeabdd56f12b31ceceb4024d2dd7b45d13ddd82f7a7be55a05d09c7e05 
 + 
 +{{ :​vci:​sample:​ongrab:​チュートリアルファン.zip |}}
  
 ===== オブジェクトの構成 ===== ===== オブジェクトの構成 =====
ライン 10: ライン 12:
 オブジェクトの構成は次のようになっています。 オブジェクトの構成は次のようになっています。
  
-{{vci:​sample:​tutorial_fan1.png?​400|}}+{{ vci:sample:animation:​tutorial_fan1.png?​600 }}
  
 ===== アニメーション制作 ===== ===== アニメーション制作 =====
  
 ファンが回転するアニメーションが必要なので作成します。\\ ファンが回転するアニメーションが必要なので作成します。\\
-VCI Objectをアタッチする一番上の階層を選択した状態で「Animation」タブの「Create」からアニメーションクリップを生成します。+VCI SubItemをアタッチしたオブジェクト選択した状態で「Animation」タブの「Create」からアニメーションクリップを生成します。
  
 アニメーションを作る際に重要な設定がいくつかあります。\\ アニメーションを作る際に重要な設定がいくつかあります。\\
 この設定を忘れると**アニメーションが動かない**ので確認しましょう。 この設定を忘れると**アニメーションが動かない**ので確認しましょう。
  
-{{vci:​sample:​tutorial_fan2.png?​400|}}+{{vci:​sample:animation:​tutorial_fan2.png?​400|}}
  
-{{vci:​sample:​tutorial_fan3.png?​400|}}+{{vci:​sample:animation:​tutorial_fan3.png?​400|}}
  
-{{vci:​sample:​tutorial_fan4.png?​400|}}+{{vci:​sample:animation:​tutorial_fan4.png?​400|}}
  
 ===== コンポーネント設定 ===== ===== コンポーネント設定 =====
ライン 30: ライン 32:
 fan,​baseには特に何も追加しません。 fan,​baseには特に何も追加しません。
  
-{{vci:​sample:​tutorial_fan5.png?​400|}}+{{ vci:sample:animation:​tutorial_fan5.png?​600 }}
  
-{{vci:​sample:​tutorial_fan6.png?​400|}}+{{ vci:sample:animation:​tutorial_fan6.png?​600 }}
  
 ===== VCIスクリプト ===== ===== VCIスクリプト =====
 <file lua main.lua>​ <file lua main.lua>​
-function onGrab(target)--つかんだとき +local transform = vci.assets.GetTransform("​fan_root"​) 
-    ​vci.assets._ALL_PlayAnimationFromName("​fan_rotate_anm",​true)--trueにすることでアニメーションをループ+local animation = transform.GetAnimation() 
 + 
 +function onGrab(target)--んだとき 
 +    ​animation._ALL_Play(true)--trueにすることでアニメーションをループ
 end end
  
 function onUngrab(target)--手を離したとき function onUngrab(target)--手を離したとき
-    ​vci.assets._ALL_StopAnimation()--アニメーション停止+    ​animation._ALL_Stop()--アニメーション停止
 end end
 </​file>​ </​file>​
  
  
vci/sample/ongrab/no1.txt · 最終更新: 2023/10/11 17:48 by pastatto

ページ用ツール