//----------------------------------------------------------------------------- void Start() { // Don't search for a rigid body every frame - that search takes time // you don't actually need to do. rb = GetComponent<Rigidbody2D>(); if (emitterController == null) { emitterController = GetComponentInChildren<ChangeEmissionByVelocity>(); } if (null == fireTrigger) { fireTrigger = GetComponent<FireTrigger>(); } }
//----------------------------------------------------------------------------- void Start() { // Don't search for a rigid body every frame - that search takes time // you don't actually need to do. rb = GetComponent <Rigidbody2D>(); if (emitterController == null) { emitterController = GetComponentInChildren <ChangeEmissionByVelocity>(); } if (null == fireTrigger) { fireTrigger = GetComponent <FireTrigger>(); } }