58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using AibisDream.FixSystem;
|
|
using AibisDream.Framework;
|
|
using Cinemachine;
|
|
|
|
public class UFSystem : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
private GameObject _UFCover;
|
|
private GameObject _UFModule;
|
|
|
|
public GameObject UFPanel;
|
|
|
|
private void Awake()
|
|
{
|
|
FixSystemCenter.SystemDic.Register(this);
|
|
var virtualCam = transform.Find("UF Camera").GetComponent<ICinemachineCamera>();
|
|
CameraKit.Instance.RegisterCamera(CameraEnum.UF, virtualCam);
|
|
}
|
|
|
|
public void OpenUFView()
|
|
{
|
|
if (!UFPanel.activeInHierarchy)
|
|
{
|
|
UFPanel.SetActive(true);
|
|
}
|
|
}
|
|
|
|
public void CloseUFView()
|
|
{
|
|
if (UFPanel.activeInHierarchy)
|
|
{
|
|
UFPanel.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void OpenCover()
|
|
{
|
|
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
|
_UFCover = bodyModuleSystem.FindBodyModuleByName("UF").transform.Find("Cover").gameObject;
|
|
if (_UFCover.activeInHierarchy)
|
|
{
|
|
_UFCover.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void RemoveUF()
|
|
{
|
|
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
|
_UFModule = bodyModuleSystem.FindBodyModuleByName("UF").gameObject;
|
|
if (_UFModule.activeInHierarchy)
|
|
{
|
|
_UFModule.SetActive(false);
|
|
}
|
|
}
|
|
} |