using System.Collections; using System.Collections.Generic; using UnityEngine; public class LiveSceneManager : SingletonMono { [HideInInspector] public FirstPersonController firstPersonController; [HideInInspector] public GameObject currentTool; public Transform spawnToolPos; public Transform tMDTips; protected override void Awake() { base.Awake(); firstPersonController = GameObject.FindGameObjectWithTag("Player").GetComponent(); tMDTips.gameObject.SetActive(false); } public void SetSpawnToolInfo(GameObject tool) { currentTool = tool; currentTool.transform.parent = Camera.main.transform; currentTool.transform.localPosition = spawnToolPos.localPosition; currentTool.transform.localEulerAngles = spawnToolPos.localEulerAngles; tMDTips.gameObject.SetActive(true); if (currentTool.name.Equals("工作证")) { GameManager.UIMgr.ShowPanel(E_UI_Layer.Mid, (p) => { p.Init("", "您好,我是xx供电公司员工,这是我的工作证。现在我们要对贵户更换电能计量表", (intTemp) => { Destroy(currentTool); }); }); tMDTips.gameObject.SetActive(false); currentTool.transform.localEulerAngles = new Vector3(90, 0, 0); } } private void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { Debug.Log("Escape"); tMDTips.gameObject.SetActive(false); Destroy(currentTool); } } }