YanCheng_Metrology/Assets/Scripts/Project/Manager/LiveSceneManager.cs

57 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LiveSceneManager : SingletonMono<LiveSceneManager>
{
[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<FirstPersonController>();
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<UI_PlayerSessionPanel>(E_UI_Layer.Mid, (p) =>
{
p.Init(currentTool.name, "您好我是xx供电公司员工这是我的工作证。现在我们要对贵户更换电能计量表", (intTemp) =>
{
GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(intTemp, true);
Destroy(currentTool);
});
});
tMDTips.gameObject.SetActive(false);
currentTool.transform.localEulerAngles = new Vector3(90, 0, 0);
}
if (currentTool.name.Equals("三相四线电能表"))
{
tMDTips.gameObject.SetActive(false);
currentTool.transform.localEulerAngles = new Vector3(-90, 0, -180);
}
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
Debug.Log("Escape");
tMDTips.gameObject.SetActive(false);
Destroy(currentTool);
}
}
}