void Awake() { if (followWind == null) { followWind = GetComponent <FollowWind>(); } }
public override void Blow(Vector2 velocity) { if (canBlow(velocity)) { if (blowSound != null) { blowSound.Play(); blowSound.volume = velocity.magnitude / 15f; } base.Blow(velocity); // make the flower react to the blow FollowWind stemFollowWind = stems[0].GetComponent <FollowWind>(); if (stemFollowWind != null) { stemFollowWind.AddImpuse(velocity, petalRoot.position); } } }
void Awake() { if ( followWind == null ) followWind = GetComponent<FollowWind>(); }