パラメータコンテナにGameObjectをセットするには

Here is the forum to do the questions about how to use to Arbor developer.
Attention point:
  • We can not answer your questions about your project specific issues.
  • We can not answer your questions on Unity's specification issues.
  • Please check Arbor Documentation and ask a question if you still don't know how to use it. If the desired function is not described in the document, it is highly possible that the function does not exist from the beginning, so go to the request forum.

ここは、Arbor開発者へ使い方に関する質問を行うフォーラムです。
注意点:
  • ユーザー様のプロジェクトの仕様上の問題や設計に対する質問には答えられません。
  • Unityの仕様上の問題に対する質問には答えられません。
  • Arbor Documentationを確認の上、それでも使い方がわからない場合にご質問ください。欲しい機能の記載がドキュメントにない場合は機能が元から存在しない可能性が高いので要望フォーラムへ。

Forum rules
Here is the forum to do the questions about how to use to Arbor developer.
Attention point:
  • We can not answer your questions about your project specific issues.
  • We can not answer your questions on Unity's specification issues.
  • Please check Arbor Documentation and ask a question if you still don't know how to use it. If the desired function is not described in the document, it is highly possible that the function does not exist from the beginning, so go to the request forum.

ここは、Arbor開発者へ使い方に関する質問を行うフォーラムです。
注意点:
  • ユーザー様のプロジェクトの仕様上の問題や設計に対する質問には答えられません。
  • Unityの仕様上の問題に対する質問には答えられません。
  • Arbor Documentationを確認の上、それでも使い方がわからない場合にご質問ください。欲しい機能の記載がドキュメントにない場合は機能が元から存在しない可能性が高いので要望フォーラムへ。
Guest

パラメータコンテナにGameObjectをセットするには

Post by Guest »

お世話になります。
Arbor2試用版を使わせて頂いております

ユーザー操作によってターゲットをロックオンするアクションゲームの実装で、
「ロックオンしたターゲットに対して○○する」という挙動を追加したいです

パラメータコンテナに、GameObject型の「Target」を追加
挙動側に、FlexibleGameObject m_Target; を追加し、上記パラメータコンテナの「Target」を参照

ここまでは良いのですが、パラメータコンテナの「Target」をどう切り替えるべきか分かりません

イメージとしては全ターゲットを配列で持っているマネージャークラスがあり、
ユーザー入力があるとパラメータコンテナの「Target」を別のターゲットに切り替えたいのですが、
ParameterContainerクラスには、SetBool、SetFloat、SetInt、SetStringしかなく、GameObjectをセットできません

この場合、どのように実装すべきでしょうか
User avatar
caitsithware
管理人
Posts: 493
Joined: 2015/08/17 12:41

Re: パラメータコンテナにGameObjectをセットするには

Post by caitsithware »

ParameterContainerのGetParam()よりParameterを取得して、
ParameterのgameObjectValueを変更後OnChanged()を呼び出してください。

ParameterContainerInternal.GetParam
Parameter.gameObjectValue

コードは以下のような感じです。

Code: Select all

Parameter targetParam = parameterContainer.GetParam("Target");
targetParam.gameObjectValue = newTarget;
targetParam.OnChanged();
頻繁にアクセスするようでしたらStart()などでGetParamを呼び出して保持しておくと若干負荷が抑えられるようになっています。

また、SetBoolのように一通り対応したほうがよさそうなので、次回更新時には他の型も対応いたします。
それまで少々お待ちいただければと思います。
Guest

Re: パラメータコンテナにGameObjectをセットするには

Post by Guest »

上記了解致しました。
ご回答ありがとうございます


Last bumped by Anonymous on 2018/02/23 05:35.
Post Reply