설비 KPI 오류 수정 및 애니메이션 속도 조정, 라이브러리 강조 효과 변경 및 UI 수정

This commit is contained in:
정영민
2025-03-28 11:15:57 +09:00
parent 2c3d7a4149
commit 73522c6e4a
6 changed files with 1382 additions and 1292 deletions

View File

@@ -119,8 +119,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 0, g: 0, b: 1, a: 0.000000014901161}
- _Color: {r: 0, g: 0, b: 1, a: 0.5}
- _BaseColor: {r: 0, g: 0, b: 1, a: 0.049999952}
- _Color: {r: 0, g: 0, b: 1, a: 0.000000029802322}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,7 @@ namespace CHN
public UI_MachineKPI machineKPI;
public Sprite previewImage;
public Vector3 centerPos;
public Animator animator;
Renderer[] renderers;
public List<Material> HoverMaterials = new List<Material>();
@@ -24,6 +25,7 @@ namespace CHN
public Material translucentMat;
Material hoverRedMat;
public int flashCount;
public float animSpeed;
public override void AfterAwake()
{
@@ -31,6 +33,8 @@ namespace CHN
return;
GetComponentInParent<Floor>().machines.Add(this);
centerPos = transform.GetMeshGroupCenter();
animator = GetComponentInChildren<Animator>();
renderers = GetComponentsInChildren<Renderer>();
translucentMat = Resources.Load<Material>("MAT_Translucent");
@@ -38,6 +42,17 @@ namespace CHN
CachingOriginMat();
}
public void SetAnimationSpeed()
{
if (machineKPI != null)
{
float.TryParse(machineKPI.data.eorate, out var eorate);
animSpeed = eorate / 100f;
animator.speed = animSpeed;
}
}
void CachingOriginMat()
{
foreach (Renderer renderer in renderers)
@@ -159,21 +174,10 @@ namespace CHN
}
IEnumerator OneFlash()
{
float alpha = 0f;
float coeff = 0.2f;
float alpha = 0.8f;
float coeff = 0.15f;
if (flashCount == 0)
{
while (alpha < 0.7f)
{
yield return new WaitForSeconds(0.05f);
foreach (var m in HoverMaterials)
{
m.color = new Color(m.color.r, m.color.g, m.color.b, alpha);
}
alpha += coeff;
}
while (alpha > 0f)
{
yield return new WaitForSeconds(0.05f);

View File

@@ -66,6 +66,7 @@ namespace CHN
var machinePos = machine.centerPos;
machine.machineKPI.transform.position = new Vector3(machinePos.x, machinePos.y + defaultNameHeight, machinePos.z);
matchingMachines.Add(machine);
machine.SetAnimationSpeed();
}
}
}
@@ -114,7 +115,7 @@ namespace CHN
}
void RangeDetection()
{
var layerMask = LayerMask.GetMask("Camera", "Floor Wall", "Floor Ground");
var layerMask = LayerMask.GetMask("Camera", "Floor Wall");
var currentFloor = FindSingle<Building>().currentFloor;
var max = cam.option.maxDistance - cam.option.minDistance;
@@ -127,12 +128,10 @@ namespace CHN
{
if (machine.GetComponentInParent<Floor>() != currentFloor)
{
machine.machineKPI.SetActive(false);
continue;
}
MachineKPIsActive(machine, layerMask);
var machineKPI = machine.machineKPI;
machineKPI.transform.localScale = originScale * distanceScale;
}
@@ -149,7 +148,7 @@ namespace CHN
}
void MachineKPIsActive(Machine machine, LayerMask layerMask)
{
var dir = cam.camera.transform.localPosition - machine.centerPos;
var dir = cam.camera.transform.position - machine.centerPos;
var hit = new RaycastHit();
if (Physics.Raycast(machine.centerPos, dir, out hit, Mathf.Infinity, layerMask))
@@ -159,9 +158,13 @@ namespace CHN
if (hitCameraLayer)
{
if (!IsScreenRange(machine))
return;
machine.machineKPI.Active();
{
machine.machineKPI.Deactive();
}
else
{
machine.machineKPI.Active();
}
}
else
{

View File

@@ -9,6 +9,7 @@ using System;
public class UI_MachineKPI : UIBase, IPointerClickHandler
{
public KPIData data;
public RectTransform DefaultKPI;
public RectTransform DetailsKPI;
@@ -26,6 +27,7 @@ public class UI_MachineKPI : UIBase, IPointerClickHandler
public void SetData(KPIData kpiData)
{
data = kpiData;
eorate = DecimalPointCalculate(kpiData.eorate);
Default_eorate.SetText(eorate.ToString());