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.
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);
}
}
}
}