启动时,手电筒切换脚本模式会切换开/关,我不知道如何解决这个问题。
我相信它来自IEnumerator Start()但是,我尝试将 更改yield return new WaitForSeconds为 0 但这并没有改变任何事情。
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using Vuforia;
public class FlashlightAPI : MonoBehaviour
{
IEnumerator Start()
{
yield return new WaitForSeconds(0);
hasTorch = CameraDevice.Instance.SetFlashTorchMode(true);
yield return new WaitForSeconds(0.000f);
CameraDevice.Instance.SetFlashTorchMode(false);
}
bool torchState = true, hasTouch = false;
public bool hasTorch;
public FlashlightAPI(bool torchState, bool hasTorch)
{
this.torchState = torchState;
this.hasTorch = hasTorch;
}
}
qq_笑_17
相关分类