ExtensionInt.cs 374 B

1234567891011121314151617181920212223
  1. using UnityEngine;
  2. using System;
  3. using System.Collections;
  4. public static class ExtensionInt
  5. {
  6. public static bool ToBool(this int integer)
  7. {
  8. if (integer == 0)
  9. {
  10. return false;
  11. }
  12. else if (integer == 1)
  13. {
  14. return true;
  15. }
  16. else
  17. {
  18. throw new Exception();
  19. }
  20. }
  21. }