Skip to content

Compile Warning for Object.FindObjectOfType #42

@Grimeh

Description

@Grimeh

Usage of Object.FindObjectOfType in GA_Menu.cs generates a compiler warning, since it has been marked obsolete in favour of the newer Object.FindAnyObjectByType, Object.FindFirstObjectByType, and Object.FindObjectsOfType methods.
While the newer methods have been backported to versions >=2020, the obsoletion warning currently only affects Unity 6 and Unity 2023.

In this case Object.FindAnyObjectByType (docs here) should be used instead for Unity versions >= 2020.3, 2021.3, 2022.2, 2023, 6000.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions