---
tags:
    - "UI, User, Interface"
---

# Graphic Default Material

[UI](../index.md) / [Graphic](index.md) / **Graphic Default Material**

## Description

Compares the Default Material property of Graphic component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Graphic |  |
| Value |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;

namespace VisualScript.Runtime
{
    [Title("Graphic Default Material")]
    [Category("UI/Graphic/Default Material")]
    [Description("Compares the Default Material property of Graphic component to another value")]
    
    [Image(typeof(IconBrush), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface")]
    
    [Parameter("Graphic")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenConditionMaterial_Graphic_CheckDefaultMaterial : Condition
    {
        [SerializeField] private GetGameObject m_Graphic = new GetGameObject(
            new GenTypeGameObject_Graphic()
        );
        
        [SerializeField] private GetMaterial m_Value = new GetMaterial();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Default Material");
            return $"{this.m_Graphic} {member} = {this.m_Value}";
        }
        
        protected override bool Run(Args args)
        {
            Graphic component = this.m_Graphic.Get<Graphic>(args);
            if (component == null) return false;
            
            return component.defaultMaterial == this.m_Value.Get(args) as Material;
        }
    }
}


```

