TextureExtensions.cs 430 B

1234567891011121314
  1. using UnityEngine;
  2. using System.Collections;
  3. public static class TextureExtensions
  4. {
  5. /// <summary>
  6. /// Determines whether this instance is bogus, i.e. the texture is the ? texture given by Unity.
  7. /// Unity does not give any error, so we have to check.
  8. /// Currently the check is very superficial and checks if the image is an 8x8.
  9. public static bool IsBogus(this Texture t)
  10. {
  11. return (t.width == 8 && t.height == 8);
  12. }
  13. }