설비 클릭 기능 및 천일 건물 모델링 수정

This commit is contained in:
정영민
2025-03-28 08:40:40 +09:00
parent 0c793f84bb
commit 10dc820cd3
23 changed files with 2889 additions and 3683 deletions

View File

@@ -1,12 +1,15 @@
using UnityEngine;
using WI;
using System;
using System.Collections.Generic;
using System.Linq;
namespace CHN
{
public class CHNRaycaster : MonoBehaviour, ISingle
{
OrbitalController controller;
public List<Machine> machines = new List<Machine>();
RaycastHit[] hitInfo = new RaycastHit[16];
Canvas_Popup popupCanvas;
@@ -28,6 +31,11 @@ namespace CHN
popupCanvas = FindSingle<Canvas_Popup>();
topCanvas = FindSingle<Canvas_Top>();
}
public override void AfterStart()
{
var building = FindSingle<Building>();
machines = building.floors.SelectMany(f => f.machines).ToList();
}
private void Update()
{
@@ -103,10 +111,22 @@ namespace CHN
if (leftClick)
{
onLeftClickMachine?.Invoke(machine);
ActivateMachinesHighlight(machine);
}
}
}
}
private void ActivateMachinesHighlight(Machine currentMachine)
{
foreach (var machine in machines)
{
machine.ResetTranslucent();
machine.StopFlash();
}
currentMachine.DeactivateTranslucent();
currentMachine.StartOneFlash();
}
private void RaycastOnClickProductionStatusBoard()
{
bool leftClick = Input.GetMouseButtonDown(0);