설비 클릭 기능 및 천일 건물 모델링 수정
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user