| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using InfraredManager;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- //处理光源检测部分
- public class InfraredLightGuider : MonoBehaviour
- {
- [SerializeField]
- RawImage rawImage;
- //相机感光部分
- [SerializeField]
- Slider slider;
- // Start is called before the first frame update
- void Start()
- {
- if (InfraredDemo._ins)
- {
- slider.onValueChanged.AddListener((value) =>
- {
- InfraredDemo._ins.onSliderEvent(value);
- });
- InfraredDemo._ins.onSetSliderValue(slider);
- }
- }
- void Update()
- {
- if (InfraredDemo.running)
- {
- //渲染相机画面
- rawImage.texture = InfraredDemo.infraredCameraHelper.GetCameraTexture();
- //rawImage.material = InfraredDemo.infraredCameraHelper.GetCameraMaterial();
- }
- }
- public void Close() {
- Destroy(gameObject);
- }
- }
|