Сделал изменение цвета завершённых пунктов и текущего
This commit is contained in:
1 parent
b167fc448f
commit
9e7457b818
20 files changed
+11178
-10685
No files matched your search
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e38c877babf0ec64b8435e86781220fa
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,137 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: NozzleCamera
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 8400000, guid: 20c4dde87b3b74c42a4468b7e0deca66, type: 2}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 8400000, guid: 20c4dde87b3b74c42a4468b7e0deca66, type: 2}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 0
|
||||
- _Metallic: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.005
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &3236094107346521140
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
|
||||
version: 10
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 579250ef9a85bda4b80de7cead8cc12e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!84 &8400000
|
||||
RenderTexture:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: NozzleCamera
|
||||
m_ImageContentsHash:
|
||||
serializedVersion: 2
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_IsAlphaChannelOptional: 0
|
||||
serializedVersion: 6
|
||||
m_Width: 256
|
||||
m_Height: 256
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 94
|
||||
m_ColorFormat: 8
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
m_SRGB: 0
|
||||
m_UseDynamicScale: 0
|
||||
m_UseDynamicScaleExplicit: 0
|
||||
m_BindMS: 0
|
||||
m_EnableCompatibleFormat: 1
|
||||
m_EnableRandomWrite: 0
|
||||
m_TextureSettings:
|
||||
serializedVersion: 2
|
||||
m_FilterMode: 1
|
||||
m_Aniso: 0
|
||||
m_MipBias: 0
|
||||
m_WrapU: 1
|
||||
m_WrapV: 1
|
||||
m_WrapW: 1
|
||||
m_Dimension: 2
|
||||
m_VolumeDepth: 1
|
||||
m_ShadowSamplingMode: 2
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20c4dde87b3b74c42a4468b7e0deca66
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 8400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+10847
-10592
File diff suppressed because it is too large.
Load diff
@@ -1,7 +1,9 @@
|
||||
using Palmmedia.ReportGenerator.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
public class MachineCoordinatesMovementScript : MonoBehaviour
|
||||
@@ -71,7 +73,11 @@ public class MachineCoordinatesMovementScript : MonoBehaviour
|
||||
static public List<Vector3> CurrentProgram { get; private set; }
|
||||
static public List<Vector3> ComponentsHoldersCords { get; private set; }
|
||||
|
||||
[Serializable]
|
||||
public class MachineStepEvent : UnityEvent<int> { }
|
||||
|
||||
[Tooltip("Event called when step updated")]
|
||||
public static MachineStepEvent OnStep = new MachineStepEvent();
|
||||
|
||||
// Ãðàíèöû ïî êîîðäèíàòàì: (0.435, 0.02, 0.4125)
|
||||
|
||||
@@ -133,6 +139,7 @@ public class MachineCoordinatesMovementScript : MonoBehaviour
|
||||
else
|
||||
{
|
||||
CurrentStep++;
|
||||
OnStep?.Invoke(CurrentStep);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -153,6 +160,7 @@ public class MachineCoordinatesMovementScript : MonoBehaviour
|
||||
Restart = true;
|
||||
CurrentProgram = new(program);
|
||||
CurrentStep = 0;
|
||||
OnStep?.Invoke(CurrentStep);
|
||||
}
|
||||
|
||||
public void MaterialInserted(int index)
|
||||
@@ -264,6 +272,7 @@ public class MachineCoordinatesMovementScript : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
//Vector3.MoveTowards()
|
||||
XAxis.localPosition = new(cords.x, XAxis.localPosition.y, XAxis.localPosition.z);
|
||||
YAxis.localPosition = new(YAxis.localPosition.x, cords.y, YAxis.localPosition.z);
|
||||
ZAxis.localPosition = new(ZAxis.localPosition.x, ZAxis.localPosition.y, cords.z);
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PositionListElement : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private List<string> propertyTitle = new List<string>();
|
||||
[SerializeField] private List<TextMeshProUGUI> propertyTextObject = new List<TextMeshProUGUI>();
|
||||
|
||||
public Color HighlightedColor;
|
||||
public Color StepCompletedColor; //= new(0xB8, 0xD3, 0xFF, 64);
|
||||
public Color CurrentStepColor; //= new(0xB8, 0xD3, 0xFF, 128);
|
||||
|
||||
//public Color colorr;
|
||||
|
||||
// Runtime dictionary (not serialized)
|
||||
public Dictionary<string, TextMeshProUGUI> propertiesDatabase { get; private set; }
|
||||
@@ -31,6 +35,11 @@ public class PositionListElement : MonoBehaviour
|
||||
propertiesDatabase[propertyName].text = value;
|
||||
}
|
||||
|
||||
public void SetStatusColor(Color color)
|
||||
{
|
||||
gameObject.GetComponent<Image>().color = color;
|
||||
}
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
@@ -9,17 +9,16 @@ public class PositionListScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
PositionListElement _positionListElementTemplate;
|
||||
|
||||
|
||||
[SerializeField]
|
||||
List<PositionListElement> _positionsList = new();
|
||||
|
||||
|
||||
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
StartCoroutine(waitForMachineInit());
|
||||
MachineCoordinatesMovementScript.OnStep.AddListener(OnStepUpdate);
|
||||
}
|
||||
|
||||
private IEnumerator waitForMachineInit()
|
||||
@@ -32,50 +31,50 @@ public class PositionListScript : MonoBehaviour
|
||||
{
|
||||
PositionListElement newElement;
|
||||
|
||||
for (int i = 1; i < MachineCoordinatesMovementScript.CurrentProgram.Count; i+=2)
|
||||
for (int i = 1; i < MachineCoordinatesMovementScript.CurrentProgram.Count; i += 2)
|
||||
{
|
||||
newElement = createNewElementObject(-1f * (i - 1) * _positionListElementTemplate.GetComponent<RectTransform>().rect.height/2);
|
||||
newElement = createNewElementObject(-1f * (i - 1) * _positionListElementTemplate.GetComponent<RectTransform>().rect.height / 2);
|
||||
|
||||
_positionsList.Add(newElement);
|
||||
|
||||
newElement.SetProperty("No", _positionsList.Count.ToString());
|
||||
|
||||
int smdComponentIndex = MachineCoordinatesMovementScript.ComponentsHoldersCords.IndexOf(
|
||||
MachineCoordinatesMovementScript.CurrentProgram[i-1]);
|
||||
MachineCoordinatesMovementScript.CurrentProgram[i - 1]);
|
||||
newElement.SetProperty("Type", smdComponentIndex.ToString());
|
||||
|
||||
switch (smdComponentIndex)
|
||||
{
|
||||
case 0:
|
||||
newElement.SetProperty("Name", "R6");
|
||||
newElement.SetProperty("Name", "R6");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
newElement.SetProperty("Name", "C2");
|
||||
break;
|
||||
case 1:
|
||||
newElement.SetProperty("Name", "C2");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
newElement.SetProperty("Name", "C1");
|
||||
break;
|
||||
case 2:
|
||||
newElement.SetProperty("Name", "C1");
|
||||
break;
|
||||
|
||||
case 3:
|
||||
newElement.SetProperty("Name", "LED3");
|
||||
break;
|
||||
case 3:
|
||||
newElement.SetProperty("Name", "LED3");
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
newElement.SetProperty("X", MachineCoordinatesMovementScript.CurrentProgram[i].x.ToString());
|
||||
newElement.SetProperty("Y", MachineCoordinatesMovementScript.CurrentProgram[i].y.ToString());
|
||||
newElement.SetProperty("Z", MachineCoordinatesMovementScript.CurrentProgram[i].z.ToString());
|
||||
newElement.SetProperty("A", "1");
|
||||
newElement.SetProperty("Val", "1");
|
||||
newElement.SetProperty("X", MachineCoordinatesMovementScript.CurrentProgram[i].x.ToString());
|
||||
newElement.SetProperty("Y", MachineCoordinatesMovementScript.CurrentProgram[i].y.ToString());
|
||||
newElement.SetProperty("Z", MachineCoordinatesMovementScript.CurrentProgram[i].z.ToString());
|
||||
newElement.SetProperty("A", "1");
|
||||
newElement.SetProperty("Val", "1");
|
||||
newElement.SetProperty("Feeder", "B");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private PositionListElement createNewElementObject(float y_pos)
|
||||
private PositionListElement createNewElementObject(float y_pos)
|
||||
{
|
||||
GameObject newObject = Instantiate(_positionListElementTemplate.gameObject, _positionListElementTemplate.transform.parent);
|
||||
newObject.GetComponent<RectTransform>().localPosition = new(0, y_pos, 0);
|
||||
@@ -84,16 +83,30 @@ public class PositionListScript : MonoBehaviour
|
||||
return newObject.GetComponent<PositionListElement>();
|
||||
}
|
||||
|
||||
private void OnStepUpdate(int step)
|
||||
{
|
||||
if (step % 2 == 0)
|
||||
{
|
||||
PositionListElement currentElement = _positionsList[step / 2];
|
||||
|
||||
currentElement.SetProperty("State", "Work");
|
||||
|
||||
currentElement.SetStatusColor(currentElement.CurrentStepColor);
|
||||
|
||||
if (step == 0) return;
|
||||
|
||||
PositionListElement prevElement = _positionsList[(step / 2) - 1];
|
||||
|
||||
prevElement.SetProperty("State", "Ok");
|
||||
|
||||
prevElement.SetStatusColor(prevElement.StepCompletedColor);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (MachineCoordinatesMovementScript.CurrentStep == 0) return;
|
||||
//if (MachineCoordinatesMovementScript.CurrentStep == 0) return;
|
||||
//{ _positionsList[MachineCoordinatesMovementScript.CurrentStep]}
|
||||
|
||||
if (MachineCoordinatesMovementScript.CurrentStep % 2 == 0)
|
||||
{
|
||||
PositionListElement currentElement = _positionsList[MachineCoordinatesMovementScript.CurrentStep-1];
|
||||
currentElement.GetComponent<Image>().color = currentElement.HighlightedColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,6 +238,8 @@ MonoBehaviour:
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 2800000, guid: ee148e281f3c41c5b4ff5f8a5afe5a6c, type: 3}
|
||||
instantiationMode: 1
|
||||
- dependency: {fileID: 2100000, guid: 579250ef9a85bda4b80de7cead8cc12e, type: 2}
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 5648130919276084443, guid: 085ce58b196caa446a8545c9dd388793, type: 3}
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 2800000, guid: 548a31974f8a95b498ae14e971a30779, type: 3}
|
||||
@@ -292,6 +294,8 @@ MonoBehaviour:
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 1503989109714432937, guid: dc067c577ec1b854684d789b6e727cc0, type: 3}
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 8400000, guid: 20c4dde87b3b74c42a4468b7e0deca66, type: 2}
|
||||
instantiationMode: 1
|
||||
- dependency: {fileID: 2800000, guid: 1b208c9c64896bb41804f87a20a84fad, type: 3}
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 2800000, guid: 62f8ba4773678164a9ffa9c26d3bcbc7, type: 3}
|
||||
@@ -552,10 +556,10 @@ MonoBehaviour:
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 2800000, guid: 9dd17d4886f019c48b75eec09c6465dc, type: 3}
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 2800000, guid: e6791c5867aa71c43961dc8cb20d0b98, type: 3}
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 8300000, guid: b319a2e4ff8f5d840b82d8635b645d22, type: 3}
|
||||
instantiationMode: 1
|
||||
- dependency: {fileID: 2800000, guid: e6791c5867aa71c43961dc8cb20d0b98, type: 3}
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: 2800000, guid: cdebec39dbf81a14688e1de8d12897b4, type: 3}
|
||||
instantiationMode: 0
|
||||
- dependency: {fileID: -5475051401550479605, guid: 31b878b1ba6f0f548bacb4ee6ae992e9, type: 3}
|
||||
|
||||
Reference in new issue
Block a user