Skip to content

CanDetect() #10

Closed
Closed
@JPhilipp

Description

@JPhilipp

Works great, thank you so much!

Just a note, for the user-exposed debug status text of my crossdevice app, I needed a type of "CanDetect()" to show one of the three values Headphones: Unknown/ Yes/ No (and not just Yes/ No), so I added to your class this:

static public bool CanDetect()
{
    bool can = false;
    #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
        can = true;
    #endif
    return can;
}

(I suppose an alternative would have been to turn Detect() into a nullable bool.)

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