【ゲームエンジン】Unityなんでも質問スレpart10at GAMEDEV
【ゲームエンジン】Unityなんでも質問スレpart10 - 暇つぶし2ch899:名前は開発中のものです。
23/07/16 22:19:59.99 7LR0yWqx.net
ParentConstraintコンポーネントのSourcesたちの値をスクリプトから直接書き換えることはできますか?
今は
[SerializeField] private ParentConstraint swordParentConstraint;
private ConstraintSource constraintSource_0;
private ConstraintSource constraintSource_1;
private void Start()
{
constraintSource_0 = swordParentConstraint.GetSource(0);
constraintSource_1 = swordParentConstraint.GetSource(1);
}
public void EquipSword()
{
constraintSource_0.weight = 0;
constraintSource_1.weight = 1;
swordParentConstraint.SetSource(0, constraintSource_0);
swordParentConstraint.SetSource(1, constraintSource_1);
}
みたいに書いたところとりあえず意図した動作はするのですが、なんとなく煩雑な気がします


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch