[정영민] 가상공장 기능 수정
26.03.17 - 미니맵 기능 수정 - 건물 기능 수정 - 설비 아이콘 기능 및 알람 기능 수정
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67bca5d452c88df4f8f33460728b7b98
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -23875,6 +23875,7 @@ Transform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1651125978}
|
||||
- {fileID: 1215460112}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -23890,7 +23891,8 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0da7b8df1e0536c439fbc4acd38d48c1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::AZTECHWB.Building
|
||||
floors: []
|
||||
floorList: []
|
||||
machineList: []
|
||||
roof: {fileID: 0}
|
||||
isOnlyMachineFloorsEnabled: 0
|
||||
--- !u!1 &720941199 stripped
|
||||
@@ -27762,7 +27764,6 @@ Transform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 543450653193274464}
|
||||
- {fileID: 1651125978}
|
||||
m_Father: {fileID: 701863452}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1215460113
|
||||
@@ -27778,7 +27779,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::AZTECHWB.Floor
|
||||
floorIndex: 0
|
||||
machines: []
|
||||
isEmptyFloor: 0
|
||||
--- !u!1001 &1224292364
|
||||
PrefabInstance:
|
||||
@@ -30766,7 +30766,7 @@ Transform:
|
||||
- {fileID: 207913470993116671}
|
||||
- {fileID: 1974879166}
|
||||
- {fileID: 377929573}
|
||||
m_Father: {fileID: 1215460112}
|
||||
m_Father: {fileID: 701863452}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!43 &1671806914
|
||||
Mesh:
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace AZTECHWB.Management
|
||||
public void MatchingMachine(List<StandardInfo> standardInfos, string[] machineFilters)
|
||||
{
|
||||
var building = FindAnyObjectByType<Building>();
|
||||
machines = building.floors.SelectMany(f => f.machines).ToArray();
|
||||
machines = building.machineList.ToArray();
|
||||
foreach (var info in standardInfos)
|
||||
{
|
||||
var p = machines.FirstOrDefault(x => x.machineName.Equals(info.code));
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace AZTECHWB.Management
|
||||
machineStatusItem = Resources.Load<MachineStatusItem>($"{ResourceURL.uiPrefabFolderPath}{nameof(MachineStatusItem)}");
|
||||
|
||||
controller = AZTECHAppMain.Instance.cameraController;
|
||||
machines = AZTECHSceneMain.Instance.building.floors.SelectMany(f => f.machines).ToArray();
|
||||
machines = AZTECHSceneMain.Instance.building.machineList.ToArray();
|
||||
|
||||
maxDistance = controller.maxDistance;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace AZTECHWB.Management
|
||||
controller = AZTECHAppMain.Instance.cameraController;
|
||||
var building = AZTECHSceneMain.Instance.building;
|
||||
|
||||
machines = building.floors.SelectMany(f => f.machines).ToList();
|
||||
machines = building.machineList;
|
||||
await UniTask.CompletedTask;
|
||||
}
|
||||
public void SetInteractable(bool isClickable)
|
||||
|
||||
@@ -7,31 +7,31 @@ namespace AZTECHWB
|
||||
{
|
||||
public class Building : MonoBehaviour
|
||||
{
|
||||
public List<Floor> floors = new List<Floor>();
|
||||
public List<Floor> floorList = new List<Floor>();
|
||||
public List<Machine> machineList = new List<Machine>();
|
||||
public Roof roof;
|
||||
public bool isOnlyMachineFloorsEnabled;
|
||||
public void Init()
|
||||
{
|
||||
roof = transform.GetComponentInChildren<Roof>(true);
|
||||
FindAllFloors();
|
||||
}
|
||||
|
||||
void FindAllFloors()
|
||||
{
|
||||
var childCount = transform.childCount;
|
||||
machineList.Clear();
|
||||
floorList.Clear();
|
||||
|
||||
for (int i = 0; i < childCount; ++i)
|
||||
var machines = GetComponentsInChildren<Machine>(true);
|
||||
for (int i = 0; i < machines.Length; i++)
|
||||
{
|
||||
var child = transform.GetChild(i);
|
||||
machines[i].Init();
|
||||
machineList.Add(machines[i]);
|
||||
}
|
||||
|
||||
if (child.TryGetComponent<Floor>(out var floor))
|
||||
{
|
||||
floor.Init();
|
||||
floors.Add(floor);
|
||||
floor.floorIndex = i;
|
||||
}
|
||||
var floor = GetComponentsInChildren<Floor>(true);
|
||||
for (int i = 0; i < floor.Length; i++)
|
||||
{
|
||||
floorList.Add(floor[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (AZTECHAppMain.Instance.cameraController == null)
|
||||
@@ -40,7 +40,7 @@ namespace AZTECHWB
|
||||
var cam = AZTECHAppMain.Instance.cameraController;
|
||||
isOnlyMachineFloorsEnabled = cam.IsCameraInsideBoundary() && cam.Camera.transform.localPosition.y < 20f ? true : false;
|
||||
|
||||
foreach(var floor in floors)
|
||||
foreach(var floor in floorList)
|
||||
{
|
||||
if (floor.isEmptyFloor)
|
||||
{
|
||||
|
||||
@@ -7,19 +7,7 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace AZTECHWB.UI
|
||||
private void OnClickAlram(AlarmInfoItem alarmInfo)
|
||||
{
|
||||
var building = AZTECHSceneMain.Instance.building;
|
||||
var machines = building.floors.SelectMany(f => f.machines);
|
||||
var machines = building.machineList;
|
||||
var selectedMachine = machines.FirstOrDefault(m => m.machineName == alarmInfo.completeInfo.worknm);
|
||||
|
||||
new SelectedMachineCommand(selectedMachine, false).Execute();
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace AZTECHWB.UI
|
||||
}
|
||||
private void UpdateMiniMapBackground()
|
||||
{
|
||||
var sprite = building.isOnlyMachineFloorsEnabled ? miniMapImages[0] : miniMapImages[1];
|
||||
var sprite = building.isOnlyMachineFloorsEnabled ? miniMapImages[1] : miniMapImages[0];
|
||||
MiniMapScreen.sprite = sprite;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user