private void Awake() { //Cache inScreenObject = GetComponent <HorizontalInScreenObject>(); //Set callback to return object to pool when it goes out of screen inScreenObject.SetOutOfScreenCallback(returnPipeToPool); }
private void Awake() { //Cache motor = GetComponent <CloudMotor>(); inScreenObject = GetComponent <HorizontalInScreenObject>(); spRenderer = GetComponent <SpriteRenderer>(); //Set reset callback for when object goes out of screen inScreenObject.SetOutOfScreenCallback(resetPosition); }