示例#1
0
 void Awake()
 {
     if (followWind == null)
     {
         followWind = GetComponent <FollowWind>();
     }
 }
示例#2
0
    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>();
	}