Skip to content

Unity 2022.3.4f1 NullReferenceException: Object reference not set to an instance of an object #43

@mdmm-git

Description

@mdmm-git

public static class GUIHelper
{
private static readonly GUIStyle _closeButtonStyle = GUI.skin.FindStyle("ToolbarSeachCancelButton");

    [PublicAPI] public static bool CloseButton(Rect buttonRect)
    {
        return GUI.Button(buttonRect, GUIContent.none, _closeButtonStyle);
        //NullReferenceException: Object reference not set to an instance of an object
    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions