using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening; using static GameManager; using UnityEngine.UI; using UnityTemplateProjects; public class CameraToPose : MonoBehaviour { public List devItemTypeGoList; public GameObjectType type; public TapName tapName; public Camera cam; public GameObject go; public void moveTo() { if(go) { /* if(cam.transform.position!=go.transform.position) cam.transform.DOMove(go.transform.position,1f).OnComplete(()=>{cam.GetComponent().initpos();}); cam.transform.rotation = go.transform.rotation; */ // go.transform.parent.DOLocalMove(new Vector3(OpenXRCamera.Instance.transform.position.x*0.004f,-2f*0.004f,OpenXRCamera.Instance.transform.position.z*0.004f)-go.transform.localPosition,1f) ; } } public void toggleWindowclick(bool b) { if(b) { GameManager.Instance.showW(type,tapName); moveTo(); if(devItemTypeGoList.Count>0&&tapName!=TapName.工业车间总览&&tapName!=TapName.科技车间总览) { if(type == GameObjectType.工业车间||type == GameObjectType.科技车间) { DeMaDataManager.Instance.GetDeviceType(GameManager.Instance.getID(tapName),(msg)=>{ try { for(int i=0;i().text =DeMaDataManager.changedate( msg["data"]["list"][i]["date"].ToString(),4); devItemTypeGoList[i].GetComponentInChildren().init(msg["data"]["list"][i]); } } catch { } }); } } } } public void init(GameObjectType type,TapName tapName) { this.type =type; this.tapName =tapName; } }