Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. InvokeRepeating("MoreTransparency", 0, 0.1f);
  2. InvokeRepeating("LessTransparency", 0, 0.1f);
  3.  
  4. private void LessTransparency()
  5. {
  6. if (alphalvl >= 1)
  7. {
  8. CancelInvoke("LessTransparency");
  9. }
  10. CancelInvoke("MoreTransparency");
  11. alphalvl = alphalvl + 0.3f;
  12. ChangeColor();
  13. }
  14. private void MoreTransparency()
  15. {
  16. if(alphalvl <= 0)
  17. {
  18. CancelInvoke("MoreTransparency");
  19. }
  20. CancelInvoke("LessTransparency");
  21. alphalvl = alphalvl - 0.3f;
  22. ChangeColor();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement