private PowerupBumpAudio bumpAudio; // connection - auto: the sibling Powerup Bump Audio // updating // // before the start: // private void Awake() { // connect to the parent Powerup // powerup = transform.parent.GetComponent <Powerup>(); // connect to the sibling Powerup Bump Audio // bumpAudio = powerup.GetComponentInChildren <PowerupBumpAudio>(); }
// updating // // before the start: // protected virtual void Awake() { // connect to the child Powerup Bump Audio and track the original name of the Powerup Bump Audio's object // bumpAudio = firstLodal <PowerupBumpAudio>(); originalBumpAudioName = bumpAudio.name; // connect to the child Powerup Pickup Audio and track the original name of the Powerup Pickup Audio's object // pickupAudio = firstLodal <PowerupPickupAudio>(); originalPickupAudioName = pickupAudio.name; }