便利なGetComponentに潜むワナについてのお話です。 「GetComponentをぶん回す」とは GetComponentをUpdate関数内で毎フレーム呼び出す、または繰り返し処理の中で使用するなど、GetComponentを大量に呼び出すことを指しています。ただし、GetComponentをぶん回すなんて ...
一回別のマテリアルの配列を作ってその配列を変更してさらにそれを戻す必要がある。 なんでこんなややこしい仕様なのかさっぱりわからんけどこうしないと変更できない ...
It is automatically injected according to the type of variable, array, and list. If an inherited class also has this attribute, it is injected. The injection method is automatically injected after the ...
public class TestAutoGetComponent : MonoBehaviour { // this will be set in Awake for you [GetComponent] public Rigidbody rb; } ...