[정영민] 아즈텍 프로젝트 OCTOPUS TWIN 템플릿 적용
26.02.26 - XRLib 추가 및 적용 - 아즈텍 프로젝트 OCTOPUS TWIN 템플릿 적용
This commit is contained in:
38
Assets/Scripts/Object/Building.cs
Normal file
38
Assets/Scripts/Object/Building.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AZTECHWB
|
||||
{
|
||||
public class Building : MonoBehaviour
|
||||
{
|
||||
public List<Floor> floors = new List<Floor>();
|
||||
public Roof roof;
|
||||
public void Init()
|
||||
{
|
||||
roof = transform.GetComponentInChildren<Roof>(true);
|
||||
FindAllFloors();
|
||||
}
|
||||
|
||||
void FindAllFloors()
|
||||
{
|
||||
var childCount = transform.childCount;
|
||||
|
||||
for (int i = 0; i < childCount; ++i)
|
||||
{
|
||||
var child = transform.GetChild(i);
|
||||
|
||||
if (child.TryGetComponent<Floor>(out var floor))
|
||||
{
|
||||
floor.Init();
|
||||
floors.Add(floor);
|
||||
floor.floorIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ActiveRoof(bool isActive)
|
||||
{
|
||||
roof.gameObject.SetActive(isActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
Assets/Scripts/Object/Building.cs.meta
Normal file
2
Assets/Scripts/Object/Building.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0da7b8df1e0536c439fbc4acd38d48c1
|
||||
25
Assets/Scripts/Object/Floor.cs
Normal file
25
Assets/Scripts/Object/Floor.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AZTECHWB
|
||||
{
|
||||
public class Floor : MonoBehaviour
|
||||
{
|
||||
public int floorIndex;
|
||||
public List<Machine> machines = new();
|
||||
|
||||
public bool isEmptyFloor;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
machines = transform.GetComponentsInChildren<Machine>(true).ToList();
|
||||
|
||||
foreach(var machine in machines)
|
||||
{
|
||||
machine.Init();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
Assets/Scripts/Object/Floor.cs.meta
Normal file
2
Assets/Scripts/Object/Floor.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d9b3ae23a75e404d8a1ba6d5fbfb0c7
|
||||
34
Assets/Scripts/Object/Machine.cs
Normal file
34
Assets/Scripts/Object/Machine.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using AZTECHWB.Extensions;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AZTECHWB
|
||||
{
|
||||
public class Machine : MonoBehaviour
|
||||
{
|
||||
private Dictionary<Component, MeshRenderer[]> meshGroupCache = new();
|
||||
|
||||
public MachineStatusItem machineStatusItem;
|
||||
public string machineName;
|
||||
|
||||
private bool isAlarmActive;
|
||||
|
||||
public string[] typeOptions;
|
||||
public Sprite previewImage;
|
||||
public Vector3 centerPos;
|
||||
|
||||
public float focusDistance;
|
||||
public float focusAzimuth;
|
||||
public float focusElevation;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
centerPos = transform.GetMeshCenter();
|
||||
}
|
||||
public void SetAlarm(string state)
|
||||
{
|
||||
isAlarmActive = state == "SET" ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
Assets/Scripts/Object/Machine.cs.meta
Normal file
2
Assets/Scripts/Object/Machine.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9e8b536ba47c894da61cf9d680353d9
|
||||
6
Assets/Scripts/Object/Roof.cs
Normal file
6
Assets/Scripts/Object/Roof.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Roof : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
2
Assets/Scripts/Object/Roof.cs.meta
Normal file
2
Assets/Scripts/Object/Roof.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e093f998e1d5444794dfffc794ae664
|
||||
39
Assets/Scripts/Object/WarningLight.cs
Normal file
39
Assets/Scripts/Object/WarningLight.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Object/WarningLight.cs.meta
Normal file
2
Assets/Scripts/Object/WarningLight.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 032807d483d94f44fae2eca28705557f
|
||||
Reference in New Issue
Block a user