Page 1 of 1

ParameterContainerのComponent型で型を切り替える方法が知りたい

Posted: 2017/12/22 02:08
by kag
Component型にして、ImageコンポーネントのGameObjectを入れると、RectTransform型になってしまいます。
Image型に切り替える方法はありますか?
FlexibleComponentの方でSlotTypeを決めて受け取っても、中に入っているのがRectTransformコンポーネントなので、
結局gameObject.GetComponent<Image>()しないと受け取れなくて不便だなと。

Re: ParameterContainerのComponent型で型を切り替える方法が知りたい

Posted: 2017/12/22 02:42
by caitsithware
ParameterContainerでの設定ではどの型かを指定できないため、Inspectorからコンポーネントをドラッグ&ドロップして格納する必要があります。

作業の流れは以下の通りです。
  • Inspectorを2つ表示する。
    Inspectorを追加するには、右上のポップアップボタンをクリックし、「AddTab / Inspector」
    [Suport]Arbor2.2.2_ParameterContainer_SetComponent01.gif
    [Suport]Arbor2.2.2_ParameterContainer_SetComponent01.gif (103.36 KiB) Viewed 4169 times
  • ParameterContainerのGameObjectをHierarchyで選択し、片方のInspectorをLock。
    InspectorをLockは、右上の錠前アイコンをクリック。
    [Suport]Arbor2.2.2_ParameterContainer_SetComponent02.gif
    [Suport]Arbor2.2.2_ParameterContainer_SetComponent02.gif (50.3 KiB) Viewed 4169 times
  • Image付きGameObjectをHierarchyで選択し、Imageコンポーネントのタイトルバーをドラッグし、Componentパラメータにドロップ。
    [Suport]Arbor2.2.2_ParameterContainer_SetComponent03.gif
    [Suport]Arbor2.2.2_ParameterContainer_SetComponent03.gif (161.17 KiB) Viewed 4169 times
  • 最後に、設定し終わったらLockした方のInspectorは閉じてしまって問題ありません。
手順がややこしいので、今後の更新で改善できないか検討いたします。

Re: ParameterContainerのComponent型で型を切り替える方法が知りたい

Posted: 2017/12/22 12:27
by kag
できました!
ありがとうございました。