I want to make on/off toggle flash button android, this my sample code :
using UnityEngine;
using System.Collections;
public class OON : MonoBehaviour
{
private bool mFlashEnabled = false;
public Texture2D Icon;
void OnGUI()
{
if (GUI.Button(new Rect(5,5, 100, 100), Icon));
{
if (!mFlashEnabled)
{
CameraDevice.Instance.SetFlashTorchMode(true);
mFlashEnabled = true;
}
else
{
CameraDevice.Instance.SetFlashTorchMode(false);
mFlashEnabled = false;
}
}
}
}
But it’s not working…
In play mode, if i click the button, still “Toggle flash OFF WORKED” (look the pic).
Anyone can help me?

From what i see... it seems to be working... You have 3 lines in your debug which shows it going from OFF, to ON, to OFF again. how is that not a toggle ? Unless that all happened in one click, i don't see the problem.
– jokim