가상공장 환경 구성
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XRLib;
|
||||
|
||||
@@ -7,5 +9,75 @@ namespace XED.VirtualFactory
|
||||
public class AGVMap : MonoBehaviour, ISingle
|
||||
{
|
||||
public List<AGVNode> nodes = new();
|
||||
|
||||
public bool TryGetPath(AGVNode currentLocation, AGVNodeType targetType)
|
||||
{
|
||||
if (currentLocation == null)
|
||||
return false;
|
||||
List<AGVNode> path = new();
|
||||
return TryGetPathRecursive(currentLocation, targetType, path);
|
||||
}
|
||||
|
||||
private bool TryGetPathRecursive(AGVNode currentLocation, AGVNodeType targetType, List<AGVNode> path)
|
||||
{
|
||||
if (currentLocation.nodeType == targetType)
|
||||
return true;
|
||||
path.Add(currentLocation);
|
||||
foreach (var n in currentLocation.linkedNodes)
|
||||
{
|
||||
if (n == null || path.Contains(n))
|
||||
continue;
|
||||
if (TryGetPathRecursive(n, targetType, path))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public void OnDrawGizmos()
|
||||
{
|
||||
HashSet<(Vector3, Vector3)> drawnLines = new HashSet<(Vector3, Vector3)>();
|
||||
|
||||
foreach (var n in nodes)
|
||||
{
|
||||
if (n == null)
|
||||
continue;
|
||||
|
||||
foreach (var l in n.linkedNodes)
|
||||
{
|
||||
Vector3 start = n.transform.position;
|
||||
if (l == null)
|
||||
continue;
|
||||
Vector3 end = l.transform.position;
|
||||
|
||||
// Ensure the line is always stored in a consistent order
|
||||
var line = start.x < end.x || (start.x == end.x && start.y < end.y) || (start.x == end.x && start.y == end.y && start.z < end.z)
|
||||
? (start, end)
|
||||
: (end, start);
|
||||
|
||||
if (!drawnLines.Contains(line))
|
||||
{
|
||||
Gizmos.DrawLine(start, end);
|
||||
drawnLines.Add(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
internal bool GetEmptyNode(AGVNodeType t, out AGVNode result)
|
||||
{
|
||||
foreach(var n in nodes)
|
||||
{
|
||||
if (n.nodeType == t && n.cargo == null)
|
||||
{
|
||||
result = n;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
result = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,11 +15,6 @@ namespace XED.EditorUtil
|
||||
base.OnInspectorGUI();
|
||||
map = (AGVMap)target;
|
||||
|
||||
if(GUILayout.Button("Load Nodes"))
|
||||
{
|
||||
LoadNodes();
|
||||
}
|
||||
|
||||
if(GUILayout.Button("Auto Indexing"))
|
||||
{
|
||||
AutoIndexing();
|
||||
@@ -28,10 +23,18 @@ namespace XED.EditorUtil
|
||||
|
||||
private void AutoIndexing()
|
||||
{
|
||||
LoadNodes();
|
||||
for (int i = 0; i < map.nodes.Count; i++)
|
||||
{
|
||||
var node = map.nodes[i];
|
||||
node.entity.id = i.ToString();
|
||||
node.entity.linkedNodeIDs.Clear();
|
||||
|
||||
foreach (var linkedNode in node.linkedNodes)
|
||||
{
|
||||
node.entity.linkedNodeIDs.Add(linkedNode.entity.id);
|
||||
}
|
||||
|
||||
map.nodes[i].gameObject.name = node.entity.id;
|
||||
}
|
||||
}
|
||||
|
||||
34
Assets/AGVNodeEditor.cs
Normal file
34
Assets/AGVNodeEditor.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
namespace XED.EditorUtil
|
||||
{
|
||||
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XED.VirtualFactory;
|
||||
[CustomEditor(typeof(AGVNode))]
|
||||
public class AGVNodeEditor : Editor
|
||||
{
|
||||
AGVNode node;
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
node = (AGVNode)target;
|
||||
if (GUILayout.Button("Create New Connection Node"))
|
||||
{
|
||||
CreateNewConnectionNode();
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateNewConnectionNode()
|
||||
{
|
||||
var copy = Instantiate(node);
|
||||
copy.transform.position = node.transform.position + Vector3.right * 2;
|
||||
copy.transform.parent = node.transform.parent;
|
||||
copy.linkedNodes= new();
|
||||
copy.linkedNodes.Add(node);
|
||||
copy.entity = new AGVNodeEntity();
|
||||
node.linkedNodes.Add(copy);
|
||||
Selection.activeGameObject = copy.gameObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/AGVNodeEditor.cs.meta
Normal file
2
Assets/AGVNodeEditor.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d60df9f29a57ef4f865b85b60a70ad1
|
||||
138
Assets/Materials/Color/MAT_UnlitBlue.mat
Normal file
138
Assets/Materials/Color/MAT_UnlitBlue.mat
Normal file
@@ -0,0 +1,138 @@
|
||||
%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: MAT_UnlitBlue
|
||||
m_Shader: {fileID: 4800000, guid: 650dd9526735d5b46b79224bc6e94025, 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: 0}
|
||||
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: 0}
|
||||
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
|
||||
- _BlendOp: 0
|
||||
- _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
|
||||
- _SampleGI: 0
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0, g: 0.06773424, b: 1, a: 1}
|
||||
- _Color: {r: 0, g: 0.06773424, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &8014367971321032248
|
||||
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:
|
||||
version: 9
|
||||
8
Assets/Materials/Color/MAT_UnlitBlue.mat.meta
Normal file
8
Assets/Materials/Color/MAT_UnlitBlue.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9f8cb69f1b57974ea4ca7f220c61f8e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
138
Assets/Materials/Color/MAT_UnlitOrange.mat
Normal file
138
Assets/Materials/Color/MAT_UnlitOrange.mat
Normal file
@@ -0,0 +1,138 @@
|
||||
%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: MAT_UnlitOrange
|
||||
m_Shader: {fileID: 4800000, guid: 650dd9526735d5b46b79224bc6e94025, 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: 0}
|
||||
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: 0}
|
||||
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
|
||||
- _BlendOp: 0
|
||||
- _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
|
||||
- _SampleGI: 0
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 0.41093177, b: 0, a: 1}
|
||||
- _Color: {r: 1, g: 0.41093177, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &8014367971321032248
|
||||
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:
|
||||
version: 9
|
||||
8
Assets/Materials/Color/MAT_UnlitOrange.mat.meta
Normal file
8
Assets/Materials/Color/MAT_UnlitOrange.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52d0eb20a11c0364382186d8f3ce8679
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
138
Assets/Materials/Color/MAT_UnlitRed.mat
Normal file
138
Assets/Materials/Color/MAT_UnlitRed.mat
Normal file
@@ -0,0 +1,138 @@
|
||||
%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: MAT_UnlitRed
|
||||
m_Shader: {fileID: 4800000, guid: 650dd9526735d5b46b79224bc6e94025, 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: 0}
|
||||
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: 0}
|
||||
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
|
||||
- _BlendOp: 0
|
||||
- _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
|
||||
- _SampleGI: 0
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 0, b: 0.027672768, a: 1}
|
||||
- _Color: {r: 1, g: 0, b: 0.027672768, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &8014367971321032248
|
||||
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:
|
||||
version: 9
|
||||
8
Assets/Materials/Color/MAT_UnlitRed.mat.meta
Normal file
8
Assets/Materials/Color/MAT_UnlitRed.mat.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e53abed626e96d847975b2582a6714d6
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ using XRLib;
|
||||
|
||||
namespace XED.VirtualFactory
|
||||
{
|
||||
public class AGV_Manager : MonoBehaviour,ISingle
|
||||
public class AGVManager : MonoBehaviour,ISingle
|
||||
{
|
||||
[SerializeField]
|
||||
GameObject agvPrefab;
|
||||
@@ -21,7 +21,6 @@ namespace XED.VirtualFactory
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
agvs = FindObjectsByType<AGV>(FindObjectsSortMode.None).ToList();
|
||||
foreach(var a in agvs)
|
||||
{
|
||||
@@ -108,7 +107,7 @@ namespace XED.VirtualFactory
|
||||
{
|
||||
OrderToAGV(agv, AGVTaskType.Charging);
|
||||
}
|
||||
if (OrderList[i].nodeClass.type == AGVNodeType.load)
|
||||
if (OrderList[i].nodeClass.type == AGVNodeType.Load')
|
||||
{
|
||||
OrderToAGV(agv, AGVTaskType.LoadCargo, OrderList[i].loadSocket, OrderList[i]);
|
||||
//OrderToAGV(agv, AGVTaskType.LiftUpDown, OrderList[i].loadSocket.transform.position + new Vector3(0, 0.2f, 0));
|
||||
@@ -135,7 +134,7 @@ namespace XED.VirtualFactory
|
||||
{
|
||||
OrderToAGV(agv, AGVTaskType.Charging);
|
||||
}
|
||||
if (OrderList[i].nodeClass.type == AGVNodeType.load)
|
||||
if (OrderList[i].nodeClass.type == AGVNodeType.Load')
|
||||
{
|
||||
OrderToAGV(agv, AGVTaskType.LoadCargo, OrderList[i].loadSocket, OrderList[i]);
|
||||
//OrderToAGV(agv, AGVTaskType.LiftUpDown, OrderList[i].loadSocket.transform.position+new Vector3(0,0.2f,0));
|
||||
@@ -7,7 +7,10 @@ namespace XED.VirtualFactory
|
||||
public class AGVNode : MonoBehaviour
|
||||
{
|
||||
public AGVNodeEntity entity;
|
||||
public List<AGVNode> linkedNodes = new();
|
||||
public AGVNodeType nodeType;
|
||||
|
||||
#region legacy
|
||||
public AGVNodeClass nodeClass;
|
||||
MaterialPropertyBlock mpb;
|
||||
List<Renderer> meshRendererList = new List<Renderer>();
|
||||
@@ -16,6 +19,7 @@ namespace XED.VirtualFactory
|
||||
[SerializeField]
|
||||
GameObject cargoPrefab;
|
||||
public GameObject cargo;
|
||||
#endregion
|
||||
|
||||
public void Initialize(AGVNodeClass data)
|
||||
{
|
||||
@@ -68,7 +72,7 @@ namespace XED.VirtualFactory
|
||||
{
|
||||
chargezone.enabled = true;
|
||||
}
|
||||
if (type == AGVNodeType.load)
|
||||
if (type == AGVNodeType.Load')
|
||||
{
|
||||
cargo = Instantiate(cargoPrefab, loadSocket.transform);
|
||||
cargo.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace XED.VirtualFactory
|
||||
public enum AGVNodeType
|
||||
{
|
||||
normal,
|
||||
load,
|
||||
Load',
|
||||
unLoad,
|
||||
charge
|
||||
}
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XED.VirtualFactory
|
||||
{
|
||||
[Serializable]
|
||||
public class AGVNodeEntity : Entity
|
||||
public class AGVNodeEntity : IEntity
|
||||
{
|
||||
public List<string> linkedNodes = new();
|
||||
public string id { get; set; }
|
||||
|
||||
public List<string> linkedNodeIDs = new();
|
||||
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53ef4d7a0b059254bae23ffee5d0aabf
|
||||
@@ -2,13 +2,10 @@ using UnityEngine;
|
||||
|
||||
namespace XED.VirtualFactory
|
||||
{
|
||||
public class Entity
|
||||
public interface IEntity
|
||||
{
|
||||
public string id;
|
||||
public string id { get; set; }
|
||||
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return JsonUtility.ToJson(this);
|
||||
}
|
||||
public abstract string ToJson();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Studio/Machine/AGV/AGVNode/Entity.cs.meta
Normal file
2
Assets/Scripts/Studio/Machine/AGV/AGVNode/Entity.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffd65ff40bb5a0d459312a38aa3726e0
|
||||
@@ -1,7 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XED.VirtualFactory
|
||||
{
|
||||
public class LoadEntity: Entity
|
||||
public class LoadEntity : IEntity
|
||||
{
|
||||
public string currentLocation;
|
||||
|
||||
public string id { get; set; }
|
||||
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69a46efba811e8b47a9e0bbec0724655
|
||||
@@ -550,5 +550,10 @@ namespace XED.VirtualFactory
|
||||
float yDistance = Mathf.Abs(value.Item1.transform.position.y - value.Item2.transform.position.y);
|
||||
return Mathf.Max(xDistance, yDistance);
|
||||
}
|
||||
|
||||
internal object Select(Func<object, object> value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1225,7 +1225,6 @@ GameObject:
|
||||
- component: {fileID: 5418552561206899447}
|
||||
- component: {fileID: 4021226453741430223}
|
||||
- component: {fileID: 6864208565738279623}
|
||||
- component: {fileID: 5524949980137133051}
|
||||
m_Layer: 0
|
||||
m_Name: StackerCraneSystem
|
||||
m_TagString: Untagged
|
||||
@@ -1272,19 +1271,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 55079185829b19e429dbd397d544b228, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &5524949980137133051
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4994960768642303974}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7f04208229125ce4f9ef15b712a31bd7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
loadPrefab: {fileID: 2713012076675240762, guid: 7cbbdba660dbd38479c561c09e38ec11, type: 3}
|
||||
--- !u!1 &5067924305745637229
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace XED.Manage
|
||||
var canvas_Windows = FindSingle<Canvas_Windows>();
|
||||
var canvas_DragArea = FindSingle<Canvas_DragArea>();
|
||||
|
||||
var agvManager = FindSingle<AGV_Manager>();
|
||||
var agvManager = FindSingle<AGVManager>();
|
||||
var wallBuilder = FindSingle<WallBuilder>();
|
||||
var agvNodeManager = FindSingle<AGVNodeManager>();
|
||||
var userInputManager = FindSingle<UserInputManager>();
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Pool;
|
||||
using XED.Interfaces;
|
||||
using XED.Attributes;
|
||||
|
||||
namespace XED
|
||||
{
|
||||
public class TwinObject : MonoBehaviour
|
||||
{
|
||||
#region lagacy
|
||||
public TwinPhysics physics = new TwinPhysics();
|
||||
public TwinMetaData metaData = new TwinMetaData();
|
||||
public AssetLabel assetLabel;
|
||||
|
||||
#endregion
|
||||
[PropertyVisible, Tooltip("ù ¹øÂ° info")]
|
||||
public bool IsDisplayable;
|
||||
[PropertyVisible, Tooltip("µÎ ¹øÂ° info")]
|
||||
|
||||
31
Assets/VirtualFactoryManager.cs
Normal file
31
Assets/VirtualFactoryManager.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using XED.VirtualFactory;
|
||||
|
||||
namespace XED
|
||||
{
|
||||
public class VirtualFactoryManager : MonoBehaviour
|
||||
{
|
||||
public List<StackerCrane> stackerCranes = new();
|
||||
public AGVManager agvManager;
|
||||
public AGVMap agvMap;
|
||||
public List<Load> loads = new();
|
||||
public override void AfterAwake()
|
||||
{
|
||||
agvMap = FindSingle<AGVMap>();
|
||||
agvManager = FindSingle<AGVManager>();
|
||||
stackerCranes = FindObjectsByType<StackerCrane>(UnityEngine.FindObjectsSortMode.None).ToList();
|
||||
|
||||
}
|
||||
|
||||
void FactoryStatusCheck()
|
||||
{
|
||||
if (loads.Count == 0)
|
||||
{
|
||||
if(agvMap.GetEmptyNode(AGVNodeType.Load, out var node))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/VirtualFactoryManager.cs.meta
Normal file
2
Assets/VirtualFactoryManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6eb9e1609cd682646a916778a2ae8797
|
||||
Reference in New Issue
Block a user