Production Status
This commit is contained in:
8
Assets/Images/UI/ProductionStatus.meta
Normal file
8
Assets/Images/UI/ProductionStatus.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7224215e4982612429b499aa770fd435
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Images/UI/ProductionStatus/IMG_ProductionStatus_bg.png
Normal file
BIN
Assets/Images/UI/ProductionStatus/IMG_ProductionStatus_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5cd2354d7ff2596489aec6d4ae577832
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -12,6 +12,8 @@ namespace CHN
|
||||
{
|
||||
public Building building;
|
||||
|
||||
public List<CompleteInfo> productionStatusInfos = new();
|
||||
|
||||
public Dictionary<string,CompleteInfo> firstFloorInfo = new Dictionary<string, CompleteInfo>();
|
||||
public Dictionary<string, CompleteInfo> secondFloorInfo = new Dictionary<string, CompleteInfo>();
|
||||
|
||||
@@ -28,7 +30,9 @@ namespace CHN
|
||||
|
||||
public void SetFloorProductionStatus(List<CompleteInfo> completeInfos)
|
||||
{
|
||||
foreach(var completeInfo in completeInfos)
|
||||
productionStatusInfos = completeInfos;
|
||||
|
||||
foreach (var completeInfo in completeInfos)
|
||||
{
|
||||
SetFloorInfo(building.floors[0], completeInfo, firstFloorInfo);
|
||||
SetFloorInfo(building.floors[1], completeInfo, secondFloorInfo);
|
||||
|
||||
82
Assets/Scripts/UI/Panel_ProductionStatus.cs
Normal file
82
Assets/Scripts/UI/Panel_ProductionStatus.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using CHN;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using WI;
|
||||
using static MQTT;
|
||||
|
||||
public class Panel_ProductionStatus : PanelBase
|
||||
{
|
||||
TextMeshProUGUI Text_DayAndTime;
|
||||
TextMeshProUGUI worknm;
|
||||
TextMeshProUGUI status;
|
||||
TextMeshProUGUI goalqty;
|
||||
TextMeshProUGUI workqty;
|
||||
TextMeshProUGUI goodqty;
|
||||
TextMeshProUGUI badqty;
|
||||
|
||||
ProductionStatusManager productionStatusManager;
|
||||
|
||||
[SerializeField]
|
||||
float loopTime = 3;
|
||||
float waitTime;
|
||||
|
||||
int productionStatusInfoNum;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
productionStatusManager = FindSingle<ProductionStatusManager>();
|
||||
}
|
||||
|
||||
public override void AfterStart()
|
||||
{
|
||||
SetProductionStatus();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
UpdateDayAndTime();
|
||||
|
||||
waitTime += Time.deltaTime;
|
||||
if (waitTime > loopTime)
|
||||
{
|
||||
productionStatusInfoNum += 1;
|
||||
if (productionStatusInfoNum > productionStatusManager.productionStatusInfos.Count)
|
||||
{
|
||||
productionStatusInfoNum = 0;
|
||||
}
|
||||
|
||||
SetProductionStatus();
|
||||
waitTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void SetProductionStatus()
|
||||
{
|
||||
List<CompleteInfo> completeInfos = productionStatusManager.productionStatusInfos;
|
||||
CompleteInfo completeInfo = completeInfos[productionStatusInfoNum];
|
||||
|
||||
worknm.SetText(completeInfo.worknm);
|
||||
status.SetText(completeInfo.statusnm);
|
||||
goalqty.SetText(RoundToIntData(completeInfo.goalqty));
|
||||
workqty.SetText(RoundToIntData(completeInfo.workqty));
|
||||
goodqty.SetText(RoundToIntData(completeInfo.goodqty));
|
||||
badqty.SetText(RoundToIntData(completeInfo.badqty));
|
||||
}
|
||||
|
||||
string RoundToIntData(string data)
|
||||
{
|
||||
var floatData = float.Parse(data);
|
||||
var intData = Mathf.RoundToInt(floatData);
|
||||
|
||||
return intData.ToString();
|
||||
}
|
||||
|
||||
void UpdateDayAndTime()
|
||||
{
|
||||
string currentTime = DateTime.Now.ToString("yyyy.MM.dd HH:mm");
|
||||
Text_DayAndTime.SetText(currentTime);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/Panel_ProductionStatus.cs.meta
Normal file
11
Assets/Scripts/UI/Panel_ProductionStatus.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9007a76f32c0734d90463210cfb995a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user