/**
* 起動関数.
*/
void Awake()
{
// すべての親オブジェクトに対して MonobitView コンポーネントを検索する
if (GetComponentInParent<MonobitView>() != null)
{
m_MonobitView = GetComponentInParent<MonobitView>();
}
// 親オブジェクトに存在しない場合、すべての子オブジェクトに対して MonobitView コンポーネントを検索する
else if (GetComponentInChildren<MonobitView>() != null)
{
m_MonobitView = GetComponentInChildren<MonobitView>();
}
// 親子オブジェクトに存在しない場合、自身のオブジェクトに対して MonobitView コンポーネントを検索して設定する
else
{
m_MonobitView = GetComponent<MonobitView>();
}
}
元々自分自身のオブジェクトが保有する MonobitView コンポーネントのみ検索していたものを
今回のサンプルデモが不幸にもこのケースに当てはまるため、・親オブジェクト自身がアニメーション情報を持っていない場合 ・親オブジェクト自身が移動や回転などの姿勢変更をしない場合