UnityEditor.TerrainSplatEditor.ValidateMainTexture C# (CSharp) Method

ValidateMainTexture() private method

private ValidateMainTexture ( Texture2D tex ) : bool
tex UnityEngine.Texture2D
return bool
        private bool ValidateMainTexture(Texture2D tex)
        {
            if (tex == null)
            {
                EditorGUILayout.HelpBox("Assign a tiling texture", MessageType.Warning);
                return false;
            }
            if (tex.wrapMode != TextureWrapMode.Repeat)
            {
                EditorGUILayout.HelpBox("Texture wrap mode must be set to Repeat", MessageType.Warning);
                return false;
            }
            if ((tex.width != Mathf.ClosestPowerOfTwo(tex.width)) || (tex.height != Mathf.ClosestPowerOfTwo(tex.height)))
            {
                EditorGUILayout.HelpBox("Texture size must be power of two", MessageType.Warning);
                return false;
            }
            if (tex.mipmapCount <= 1)
            {
                EditorGUILayout.HelpBox("Texture must have mip maps", MessageType.Warning);
                return false;
            }
            return true;
        }