using DG.Tweening; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; /// /// 模式选择 /// [AddComponentMenu("PatternChoose/模式选择")] public class PatternChoose : MonoBehaviour { static PatternChoose _inst; public static PatternChoose Inst => _inst; public Button TS_button; public Button RL_button; /// /// 热力效果图 /// public GameObject heatMap; public GameObject search_go; Vector3 init_pos; Vector3 init_rot; [SerializeField] public Color red_alarm; [SerializeField] public Color yellow_alarm; [SerializeField] public Color blue_alarm; /// /// 设备新增窗口 /// public GameObject sb_xz_page; /// /// 设备编辑窗口 /// public GameObject sb_bj_page; /// /// 端口新增窗口 /// public GameObject dk_xz_page; /// /// 端口编辑窗口 /// public GameObject dk_bj_page; /// /// 线缆 /// public GameObject xianlan; private void Awake() { if (_inst != null && _inst != this) { Destroy(this.gameObject); } else { _inst = this; DontDestroyOnLoad(this.gameObject); } init_pos = Camera.main.transform.localPosition; init_rot = Camera.main.transform.localEulerAngles; } void Start() { } // Update is called once per frame void Update() { } public void F1(bool isheatMap) { heatMap.SetActive(isheatMap); ExtendedFlycam.Inst.init_mainCamera_rot(); Camera.main.transform.DOMove(/*TransparentGlowManage.Inst.MainCamera_pos*/init_pos, 1f); Camera.main.transform.DORotateQuaternion(Quaternion.Euler(/*TransparentGlowManage.Inst.MainCamera_rot*/init_rot), 1f).OnComplete(() => { //更新相机初始旋转角度 ExtendedFlycam.Inst.initialRotationEulerAngles = Camera.main.transform.localEulerAngles; }); TransparentGlowManage.Inst.renewALL(); } void F2(bool isheatMap) { heatMap.SetActive(isheatMap); ExtendedFlycam.Inst.init_mainCamera_rot(); Camera.main.transform.DOMove(/*TransparentGlowManage.Inst.MainCamera_pos*/init_pos, 1f); Camera.main.transform.DORotateQuaternion(Quaternion.Euler(/*TransparentGlowManage.Inst.MainCamera_rot*/init_rot), 1f).OnComplete(() => { //更新相机初始旋转角度 ExtendedFlycam.Inst.initialRotationEulerAngles = Camera.main.transform.localEulerAngles; }); TransparentGlowManage.Inst.renewALL(); } }