[정영민] 층 조절 기능 추가 및 아이콘 오류 수정
26.03.18 - 층 자동 조절 기능 및 수동 조절 기능 추가 - 설비명 아이콘 안 보이는 오류 수정 - 카메라 2D/3D 위치 조정
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AZTECHWB.Core;
|
||||
using Unity.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AZTECHWB
|
||||
@@ -9,12 +10,10 @@ namespace AZTECHWB
|
||||
{
|
||||
public List<Floor> floorList = new List<Floor>();
|
||||
public List<Machine> machineList = new List<Machine>();
|
||||
public Roof roof;
|
||||
public bool isOnlyMachineFloorsEnabled;
|
||||
public bool isAutoActiveFloor;
|
||||
public void Init()
|
||||
{
|
||||
roof = transform.GetComponentInChildren<Roof>(true);
|
||||
|
||||
machineList.Clear();
|
||||
floorList.Clear();
|
||||
|
||||
@@ -30,26 +29,39 @@ namespace AZTECHWB
|
||||
{
|
||||
floorList.Add(floor[i]);
|
||||
}
|
||||
|
||||
isAutoActiveFloor= true;
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
private void Update()
|
||||
{
|
||||
if (!isAutoActiveFloor)
|
||||
return;
|
||||
|
||||
if (AZTECHAppMain.Instance.cameraController == null)
|
||||
return;
|
||||
|
||||
var cam = AZTECHAppMain.Instance.cameraController;
|
||||
isOnlyMachineFloorsEnabled = cam.IsCameraInsideBoundary() && cam.Camera.transform.localPosition.y < 20f ? true : false;
|
||||
isOnlyMachineFloorsEnabled = cam.IsCameraInsideBoundary();
|
||||
|
||||
foreach(var floor in floorList)
|
||||
var equipmentInFloor = floorList.FirstOrDefault(f => !f.isEmptyFloor);
|
||||
equipmentInFloor.gameObject.SetActive(isOnlyMachineFloorsEnabled);
|
||||
|
||||
var emptyFloor = floorList.FirstOrDefault(f => f.isEmptyFloor);
|
||||
emptyFloor.gameObject.SetActive(!isOnlyMachineFloorsEnabled);
|
||||
}
|
||||
public void SetActiveEmptyFloor(bool isOn)
|
||||
{
|
||||
isAutoActiveFloor = isOn;
|
||||
|
||||
if (!isAutoActiveFloor)
|
||||
{
|
||||
if (floor.isEmptyFloor)
|
||||
{
|
||||
floor.gameObject.SetActive(!isOnlyMachineFloorsEnabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
floor.gameObject.SetActive(isOnlyMachineFloorsEnabled);
|
||||
}
|
||||
var equipmentInFloor = floorList.FirstOrDefault(f => !f.isEmptyFloor);
|
||||
equipmentInFloor.gameObject.SetActive(true);
|
||||
isOnlyMachineFloorsEnabled = true;
|
||||
|
||||
var emptyFloor = floorList.FirstOrDefault(f => f.isEmptyFloor);
|
||||
emptyFloor.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,10 @@ namespace AZTECHWB
|
||||
{
|
||||
public class Machine : MonoBehaviour
|
||||
{
|
||||
private Dictionary<Component, MeshRenderer[]> meshGroupCache = new();
|
||||
|
||||
public MachineStatusItem machineStatusItem;
|
||||
public string machineName;
|
||||
|
||||
private bool isAlarmActive;
|
||||
//private bool isAlarmActive;
|
||||
|
||||
public string[] typeOptions;
|
||||
public Sprite previewImage;
|
||||
@@ -25,10 +23,10 @@ namespace AZTECHWB
|
||||
{
|
||||
centerPos = transform.GetMeshCenter();
|
||||
}
|
||||
public void SetAlarm(string state)
|
||||
{
|
||||
isAlarmActive = state == "SET" ? true : false;
|
||||
}
|
||||
// public void SetAlarm(string state)
|
||||
// {
|
||||
// isAlarmActive = state == "SET" ? true : false;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Roof : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e093f998e1d5444794dfffc794ae664
|
||||
@@ -1,39 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class WarningLight : MonoBehaviour
|
||||
{
|
||||
public Transform currentLight;
|
||||
|
||||
public Transform RedLight;
|
||||
public Transform YellowLight;
|
||||
public Transform GreenLight;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
RedLight = transform.Find("WarningLightRed").GetChild(0);
|
||||
YellowLight = transform.Find("WarningLightYellow").GetChild(0);
|
||||
GreenLight = transform.Find("WarningLightGreen").GetChild(0);
|
||||
}
|
||||
public void SetCurrentLight(Transform light)
|
||||
{
|
||||
if (currentLight != light && currentLight != null)
|
||||
{
|
||||
currentLight.gameObject.SetActive(false);
|
||||
}
|
||||
currentLight = light;
|
||||
currentLight.gameObject.SetActive(true);
|
||||
}
|
||||
public void SetYellowLightActive()
|
||||
{
|
||||
SetCurrentLight(YellowLight);
|
||||
}
|
||||
public void SetGreenLightActvie()
|
||||
{
|
||||
SetCurrentLight(GreenLight);
|
||||
}
|
||||
public void SetRedLightActvie()
|
||||
{
|
||||
SetCurrentLight(RedLight);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 032807d483d94f44fae2eca28705557f
|
||||
Reference in New Issue
Block a user