AndroidNativeCore.Flash

Description

This class is wraper class of android default camera class to check if device has flashlight fature and enable or disable flashlight.

You need to add "android.permission.CAMERA" and android.permission.FLASHLIGHT to use this feature. Check how add permissions

Summary:
Public methods
bool isFlashAvailable()

This method returns true if device has flashlight else return false.

void setFlashEnable(bool enable)

Enable or disable flash by passing bool value.

Example
    
using AndroidNativeCore;
using UnityEngine;

class example{
Flash flash;
void Start()
{
flash = new Flash();

//logic
if(flash.isFlashAvailable()){
if(condition){
//turn on flash
flash.setFlashEnable(true);
}else{
//turn off flash
flash.setFlashEnable(false);
}
}
}         
}