Skip to content

How to create a sand clock in Unity. Based on Hamza Herbou 's tutorial.

Notifications You must be signed in to change notification settings

Normandy72/Unity-SandClock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructions

  1. Create a Canvas, change its color.
  2. Create an empty GameObject (rename to SandClock).
  3. In SandClock add an Image (rename to Holder). Encrease SandClock's size.
  4. Check SandClock sprite, change Sprite Mode to "multiple", slice this sprite.
  5. Set "SandClock_0" sprite as Holder's source image. Change Holder's size and color.
  6. Duplicate the Holder (rename to Glass), place it before Holder.
  7. Set "SandClock_1" sprite as Glass's source image. Change its color and size.
  8. Inside the SandClock create a new empty GameObject (rename it to Fill).
  9. In Fill create an Image (rename to TopFillImage).
  10. Set "SandClock_2" sprite as TopFillImage's source image, rotate it (180 degrees), change its size and color.
  11. Duplicate the TopFillImage (rename to BottomFillImage), rotate it (0 degrees).
  12. In the SandClock add Text field (place it to the upper part of the Glass).
  13. In TopFillImage and BottomFillImage set Image Type to "Filled", set Fill Method to "Vertical".
  14. In TopFillImage set Fill Origin to "Top".
  15. Create a new C# script, add logic.
  16. Add script to SandClock.
  17. Create a new Material (SandDots). Set Shader (Mobile -> Particles -> Alpha Blended). Set Texture (Sand).
  18. In Sand sprite set Wrape Mode to "Repeat", Pixel per unit = 450.
  19. In Fill duplicate the BottomFillImage (rename to SandDots). Set its Image Type to "Tiled". Set Source Image (Sand). Set Material (SandDots). Change its size. Place it before TopFillImage.
  20. Duplicate BottomFillImage (rename to BottomMask), replace it before SandDots. Add a Mask component. Set a color same as a glass color. Set Image Type to "Simple".
  21. Inside the BottomMask create an Image (SandPyramidImage). Set Source Image (SandPyramid). Change its color an size.

About

How to create a sand clock in Unity. Based on Hamza Herbou 's tutorial.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published