UnityEditor.SpriteRendererEditor.ShowError C# (CSharp) Method

ShowError() private static method

private static ShowError ( string error ) : void
error string
return void
        private static void ShowError(string error)
        {
            GUIContent content = new GUIContent(error) {
                image = Contents.warningIcon
            };
            GUILayout.Space(5f);
            GUILayout.BeginVertical(EditorStyles.helpBox, new GUILayoutOption[0]);
            GUILayout.Label(content, EditorStyles.wordWrappedMiniLabel, new GUILayoutOption[0]);
            GUILayout.EndVertical();
        }

Usage Example

示例#1
0
        private void CheckForErrors()
        {
            if (this.IsMaterialTextureAtlasConflict())
            {
                SpriteRendererEditor.ShowError("Material has CanUseSpriteAtlas=False tag. Sprite texture has atlasHint set. Rendering artifacts possible.");
            }
            bool flag;

            if (!this.DoesMaterialHaveSpriteTexture(out flag))
            {
                SpriteRendererEditor.ShowError("Material does not have a _MainTex texture property. It is required for SpriteRenderer.");
            }
            else if (flag)
            {
                SpriteRendererEditor.ShowError("Material texture property _MainTex has offset/scale set. It is incompatible with SpriteRenderer.");
            }
        }