123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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<GameObject> 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<SimpleCameraController>().initpos();});
- cam.transform.rotation = go.transform.rotation;
- */
- go.transform.parent.DOLocalMove(new Vector3(OpenXRCamera.Instance.transform.position.x,-2f,OpenXRCamera.Instance.transform.position.z)-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<msg["data"]["list"].Count;i++)
- {
- devItemTypeGoList[i].GetComponentInChildren<Text>().text =DeMaDataManager.changedate( msg["data"]["list"][i]["date"].ToString(),4);
- devItemTypeGoList[i].GetComponentInChildren<DataTypeManager>().init(msg["data"]["list"][i]);
- }
- }
- catch
- {
- }
-
- });
- }
- }
- }
- }
- public void init(GameObjectType type,TapName tapName)
- {
- this.type =type;
- this.tapName =tapName;
- }
- }
|