スクリプト内で動的にPhysicsMaterialを設定する/Resources.Load

基本的にはPrefab側で設定しておき、インスタンスを生成するのがベターだろうが時にはスクリプト内で動的に物理挙動を設定したい場合もある。かもしれない。
一応以下の方法で可能なことは確認した。PhysicsMaterialの設定というか、Resources.Loadの使い方かな。

thisObject.rigidbody.collider.material = (PhysicMaterial)Resources.Load("Physics/BulletSatellite");

ただし対象となるファイルはResourcesフォルダの下に配置しておかないとダメらしい。
AddComponentみたいに一発で決められるといいんだけどなぁ。
f:id:DYMN:20140604212612p:plain

http://realisapp.com/unity3d/resources-load/
http://answers.unity3d.com/questions/14242/how-to-change-physics-material-of-a-colider-in-run.html