77 lines
2.1 KiB
C#
77 lines
2.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class GameManager : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 控制器
|
|
/// </summary>
|
|
public static GameManager Instance;
|
|
/// <summary>
|
|
/// 主视角
|
|
/// </summary>
|
|
public Transform CameraMain;
|
|
/// <summary>
|
|
/// 任务控制
|
|
/// </summary>
|
|
private CameraMove cameraMove;
|
|
/// <summary>
|
|
/// 是否显示UI
|
|
/// </summary>
|
|
public bool isShowUI;
|
|
/// <summary>
|
|
/// 主场景点位
|
|
/// </summary>
|
|
public List<Transform> MainPos = new List<Transform>();
|
|
/// <summary>
|
|
/// 所有点位
|
|
/// </summary>
|
|
public List<Transform> AllPos = new List<Transform>();
|
|
/// <summary>
|
|
/// 所有建筑模型
|
|
/// </summary>
|
|
public List<GameObject> Architectures = new List<GameObject>();
|
|
/// <summary>
|
|
/// 转场点
|
|
/// </summary>
|
|
//public Transform cutToPos;
|
|
/// <summary>
|
|
/// 转场
|
|
/// </summary>
|
|
//public GameObject cutToObj;
|
|
public static CameraMove CameraMove { get { if (Instance.cameraMove == null) Instance.cameraMove = Instance.CameraMain.GetComponent<CameraMove>(); return Instance.cameraMove; } }
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
//private void Update()
|
|
//{
|
|
// if (Input.GetMouseButtonDown(0))
|
|
// {
|
|
// Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
|
// RaycastHit hit;
|
|
|
|
// if (Physics.Raycast(ray, out hit))
|
|
// {
|
|
// if (hit.collider.CompareTag("distributionbox"))
|
|
// {
|
|
// Debug.Log("点击到了配电箱!");
|
|
// //前端方法: DistributionBox
|
|
|
|
// // 在这里编写你点击带有特定标签的碰撞体后的逻辑代码
|
|
// }
|
|
// }
|
|
// }
|
|
//}
|
|
/// <summary>
|
|
/// 模型显示
|
|
/// </summary>
|
|
/// <param name="_ShowModerName"></param>
|
|
public void ModerShow(string _ShowModerName)
|
|
{
|
|
Architectures.ForEach(x => x.SetActive(x.transform.name == _ShowModerName));
|
|
}
|
|
}
|