Readme.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Exploding Fruits
  2. To use the fruits in your game, place them in the scene or instantiate the prefab at runtime, access the ExplodingFruits component and use its methods like this:
  3. ExplodingFruit explodingFruit = fruitObject.GetComponent<ExplodingFruit>();
  4. // By default, the fruit object and all of its parts will disappear 4 seconds
  5. // after the explosion. You can vary this time or set it to 0 if you want the
  6. // parts to stay around indefinitely:
  7. explodingFruit.destroyAfterSeconds = 5;
  8. // Make the fruit explode with a default force from its center:
  9. explodingFruit.Explode();
  10. // Make the fruit explode from an impact with direction hitDirection and force hitForce:
  11. // (This will push the pieces in the direction of the impact)
  12. Vector3 hitVector = hitForce * hitDirection;
  13. Explode( hitVector );
  14. // Reset the exploded fruit object, so you can explode it again:
  15. explodingFruit.Reset();
  16. For any support inquiries, please contact us: info@chromegekko.com
  17. Credits:
  18. Pumpkin Texture: Patrick Hoesly flickr.com
  19. Watermelon/Pumpkin squash sounds: MWLANDI from freesound.org