初始化代码
This commit is contained in:
parent
3368cdfb44
commit
31556f9aa3
8
Assets/script/application.meta
Normal file
8
Assets/script/application.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1f929e13cdfcff040943be73eacb7809
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
79
Assets/script/application/ApplicationBoot.cs
Normal file
79
Assets/script/application/ApplicationBoot.cs
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using EasyInject.Utils;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
[DefaultExecutionOrder(-1000000000)]
|
||||||
|
[GameObjectBean]
|
||||||
|
[AddComponentMenu("WXDC/Application/ApplicationBoot")]
|
||||||
|
public sealed class ApplicationBoot : MonoBehaviour
|
||||||
|
{
|
||||||
|
public static readonly IIoC Instance = new MyIoC();
|
||||||
|
|
||||||
|
|
||||||
|
[Autowired]
|
||||||
|
private ApplicationStateMachine applicationState;
|
||||||
|
|
||||||
|
|
||||||
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||||
|
static void OnBeforeSceneLoad()
|
||||||
|
{
|
||||||
|
Debug.Log("First scene loading: Before Awake is called.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
Debug.Log("IOC容器初始化");
|
||||||
|
Instance.Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
|
||||||
|
private static void Run()
|
||||||
|
{
|
||||||
|
//Debug.Log("IOC容器初始化");
|
||||||
|
//Instance.Init();
|
||||||
|
}
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
applicationState.OnInit();
|
||||||
|
}
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
applicationState.OnUpdate();
|
||||||
|
}
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
// Clear the Beans in the corresponding scene
|
||||||
|
Shutdown();
|
||||||
|
Instance.ClearBeans(UnityEngine.SceneManagement.SceneManager.GetActiveScene().name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用关闭执行
|
||||||
|
/// </summary>
|
||||||
|
private void Shutdown()
|
||||||
|
{
|
||||||
|
List<IApplcationShutdown> shutdowns = Instance.GetBeans<IApplcationShutdown>();
|
||||||
|
shutdowns = shutdowns.Distinct().ToList();
|
||||||
|
foreach(var down in shutdowns)
|
||||||
|
{
|
||||||
|
if (down == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
down?.Shutdown();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.LogError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/application/ApplicationBoot.cs.meta
Normal file
11
Assets/script/application/ApplicationBoot.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bf2b446408cd7864abf9d503e7e25d4c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
85
Assets/script/application/ApplicationStateMachine.cs
Normal file
85
Assets/script/application/ApplicationStateMachine.cs
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
using EasyInject.Attributes;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 程序状态机
|
||||||
|
/// </summary>
|
||||||
|
[Component]
|
||||||
|
public class ApplicationStateMachine
|
||||||
|
{
|
||||||
|
private List<IProcessState> processStates;
|
||||||
|
private static IProcessState currentProcess ;
|
||||||
|
|
||||||
|
private static ApplicationStateMachine stateMachine;
|
||||||
|
|
||||||
|
public event ProcessCompleted ProcessCompletedEvent;
|
||||||
|
public delegate void ProcessCompleted();
|
||||||
|
public ApplicationStateMachine()
|
||||||
|
{
|
||||||
|
stateMachine = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetCurrentProcess(IProcessState current)
|
||||||
|
{
|
||||||
|
current.IsExecuteProcess = true;
|
||||||
|
currentProcess = current;
|
||||||
|
|
||||||
|
int index = stateMachine.processStates.IndexOf(currentProcess);
|
||||||
|
|
||||||
|
try {
|
||||||
|
current.OnEnter();
|
||||||
|
}catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.LogError(ex.Message);
|
||||||
|
}
|
||||||
|
//已经是最后流程了,触发完成事件
|
||||||
|
if (index == stateMachine.processStates.Count - 1)
|
||||||
|
{
|
||||||
|
stateMachine.ProcessCompletedEvent?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 切换下一个流程,根据流程优先级切换
|
||||||
|
/// </summary>
|
||||||
|
public static void Chanage(IProcessState currentProcess)
|
||||||
|
{
|
||||||
|
int index = stateMachine.processStates.IndexOf(currentProcess) + 1;
|
||||||
|
if (stateMachine.processStates.Count != index && stateMachine.processStates[index] != null)
|
||||||
|
{
|
||||||
|
currentProcess.IsExecuteProcess = false;
|
||||||
|
currentProcess.OnExit();
|
||||||
|
SetCurrentProcess(stateMachine.processStates[index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void OnInit()
|
||||||
|
{
|
||||||
|
Debug.Log("初始化状态机");
|
||||||
|
processStates = ApplicationBoot.Instance.GetBeans<IProcessState>();
|
||||||
|
if (processStates != null && processStates.Count > 0)
|
||||||
|
{
|
||||||
|
processStates.Sort((a, b) => a.Priority - b.Priority);
|
||||||
|
SetCurrentProcess(processStates[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 每帧更新状态机
|
||||||
|
/// </summary>
|
||||||
|
public void OnUpdate()
|
||||||
|
{
|
||||||
|
if (currentProcess != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
currentProcess.OnUpdate();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.LogError(ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/application/ApplicationStateMachine.cs.meta
Normal file
11
Assets/script/application/ApplicationStateMachine.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 91a82c44d0f076b478ffbecd1893fd9d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
11
Assets/script/application/IApplcationShutdown.cs
Normal file
11
Assets/script/application/IApplcationShutdown.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 程序关闭
|
||||||
|
/// </summary>
|
||||||
|
public interface IApplcationShutdown
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 程序关闭触发
|
||||||
|
/// </summary>
|
||||||
|
void Shutdown();
|
||||||
|
}
|
11
Assets/script/application/IApplcationShutdown.cs.meta
Normal file
11
Assets/script/application/IApplcationShutdown.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3b730479947d8c04d81a74f03b342157
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
10
Assets/script/application/IProcessCompleted.cs
Normal file
10
Assets/script/application/IProcessCompleted.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/// <summary>
|
||||||
|
/// 当流程完成的时候会触发
|
||||||
|
/// </summary>
|
||||||
|
public interface IProcessCompleted
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 当流程完成的时候会触发
|
||||||
|
/// </summary>
|
||||||
|
void ProcessCompleted();
|
||||||
|
}
|
11
Assets/script/application/IProcessCompleted.cs.meta
Normal file
11
Assets/script/application/IProcessCompleted.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 112656af330cf334b9ec0267b8321f0a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
31
Assets/script/application/IProcessState.cs
Normal file
31
Assets/script/application/IProcessState.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using EasyInject.Attributes;
|
||||||
|
using EasyInject.Behaviours;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 流程状态
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public interface IProcessState
|
||||||
|
{
|
||||||
|
string Name { get;}
|
||||||
|
int Priority { get;}
|
||||||
|
/// <summary>
|
||||||
|
/// 进入当前流程
|
||||||
|
/// </summary>
|
||||||
|
void OnEnter();
|
||||||
|
/// <summary>
|
||||||
|
/// 退出当前流程
|
||||||
|
/// </summary>
|
||||||
|
void OnExit();
|
||||||
|
/// <summary>
|
||||||
|
/// 处于当前流程每帧都会执行
|
||||||
|
/// </summary>
|
||||||
|
void OnUpdate();
|
||||||
|
/// <summary>
|
||||||
|
/// 是当前流程
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
bool IsExecuteProcess { get; set; }
|
||||||
|
}
|
11
Assets/script/application/IProcessState.cs.meta
Normal file
11
Assets/script/application/IProcessState.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 55c91436de8ce9e4391616a85bfdf5f7
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
58
Assets/script/application/InitNetWorkProcess.cs
Normal file
58
Assets/script/application/InitNetWorkProcess.cs
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
using EasyInject.Attributes;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化网络流程
|
||||||
|
/// </summary>
|
||||||
|
[Component("InitNetWorkProcess")]
|
||||||
|
public class InitNetWorkProcess : IProcessState
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
private NetWorkComponent netWorkComponent;
|
||||||
|
[Autowired("WcsWebSocket")]
|
||||||
|
private WcsWebSocket wcsWebSocket;
|
||||||
|
[Autowired("WmsStorageWebsocket")]
|
||||||
|
private WmsStorageWebsocket wmsStorageWebsocket;
|
||||||
|
private bool executing = false;
|
||||||
|
public string Name { get => "InitNetWorkProcess"; }
|
||||||
|
public int Priority { get => 0; }
|
||||||
|
public bool IsExecuteProcess { get => executing; set => executing = value; }
|
||||||
|
|
||||||
|
public void OnEnter()
|
||||||
|
{
|
||||||
|
Debug.Log("正在处理网络流程");
|
||||||
|
|
||||||
|
List<IWcsSocketDataHandle> wcsSocketDataHandles = ApplicationBoot.Instance.GetBeans<IWcsSocketDataHandle>();
|
||||||
|
wcsSocketDataHandles.ForEach(x =>
|
||||||
|
{
|
||||||
|
////监听后台数据变化
|
||||||
|
wcsWebSocket.OnMessage(x.GetChannleKey(), x.DataHandle);
|
||||||
|
});
|
||||||
|
|
||||||
|
List<IStorageSocketDataHandle> storageSocketDataHandles = ApplicationBoot.Instance.GetBeans<IStorageSocketDataHandle>();
|
||||||
|
storageSocketDataHandles.ForEach(v =>
|
||||||
|
{
|
||||||
|
////监听后台数据变化
|
||||||
|
wmsStorageWebsocket.OnMessage(v.DataHandle);
|
||||||
|
});
|
||||||
|
|
||||||
|
netWorkComponent?.ConnectAllWebSocket();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnExit()
|
||||||
|
{
|
||||||
|
Debug.Log("网络服务启动完成");
|
||||||
|
IsExecuteProcess = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnUpdate()
|
||||||
|
{
|
||||||
|
if (netWorkComponent.AllWebSocketConnected())
|
||||||
|
{
|
||||||
|
ApplicationStateMachine.Chanage(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/application/InitNetWorkProcess.cs.meta
Normal file
11
Assets/script/application/InitNetWorkProcess.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d5829e6adbee6914f9b14646062a4f1d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
117
Assets/script/application/InitStorageProcess.cs
Normal file
117
Assets/script/application/InitStorageProcess.cs
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
using BestHTTP;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using Unity.VisualScripting;
|
||||||
|
using UnityEngine;
|
||||||
|
using static UnityEngine.EventSystems.EventTrigger;
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化库存流程
|
||||||
|
/// </summary>
|
||||||
|
[Component]
|
||||||
|
public class InitStorageProcess : IProcessState
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
private readonly NetWorkComponent netWorkComponent;
|
||||||
|
[Autowired]
|
||||||
|
private readonly LocationStorageManage storageManage;
|
||||||
|
[Autowired]
|
||||||
|
private readonly ContainersManage containerManage;
|
||||||
|
public string Name => "InitStorageProcess";
|
||||||
|
public int Priority => 2;
|
||||||
|
|
||||||
|
private bool isExecuting;
|
||||||
|
public bool IsExecuteProcess { get => isExecuting; set => isExecuting = value; }
|
||||||
|
|
||||||
|
public void OnEnter()
|
||||||
|
{
|
||||||
|
IsExecuteProcess = true;
|
||||||
|
Debug.Log("进入库存初始化流程");
|
||||||
|
///平库
|
||||||
|
SendRequset(33, 50);
|
||||||
|
SendRequset(1, 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SendRequset(int startRow, int endRow)
|
||||||
|
{
|
||||||
|
List<string> ints = new List<string>();
|
||||||
|
for (int i = startRow; i <= endRow; i++)
|
||||||
|
{
|
||||||
|
ints.Add(i.ToString("D2"));
|
||||||
|
}
|
||||||
|
netWorkComponent.RemoteGetStorageDataByRows(ints, RsultHandle);
|
||||||
|
|
||||||
|
}
|
||||||
|
public void RsultHandle(HTTPRequest originalRequest, HTTPResponse response)
|
||||||
|
{
|
||||||
|
if (response == null)
|
||||||
|
{
|
||||||
|
//请求错误重试
|
||||||
|
if(originalRequest.State == HTTPRequestStates.Error)
|
||||||
|
{
|
||||||
|
Debug.LogWarning("异常重试");
|
||||||
|
originalRequest.Send();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.IsSuccess)
|
||||||
|
{
|
||||||
|
Debug.LogWarning("处理");
|
||||||
|
JObject keyValues = JObject.Parse(UTF8Encoding.UTF8.GetString(response.Data));
|
||||||
|
JToken containers = keyValues["object"]["containers"];
|
||||||
|
|
||||||
|
List<StorageResponseData> storageResponses = JsonConvert.DeserializeObject<List<StorageResponseData>>(containers.ToString());
|
||||||
|
|
||||||
|
if (storageResponses != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
foreach (StorageResponseData responseData in storageResponses)
|
||||||
|
{
|
||||||
|
|
||||||
|
//无货的不往下处理了
|
||||||
|
if (string.IsNullOrEmpty(responseData.containerCode))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//库位号
|
||||||
|
string storageName = responseData.locationCode;
|
||||||
|
GameObject storageObj = storageManage.GetStorageByName(storageName);
|
||||||
|
if (storageObj != null)
|
||||||
|
{
|
||||||
|
//赋值容器数据
|
||||||
|
ContainerEntity containerEntity = new();
|
||||||
|
containerEntity.channelType = responseData.channelType;
|
||||||
|
containerEntity.location = responseData.locationCode;
|
||||||
|
containerEntity.containerCode = responseData.containerCode;
|
||||||
|
containerEntity.procedureCode = responseData.procedureCode;
|
||||||
|
containerEntity.containerType = responseData.containerType;
|
||||||
|
containerEntity.isEmpty = responseData.isEmpty;
|
||||||
|
containerEntity.isTool = responseData.isTool;
|
||||||
|
int row = int.Parse(storageObj.name.Split("-")[0]);
|
||||||
|
if (row >= storageManage.startRow && row <= storageManage.endRow)
|
||||||
|
{
|
||||||
|
containerManage.CreateContainer(new Vector3(0, -0.2472343f, 0.0006999969f), storageObj.transform, containerEntity, storageObj.layer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
containerManage.CreateContainer(Vector3.zero, storageObj.transform, containerEntity, storageObj.layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void OnExit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnUpdate()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/application/InitStorageProcess.cs.meta
Normal file
11
Assets/script/application/InitStorageProcess.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5356c9924db061442ac19e4b9602dc24
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
32
Assets/script/application/SkipUnityLogo.cs
Normal file
32
Assets/script/application/SkipUnityLogo.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#if !UNITY_EDITOR
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
using UnityEngine.Scripting;
|
||||||
|
|
||||||
|
[Preserve]
|
||||||
|
public class SkipUnityLogo
|
||||||
|
{
|
||||||
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
|
||||||
|
private static void BeforeSplashScreen()
|
||||||
|
{
|
||||||
|
#if UNITY_WEBGL
|
||||||
|
Application.focusChanged += Application_focusChanged;
|
||||||
|
#else
|
||||||
|
System.Threading.Tasks.Task.Run(AsyncSkip);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_WEBGL
|
||||||
|
private static void Application_focusChanged(bool obj)
|
||||||
|
{
|
||||||
|
Application.focusChanged -= Application_focusChanged;
|
||||||
|
SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
private static void AsyncSkip()
|
||||||
|
{
|
||||||
|
SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
11
Assets/script/application/SkipUnityLogo.cs.meta
Normal file
11
Assets/script/application/SkipUnityLogo.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: eb3f51339d2eaff4bb339138c258df10
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/script/camera.meta
Normal file
8
Assets/script/camera.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e87a7b10ff9f0784aa9fd055039fef4f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
83
Assets/script/camera/CameraController.cs
Normal file
83
Assets/script/camera/CameraController.cs
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using System;
|
||||||
|
using Unity.VisualScripting;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Playables;
|
||||||
|
/// <summary>
|
||||||
|
/// 相机控制
|
||||||
|
/// </summary>
|
||||||
|
[GameObjectBean]
|
||||||
|
public class CameraController : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Transform target; // 要围绕其旋转的目标物体
|
||||||
|
|
||||||
|
[Space(5)]
|
||||||
|
[Header("缩放配置")]
|
||||||
|
public float zoomSpeed = 5.0f; // 缩放速度
|
||||||
|
public float minDistance = 1.0f; // 最小距离
|
||||||
|
public float maxDistance = 30.0f; // 最大距离
|
||||||
|
public float speed = 1f; // 最大距离
|
||||||
|
public float distance = 0f; // 最大距离
|
||||||
|
|
||||||
|
public float yMin = 1;
|
||||||
|
public float yMax = 60;
|
||||||
|
private float xRot = 0;
|
||||||
|
private float yRot = 0;
|
||||||
|
|
||||||
|
|
||||||
|
public bool isPlaying = true;
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
distance = Vector3.Distance(transform.position, target.position);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void FixedUpdate()
|
||||||
|
{
|
||||||
|
//鼠标围绕目标旋转
|
||||||
|
mouseRoundRoller();
|
||||||
|
|
||||||
|
// 检测鼠标滚轮输入并进行缩放
|
||||||
|
float scrollInput = Input.GetAxis("Mouse ScrollWheel");
|
||||||
|
|
||||||
|
if (scrollInput != 0)
|
||||||
|
{
|
||||||
|
// 根据鼠标滚轮的方向改变距离
|
||||||
|
Camera camera = transform.GetComponent<Camera>();
|
||||||
|
|
||||||
|
float result = camera.fieldOfView - scrollInput * zoomSpeed;
|
||||||
|
// 限制距离范围
|
||||||
|
result = Mathf.Clamp(result, minDistance, maxDistance);
|
||||||
|
camera.fieldOfView = result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 鼠标操作旋转
|
||||||
|
/// </summary>
|
||||||
|
void mouseRoundRoller()
|
||||||
|
{
|
||||||
|
if (Input.GetMouseButton(0)) // 检查鼠标左键是否按下
|
||||||
|
{
|
||||||
|
// 根据鼠标移动量调整旋转角度
|
||||||
|
float mouseX = Input.GetAxis("Mouse X") * speed;
|
||||||
|
float mouseY = Input.GetAxis("Mouse Y") * speed;
|
||||||
|
|
||||||
|
yRot -= mouseX;
|
||||||
|
xRot += mouseY;
|
||||||
|
|
||||||
|
// 限制上下旋转角度
|
||||||
|
xRot = Mathf.Clamp(xRot, -90, 90);
|
||||||
|
// 应用新的旋转角度
|
||||||
|
transform.rotation = Quaternion.Euler(xRot, yRot, 0);
|
||||||
|
|
||||||
|
// 更新位置以保持与目标物体的距离不变
|
||||||
|
|
||||||
|
Vector3 v = target.position - transform.forward * distance;
|
||||||
|
transform.position = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
11
Assets/script/camera/CameraController.cs.meta
Normal file
11
Assets/script/camera/CameraController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 88bd1d8cdefb5004db4a38ccd2f53aa0
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
90
Assets/script/camera/CameraFollow.cs
Normal file
90
Assets/script/camera/CameraFollow.cs
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
using Cinemachine;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 相机的跟随
|
||||||
|
/// </summary>
|
||||||
|
[GameObjectBean]
|
||||||
|
public class CameraFollow : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("上下偏移")]
|
||||||
|
public float y;
|
||||||
|
[Header("左右偏移")]
|
||||||
|
public float z;
|
||||||
|
public float speed = 120;
|
||||||
|
[Autowired]
|
||||||
|
private CameraManage cameraManage;
|
||||||
|
public CinemachineVirtualCamera virtualCamera;
|
||||||
|
/// <summary>
|
||||||
|
/// 主要控制旋转的句柄
|
||||||
|
/// </summary>
|
||||||
|
private GameObject target;
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
mouseRoundRoller();
|
||||||
|
}
|
||||||
|
void mouseRoundRoller()
|
||||||
|
{
|
||||||
|
if(target == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//不得当前活动相机返回
|
||||||
|
if (!CinemachineCore.Instance.IsLive(virtualCamera))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Input.GetMouseButton(0)) // 检查鼠标左键是否按下
|
||||||
|
{
|
||||||
|
// 根据鼠标移动量调整旋转角度
|
||||||
|
float mouseX = Input.GetAxis("Mouse X") * speed * Time.deltaTime;
|
||||||
|
float y = target.transform.rotation.eulerAngles.y;
|
||||||
|
y -= mouseX;
|
||||||
|
// 应用新的旋转角度
|
||||||
|
target.transform.rotation = Quaternion.Euler(0, y, 0);
|
||||||
|
//transform.position = transform.position - transform.forward;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public void OnEnter(CinemachineVirtualCamera cinemachineCamera)
|
||||||
|
{
|
||||||
|
cinemachineCamera.LookAt = transform;
|
||||||
|
cinemachineCamera.Follow = transform;
|
||||||
|
CinemachineTransposer transposer = cinemachineCamera.GetCinemachineComponent<CinemachineTransposer>();
|
||||||
|
if (transposer != null )
|
||||||
|
{
|
||||||
|
cameraManage.IsPlaying = false;
|
||||||
|
transposer.m_FollowOffset.y = y;
|
||||||
|
transposer.m_FollowOffset.z = z;
|
||||||
|
ICinemachineCamera cinemachine = cameraManage.GetMaxPriorityCamera();
|
||||||
|
cinemachineCamera.Priority = cinemachine.Priority +1;
|
||||||
|
cinemachine.Priority = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void OnEnter()
|
||||||
|
{
|
||||||
|
if (target == null)
|
||||||
|
{
|
||||||
|
target = new GameObject(name + "_camera");
|
||||||
|
target.transform.parent = transform;
|
||||||
|
target.transform.localPosition = Vector3.zero;
|
||||||
|
}
|
||||||
|
virtualCamera.LookAt = target.transform;
|
||||||
|
virtualCamera.Follow = target.transform;
|
||||||
|
CinemachineTransposer transposer = virtualCamera.GetCinemachineComponent<CinemachineTransposer>();
|
||||||
|
if (transposer != null)
|
||||||
|
{
|
||||||
|
cameraManage.IsPlaying = false;
|
||||||
|
//cameraManage.playable.Stop();
|
||||||
|
transposer.m_FollowOffset.y = y;
|
||||||
|
transposer.m_FollowOffset.z = z;
|
||||||
|
ICinemachineCamera cinemachine = cameraManage.GetMaxPriorityCamera();
|
||||||
|
int back = cinemachine.Priority;
|
||||||
|
Debug.LogWarning("相机切换="+transform.name);
|
||||||
|
virtualCamera.Priority = cinemachine.Priority + 1;
|
||||||
|
cinemachine.Priority = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
11
Assets/script/camera/CameraFollow.cs.meta
Normal file
11
Assets/script/camera/CameraFollow.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3284cab85002c51468e01d53c50c6f29
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
92
Assets/script/camera/CameraManage.cs
Normal file
92
Assets/script/camera/CameraManage.cs
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
using Cinemachine;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Playables;
|
||||||
|
[GameObjectBean]
|
||||||
|
public class CameraManage:MonoBehaviour
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
private AutoRotationButton autoRotation;
|
||||||
|
[SerializeField]
|
||||||
|
private CinemachineVirtualCamera followVirtualCamera;
|
||||||
|
private float startTime = 0;
|
||||||
|
[SerializeField]
|
||||||
|
private bool _isPlaying = true;
|
||||||
|
private PlayableDirector _playableDirector;
|
||||||
|
public bool IsPlaying { get { return _isPlaying; } set {
|
||||||
|
_isPlaying = value;
|
||||||
|
} }
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
_playableDirector = GetComponent<PlayableDirector>();
|
||||||
|
}
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
//if (CinemachineCore.Instance.IsLive(followVirtualCamera))
|
||||||
|
//{
|
||||||
|
// Camera.main.cullingMask = LayerMask.GetMask("storage", LayerMask.LayerToName(followVirtualCamera.Follow.gameObject.layer));
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
if (!_isPlaying)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//如果时间线正在播放
|
||||||
|
//任意键按下
|
||||||
|
//if (Input.anyKeyDown)
|
||||||
|
//{
|
||||||
|
// playable.Pause();
|
||||||
|
// startTime = Time.time + 3;
|
||||||
|
//}
|
||||||
|
//if (Time.time - startTime > 0)
|
||||||
|
//{
|
||||||
|
// playable.Play();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private CinemachineVirtualCameraBase[] cinemachineVirtuals;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取最高的优先级相机
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public ICinemachineCamera GetMaxPriorityCamera()
|
||||||
|
{
|
||||||
|
if (cinemachineVirtuals == null)
|
||||||
|
{
|
||||||
|
cinemachineVirtuals = GameObject.FindObjectsByType<CinemachineVirtualCameraBase>(FindObjectsSortMode.InstanceID);
|
||||||
|
}
|
||||||
|
var list = new List<CinemachineVirtualCameraBase>(cinemachineVirtuals);
|
||||||
|
list.Sort((a,b) => b.Priority-a.Priority);
|
||||||
|
return list[0];
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 镜头切换
|
||||||
|
/// </summary>
|
||||||
|
private void ShotCut(Transform follow,Transform lookAt,Vector3 offset)
|
||||||
|
{
|
||||||
|
|
||||||
|
followVirtualCamera.Follow = follow;
|
||||||
|
followVirtualCamera.LookAt = lookAt;
|
||||||
|
//关闭旋转
|
||||||
|
autoRotation.ClickRotationBtn(false);
|
||||||
|
CinemachineTransposer transposer= followVirtualCamera.GetCinemachineComponent<CinemachineTransposer>();
|
||||||
|
transposer.m_FollowOffset.x = offset.x;
|
||||||
|
transposer.m_FollowOffset.y = offset.y;
|
||||||
|
transposer.m_FollowOffset.z = offset.z;
|
||||||
|
// Camera.main.cullingMask = LayerMask.GetMask("storage", LayerMask.LayerToName(follow.gameObject.layer));
|
||||||
|
|
||||||
|
ICinemachineCamera maxCamera = GetMaxPriorityCamera();
|
||||||
|
followVirtualCamera.Priority = maxCamera.Priority + 2;
|
||||||
|
maxCamera.Priority -= 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
public void ShotCut(IFollowHelp follow)
|
||||||
|
{
|
||||||
|
ShotCut(follow.Follow,follow.FookAt,follow.Offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
11
Assets/script/camera/CameraManage.cs.meta
Normal file
11
Assets/script/camera/CameraManage.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4f7bf896c872ab44e8c9ca7cbf489a13
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
38
Assets/script/camera/CameraRotate.cs
Normal file
38
Assets/script/camera/CameraRotate.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
using Cinemachine;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 相机的左右围绕旋转
|
||||||
|
/// </summary>
|
||||||
|
[GameObjectBean]
|
||||||
|
public sealed class CameraRotate : MonoBehaviour
|
||||||
|
{
|
||||||
|
public float speed = 0;
|
||||||
|
[SerializeField]
|
||||||
|
private CinemachineVirtualCamera followVirtualCamera;
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
mouseRoundRoller();
|
||||||
|
}
|
||||||
|
void mouseRoundRoller()
|
||||||
|
{
|
||||||
|
//不得当前活动相机返回
|
||||||
|
if (!CinemachineCore.Instance.IsLive(followVirtualCamera))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Input.GetMouseButton(0)) // 检查鼠标左键是否按下
|
||||||
|
{
|
||||||
|
// 根据鼠标移动量调整旋转角度
|
||||||
|
float mouseX = Input.GetAxis("Mouse X") * speed * Time.deltaTime;
|
||||||
|
Transform target = followVirtualCamera.LookAt;
|
||||||
|
float y = target.rotation.eulerAngles.y;
|
||||||
|
y -= mouseX;
|
||||||
|
// 应用新的旋转角度
|
||||||
|
target.rotation = Quaternion.Euler(0, y, 0);
|
||||||
|
//transform.position = transform.position - transform.forward;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/camera/CameraRotate.cs.meta
Normal file
11
Assets/script/camera/CameraRotate.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 53dfad170f20c564cb9314f3c28236ad
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
57
Assets/script/camera/CameraShotCut.cs
Normal file
57
Assets/script/camera/CameraShotCut.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using Cinemachine;
|
||||||
|
using Unity.VisualScripting;
|
||||||
|
[GameObjectBean(ENameType.GameObjectName)]
|
||||||
|
public class CameraShotCut : MonoBehaviour,IFollowHelp
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
private AutoRotationButton autoRotation;
|
||||||
|
[Autowired]
|
||||||
|
private CameraManage cameraManage;
|
||||||
|
[SerializeField]
|
||||||
|
private GameObject follow;
|
||||||
|
[SerializeField]
|
||||||
|
private GameObject lookat;
|
||||||
|
[SerializeField]
|
||||||
|
private Vector3 offset;
|
||||||
|
private Button button;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private LayerMask layerMask;
|
||||||
|
[SerializeField]
|
||||||
|
public MonoBehaviour followHelp;
|
||||||
|
public Transform Follow => follow.transform;
|
||||||
|
|
||||||
|
public Transform FookAt => lookat.transform;
|
||||||
|
|
||||||
|
public Vector3 Offset => offset;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
button = GetComponent<Button>();
|
||||||
|
button.onClick.AddListener(Click);
|
||||||
|
}
|
||||||
|
public void Click()
|
||||||
|
{
|
||||||
|
autoRotation.ClickRotationBtn(true);
|
||||||
|
if (followHelp != null)
|
||||||
|
{
|
||||||
|
if(followHelp is IFollowHelp help)
|
||||||
|
{
|
||||||
|
cameraManage.ShotCut(help);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
cameraManage.ShotCut(this);
|
||||||
|
if(!layerMask.IsUnityNull())
|
||||||
|
{
|
||||||
|
Camera.main.cullingMask = layerMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/camera/CameraShotCut.cs.meta
Normal file
11
Assets/script/camera/CameraShotCut.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 19e22ba8fc54d4941bec29d7ce6d6fdc
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
18
Assets/script/camera/IFollowHelp.cs
Normal file
18
Assets/script/camera/IFollowHelp.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public interface IFollowHelp
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ¾µÍ·¸úËæ
|
||||||
|
/// </summary>
|
||||||
|
public Transform Follow { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ¾µÍ·³¯Ïò
|
||||||
|
/// </summary>
|
||||||
|
public Transform FookAt { get; }
|
||||||
|
|
||||||
|
public Vector3 Offset { get; }
|
||||||
|
}
|
11
Assets/script/camera/IFollowHelp.cs.meta
Normal file
11
Assets/script/camera/IFollowHelp.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 92780c2202903734ba95c5010343419f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
70
Assets/script/camera/Main Camera Blends.asset
Normal file
70
Assets/script/camera/Main Camera Blends.asset
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: 36baaa8bdcb9d8b49b9199833965d2c3, type: 3}
|
||||||
|
m_Name: Main Camera Blends
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_CustomBlends:
|
||||||
|
- m_From: "\u5DE6"
|
||||||
|
m_To: "\u53F3"
|
||||||
|
m_Blend:
|
||||||
|
m_Style: 1
|
||||||
|
m_Time: 2
|
||||||
|
m_CustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 0
|
||||||
|
m_PostInfinity: 0
|
||||||
|
m_RotationOrder: 0
|
||||||
|
- m_From: "\u5DE6"
|
||||||
|
m_To: "\u8DDF\u968F\u76F8\u673A"
|
||||||
|
m_Blend:
|
||||||
|
m_Style: 1
|
||||||
|
m_Time: 2
|
||||||
|
m_CustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 0
|
||||||
|
m_PostInfinity: 0
|
||||||
|
m_RotationOrder: 0
|
||||||
|
- m_From: "\u53F3"
|
||||||
|
m_To: "\u8DDF\u968F\u76F8\u673A"
|
||||||
|
m_Blend:
|
||||||
|
m_Style: 1
|
||||||
|
m_Time: 2
|
||||||
|
m_CustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 0
|
||||||
|
m_PostInfinity: 0
|
||||||
|
m_RotationOrder: 0
|
||||||
|
- m_From: "\u53F3\u4E0B"
|
||||||
|
m_To: "\u8DDF\u968F\u76F8\u673A"
|
||||||
|
m_Blend:
|
||||||
|
m_Style: 1
|
||||||
|
m_Time: 2
|
||||||
|
m_CustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 0
|
||||||
|
m_PostInfinity: 0
|
||||||
|
m_RotationOrder: 0
|
||||||
|
- m_From: "\u5DE6\u4E0B"
|
||||||
|
m_To: "\u8DDF\u968F\u76F8\u673A"
|
||||||
|
m_Blend:
|
||||||
|
m_Style: 1
|
||||||
|
m_Time: 2
|
||||||
|
m_CustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 0
|
||||||
|
m_PostInfinity: 0
|
||||||
|
m_RotationOrder: 0
|
8
Assets/script/camera/Main Camera Blends.asset.meta
Normal file
8
Assets/script/camera/Main Camera Blends.asset.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 921515e1946af534095c2aeb2cf3ee19
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
345
Assets/script/camera/MainCameraTimeline.playable
Normal file
345
Assets/script/camera/MainCameraTimeline.playable
Normal file
@ -0,0 +1,345 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &-9120200862367922837
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
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: 05acc715f855ced458d76ee6f8ac6c61, type: 3}
|
||||||
|
m_Name: Cinemachine Track
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Version: 3
|
||||||
|
m_AnimClip: {fileID: 0}
|
||||||
|
m_Locked: 0
|
||||||
|
m_Muted: 0
|
||||||
|
m_CustomPlayableFullTypename:
|
||||||
|
m_Curves: {fileID: 0}
|
||||||
|
m_Parent: {fileID: 11400000}
|
||||||
|
m_Children: []
|
||||||
|
m_Clips:
|
||||||
|
- m_Version: 1
|
||||||
|
m_Start: 0
|
||||||
|
m_ClipIn: 0
|
||||||
|
m_Asset: {fileID: -4839479124151947342}
|
||||||
|
m_Duration: 5
|
||||||
|
m_TimeScale: 1
|
||||||
|
m_ParentTrack: {fileID: -9120200862367922837}
|
||||||
|
m_EaseInDuration: 0
|
||||||
|
m_EaseOutDuration: 0
|
||||||
|
m_BlendInDuration: -1
|
||||||
|
m_BlendOutDuration: 2.0166666666666666
|
||||||
|
m_MixInCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0
|
||||||
|
outWeight: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1
|
||||||
|
value: 1
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0
|
||||||
|
outWeight: 0
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_MixOutCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 1
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0
|
||||||
|
outWeight: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0
|
||||||
|
outWeight: 0
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_BlendInCurveMode: 0
|
||||||
|
m_BlendOutCurveMode: 0
|
||||||
|
m_ExposedParameterNames: []
|
||||||
|
m_AnimationCurves: {fileID: 0}
|
||||||
|
m_Recordable: 0
|
||||||
|
m_PostExtrapolationMode: 0
|
||||||
|
m_PreExtrapolationMode: 0
|
||||||
|
m_PostExtrapolationTime: 0
|
||||||
|
m_PreExtrapolationTime: 0
|
||||||
|
m_DisplayName: "\u5DE6"
|
||||||
|
- m_Version: 1
|
||||||
|
m_Start: 2.9833333333333334
|
||||||
|
m_ClipIn: 0
|
||||||
|
m_Asset: {fileID: 3869146167389441144}
|
||||||
|
m_Duration: 13.033333333333331
|
||||||
|
m_TimeScale: 1
|
||||||
|
m_ParentTrack: {fileID: -9120200862367922837}
|
||||||
|
m_EaseInDuration: 0
|
||||||
|
m_EaseOutDuration: 0
|
||||||
|
m_BlendInDuration: 2.0166666666666666
|
||||||
|
m_BlendOutDuration: 6.016666666666666
|
||||||
|
m_MixInCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_MixOutCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_BlendInCurveMode: 0
|
||||||
|
m_BlendOutCurveMode: 0
|
||||||
|
m_ExposedParameterNames: []
|
||||||
|
m_AnimationCurves: {fileID: 0}
|
||||||
|
m_Recordable: 0
|
||||||
|
m_PostExtrapolationMode: 0
|
||||||
|
m_PreExtrapolationMode: 0
|
||||||
|
m_PostExtrapolationTime: 0
|
||||||
|
m_PreExtrapolationTime: 0
|
||||||
|
m_DisplayName: "\u53F3"
|
||||||
|
- m_Version: 1
|
||||||
|
m_Start: 20
|
||||||
|
m_ClipIn: 0
|
||||||
|
m_Asset: {fileID: -600863716661459833}
|
||||||
|
m_Duration: 11.666666666666668
|
||||||
|
m_TimeScale: 1
|
||||||
|
m_ParentTrack: {fileID: -9120200862367922837}
|
||||||
|
m_EaseInDuration: 0
|
||||||
|
m_EaseOutDuration: 0
|
||||||
|
m_BlendInDuration: 2
|
||||||
|
m_BlendOutDuration: 6.666666666666668
|
||||||
|
m_MixInCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_MixOutCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_BlendInCurveMode: 0
|
||||||
|
m_BlendOutCurveMode: 0
|
||||||
|
m_ExposedParameterNames: []
|
||||||
|
m_AnimationCurves: {fileID: 0}
|
||||||
|
m_Recordable: 0
|
||||||
|
m_PostExtrapolationMode: 0
|
||||||
|
m_PreExtrapolationMode: 0
|
||||||
|
m_PostExtrapolationTime: 0
|
||||||
|
m_PreExtrapolationTime: 0
|
||||||
|
m_DisplayName: "\u5DE6\u4E0B"
|
||||||
|
- m_Version: 1
|
||||||
|
m_Start: 25
|
||||||
|
m_ClipIn: 0
|
||||||
|
m_Asset: {fileID: -1774310540759384460}
|
||||||
|
m_Duration: 7.033333333333331
|
||||||
|
m_TimeScale: 1
|
||||||
|
m_ParentTrack: {fileID: -9120200862367922837}
|
||||||
|
m_EaseInDuration: 0
|
||||||
|
m_EaseOutDuration: 0
|
||||||
|
m_BlendInDuration: 6.666666666666668
|
||||||
|
m_BlendOutDuration: -1
|
||||||
|
m_MixInCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_MixOutCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 1
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0
|
||||||
|
outWeight: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0
|
||||||
|
outWeight: 0
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_BlendInCurveMode: 0
|
||||||
|
m_BlendOutCurveMode: 0
|
||||||
|
m_ExposedParameterNames: []
|
||||||
|
m_AnimationCurves: {fileID: 0}
|
||||||
|
m_Recordable: 0
|
||||||
|
m_PostExtrapolationMode: 0
|
||||||
|
m_PreExtrapolationMode: 0
|
||||||
|
m_PostExtrapolationTime: 0
|
||||||
|
m_PreExtrapolationTime: 0
|
||||||
|
m_DisplayName: "\u5DE6"
|
||||||
|
- m_Version: 1
|
||||||
|
m_Start: 10
|
||||||
|
m_ClipIn: 0
|
||||||
|
m_Asset: {fileID: -5305193237852543412}
|
||||||
|
m_Duration: 12
|
||||||
|
m_TimeScale: 1
|
||||||
|
m_ParentTrack: {fileID: -9120200862367922837}
|
||||||
|
m_EaseInDuration: 0
|
||||||
|
m_EaseOutDuration: 0
|
||||||
|
m_BlendInDuration: 6.016666666666666
|
||||||
|
m_BlendOutDuration: 2
|
||||||
|
m_MixInCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_MixOutCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve: []
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
m_BlendInCurveMode: 0
|
||||||
|
m_BlendOutCurveMode: 0
|
||||||
|
m_ExposedParameterNames: []
|
||||||
|
m_AnimationCurves: {fileID: 0}
|
||||||
|
m_Recordable: 0
|
||||||
|
m_PostExtrapolationMode: 0
|
||||||
|
m_PreExtrapolationMode: 0
|
||||||
|
m_PostExtrapolationTime: 0
|
||||||
|
m_PreExtrapolationTime: 0
|
||||||
|
m_DisplayName: "\u53F3\u4E0B"
|
||||||
|
m_Markers:
|
||||||
|
m_Objects: []
|
||||||
|
--- !u!114 &-5305193237852543412
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
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: 90fb794a295e73545af71bcdb7375791, type: 3}
|
||||||
|
m_Name: CinemachineShot
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
DisplayName:
|
||||||
|
VirtualCamera:
|
||||||
|
exposedName: f8f72e9d9adad5e4eac9007b169588c1
|
||||||
|
defaultValue: {fileID: 0}
|
||||||
|
--- !u!114 &-4839479124151947342
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
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: 90fb794a295e73545af71bcdb7375791, type: 3}
|
||||||
|
m_Name: CinemachineShot
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
DisplayName:
|
||||||
|
VirtualCamera:
|
||||||
|
exposedName: fcfc5d0874cf46645ace7e8f757b3b02
|
||||||
|
defaultValue: {fileID: 0}
|
||||||
|
--- !u!114 &-1774310540759384460
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
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: 90fb794a295e73545af71bcdb7375791, type: 3}
|
||||||
|
m_Name: CinemachineShot
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
DisplayName:
|
||||||
|
VirtualCamera:
|
||||||
|
exposedName: d6ab726d4edbb0443b839adbbcccba9e
|
||||||
|
defaultValue: {fileID: 0}
|
||||||
|
--- !u!114 &-600863716661459833
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
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: 90fb794a295e73545af71bcdb7375791, type: 3}
|
||||||
|
m_Name: CinemachineShot
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
DisplayName:
|
||||||
|
VirtualCamera:
|
||||||
|
exposedName: fbb2cf2d9bbf8f74aa8f994ef5712e6b
|
||||||
|
defaultValue: {fileID: 0}
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: bfda56da833e2384a9677cd3c976a436, type: 3}
|
||||||
|
m_Name: MainCameraTimeline
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Version: 0
|
||||||
|
m_Tracks:
|
||||||
|
- {fileID: -9120200862367922837}
|
||||||
|
m_FixedDuration: 0
|
||||||
|
m_EditorSettings:
|
||||||
|
m_Framerate: 60
|
||||||
|
m_ScenePreview: 1
|
||||||
|
m_DurationMode: 0
|
||||||
|
m_MarkerTrack: {fileID: 0}
|
||||||
|
--- !u!114 &3869146167389441144
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
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: 90fb794a295e73545af71bcdb7375791, type: 3}
|
||||||
|
m_Name: CinemachineShot
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
DisplayName:
|
||||||
|
VirtualCamera:
|
||||||
|
exposedName: 96dacde9fa9202640a2fa301363c0fea
|
||||||
|
defaultValue: {fileID: 0}
|
8
Assets/script/camera/MainCameraTimeline.playable.meta
Normal file
8
Assets/script/camera/MainCameraTimeline.playable.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8d2181f6a7bee2c4987074c849d9d111
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
63
Assets/script/camera/_lighting
Normal file
63
Assets/script/camera/_lighting
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!850595691 &4890085278179872738
|
||||||
|
LightingSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: _lighting
|
||||||
|
serializedVersion: 7
|
||||||
|
m_GIWorkflowMode: 1
|
||||||
|
m_EnableBakedLightmaps: 1
|
||||||
|
m_EnableRealtimeLightmaps: 0
|
||||||
|
m_RealtimeEnvironmentLighting: 1
|
||||||
|
m_BounceScale: 1
|
||||||
|
m_AlbedoBoost: 1
|
||||||
|
m_IndirectOutputScale: 1
|
||||||
|
m_UsingShadowmask: 1
|
||||||
|
m_BakeBackend: 1
|
||||||
|
m_LightmapMaxSize: 1024
|
||||||
|
m_LightmapSizeFixed: 0
|
||||||
|
m_BakeResolution: 40
|
||||||
|
m_Padding: 2
|
||||||
|
m_LightmapCompression: 3
|
||||||
|
m_AO: 0
|
||||||
|
m_AOMaxDistance: 1
|
||||||
|
m_CompAOExponent: 1
|
||||||
|
m_CompAOExponentDirect: 0
|
||||||
|
m_ExtractAO: 0
|
||||||
|
m_MixedBakeMode: 2
|
||||||
|
m_LightmapsBakeMode: 1
|
||||||
|
m_FilterMode: 1
|
||||||
|
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ExportTrainingData: 0
|
||||||
|
m_TrainingDataDestination: TrainingData
|
||||||
|
m_RealtimeResolution: 2
|
||||||
|
m_ForceWhiteAlbedo: 0
|
||||||
|
m_ForceUpdates: 0
|
||||||
|
m_PVRCulling: 1
|
||||||
|
m_PVRSampling: 1
|
||||||
|
m_PVRDirectSampleCount: 32
|
||||||
|
m_PVRSampleCount: 512
|
||||||
|
m_PVREnvironmentSampleCount: 256
|
||||||
|
m_PVREnvironmentReferencePointCount: 2048
|
||||||
|
m_LightProbeSampleCountMultiplier: 4
|
||||||
|
m_PVRBounces: 2
|
||||||
|
m_PVRMinBounces: 2
|
||||||
|
m_PVREnvironmentImportanceSampling: 1
|
||||||
|
m_PVRFilteringMode: 1
|
||||||
|
m_PVRDenoiserTypeDirect: 1
|
||||||
|
m_PVRDenoiserTypeIndirect: 1
|
||||||
|
m_PVRDenoiserTypeAO: 1
|
||||||
|
m_PVRFilterTypeDirect: 0
|
||||||
|
m_PVRFilterTypeIndirect: 0
|
||||||
|
m_PVRFilterTypeAO: 0
|
||||||
|
m_PVRFilteringGaussRadiusDirect: 1
|
||||||
|
m_PVRFilteringGaussRadiusIndirect: 5
|
||||||
|
m_PVRFilteringGaussRadiusAO: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||||
|
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||||
|
m_PVRTiledBaking: 0
|
||||||
|
m_RespectSceneVisibilityWhenBakingGI: 0
|
7
Assets/script/camera/_lighting.meta
Normal file
7
Assets/script/camera/_lighting.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d3be33b3399e41c4e936e8c0833bd4d5
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/script/data.meta
Normal file
8
Assets/script/data.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cc953b94c228fae41b868e9897c5fd6e
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
17
Assets/script/data/AgvData.cs
Normal file
17
Assets/script/data/AgvData.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class AgvData
|
||||||
|
{
|
||||||
|
public string deviecCode;
|
||||||
|
public string driverName = "标准AGV驱动";
|
||||||
|
public string onlineStatus = "在线";
|
||||||
|
public string isWoking = "运行中";
|
||||||
|
public string currentAction;
|
||||||
|
public string feedBack;
|
||||||
|
public string startDevice;
|
||||||
|
public string endDevice;
|
||||||
|
public string errorMessage;
|
||||||
|
public string container;
|
||||||
|
}
|
11
Assets/script/data/AgvData.cs.meta
Normal file
11
Assets/script/data/AgvData.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b2e931be944e5294c969344595c297c5
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
43
Assets/script/data/AgvTaskData.cs
Normal file
43
Assets/script/data/AgvTaskData.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using System;
|
||||||
|
using static AgvCarManage;
|
||||||
|
[System.Serializable]
|
||||||
|
|
||||||
|
public class AgvTaskData
|
||||||
|
{
|
||||||
|
|
||||||
|
public long instructionId;
|
||||||
|
|
||||||
|
public long instructionCode;
|
||||||
|
|
||||||
|
public String containerCode;
|
||||||
|
|
||||||
|
public string containerIsEmpty;
|
||||||
|
|
||||||
|
public String taskProcedure;
|
||||||
|
|
||||||
|
public String fromDevice;
|
||||||
|
|
||||||
|
public String fromLocation;
|
||||||
|
|
||||||
|
public String toDevice;
|
||||||
|
|
||||||
|
public String toLocation;
|
||||||
|
|
||||||
|
public String carId;
|
||||||
|
|
||||||
|
public string instructionStatus;
|
||||||
|
|
||||||
|
public CarTaskStatusEnum agvTaskStatus;
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
return obj is AgvTaskData data &&
|
||||||
|
instructionId == data.instructionId &&
|
||||||
|
instructionCode == data.instructionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return HashCode.Combine(instructionId, instructionCode);
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/data/AgvTaskData.cs.meta
Normal file
11
Assets/script/data/AgvTaskData.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ab335d53137c9a344ae59fef11973559
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
27
Assets/script/data/ConveyorData.cs
Normal file
27
Assets/script/data/ConveyorData.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// ÊäËÍÏß¶Ô½ÓÊý¾Ý
|
||||||
|
/// </summary>
|
||||||
|
[System.Serializable]
|
||||||
|
public class ConveyorData
|
||||||
|
{
|
||||||
|
public int mode;
|
||||||
|
public int move;
|
||||||
|
public int action;
|
||||||
|
public string nextDevice;
|
||||||
|
public string containerType;
|
||||||
|
public string containerCode;
|
||||||
|
public string instructionCode;
|
||||||
|
public string lastInstructionCode;
|
||||||
|
public string lastContainerCode;
|
||||||
|
public string procedureCode;
|
||||||
|
public string deviceCode;
|
||||||
|
public bool? stopWorking;
|
||||||
|
public bool isEmpty;
|
||||||
|
public string isFull;
|
||||||
|
public string skuCode;
|
||||||
|
public int toCommand;
|
||||||
|
|
||||||
|
}
|
11
Assets/script/data/ConveyorData.cs.meta
Normal file
11
Assets/script/data/ConveyorData.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 427abe6841b604e4da5b05ef8d7cac13
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
19
Assets/script/data/DeviceData.cs
Normal file
19
Assets/script/data/DeviceData.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class DeviceData
|
||||||
|
{
|
||||||
|
public string deviceCode { get; set; }
|
||||||
|
public string deviceName { get; set; }
|
||||||
|
public string deviceType { get; set; }
|
||||||
|
public Boolean isOnline { get; set; }
|
||||||
|
public Boolean hasError { get; set; }
|
||||||
|
public Boolean isWorking { get; set; }
|
||||||
|
public Boolean hasGoods { get; set; }
|
||||||
|
public string errorMessage { get; set; }
|
||||||
|
public string driverCode { get; set; }
|
||||||
|
public string driverName { get; set; }
|
||||||
|
public object extra { get; set; }
|
||||||
|
}
|
11
Assets/script/data/DeviceData.cs.meta
Normal file
11
Assets/script/data/DeviceData.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cd43a2c2f803f10448f853dd13ff0596
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
13
Assets/script/data/KeyValueObject.cs
Normal file
13
Assets/script/data/KeyValueObject.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class KeyValueObject
|
||||||
|
{
|
||||||
|
public string label;
|
||||||
|
public object value;
|
||||||
|
|
||||||
|
public KeyValueObject(string label, object value)
|
||||||
|
{
|
||||||
|
this.label = label;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/data/KeyValueObject.cs.meta
Normal file
11
Assets/script/data/KeyValueObject.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8be9716288a487144a5252e4e0483b56
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
54
Assets/script/data/StackerData.cs
Normal file
54
Assets/script/data/StackerData.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class StackerData
|
||||||
|
{
|
||||||
|
public string frontContainerCode;
|
||||||
|
public string frontInstructionCode;
|
||||||
|
//public string frontFrom;
|
||||||
|
//public bool? frontStatus;
|
||||||
|
public string frontStatusDescription;
|
||||||
|
//public string backContainerCode;
|
||||||
|
//public string backInstructionCode;
|
||||||
|
//public string backTo;
|
||||||
|
//public string backStatusDescription;
|
||||||
|
public int roadway;
|
||||||
|
public int frontRow;
|
||||||
|
public int frontColumn;
|
||||||
|
public int frontLayer;
|
||||||
|
public int special1;
|
||||||
|
public StackerForkActionEnum frontForkAction;
|
||||||
|
public string frontForkActionDescription;
|
||||||
|
public StackerForkCargoEnum frontForkCargo;
|
||||||
|
//public int backRow;
|
||||||
|
//public int backColumn;
|
||||||
|
//public int backLayer;
|
||||||
|
//public StackerForkActionEnum backForkAction;
|
||||||
|
//public string backForkActionDescription;
|
||||||
|
//public string taskType;
|
||||||
|
//public string taskTypeDescription;
|
||||||
|
public Boolean frontForkHasGoods;
|
||||||
|
//public bool? backForkHasGoods;
|
||||||
|
public string strategyCode;
|
||||||
|
public string strategyName;
|
||||||
|
//public string stageTrackLength;
|
||||||
|
//public string realTrackLength;
|
||||||
|
//public string moveDirection;
|
||||||
|
public int toRow;
|
||||||
|
public int toColumn;
|
||||||
|
public int toLayer;
|
||||||
|
public int toCommand;
|
||||||
|
public string toCommandDescription;
|
||||||
|
public bool? stopWorking;
|
||||||
|
public bool? frontContainerIsFull;
|
||||||
|
public bool? backContainerIsFull;
|
||||||
|
//public string futureFlow;
|
||||||
|
//public string pastFlow;
|
||||||
|
//public string moveLocation;
|
||||||
|
//public string moveLocationFromLocation;
|
||||||
|
//public string moveLocationToLocation;
|
||||||
|
//public string moveLocationContainer;
|
||||||
|
//public string moveLocationInstructionCode;
|
||||||
|
|
||||||
|
}
|
11
Assets/script/data/StackerData.cs.meta
Normal file
11
Assets/script/data/StackerData.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: af412422405635441a65c4c24379d1b3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
12
Assets/script/data/StorageRequestEntity.cs
Normal file
12
Assets/script/data/StorageRequestEntity.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class StorageRequestEntity
|
||||||
|
{
|
||||||
|
public string systemCode = "DT";
|
||||||
|
public string houseCode = "DT";
|
||||||
|
public bool excludeEmptyLoc = false;
|
||||||
|
public List<string> rows = new();
|
||||||
|
}
|
11
Assets/script/data/StorageRequestEntity.cs.meta
Normal file
11
Assets/script/data/StorageRequestEntity.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f9fa5055e0250c747acc171e54b33683
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
19
Assets/script/data/StorageRespones.cs
Normal file
19
Assets/script/data/StorageRespones.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
[System.Serializable]
|
||||||
|
public class StorageResponseData
|
||||||
|
{
|
||||||
|
public string containerCode;
|
||||||
|
public string skuCode;
|
||||||
|
public string containerType;
|
||||||
|
public string lot;
|
||||||
|
public string procedureCode;
|
||||||
|
public string channelType;
|
||||||
|
public bool isEmpty;
|
||||||
|
public string locationCode;
|
||||||
|
public bool isTool;
|
||||||
|
public int row;
|
||||||
|
public int column;
|
||||||
|
public int layer;
|
||||||
|
}
|
11
Assets/script/data/StorageRespones.cs.meta
Normal file
11
Assets/script/data/StorageRespones.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d29b14cd6d8f9cf4baf19a711bda9655
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/script/device.meta
Normal file
8
Assets/script/device.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4778982b1a4bb054594f41fb17c62e65
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
239
Assets/script/device/AGVTimeline.playable
Normal file
239
Assets/script/device/AGVTimeline.playable
Normal file
@ -0,0 +1,239 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!74 &-6240113443753101189
|
||||||
|
AnimationClip:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Recorded
|
||||||
|
serializedVersion: 7
|
||||||
|
m_Legacy: 0
|
||||||
|
m_Compressed: 0
|
||||||
|
m_UseHighQualityCurve: 1
|
||||||
|
m_RotationCurves: []
|
||||||
|
m_CompressedRotationCurves: []
|
||||||
|
m_EulerCurves: []
|
||||||
|
m_PositionCurves:
|
||||||
|
- curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: {x: 0, y: -0.026630457, z: 0}
|
||||||
|
inSlope: {x: 0, y: 0, z: 0}
|
||||||
|
outSlope: {x: 0, y: 0, z: 0}
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 2
|
||||||
|
value: {x: 0, y: 0.071469545, z: 0}
|
||||||
|
inSlope: {x: 0, y: 0, z: 0}
|
||||||
|
outSlope: {x: 0, y: 0, z: 0}
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
path:
|
||||||
|
m_ScaleCurves: []
|
||||||
|
m_FloatCurves: []
|
||||||
|
m_PPtrCurves: []
|
||||||
|
m_SampleRate: 60
|
||||||
|
m_WrapMode: 0
|
||||||
|
m_Bounds:
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
m_Extent: {x: 0, y: 0, z: 0}
|
||||||
|
m_ClipBindingConstant:
|
||||||
|
genericBindings:
|
||||||
|
- serializedVersion: 2
|
||||||
|
path: 0
|
||||||
|
attribute: 1
|
||||||
|
script: {fileID: 0}
|
||||||
|
typeID: 4
|
||||||
|
customType: 0
|
||||||
|
isPPtrCurve: 0
|
||||||
|
isIntCurve: 0
|
||||||
|
isSerializeReferenceCurve: 0
|
||||||
|
pptrCurveMapping: []
|
||||||
|
m_AnimationClipSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||||
|
m_AdditiveReferencePoseTime: 0
|
||||||
|
m_StartTime: 0
|
||||||
|
m_StopTime: 2
|
||||||
|
m_OrientationOffsetY: 0
|
||||||
|
m_Level: 0
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_HasAdditiveReferencePose: 0
|
||||||
|
m_LoopTime: 0
|
||||||
|
m_LoopBlend: 0
|
||||||
|
m_LoopBlendOrientation: 0
|
||||||
|
m_LoopBlendPositionY: 0
|
||||||
|
m_LoopBlendPositionXZ: 0
|
||||||
|
m_KeepOriginalOrientation: 0
|
||||||
|
m_KeepOriginalPositionY: 1
|
||||||
|
m_KeepOriginalPositionXZ: 0
|
||||||
|
m_HeightFromFeet: 0
|
||||||
|
m_Mirror: 0
|
||||||
|
m_EditorCurves:
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 2
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.x
|
||||||
|
path:
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: -0.026630457
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 2
|
||||||
|
value: 0.071469545
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.y
|
||||||
|
path:
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 2
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.z
|
||||||
|
path:
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
m_EulerEditorCurves: []
|
||||||
|
m_HasGenericRootTransform: 1
|
||||||
|
m_HasMotionFloatCurves: 0
|
||||||
|
m_Events: []
|
||||||
|
--- !u!114 &-3286729104064144605
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
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: d21dcc2386d650c4597f3633c75a1f98, type: 3}
|
||||||
|
m_Name: Animation Track
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Version: 3
|
||||||
|
m_AnimClip: {fileID: 0}
|
||||||
|
m_Locked: 0
|
||||||
|
m_Muted: 0
|
||||||
|
m_CustomPlayableFullTypename:
|
||||||
|
m_Curves: {fileID: 0}
|
||||||
|
m_Parent: {fileID: 11400000}
|
||||||
|
m_Children: []
|
||||||
|
m_Clips: []
|
||||||
|
m_Markers:
|
||||||
|
m_Objects: []
|
||||||
|
m_InfiniteClipPreExtrapolation: 1
|
||||||
|
m_InfiniteClipPostExtrapolation: 1
|
||||||
|
m_InfiniteClipOffsetPosition: {x: -7.4328966, y: 0.055430457, z: -6.7326818}
|
||||||
|
m_InfiniteClipOffsetEulerAngles: {x: 0, y: 270, z: 0}
|
||||||
|
m_InfiniteClipTimeOffset: 0
|
||||||
|
m_InfiniteClipRemoveOffset: 0
|
||||||
|
m_InfiniteClipApplyFootIK: 1
|
||||||
|
mInfiniteClipLoop: 0
|
||||||
|
m_MatchTargetFields: 63
|
||||||
|
m_Position: {x: 0, y: 0, z: 0}
|
||||||
|
m_EulerAngles: {x: 0, y: 0, z: 0}
|
||||||
|
m_AvatarMask: {fileID: 0}
|
||||||
|
m_ApplyAvatarMask: 1
|
||||||
|
m_TrackOffset: 0
|
||||||
|
m_InfiniteClip: {fileID: -6240113443753101189}
|
||||||
|
m_OpenClipOffsetRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_Rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_ApplyOffsets: 0
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: bfda56da833e2384a9677cd3c976a436, type: 3}
|
||||||
|
m_Name: AGVTimeline
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Version: 0
|
||||||
|
m_Tracks:
|
||||||
|
- {fileID: -3286729104064144605}
|
||||||
|
m_FixedDuration: 0
|
||||||
|
m_EditorSettings:
|
||||||
|
m_Framerate: 60
|
||||||
|
m_ScenePreview: 1
|
||||||
|
m_DurationMode: 0
|
||||||
|
m_MarkerTrack: {fileID: 0}
|
8
Assets/script/device/AGVTimeline.playable.meta
Normal file
8
Assets/script/device/AGVTimeline.playable.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4ad0394721849a54a8c435c19fa1f86d
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
56
Assets/script/device/AbstractDevice.cs
Normal file
56
Assets/script/device/AbstractDevice.cs
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
using Cinemachine;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 抽象的设备类
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public abstract class AbstractDevice : MonoBehaviour, IWcsSocketDataHandle, IFollowHelp, IProcessCompleted, IMouseClick
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
protected EventCompent eventCompent;
|
||||||
|
[Autowired]
|
||||||
|
protected CameraManage cameraManage;
|
||||||
|
[Header("镜头跟随")]
|
||||||
|
public Transform follow;
|
||||||
|
[Header("镜头看向")]
|
||||||
|
public Transform lookAt;
|
||||||
|
[Header("镜头偏移")]
|
||||||
|
public Vector3 offset;
|
||||||
|
|
||||||
|
public event IDevice.DataChangeEvent DataChange;
|
||||||
|
public event IDevice.DataChangeEvent ErrorMessage;
|
||||||
|
|
||||||
|
public abstract Transform Transform { get; }
|
||||||
|
public abstract string DeviceType { get; }
|
||||||
|
public abstract string DeviceCode { get; }
|
||||||
|
|
||||||
|
Transform IFollowHelp.Follow => follow;
|
||||||
|
|
||||||
|
Transform IFollowHelp.FookAt => lookAt;
|
||||||
|
|
||||||
|
public Vector3 Offset => offset;
|
||||||
|
|
||||||
|
public abstract DeviceData DeviceData { get; }
|
||||||
|
|
||||||
|
public virtual void MouseSingleClick()
|
||||||
|
{
|
||||||
|
if (follow && lookAt)
|
||||||
|
{
|
||||||
|
cameraManage.ShotCut(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public virtual void MouseDoubleClick()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void ProcessCompleted();
|
||||||
|
public virtual void DataHandle(object data, object other = null)
|
||||||
|
{
|
||||||
|
DataChange?.Invoke(data,other);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract T DynamicData<T>();
|
||||||
|
}
|
11
Assets/script/device/AbstractDevice.cs.meta
Normal file
11
Assets/script/device/AbstractDevice.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a892659c6e01b87458fff917608d43ec
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
74
Assets/script/device/DeviceParseService.cs
Normal file
74
Assets/script/device/DeviceParseService.cs
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
using EasyInject.Attributes;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 设备解析服务
|
||||||
|
/// </summary>
|
||||||
|
[Component("DeviceParseService")]
|
||||||
|
public class DeviceParseService
|
||||||
|
{
|
||||||
|
[Autowired("LocationStorageManage")]
|
||||||
|
private LocationStorageManage storageManage;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据设备号解析所在场景坐标
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="device"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="System.Exception"></exception>
|
||||||
|
public Vector3 PositionByDevice(string device)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(device))
|
||||||
|
{
|
||||||
|
throw new System.Exception("解析设备坐标异常,设备号未传递");
|
||||||
|
}
|
||||||
|
//带横杠就是库位
|
||||||
|
|
||||||
|
if(device.Contains("-"))
|
||||||
|
{
|
||||||
|
if(storageManage == null)
|
||||||
|
{
|
||||||
|
storageManage = ApplicationBoot.Instance.GetBean<LocationStorageManage>();
|
||||||
|
}
|
||||||
|
GameObject storage = storageManage.storages.Find(v => v.name == device);
|
||||||
|
if (storage != null)
|
||||||
|
{
|
||||||
|
return storage.transform.position;
|
||||||
|
}
|
||||||
|
throw new System.Exception("解析设备坐标异常,场景不存在该设备 :"+device);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<IDevice> list = ApplicationBoot.Instance.GetBeans<IDevice>();
|
||||||
|
IDevice currentDevice = list.Find(v => v.DeviceCode == device);
|
||||||
|
if (currentDevice != null)
|
||||||
|
{
|
||||||
|
return currentDevice.Transform.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new System.Exception("解析设备坐标异常");
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 根据设备名在场景搜索
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="device"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public GameObject GameObjectByDevice(string device)
|
||||||
|
{
|
||||||
|
//是库位
|
||||||
|
if(device.Contains("-"))
|
||||||
|
{
|
||||||
|
GameObject obj = storageManage.storages.Find(v => string.Equals(device, v.name));
|
||||||
|
if (obj != null)
|
||||||
|
{
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ConveyorDevice conveyor = ApplicationBoot.Instance.GetBean<ConveyorDevice>(device);
|
||||||
|
return conveyor.Position;
|
||||||
|
}
|
||||||
|
throw new Exception(string.Format("未在找到设备【{0}】", device));
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/device/DeviceParseService.cs.meta
Normal file
11
Assets/script/device/DeviceParseService.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 18d9c1dbbfeeddd4eaad89973dbc5b56
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
17
Assets/script/device/DeviceStatus.cs
Normal file
17
Assets/script/device/DeviceStatus.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
using UnityEngine.Playables;
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class DeviceStatus
|
||||||
|
{
|
||||||
|
public SerializationVector posistion;
|
||||||
|
public SerializationVector roation;
|
||||||
|
public SerializationVector scale;
|
||||||
|
public string deviceCode;
|
||||||
|
public double animationTime;
|
||||||
|
public double animationSpeed;
|
||||||
|
public PlayState playState;
|
||||||
|
public int modelId;
|
||||||
|
|
||||||
|
}
|
11
Assets/script/device/DeviceStatus.cs.meta
Normal file
11
Assets/script/device/DeviceStatus.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a3919649d16133d4bb17b64d20280ae0
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
38
Assets/script/device/ICar.cs
Normal file
38
Assets/script/device/ICar.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 小车接口
|
||||||
|
/// </summary>
|
||||||
|
public interface ICar : IDevice
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 所属区域
|
||||||
|
/// </summary>
|
||||||
|
string Region { get;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 有正在执行的任务
|
||||||
|
/// </summary>
|
||||||
|
bool hasTask { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 下发任务给小车
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="taskData"></param>
|
||||||
|
void SendTask(AgvTaskData taskData);
|
||||||
|
/// <summary>
|
||||||
|
/// 可用巷道
|
||||||
|
/// </summary>
|
||||||
|
List<string> AllowRows { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 已初始化
|
||||||
|
/// </summary>
|
||||||
|
bool Initialize { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化触发
|
||||||
|
/// </summary>
|
||||||
|
void OnInit();
|
||||||
|
|
||||||
|
float Speed { get; set; }
|
||||||
|
}
|
11
Assets/script/device/ICar.cs.meta
Normal file
11
Assets/script/device/ICar.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6bf42f74850f0664a9ce1894be4e4379
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
46
Assets/script/device/IDevice.cs
Normal file
46
Assets/script/device/IDevice.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 设备基本属性
|
||||||
|
/// </summary>
|
||||||
|
public interface IDevice
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 位置信息
|
||||||
|
/// </summary>
|
||||||
|
Transform Transform { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 当前设备数据
|
||||||
|
/// </summary>
|
||||||
|
DeviceData DeviceData { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// 实时交互数据
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <returns></returns>
|
||||||
|
T DynamicData<T>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备代码
|
||||||
|
/// </summary>
|
||||||
|
string DeviceCode{ get; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备类型
|
||||||
|
/// </summary>
|
||||||
|
string DeviceType { get; }
|
||||||
|
|
||||||
|
delegate void DataChangeEvent(object data,object other);
|
||||||
|
|
||||||
|
delegate void ErrorMessageEvent(object data);
|
||||||
|
/// <summary>
|
||||||
|
/// 数据变化监听
|
||||||
|
/// </summary>
|
||||||
|
event DataChangeEvent DataChange;
|
||||||
|
/// <summary>
|
||||||
|
/// 异常信息监听
|
||||||
|
/// </summary>
|
||||||
|
event DataChangeEvent ErrorMessage;
|
||||||
|
|
||||||
|
}
|
11
Assets/script/device/IDevice.cs.meta
Normal file
11
Assets/script/device/IDevice.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d6b43c871575ef44091aee32c4a8e91d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/script/device/agv.meta
Normal file
8
Assets/script/device/agv.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a6a17d44ebe06924285e498ab3d69a96
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
200
Assets/script/device/agv/AgvCarManage.cs
Normal file
200
Assets/script/device/agv/AgvCarManage.cs
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
using BestHTTP;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// AGV 小车管理
|
||||||
|
/// </summary>
|
||||||
|
[GameObjectBean]
|
||||||
|
public class AgvCarManage : MonoBehaviour,IApplcationShutdown
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// agv小车来源
|
||||||
|
/// </summary>
|
||||||
|
private List<ICar> source;
|
||||||
|
/// <summary>
|
||||||
|
/// agv任务列表
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
private List<AgvTaskData> tasks;
|
||||||
|
[Autowired]
|
||||||
|
NetWorkComponent netWorkComponent;
|
||||||
|
|
||||||
|
private Coroutine coroutine;
|
||||||
|
[SerializeField]
|
||||||
|
private bool initialize;
|
||||||
|
|
||||||
|
public enum CarTaskStatusEnum
|
||||||
|
{
|
||||||
|
//待机
|
||||||
|
STANDBY = 0,
|
||||||
|
//取货中
|
||||||
|
TAKING = 1,
|
||||||
|
//申请取货
|
||||||
|
APPLY_TAKE = 2,
|
||||||
|
//取货完成
|
||||||
|
TAKE_FINISHED = 3,
|
||||||
|
//放货中
|
||||||
|
PUTTING = 4,
|
||||||
|
//申请放货
|
||||||
|
APPLY_PUT = 5,
|
||||||
|
//放货完成
|
||||||
|
PUT_FINISHED = 6,
|
||||||
|
//任务异常完成
|
||||||
|
ERORR_FINNSHED = 7,
|
||||||
|
//异常
|
||||||
|
EXCEPTION = 8,
|
||||||
|
//作废
|
||||||
|
DERRECATE = 9,
|
||||||
|
SENT = 10,
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
coroutine = StartCoroutine(LoadAgvTask());
|
||||||
|
source = ApplicationBoot.Instance.GetBeans<ICar>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnInit()
|
||||||
|
{
|
||||||
|
foreach (ICar car in source)
|
||||||
|
{
|
||||||
|
car?.OnInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
initialize = true;
|
||||||
|
}
|
||||||
|
private void FixedUpdate()
|
||||||
|
{
|
||||||
|
if (!initialize)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//排序
|
||||||
|
//tasks.Sort((a, b) =>
|
||||||
|
//{
|
||||||
|
// if(a.fromLocation.Contains("-") && b.fromLocation.Contains("-"))
|
||||||
|
// {
|
||||||
|
// string[] aStr = a.fromLocation.Split("-");
|
||||||
|
// string[] bStr = b.fromLocation.Split("-");
|
||||||
|
|
||||||
|
// if (int.Parse(aStr[0]) > int.Parse(bStr[0]))
|
||||||
|
// {
|
||||||
|
// return 1;
|
||||||
|
// }
|
||||||
|
// if (int.Parse(aStr[1]) > int.Parse(bStr[1]))
|
||||||
|
// {
|
||||||
|
// return 1;
|
||||||
|
// }
|
||||||
|
// return -1;
|
||||||
|
// }
|
||||||
|
// return 0;
|
||||||
|
//});
|
||||||
|
//分配小车去消费任务
|
||||||
|
|
||||||
|
foreach (AgvTaskData data in tasks)
|
||||||
|
{
|
||||||
|
ICar car = source.Find(v => (v.AllowRows.Contains(data.fromDevice)) && !v.hasTask && v.Initialize);
|
||||||
|
if (car != null)
|
||||||
|
{
|
||||||
|
//下发任务给小车
|
||||||
|
car.SendTask(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 每秒加载后台AGV任务列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public IEnumerator LoadAgvTask()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
|
||||||
|
yield return new WaitForSecondsRealtime(1f);
|
||||||
|
|
||||||
|
netWorkComponent.RemoteGetAgvTaskListData(OnTaskList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 接受响应数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="originalRequest"></param>
|
||||||
|
/// <param name="response"></param>
|
||||||
|
private void OnTaskList(HTTPRequest originalRequest, HTTPResponse response)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(response == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (response.IsSuccess)
|
||||||
|
{
|
||||||
|
JObject resultData = JObject.Parse(response.DataAsText);
|
||||||
|
string json = resultData["object"].ToString();
|
||||||
|
if (!string.IsNullOrEmpty(json))
|
||||||
|
{
|
||||||
|
List<AgvTaskData> agvTasks = JsonConvert.DeserializeObject<List<AgvTaskData>>(json);
|
||||||
|
agvTasks.Sort((a, b) =>
|
||||||
|
{
|
||||||
|
if (a.fromLocation.Contains("-") && b.fromLocation.Contains("-"))
|
||||||
|
{
|
||||||
|
string[] aStr = a.fromLocation.Split("-");
|
||||||
|
string[] bStr = b.fromLocation.Split("-");
|
||||||
|
|
||||||
|
if (int.Parse(aStr[0]) > int.Parse(bStr[0]))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (int.Parse(aStr[1]) > int.Parse(bStr[1]))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
tasks = agvTasks;
|
||||||
|
if (!initialize)
|
||||||
|
{
|
||||||
|
OnInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 存在当前任务
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="task"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool Contains(AgvTaskData task)
|
||||||
|
{
|
||||||
|
return tasks.Find(v => task.instructionCode == v.instructionCode && task.instructionId == v.instructionId) != null;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 根据指令号获取任务
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instructionCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public AgvTaskData GetTaskByCode(long instructionCode)
|
||||||
|
{
|
||||||
|
return tasks.Find(v => instructionCode == v.instructionCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Shutdown()
|
||||||
|
{
|
||||||
|
Debug.Log("释放AGV任务协程");
|
||||||
|
StopCoroutine(coroutine);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
11
Assets/script/device/agv/AgvCarManage.cs.meta
Normal file
11
Assets/script/device/agv/AgvCarManage.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 466fde5bc2211024d81c7ae88e5a7835
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
14
Assets/script/device/agv/AgvForkSignal.signal
Normal file
14
Assets/script/device/agv/AgvForkSignal.signal
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: d6fa2d92fc1b3f34da284357edf89c3b, type: 3}
|
||||||
|
m_Name: AgvForkSignal
|
||||||
|
m_EditorClassIdentifier:
|
8
Assets/script/device/agv/AgvForkSignal.signal.meta
Normal file
8
Assets/script/device/agv/AgvForkSignal.signal.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7330af05866dfbe45bcdb17cbc55eeba
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
904
Assets/script/device/agv/ForkAgvDevice.cs
Normal file
904
Assets/script/device/agv/ForkAgvDevice.cs
Normal file
@ -0,0 +1,904 @@
|
|||||||
|
using AssetBundleBrowser.AssetBundleModel;
|
||||||
|
using BestHTTP;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Unity.VisualScripting;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.AI;
|
||||||
|
using UnityEngine.Playables;
|
||||||
|
using static UnityEditor.FilePathAttribute;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
/// <summary>
|
||||||
|
/// 叉车AGV
|
||||||
|
/// </summary>
|
||||||
|
[GameObjectBean(ENameType.GameObjectName)]
|
||||||
|
public class ForkAgvDevice : AbstractDevice, ICar
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
private AgvPopUI agvPopUI;
|
||||||
|
/// <summary>
|
||||||
|
/// 设备位置解析服务
|
||||||
|
/// </summary>
|
||||||
|
[Autowired("DeviceParseService")]
|
||||||
|
private readonly DeviceParseService deviceParseService;
|
||||||
|
/// <summary>
|
||||||
|
/// 提供网络服务
|
||||||
|
/// </summary>
|
||||||
|
[Autowired]
|
||||||
|
private readonly NetWorkComponent netWorkComponent;
|
||||||
|
/// <summary>
|
||||||
|
/// 车辆管理服务
|
||||||
|
/// </summary>
|
||||||
|
[Autowired]
|
||||||
|
private readonly AgvCarManage carManage;
|
||||||
|
|
||||||
|
[Autowired]
|
||||||
|
private ContainersManage containersManage;
|
||||||
|
/// <summary>
|
||||||
|
/// 路线高亮服务
|
||||||
|
/// </summary>
|
||||||
|
private LineRenderer lineRenderer;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private bool initialize = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float _speed;
|
||||||
|
[Header("货叉")]
|
||||||
|
[SerializeField]
|
||||||
|
private GameObject forkCargo;
|
||||||
|
[Header("申请取货位置")]
|
||||||
|
[SerializeField]
|
||||||
|
private List<GameObject> applyTakePosition = new();
|
||||||
|
[Header("申请放货位置")]
|
||||||
|
[SerializeField]
|
||||||
|
private List<GameObject> applyPutPosition = new();
|
||||||
|
[Header("目标是设备角度设置")]
|
||||||
|
[SerializeField]
|
||||||
|
private List<ForkAgvRotationSet> forkAgvRotationSets = new();
|
||||||
|
[Header("目标是库位角度设置")]
|
||||||
|
[SerializeField]
|
||||||
|
public float shelfRotation = -90;
|
||||||
|
public string CarName => name;
|
||||||
|
[Header("可用巷道")]
|
||||||
|
public List<string> _allowRows = new List<string>();
|
||||||
|
[SerializeField]
|
||||||
|
private bool _hasTask;
|
||||||
|
[SerializeField]
|
||||||
|
private string _region;
|
||||||
|
[Header("路线颜色")]
|
||||||
|
[SerializeField]
|
||||||
|
private Color pathColor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 代理组件
|
||||||
|
/// </summary>
|
||||||
|
private NavMeshAgent agent;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 时间轴组件
|
||||||
|
/// </summary>
|
||||||
|
private PlayableDirector playable;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前agv任务
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
private AgvTaskData taskData;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前反馈状态
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
private AgvCarManage.CarTaskStatusEnum currentFeedBackStatus;
|
||||||
|
|
||||||
|
private List<string> paths = new List<string>();
|
||||||
|
|
||||||
|
public bool hasTask => _hasTask;
|
||||||
|
|
||||||
|
public string Region => _region;
|
||||||
|
|
||||||
|
public List<string> AllowRows => _allowRows;
|
||||||
|
|
||||||
|
public override Transform Transform => transform;
|
||||||
|
|
||||||
|
public override string DeviceCode => name;
|
||||||
|
|
||||||
|
public override string DeviceType => "AGV";
|
||||||
|
|
||||||
|
public bool Initialize => initialize;
|
||||||
|
|
||||||
|
public bool HasGood{ get{ return forkCargo.GetComponentInChildren<Container>() != null;} }
|
||||||
|
|
||||||
|
float ICar.Speed { get => _speed; set { agent.speed = value; _speed = value; } }
|
||||||
|
|
||||||
|
public override DeviceData DeviceData => throw new NotImplementedException();
|
||||||
|
|
||||||
|
private AgvData _data = new();
|
||||||
|
private bool isOpenPop;
|
||||||
|
[Header("模拟反馈")]
|
||||||
|
[SerializeField]
|
||||||
|
private bool debugFeedBack;
|
||||||
|
//保存当前动画状态
|
||||||
|
public double animationTime;
|
||||||
|
public double animationSpeed;
|
||||||
|
public PlayState playState;
|
||||||
|
public Boolean agentIsStoping;
|
||||||
|
public Boolean agentRotationUpdate;
|
||||||
|
public Vector3 agentTarget;
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class ForkAgvRotationSet
|
||||||
|
{
|
||||||
|
//设备
|
||||||
|
public List<GameObject> device;
|
||||||
|
//非库位取或放,agv保持的角度
|
||||||
|
public float deviceRotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
agent = GetComponent<NavMeshAgent>();
|
||||||
|
agent.speed = _speed;
|
||||||
|
playable = GetComponent<PlayableDirector>();
|
||||||
|
playable.Pause();
|
||||||
|
lineRenderer = transform.GetOrAddComponent<LineRenderer>();
|
||||||
|
|
||||||
|
lineRenderer.positionCount = 0;
|
||||||
|
lineRenderer.startColor = pathColor;
|
||||||
|
lineRenderer.endColor = pathColor;
|
||||||
|
_data.deviecCode = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void FixedUpdate()
|
||||||
|
{
|
||||||
|
//设备没初始化
|
||||||
|
if (!initialize)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasTask)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UpdateTask();
|
||||||
|
//当任务状态是下发状态是,执行
|
||||||
|
if (taskData.agvTaskStatus == AgvCarManage.CarTaskStatusEnum.SENT)
|
||||||
|
{
|
||||||
|
if (currentFeedBackStatus != AgvCarManage.CarTaskStatusEnum.TAKING)
|
||||||
|
{
|
||||||
|
currentFeedBackStatus = AgvCarManage.CarTaskStatusEnum.TAKING;
|
||||||
|
}
|
||||||
|
//多次申请
|
||||||
|
FeedBackTaskStatus(currentFeedBackStatus);
|
||||||
|
}
|
||||||
|
//取货中
|
||||||
|
if (taskData.agvTaskStatus == AgvCarManage.CarTaskStatusEnum.TAKING)
|
||||||
|
{
|
||||||
|
agent.isStopped = false;
|
||||||
|
//开始代理
|
||||||
|
StartAgent(taskData.fromLocation);
|
||||||
|
// 起点旋转位置
|
||||||
|
if (applyTakePosition.Count > 0)
|
||||||
|
{
|
||||||
|
Vector3 applyTakeVector = LastPosition(applyTakePosition,taskData.fromLocation);
|
||||||
|
//抵达后,申请取货流程
|
||||||
|
Vector3 targetPosition = new Vector3(applyTakeVector.x, transform.position.y, applyTakeVector.z);
|
||||||
|
if (Vector3.Distance(transform.position, targetPosition) <= 0.1f)
|
||||||
|
{
|
||||||
|
agent.isStopped = true;
|
||||||
|
agent.updateRotation = false;
|
||||||
|
currentFeedBackStatus = AgvCarManage.CarTaskStatusEnum.APPLY_TAKE;
|
||||||
|
FeedBackTaskStatus(currentFeedBackStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//申请取货
|
||||||
|
if (taskData.agvTaskStatus == AgvCarManage.CarTaskStatusEnum.APPLY_TAKE)
|
||||||
|
{
|
||||||
|
//抵达终点
|
||||||
|
if (Vector3.Distance(transform.position, agent.destination) <= 0.1f)
|
||||||
|
{
|
||||||
|
//获取库位容器模型,绑定到货叉上
|
||||||
|
GameObject game = deviceParseService.GameObjectByDevice(taskData.fromLocation);
|
||||||
|
if (game != null)
|
||||||
|
{
|
||||||
|
Container container = game.GetComponentInChildren<Container>();
|
||||||
|
if (container != null)
|
||||||
|
{
|
||||||
|
container.transform.parent = forkCargo.transform;
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//反馈取货完成
|
||||||
|
currentFeedBackStatus = AgvCarManage.CarTaskStatusEnum.TAKE_FINISHED;
|
||||||
|
FeedBackTaskStatus(currentFeedBackStatus);
|
||||||
|
}
|
||||||
|
Quaternion targetRotation = RotationByDevice(taskData.fromDevice);
|
||||||
|
if (transform.localRotation == targetRotation)
|
||||||
|
{
|
||||||
|
//校验起点是设备,需要提升货叉到高位
|
||||||
|
if (!IsShelf(taskData.fromLocation))
|
||||||
|
{
|
||||||
|
if(playable.time <= 1.3)
|
||||||
|
{
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playable.Pause();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(playable.state == PlayState.Paused)
|
||||||
|
{
|
||||||
|
agent.isStopped = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
transform.localRotation = Quaternion.RotateTowards(transform.localRotation, targetRotation, _speed * 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//取货完成
|
||||||
|
if (taskData.agvTaskStatus == AgvCarManage.CarTaskStatusEnum.TAKE_FINISHED)
|
||||||
|
{
|
||||||
|
if (HasGood)
|
||||||
|
{
|
||||||
|
//是库位取货方式
|
||||||
|
if (IsShelf(taskData.fromDevice))
|
||||||
|
{
|
||||||
|
if (playable.time >= 0.4)
|
||||||
|
{
|
||||||
|
OnMinFPS();
|
||||||
|
}
|
||||||
|
if (playable.state == PlayState.Paused)
|
||||||
|
{
|
||||||
|
agent.updateRotation = true;
|
||||||
|
currentFeedBackStatus = AgvCarManage.CarTaskStatusEnum.PUTTING;
|
||||||
|
FeedBackTaskStatus(currentFeedBackStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//接驳点取货方式
|
||||||
|
//需要回退到指定位置做货叉下降动作
|
||||||
|
Vector3 target = LastPosition(applyTakePosition, taskData.fromDevice);
|
||||||
|
agent.isStopped = false;
|
||||||
|
//开始代理
|
||||||
|
StartAgent(target);
|
||||||
|
Vector3 targetPosition = new Vector3(target.x, transform.position.y, target.z);
|
||||||
|
//到位后,开始下降货叉
|
||||||
|
if (Vector3.Distance(transform.position, targetPosition) <= 0.1f)
|
||||||
|
{
|
||||||
|
if (playable.time >= 0.4)
|
||||||
|
{
|
||||||
|
playable.playableGraph.GetRootPlayable(0).SetSpeed(-1);
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playable.Pause();
|
||||||
|
agent.updateRotation = true;
|
||||||
|
currentFeedBackStatus = AgvCarManage.CarTaskStatusEnum.PUTTING;
|
||||||
|
FeedBackTaskStatus(currentFeedBackStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//货叉升到满叉才执行后续动作
|
||||||
|
if (playable.time < 1.99)
|
||||||
|
{
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameObject game = deviceParseService.GameObjectByDevice(taskData.fromLocation);
|
||||||
|
if (game != null)
|
||||||
|
{
|
||||||
|
Container container = game.GetComponentInChildren<Container>();
|
||||||
|
|
||||||
|
if (container != null)
|
||||||
|
{
|
||||||
|
container.Agent.enabled = false;
|
||||||
|
container.transform.parent = forkCargo.transform;
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//放货中
|
||||||
|
if (taskData.agvTaskStatus == AgvCarManage.CarTaskStatusEnum.PUTTING)
|
||||||
|
{
|
||||||
|
//未代理开始代理
|
||||||
|
StartAgent(taskData.toLocation);
|
||||||
|
|
||||||
|
// 起点旋转位置
|
||||||
|
if (applyPutPosition.Count > 0)
|
||||||
|
{
|
||||||
|
Vector3 applyPutVector = LastPosition(applyPutPosition, taskData.toLocation);
|
||||||
|
//抵达后,申请取货流程
|
||||||
|
Vector3 targetPosition = new Vector3(applyPutVector.x, transform.position.y, applyPutVector.z);
|
||||||
|
if (Vector3.Distance(transform.position, targetPosition) <= 0.1f)
|
||||||
|
{
|
||||||
|
agent.isStopped = true;
|
||||||
|
agent.updateRotation = false;
|
||||||
|
currentFeedBackStatus = AgvCarManage.CarTaskStatusEnum.APPLY_PUT;
|
||||||
|
FeedBackTaskStatus(currentFeedBackStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//申请放货
|
||||||
|
if (taskData.agvTaskStatus == AgvCarManage.CarTaskStatusEnum.APPLY_PUT && currentFeedBackStatus == AgvCarManage.CarTaskStatusEnum.APPLY_PUT)
|
||||||
|
{
|
||||||
|
//抵达终点
|
||||||
|
if (Vector3.Distance(transform.position, agent.destination) <= 0.1f)
|
||||||
|
{
|
||||||
|
currentFeedBackStatus = AgvCarManage.CarTaskStatusEnum.PUT_FINISHED;
|
||||||
|
|
||||||
|
}
|
||||||
|
Quaternion targetRotation = RotationByDevice(taskData.toDevice);
|
||||||
|
if (transform.localRotation == targetRotation)
|
||||||
|
{
|
||||||
|
//启用代理
|
||||||
|
agent.isStopped = false;
|
||||||
|
//如果是设备将货叉提升完
|
||||||
|
if(!IsShelf(taskData.toLocation))
|
||||||
|
{
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
transform.localRotation = Quaternion.RotateTowards(transform.localRotation, targetRotation, _speed * 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentFeedBackStatus == AgvCarManage.CarTaskStatusEnum.PUT_FINISHED)
|
||||||
|
{
|
||||||
|
if (HasGood)
|
||||||
|
{
|
||||||
|
//校验是库位还是设备
|
||||||
|
|
||||||
|
if(IsShelf(taskData.toLocation))
|
||||||
|
{
|
||||||
|
Debug.LogWarning("放货持续");
|
||||||
|
if (playable.time > 0)
|
||||||
|
{
|
||||||
|
playable.playableGraph.GetRootPlayable(0).SetSpeed(-1);
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//暂停播放
|
||||||
|
//playable.Pause();
|
||||||
|
////解绑容器
|
||||||
|
//Container container = forkCargo.transform.GetComponentInChildren<Container>();
|
||||||
|
//container.transform.parent = null;
|
||||||
|
OnMaxFPS();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (playable.time > 1.5f)
|
||||||
|
{
|
||||||
|
playable.playableGraph.GetRootPlayable(0).SetSpeed(-1);
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnMaxFPS();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!IsShelf(taskData.toLocation))
|
||||||
|
{
|
||||||
|
//当后退完成后最终下降完货叉,并重置agv状态
|
||||||
|
Vector3 position = LastPosition(applyPutPosition, taskData.toLocation);
|
||||||
|
Vector3 targetPosition = new Vector3(position.x, transform.position.y, position.z);
|
||||||
|
|
||||||
|
if (Vector3.Distance(transform.position, targetPosition) <= 0.1f)
|
||||||
|
{
|
||||||
|
if(playable.time > 0)
|
||||||
|
{
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playable.Pause();
|
||||||
|
FeedBackTaskStatus(currentFeedBackStatus);
|
||||||
|
Rest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Vector3 position = LastPosition(applyPutPosition, taskData.toLocation);
|
||||||
|
Vector3 targetPosition = new Vector3(position.x, transform.position.y, position.z);
|
||||||
|
if (Vector3.Distance(transform.position, targetPosition) <= 0.1f)
|
||||||
|
{
|
||||||
|
GameObject game = deviceParseService.GameObjectByDevice(taskData.toLocation);
|
||||||
|
Container container = containersManage.GetContainerByCode(taskData.containerCode);
|
||||||
|
container.transform.parent = game.transform;
|
||||||
|
container.transform.localPosition = new Vector3(0, -0.2472343f, 0.0006999969f);
|
||||||
|
container.Agent.enabled = true;
|
||||||
|
FeedBackTaskStatus(currentFeedBackStatus);
|
||||||
|
Rest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 重置设备状态
|
||||||
|
/// </summary>
|
||||||
|
public void Rest()
|
||||||
|
{
|
||||||
|
taskData = new AgvTaskData();
|
||||||
|
_hasTask = false;
|
||||||
|
paths.Clear();
|
||||||
|
currentFeedBackStatus =AgvCarManage.CarTaskStatusEnum.STANDBY;
|
||||||
|
agent.ResetPath();
|
||||||
|
agent.isStopped = false;
|
||||||
|
agent.updateRotation = true;
|
||||||
|
playable.playableGraph.GetRootPlayable(0).SetSpeed(1);
|
||||||
|
playable.time = 0;
|
||||||
|
playable.Pause();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 反馈任务状态
|
||||||
|
/// </summary>
|
||||||
|
public void FeedBackTaskStatus(AgvCarManage.CarTaskStatusEnum status,string feedBacklocation = "")
|
||||||
|
{
|
||||||
|
if(debugFeedBack)
|
||||||
|
{
|
||||||
|
taskData.agvTaskStatus = status;
|
||||||
|
}
|
||||||
|
FeedBackEntity feedBackDTO = new FeedBackEntity();
|
||||||
|
feedBackDTO.feedbackStatus = status.ToString();
|
||||||
|
feedBackDTO.feedbackLocation = feedBacklocation;
|
||||||
|
feedBackDTO.taskCode = taskData.instructionCode;
|
||||||
|
feedBackDTO.carId = taskData.carId;
|
||||||
|
netWorkComponent.RemoteFeedBackAgvTaskStatus(feedBackDTO, OnFeedBack);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 接受反馈回调信息
|
||||||
|
/// </summary>
|
||||||
|
private void OnFeedBack(HTTPRequest originalRequest, HTTPResponse response)
|
||||||
|
{
|
||||||
|
if(response == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//请求成功
|
||||||
|
if (response.IsSuccess)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//解析反馈
|
||||||
|
JObject result = JObject.Parse(response.DataAsText);
|
||||||
|
bool isSuccesss = bool.Parse(result["success"].ToString());
|
||||||
|
//后台处理反馈成功
|
||||||
|
if (isSuccesss)
|
||||||
|
{
|
||||||
|
//更新当前任务状态,懒更新
|
||||||
|
// taskData.agvTaskStatus = currentFeedBackStatus;
|
||||||
|
//agent.isStopped = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError(name + " 反馈 =" + response.DataAsText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void Reset()
|
||||||
|
{
|
||||||
|
taskData = null;
|
||||||
|
_hasTask = false;
|
||||||
|
agent.ResetPath();
|
||||||
|
}
|
||||||
|
public void SendTask(AgvTaskData taskData)
|
||||||
|
{
|
||||||
|
//if (!Initialize)
|
||||||
|
//{
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
this.taskData = taskData;
|
||||||
|
_hasTask = true;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 检查数据并初始化
|
||||||
|
/// </summary>
|
||||||
|
private void CheckValueAndInit(HTTPRequest originalRequest, HTTPResponse response)
|
||||||
|
{
|
||||||
|
|
||||||
|
//响应成功
|
||||||
|
if (response.IsSuccess)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
JObject result = JObject.Parse(response.DataAsText);
|
||||||
|
|
||||||
|
if (result["object"] == null)
|
||||||
|
{
|
||||||
|
Debug.LogWarning("检查数据并初始化" + $"{response.DataAsText}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
string json = result["object"].ToString();
|
||||||
|
CarStatusEntity statusEntity = JsonConvert.DeserializeObject<CarStatusEntity>(json);
|
||||||
|
if (statusEntity != null && statusEntity.task != null)
|
||||||
|
{
|
||||||
|
//任务存在的时候才运行初始位置
|
||||||
|
if (carManage.Contains(statusEntity.task))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
Debug.LogWarning(name + "agv 初始化赋值 =" + JsonConvert.SerializeObject(statusEntity.task));
|
||||||
|
//agv本体
|
||||||
|
this.SendTask(statusEntity.task);
|
||||||
|
this.transform.localPosition = statusEntity.posistion.ToVector();
|
||||||
|
this.transform.localRotation = statusEntity.roation.ToQuaternion();
|
||||||
|
this.transform.localScale = statusEntity.scale.ToVector();
|
||||||
|
this.currentFeedBackStatus = statusEntity.currentFeedBackStatus;
|
||||||
|
|
||||||
|
//货叉
|
||||||
|
if (statusEntity.cargoStatus != null)
|
||||||
|
{
|
||||||
|
//forkCargo.transform.localPosition = statusEntity.cargoStatus.posistion.ToVector();
|
||||||
|
//forkCargo.transform.localRotation = statusEntity.cargoStatus.roation.ToQuaternion();
|
||||||
|
//forkCargo.transform.localScale = statusEntity.cargoStatus.scale.ToVector();
|
||||||
|
playable.time = statusEntity.cargoStatus.animationTime;
|
||||||
|
if (statusEntity.cargoStatus.playState == PlayState.Playing)
|
||||||
|
{
|
||||||
|
playable.Play();
|
||||||
|
}
|
||||||
|
if (statusEntity.cargoStatus.playState == PlayState.Paused)
|
||||||
|
{
|
||||||
|
playable.Pause();
|
||||||
|
}
|
||||||
|
playable.RebuildGraph();
|
||||||
|
playable.playableGraph.GetRootPlayable(0).SetSpeed(statusEntity.cargoStatus.animationSpeed);
|
||||||
|
}
|
||||||
|
//容器
|
||||||
|
if (statusEntity.containerStatus != null)
|
||||||
|
{
|
||||||
|
Container container = ApplicationBoot.Instance.GetBean<Container>(statusEntity.containerStatus.deviceCode);
|
||||||
|
container.transform.localPosition = statusEntity.containerStatus.posistion.ToVector();
|
||||||
|
container.transform.localRotation = statusEntity.containerStatus.roation.ToQuaternion();
|
||||||
|
container.transform.localScale = statusEntity.containerStatus.scale.ToVector();
|
||||||
|
container.transform.parent = forkCargo.transform;
|
||||||
|
}
|
||||||
|
initialize = true;
|
||||||
|
}
|
||||||
|
}catch(Exception x) { }
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Debug.LogWarning(name + ":获取缓存数据响应=" + response.DataAsText);
|
||||||
|
// Debug.LogWarning(string.Format("【url:{0}】", originalRequest.CurrentUri));
|
||||||
|
|
||||||
|
}
|
||||||
|
initialize = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
Shutdown();
|
||||||
|
}
|
||||||
|
public void Shutdown()
|
||||||
|
{
|
||||||
|
//当前agv的设备信息
|
||||||
|
CarStatusEntity carStatus = new();
|
||||||
|
carStatus.scale = Utils.ToSerializationVectorByVector(transform.localScale);
|
||||||
|
carStatus.posistion = Utils.ToSerializationVectorByVector(transform.localPosition);
|
||||||
|
carStatus.roation = Utils.ToSerializationVectorByVector(transform.localRotation.eulerAngles);
|
||||||
|
carStatus.deviceCode = DeviceCode;
|
||||||
|
carStatus.modelId = GetInstanceID();
|
||||||
|
carStatus.currentFeedBackStatus = currentFeedBackStatus;
|
||||||
|
carStatus.agentIsStoping = this.agentIsStoping;
|
||||||
|
carStatus.agentRotationUpdate = this.agentRotationUpdate;
|
||||||
|
carStatus.target = Utils.ToSerializationVectorByVector(this.agentTarget);
|
||||||
|
//货叉设备信息
|
||||||
|
CarStatusEntity cargo = new()
|
||||||
|
{
|
||||||
|
scale = Utils.ToSerializationVectorByVector(forkCargo.transform.localScale),
|
||||||
|
posistion = Utils.ToSerializationVectorByVector(forkCargo.transform.localPosition),
|
||||||
|
roation = Utils.ToSerializationVectorByVector(forkCargo.transform.localRotation.eulerAngles),
|
||||||
|
modelId = forkCargo.GetInstanceID(),
|
||||||
|
deviceCode = forkCargo.name,
|
||||||
|
animationTime = animationTime,
|
||||||
|
animationSpeed = animationSpeed,
|
||||||
|
playState = this.playState
|
||||||
|
};
|
||||||
|
//有货
|
||||||
|
if (HasGood)
|
||||||
|
{
|
||||||
|
CarStatusEntity containerStatus = new();
|
||||||
|
Container container = forkCargo.GetComponentInChildren<Container>();
|
||||||
|
containerStatus.scale = Utils.ToSerializationVectorByVector(container.transform.localScale);
|
||||||
|
containerStatus.posistion = Utils.ToSerializationVectorByVector(container.transform.localPosition);
|
||||||
|
containerStatus.roation = Utils.ToSerializationVectorByVector(container.transform.localRotation.eulerAngles);
|
||||||
|
|
||||||
|
carStatus.containerStatus = containerStatus;
|
||||||
|
}
|
||||||
|
carStatus.cargoStatus = cargo;
|
||||||
|
if(taskData != null && taskData.instructionId != 0)
|
||||||
|
{
|
||||||
|
carStatus.task = taskData;
|
||||||
|
}
|
||||||
|
|
||||||
|
//保存当前设备数据
|
||||||
|
netWorkComponent.RemoteSaveData(name, carStatus, SaveResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveResult(HTTPRequest originalRequest, HTTPResponse response)
|
||||||
|
{
|
||||||
|
if (response == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.IsSuccess)
|
||||||
|
{
|
||||||
|
Debug.Log("保存返回= " + response.DataAsText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log("保存返回= " + response.DataAsText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 开始代理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="deviceName"></param>
|
||||||
|
public void StartAgent(string deviceName)
|
||||||
|
{
|
||||||
|
//未代理开始代理
|
||||||
|
if (!paths.Contains(deviceName))
|
||||||
|
{
|
||||||
|
Vector3 targetPosistion = deviceParseService.PositionByDevice(deviceName);
|
||||||
|
agent.SetDestination(targetPosistion);
|
||||||
|
lineRenderer.positionCount = 0;
|
||||||
|
lineRenderer.SetPositions(agent.path.corners);
|
||||||
|
paths.Add(taskData.fromLocation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 开始代理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="deviceName"></param>
|
||||||
|
public void StartAgent(Vector3 target)
|
||||||
|
{
|
||||||
|
agent.SetDestination(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 取货完成
|
||||||
|
/// </summary>
|
||||||
|
public void OnTakeFinish()
|
||||||
|
{
|
||||||
|
currentFeedBackStatus = AgvCarManage.CarTaskStatusEnum.TAKE_FINISHED;
|
||||||
|
|
||||||
|
}
|
||||||
|
public void MouseLeftDown()
|
||||||
|
{
|
||||||
|
CameraFollow cameraFollow = transform.GetComponent<CameraFollow>();
|
||||||
|
if (cameraFollow)
|
||||||
|
{
|
||||||
|
cameraFollow.OnEnter();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 更新任务
|
||||||
|
/// </summary>
|
||||||
|
public void UpdateTask()
|
||||||
|
{
|
||||||
|
|
||||||
|
_data.feedBack = currentFeedBackStatus.ToString();
|
||||||
|
if(taskData != null)
|
||||||
|
{
|
||||||
|
AgvTaskData task = carManage.GetTaskByCode(taskData.instructionCode);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
animationSpeed = playable.playableGraph.GetRootPlayable(0).GetSpeed();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
animationTime = playable.time;
|
||||||
|
playState = playable.state;
|
||||||
|
agentIsStoping = agent.isStopped;
|
||||||
|
agentRotationUpdate = agent.updateRotation;
|
||||||
|
agentTarget = agent.destination;
|
||||||
|
if (task != null)
|
||||||
|
{
|
||||||
|
taskData = task;
|
||||||
|
_data.container = taskData.containerCode;
|
||||||
|
_data.startDevice = taskData.fromLocation;
|
||||||
|
_data.endDevice = taskData.toLocation;
|
||||||
|
_data.currentAction = taskData.agvTaskStatus.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Rest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public void OnInit()
|
||||||
|
{
|
||||||
|
//获取远程缓存
|
||||||
|
netWorkComponent.RemoteGetDataByLable(name, CheckValueAndInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 任务状态反馈实体
|
||||||
|
/// </summary>
|
||||||
|
private class FeedBackEntity
|
||||||
|
{
|
||||||
|
public string systemCode = "DT";
|
||||||
|
public string houseCode = "DT";
|
||||||
|
public long taskCode;
|
||||||
|
public string carId;
|
||||||
|
public string taskType;
|
||||||
|
public string feedbackStatus;
|
||||||
|
public string feedbackLocation;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 车辆状态实体
|
||||||
|
/// </summary>
|
||||||
|
[System.Serializable]
|
||||||
|
private class CarStatusEntity : DeviceStatus
|
||||||
|
{
|
||||||
|
public AgvTaskData task;
|
||||||
|
public AgvCarManage.CarTaskStatusEnum currentFeedBackStatus;
|
||||||
|
public Boolean agentIsStoping;
|
||||||
|
public Boolean agentRotationUpdate;
|
||||||
|
public SerializationVector target;
|
||||||
|
public DeviceStatus cargoStatus;
|
||||||
|
public DeviceStatus containerStatus;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 解析申请取放货坐标
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="objects"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="Exception"></exception>
|
||||||
|
public Vector3 LastPosition(List<GameObject> objects, string name)
|
||||||
|
{
|
||||||
|
//如果的库位
|
||||||
|
if (name.Contains("-"))
|
||||||
|
{
|
||||||
|
string[] str = name.Split('-');
|
||||||
|
GameObject game = objects.Find(v => string.Equals(v.name, "row_" + str[0]));
|
||||||
|
if (game != null)
|
||||||
|
{
|
||||||
|
return new Vector3(game.transform.position.x, transform.position.y, game.transform.position.z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//设备
|
||||||
|
GameObject game = objects.Find(v => string.Equals(v.name, "device_" +name));
|
||||||
|
if (game != null)
|
||||||
|
{
|
||||||
|
return new Vector3(game.transform.position.x,transform.position.y,game.transform.position.z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Exception(string.Format("【{0}】未配置申请取放货坐标【{1}】",this.name,name));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Quaternion RotationByDevice(string name)
|
||||||
|
{
|
||||||
|
if(name.Contains("shelf"))
|
||||||
|
{
|
||||||
|
return Quaternion.Euler(0,shelfRotation , 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var itme in forkAgvRotationSets)
|
||||||
|
{
|
||||||
|
GameObject obj = itme.device.Find(v => string.Equals(v.name, name));
|
||||||
|
|
||||||
|
if (obj != null)
|
||||||
|
{
|
||||||
|
return Quaternion.Euler(0, itme.deviceRotation, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Exception(string.Format("未找到该设备【{0}】旋转角度",name));
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 在动画指定最小帧时触发
|
||||||
|
/// </summary>
|
||||||
|
public void OnMinFPS()
|
||||||
|
{
|
||||||
|
//有货停止播放
|
||||||
|
if (HasGood)
|
||||||
|
{
|
||||||
|
playable.Pause();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void OnMaxFPS()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (currentFeedBackStatus == AgvCarManage.CarTaskStatusEnum.PUT_FINISHED)
|
||||||
|
{
|
||||||
|
|
||||||
|
//暂停播放
|
||||||
|
playable.Pause();
|
||||||
|
//解绑容器
|
||||||
|
Container container = forkCargo.transform.GetComponentInChildren<Container>();
|
||||||
|
container.transform.parent = null;
|
||||||
|
container.Agent.enabled = true;
|
||||||
|
//agv得退出一段距离
|
||||||
|
//倒退位置坐标
|
||||||
|
Vector3 applyPutVector = LastPosition(applyPutPosition, taskData.toLocation);
|
||||||
|
//开始代理
|
||||||
|
StartAgent(applyPutVector);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 校验当前目标是否是库位
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
public bool IsShelf(string name)
|
||||||
|
{
|
||||||
|
return name.Contains("-") || name.Contains("shelf");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DataHandle(object data, object other = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ProcessCompleted()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override T DynamicData<T>()
|
||||||
|
{
|
||||||
|
return (T)(object) _data;
|
||||||
|
}
|
||||||
|
public override void MouseSingleClick()
|
||||||
|
{
|
||||||
|
base.MouseSingleClick();
|
||||||
|
isOpenPop = !isOpenPop;
|
||||||
|
agvPopUI.Open(this, isOpenPop);
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/device/agv/ForkAgvDevice.cs.meta
Normal file
11
Assets/script/device/agv/ForkAgvDevice.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d6a19140d0547b543a8b8d970239d4fb
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/script/device/container.meta
Normal file
8
Assets/script/device/container.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2951555ea357d3048bed9f854d7a8494
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
103
Assets/script/device/container/Container.cs
Normal file
103
Assets/script/device/container/Container.cs
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using UnityEngine.AI;
|
||||||
|
|
||||||
|
|
||||||
|
[GameObjectBean(ENameType.GameObjectName)]
|
||||||
|
[AddComponentMenu("WXDC/Container/Container")]
|
||||||
|
public class Container : MonoBehaviour, IMouseClick, IFollowHelp
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
private ContainerEntity _containerData;
|
||||||
|
[Autowired]
|
||||||
|
private CameraManage cameraManage;
|
||||||
|
private NavMeshAgent _agent;
|
||||||
|
[SerializeField]
|
||||||
|
public GameObject target;
|
||||||
|
[SerializeField]
|
||||||
|
public bool debugMode;
|
||||||
|
|
||||||
|
public bool isAwke;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Vector3 _offset = new Vector3(0,0,-3);
|
||||||
|
[SerializeField]
|
||||||
|
private Transform _follow;
|
||||||
|
[SerializeField]
|
||||||
|
private Transform _lookAt;
|
||||||
|
[Autowired]
|
||||||
|
private ContainerPopUI containerPop;
|
||||||
|
private bool isOpenPop;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NavMeshAgent 代理
|
||||||
|
/// </summary>
|
||||||
|
public NavMeshAgent Agent { get => _agent; set => _agent = value; }
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
_agent = GetComponent<NavMeshAgent>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 容器信息
|
||||||
|
/// </summary>
|
||||||
|
public ContainerEntity ContainerData { get => _containerData; set => _containerData = value; }
|
||||||
|
|
||||||
|
public Transform Follow => _follow ? _follow : transform;
|
||||||
|
|
||||||
|
public Transform FookAt => _lookAt ? _lookAt : transform;
|
||||||
|
|
||||||
|
public Vector3 Offset => _offset;
|
||||||
|
private void FixedUpdate()
|
||||||
|
{
|
||||||
|
if (debugMode)
|
||||||
|
{
|
||||||
|
if (!CheckAgentPosition(target.transform.position))
|
||||||
|
{
|
||||||
|
Agent.SetDestination(target.transform.position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 如果代理终点已经是该位置了返回true
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool CheckAgentPosition(Vector3 target)
|
||||||
|
{
|
||||||
|
Debug.LogWarning(string.Format("容器= 【{0}】 距离【{1}】 ", name, Vector3.Distance(Agent.destination, new Vector3(target.x, Agent.destination.y, target.z))));
|
||||||
|
return Vector3.Distance(Agent.destination, new Vector3(target.x, Agent.destination.y, target.z)) <= 0.12f;
|
||||||
|
}
|
||||||
|
public void ToTarget(Vector3 target)
|
||||||
|
{
|
||||||
|
if(debugMode)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!isAwke)
|
||||||
|
{
|
||||||
|
//唤醒
|
||||||
|
Agent.Warp(target);
|
||||||
|
Agent.enabled = true;
|
||||||
|
isAwke = true;
|
||||||
|
}
|
||||||
|
Agent.SetDestination(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void MouseSingleClick()
|
||||||
|
{
|
||||||
|
if (Follow && FookAt)
|
||||||
|
{
|
||||||
|
cameraManage.ShotCut(this);
|
||||||
|
}
|
||||||
|
isOpenPop = !isOpenPop;
|
||||||
|
containerPop.Open(_containerData,Follow,isOpenPop);
|
||||||
|
|
||||||
|
}
|
||||||
|
public virtual void MouseDoubleClick()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/device/container/Container.cs.meta
Normal file
11
Assets/script/device/container/Container.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 49c84f211aaa17841b7f94f22df5d7bf
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
60
Assets/script/device/container/ContainerEntity.cs
Normal file
60
Assets/script/device/container/ContainerEntity.cs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
[System.Serializable]
|
||||||
|
public class ContainerEntity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 容器编号
|
||||||
|
/// </summary>
|
||||||
|
public string containerCode;
|
||||||
|
/// <summary>
|
||||||
|
/// 容器类型
|
||||||
|
/// </summary>
|
||||||
|
public string containerType;
|
||||||
|
/// <summary>
|
||||||
|
/// 生产批次
|
||||||
|
/// </summary>
|
||||||
|
public string lot;
|
||||||
|
/// <summary>
|
||||||
|
/// 工序编号
|
||||||
|
/// </summary>
|
||||||
|
public string procedureCode;
|
||||||
|
/// <summary>
|
||||||
|
/// 通道策略
|
||||||
|
/// </summary>
|
||||||
|
public string procedureName;
|
||||||
|
/// <summary>
|
||||||
|
/// 通道策略
|
||||||
|
/// </summary>
|
||||||
|
public string channelType;
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是空托
|
||||||
|
/// </summary>
|
||||||
|
public bool isEmpty;
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是工装托盘
|
||||||
|
/// </summary>
|
||||||
|
public bool isTool;
|
||||||
|
/// <summary>
|
||||||
|
/// 布局行数
|
||||||
|
/// </summary>
|
||||||
|
public int layoutRows;
|
||||||
|
/// <summary>
|
||||||
|
/// 布局列数
|
||||||
|
/// </summary>
|
||||||
|
public int layoutColumns;
|
||||||
|
/// <summary>
|
||||||
|
///通道总数(最大通道号)
|
||||||
|
/// </summary>
|
||||||
|
public int maxChannel;
|
||||||
|
/// <summary>
|
||||||
|
/// 入库时间
|
||||||
|
/// </summary>
|
||||||
|
public string stockInTime;
|
||||||
|
/// <summary>
|
||||||
|
/// 库位号
|
||||||
|
/// </summary>
|
||||||
|
public string location;
|
||||||
|
/// <summary>
|
||||||
|
/// 线边仓编号
|
||||||
|
/// </summary>
|
||||||
|
public string stockCode;
|
||||||
|
}
|
11
Assets/script/device/container/ContainerEntity.cs.meta
Normal file
11
Assets/script/device/container/ContainerEntity.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2e2892a1eb5700a4b9e20785c7e3fa93
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
162
Assets/script/device/container/ContainersManage.cs
Normal file
162
Assets/script/device/container/ContainersManage.cs
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine.AI;
|
||||||
|
using Unity.VisualScripting;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
[GameObjectBean]
|
||||||
|
[AddComponentMenu("WXDC/Container/ContainerManage")]
|
||||||
|
public class ContainersManage : MonoBehaviour, IApplcationShutdown
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
private EventCompent eventCompent;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private List<GameObject> _source = new();
|
||||||
|
[SerializeField]
|
||||||
|
private GameObject defualtContainer;
|
||||||
|
[SerializeField]
|
||||||
|
private List<Container> _hideContainers = new();
|
||||||
|
[SerializeField]
|
||||||
|
private float speed;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float agentHight;
|
||||||
|
[SerializeField]
|
||||||
|
private float agentWidth;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据模型代码加载
|
||||||
|
/// </summary>
|
||||||
|
public Container CreateContainer(Vector3 position,ContainerEntity entity, LayerMask layerMask)
|
||||||
|
{
|
||||||
|
Container container = CreateContainer(entity);
|
||||||
|
container.transform.parent = null;
|
||||||
|
container.transform.position = position;
|
||||||
|
container.gameObject.layer = layerMask;
|
||||||
|
foreach (Transform child in container.GetComponentsInChildren<Transform>())
|
||||||
|
{
|
||||||
|
child.gameObject.layer = layerMask;
|
||||||
|
}
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
private Container CreateContainer(ContainerEntity entity)
|
||||||
|
{
|
||||||
|
//容器类型为空
|
||||||
|
if (string.IsNullOrEmpty(entity.containerType))
|
||||||
|
{
|
||||||
|
throw new System.Exception("容器类型 为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (_hideContainers.Count > 0)
|
||||||
|
{
|
||||||
|
lock (_hideContainers)
|
||||||
|
{
|
||||||
|
Container containerObject = _hideContainers.Find(v => string.Equals(v.ContainerData.containerType, entity.containerType));
|
||||||
|
if (containerObject != null)
|
||||||
|
{
|
||||||
|
ApplicationBoot.Instance.AddBean(containerObject, entity.containerCode);
|
||||||
|
containerObject.name = entity.containerCode;
|
||||||
|
containerObject.ContainerData = entity;
|
||||||
|
return containerObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameObject obj = _source.Find(v => string.Equals(entity.containerType, v.name));
|
||||||
|
if (obj != null)
|
||||||
|
{
|
||||||
|
Container container = ApplicationBoot.Instance.CreateGameObjectAsBean<Container>(obj, entity.containerCode);
|
||||||
|
container.name = entity.containerCode;
|
||||||
|
container.ContainerData = entity;
|
||||||
|
container.transform.localPosition = obj.transform.localPosition;
|
||||||
|
container.Agent = container.GetComponent<NavMeshAgent>();
|
||||||
|
container.Agent.updateRotation = false;
|
||||||
|
|
||||||
|
eventCompent.MouseClickEvents += container.MouseSingleClick;
|
||||||
|
eventCompent.MouseDoubleClickEvents += container.MouseDoubleClick;
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Container container = ApplicationBoot.Instance.CreateGameObjectAsBean<Container>(defualtContainer, entity.containerCode);
|
||||||
|
container.name = entity.containerCode;
|
||||||
|
container.ContainerData = entity;
|
||||||
|
container.transform.localPosition = obj.transform.localPosition;
|
||||||
|
container.Agent = container.GetComponent<NavMeshAgent>();
|
||||||
|
container.Agent.updateRotation = false;
|
||||||
|
|
||||||
|
eventCompent.MouseClickEvents += container.MouseSingleClick;
|
||||||
|
eventCompent.MouseDoubleClickEvents += container.MouseDoubleClick;
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
throw new System.Exception(string.Format("生成容器类型:【{code}】失败"));
|
||||||
|
}
|
||||||
|
public Container CreateContainer(Vector3 localPosition,Transform parent, ContainerEntity entity,LayerMask layerMask)
|
||||||
|
{
|
||||||
|
Container container = CreateContainer(entity);
|
||||||
|
container.transform.parent = parent;
|
||||||
|
container.transform.localPosition = localPosition;
|
||||||
|
foreach (Transform child in container.GetComponentsInChildren<Transform>())
|
||||||
|
{
|
||||||
|
child.gameObject.layer = layerMask;
|
||||||
|
}
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
public Container CreateContainer(Transform parent, ContainerEntity entity)
|
||||||
|
{
|
||||||
|
Container container = CreateContainer(entity);
|
||||||
|
container.transform.parent = parent;
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取IOC容器中的托盘实例
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="containerCode">容器代码也是bean名称</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Container GetContainerByCode(string containerCode)
|
||||||
|
{
|
||||||
|
return ApplicationBoot.Instance.GetBean<Container>(containerCode);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 从场景中移除该容器
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="container"></param>
|
||||||
|
public void RemoveContainer(Container container)
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//只从ioc移除
|
||||||
|
ApplicationBoot.Instance.DeleteGameObjBean(container, container.name, false);
|
||||||
|
//隐藏
|
||||||
|
container.gameObject.SetActive(false);
|
||||||
|
container.enabled = false;
|
||||||
|
//添加到隐藏队列
|
||||||
|
_hideContainers.Add(container);
|
||||||
|
}catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
public void Shutdown()
|
||||||
|
{
|
||||||
|
_hideContainers.Clear();
|
||||||
|
_source.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
11
Assets/script/device/container/ContainersManage.cs.meta
Normal file
11
Assets/script/device/container/ContainersManage.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 073f84e53b9339f419a64ce0005ca85d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,63 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!850595691 &4890085278179872738
|
||||||
|
LightingSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: New Lighting Settings
|
||||||
|
serializedVersion: 7
|
||||||
|
m_GIWorkflowMode: 1
|
||||||
|
m_EnableBakedLightmaps: 1
|
||||||
|
m_EnableRealtimeLightmaps: 0
|
||||||
|
m_RealtimeEnvironmentLighting: 1
|
||||||
|
m_BounceScale: 1
|
||||||
|
m_AlbedoBoost: 1
|
||||||
|
m_IndirectOutputScale: 1
|
||||||
|
m_UsingShadowmask: 1
|
||||||
|
m_BakeBackend: 1
|
||||||
|
m_LightmapMaxSize: 1024
|
||||||
|
m_LightmapSizeFixed: 0
|
||||||
|
m_BakeResolution: 40
|
||||||
|
m_Padding: 2
|
||||||
|
m_LightmapCompression: 3
|
||||||
|
m_AO: 0
|
||||||
|
m_AOMaxDistance: 1
|
||||||
|
m_CompAOExponent: 1
|
||||||
|
m_CompAOExponentDirect: 0
|
||||||
|
m_ExtractAO: 0
|
||||||
|
m_MixedBakeMode: 2
|
||||||
|
m_LightmapsBakeMode: 1
|
||||||
|
m_FilterMode: 1
|
||||||
|
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ExportTrainingData: 0
|
||||||
|
m_TrainingDataDestination: TrainingData
|
||||||
|
m_RealtimeResolution: 2
|
||||||
|
m_ForceWhiteAlbedo: 0
|
||||||
|
m_ForceUpdates: 0
|
||||||
|
m_PVRCulling: 1
|
||||||
|
m_PVRSampling: 1
|
||||||
|
m_PVRDirectSampleCount: 32
|
||||||
|
m_PVRSampleCount: 512
|
||||||
|
m_PVREnvironmentSampleCount: 256
|
||||||
|
m_PVREnvironmentReferencePointCount: 2048
|
||||||
|
m_LightProbeSampleCountMultiplier: 4
|
||||||
|
m_PVRBounces: 2
|
||||||
|
m_PVRMinBounces: 2
|
||||||
|
m_PVREnvironmentImportanceSampling: 1
|
||||||
|
m_PVRFilteringMode: 1
|
||||||
|
m_PVRDenoiserTypeDirect: 1
|
||||||
|
m_PVRDenoiserTypeIndirect: 1
|
||||||
|
m_PVRDenoiserTypeAO: 1
|
||||||
|
m_PVRFilterTypeDirect: 0
|
||||||
|
m_PVRFilterTypeIndirect: 0
|
||||||
|
m_PVRFilterTypeAO: 0
|
||||||
|
m_PVRFilteringGaussRadiusDirect: 1
|
||||||
|
m_PVRFilteringGaussRadiusIndirect: 5
|
||||||
|
m_PVRFilteringGaussRadiusAO: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||||
|
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||||
|
m_PVRTiledBaking: 0
|
||||||
|
m_RespectSceneVisibilityWhenBakingGI: 0
|
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 696614c20af50714dba8acc0c00abf4c
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 4890085278179872738
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/script/device/conveyor.meta
Normal file
8
Assets/script/device/conveyor.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 13c2a3d8d5368764cb5abbb4175a957f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
75
Assets/script/device/conveyor/AbstractConveyorDevice.cs
Normal file
75
Assets/script/device/conveyor/AbstractConveyorDevice.cs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
|
||||||
|
using EasyInject.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 抽象的输送线设备
|
||||||
|
/// </summary>
|
||||||
|
public abstract class AbstractConveyorDevice : AbstractDevice
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
public ConveyorPopUI PopUI;
|
||||||
|
public ConveyorData conveyorData;
|
||||||
|
public GameObject ShadowPosition;
|
||||||
|
public DeviceData deviceData;
|
||||||
|
public override string DeviceType => "CONVEYOR";
|
||||||
|
public override Transform Transform => transform;
|
||||||
|
public override string DeviceCode => this.name;
|
||||||
|
|
||||||
|
public override T DynamicData<T>() => (T)(object)conveyorData;
|
||||||
|
|
||||||
|
private bool isOpenPop;
|
||||||
|
|
||||||
|
public override DeviceData DeviceData => deviceData;
|
||||||
|
/// <summary>
|
||||||
|
/// 位置坐标
|
||||||
|
/// </summary>
|
||||||
|
public GameObject Position {
|
||||||
|
get{
|
||||||
|
return ShadowPosition ? ShadowPosition : gameObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DataHandle(object data, object other = null)
|
||||||
|
{
|
||||||
|
conveyorData = JsonConvert.DeserializeObject<ConveyorData>(JsonConvert.SerializeObject(data));
|
||||||
|
deviceData = JsonConvert.DeserializeObject<DeviceData>(JsonConvert.SerializeObject(other));
|
||||||
|
base.DataHandle(data, other);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 容器在输送线上可停靠的坐标
|
||||||
|
/// </summary>
|
||||||
|
public Vector3 ContainerParkingPosition {
|
||||||
|
get {
|
||||||
|
if(ShadowPosition != null)
|
||||||
|
{
|
||||||
|
return ShadowPosition.transform.position;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return transform.position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Transform ContainerParkingTransform
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (ShadowPosition != null)
|
||||||
|
{
|
||||||
|
return ShadowPosition.transform;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return transform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public override void MouseSingleClick()
|
||||||
|
{
|
||||||
|
isOpenPop = !isOpenPop;
|
||||||
|
PopUI.Open(this,isOpenPop);
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/device/conveyor/AbstractConveyorDevice.cs.meta
Normal file
11
Assets/script/device/conveyor/AbstractConveyorDevice.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 13b135f147f724a41814b01cf5ec1c47
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
98
Assets/script/device/conveyor/ConveyorDevice.cs
Normal file
98
Assets/script/device/conveyor/ConveyorDevice.cs
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
using EasyInject.Attributes;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标准输送线设备
|
||||||
|
/// </summary>
|
||||||
|
[GameObjectBean(ENameType.GameObjectName)]
|
||||||
|
public class ConveyorDevice : AbstractConveyorDevice
|
||||||
|
{
|
||||||
|
[Autowired]
|
||||||
|
private readonly ContainersManage containerManage;
|
||||||
|
[SerializeField]
|
||||||
|
[Header("是agv交互位置")]
|
||||||
|
private bool isAgvInteraction;
|
||||||
|
|
||||||
|
|
||||||
|
private void LateUpdate()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(conveyorData.containerCode))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//存在容器号。同时忽略执行中的,当设备有货有容器号且待机的托盘移动到当前设备
|
||||||
|
if( conveyorData.mode == 3 && conveyorData.move % 2 == 1)
|
||||||
|
{
|
||||||
|
//获取场景中的容器
|
||||||
|
Container container = containerManage.GetContainerByCode(conveyorData.containerCode);
|
||||||
|
|
||||||
|
if (container != null)
|
||||||
|
{
|
||||||
|
//设置图层
|
||||||
|
SetLayer(container);
|
||||||
|
//如果托盘的终点不是当前位置,更改容器目标点坐标
|
||||||
|
if (!container.CheckAgentPosition(ContainerParkingPosition))
|
||||||
|
{
|
||||||
|
//Debug.LogWarning(string.Format("输送线【{0}】停盘位置 【{1}】",this.name, ContainerParkingPosition));
|
||||||
|
container.ToTarget(ContainerParkingPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//待机有货的时候
|
||||||
|
if (conveyorData.mode == 2 && conveyorData.move % 2 == 1 && !string.IsNullOrEmpty(conveyorData.containerCode))
|
||||||
|
{
|
||||||
|
//获取场景中的容器
|
||||||
|
Container container = containerManage.GetContainerByCode(conveyorData.containerCode);
|
||||||
|
|
||||||
|
|
||||||
|
if (container == null)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
//到这一步也就是说这个条码托盘未被加载到场景,这种情况属于初始化才会出现
|
||||||
|
ContainerEntity entity = new();
|
||||||
|
entity.containerCode = conveyorData.containerCode;
|
||||||
|
entity.containerType = conveyorData.containerType;
|
||||||
|
entity.isEmpty = conveyorData.isEmpty;
|
||||||
|
//containerManage.CreateContainer(ContainerParkingPosition, entity);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//如果托盘的终点不是当前位置,更改容器目标点坐标
|
||||||
|
if (!container.CheckAgentPosition(ContainerParkingPosition))
|
||||||
|
{
|
||||||
|
//Debug.LogWarning(string.Format("输送线【{0}】停盘位置 【{1}】", this.name, ContainerParkingPosition));
|
||||||
|
container.ToTarget(ContainerParkingPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public override void ProcessCompleted()
|
||||||
|
{
|
||||||
|
//流程完成后触发,用来作位置的初始化操作
|
||||||
|
Container container = containerManage.GetContainerByCode(conveyorData.containerCode);
|
||||||
|
if(container == null)
|
||||||
|
{
|
||||||
|
//到这一步也就是说这个条码托盘未被加载到场景,这种情况属于初始化才会出现
|
||||||
|
ContainerEntity entity = new();
|
||||||
|
entity.containerCode = conveyorData.containerCode;
|
||||||
|
entity.containerType = conveyorData.containerType;
|
||||||
|
entity.isEmpty = conveyorData.isEmpty;
|
||||||
|
containerManage.CreateContainer(ContainerParkingPosition, entity,gameObject.layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private void SetLayer(Container container)
|
||||||
|
{
|
||||||
|
foreach(var item in container.GetComponentsInChildren<Transform>())
|
||||||
|
{
|
||||||
|
item.gameObject.layer = gameObject.layer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
11
Assets/script/device/conveyor/ConveyorDevice.cs.meta
Normal file
11
Assets/script/device/conveyor/ConveyorDevice.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 97126d1b539625348be03e42a6837bd9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/script/device/stacker.meta
Normal file
8
Assets/script/device/stacker.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 94dc1ec673fb6224abf50f6bf5541671
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
14
Assets/script/device/stacker/Stacker.signal
Normal file
14
Assets/script/device/stacker/Stacker.signal
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: d6fa2d92fc1b3f34da284357edf89c3b, type: 3}
|
||||||
|
m_Name: Stacker
|
||||||
|
m_EditorClassIdentifier:
|
8
Assets/script/device/stacker/Stacker.signal.meta
Normal file
8
Assets/script/device/stacker/Stacker.signal.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ad7d7e69be6e818488932deb78209de7
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
556
Assets/script/device/stacker/StackerDevice.cs
Normal file
556
Assets/script/device/stacker/StackerDevice.cs
Normal file
@ -0,0 +1,556 @@
|
|||||||
|
using EasyInject.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Playables;
|
||||||
|
using UnityEngine.Timeline;
|
||||||
|
|
||||||
|
[GameObjectBean(ENameType.GameObjectName)]
|
||||||
|
public class StackerDevice : AbstractDevice
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
private StackerData stackerData;
|
||||||
|
private DeviceData deviceData;
|
||||||
|
[Header("前叉货叉光电描述")]
|
||||||
|
[SerializeField]
|
||||||
|
private string frontHasGoodsDesc;
|
||||||
|
|
||||||
|
|
||||||
|
[Autowired]
|
||||||
|
private LocationStorageManage storageManage;
|
||||||
|
[Autowired]
|
||||||
|
private ContainersManage containersManage;
|
||||||
|
[Autowired]
|
||||||
|
private StackerPopUI stackerPopUI;
|
||||||
|
[SerializeField]
|
||||||
|
private List<StackerForkActionBinding> forkActionBinding;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 深浅伸叉动作映射
|
||||||
|
/// </summary>
|
||||||
|
[Header("深浅伸叉动作映射")]
|
||||||
|
[SerializeField]
|
||||||
|
private ForkActionMap forkActionMap;
|
||||||
|
/// <summary>
|
||||||
|
/// 上一次动作
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
private StackerForkActionEnum lastforkActionEnum;
|
||||||
|
/// <summary>
|
||||||
|
/// 堆垛机移动的方向
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField]
|
||||||
|
private Direction moveDirection = Direction.X;
|
||||||
|
[SerializeField]
|
||||||
|
private GameObject forkCargo;
|
||||||
|
[SerializeField]
|
||||||
|
private GameObject fork;
|
||||||
|
[SerializeField]
|
||||||
|
private Vector3 forkCargoOffset = Vector3.zero;
|
||||||
|
[Header("行走巷道内载货台高度偏移")]
|
||||||
|
[SerializeField]
|
||||||
|
private float isStorageforkCargoYOffset = 0.8f;
|
||||||
|
[Header("站台列载货台高度偏移")]
|
||||||
|
[SerializeField]
|
||||||
|
private float isDeviceforkCargoYOffset = -0.15f;
|
||||||
|
[SerializeField]
|
||||||
|
private float speed = 0.3f;
|
||||||
|
[SerializeField]
|
||||||
|
private float forkCargoUpOrDownSpeed = 0.3f;
|
||||||
|
|
||||||
|
[Header("载货台起升下降距离")]
|
||||||
|
[SerializeField]
|
||||||
|
private float LiftingAndLoweringDistance = 0.3f;
|
||||||
|
public override Transform Transform => forkCargo.transform;
|
||||||
|
public override string DeviceType => "STACKER";
|
||||||
|
public override string DeviceCode => name;
|
||||||
|
|
||||||
|
public override DeviceData DeviceData => deviceData;
|
||||||
|
|
||||||
|
private bool allowUpOrDown;
|
||||||
|
private float upOrDownSpeed;
|
||||||
|
|
||||||
|
private bool isOpenPop;
|
||||||
|
public enum Direction
|
||||||
|
{
|
||||||
|
Z,X
|
||||||
|
}
|
||||||
|
private PlayableDirector playableDirector;
|
||||||
|
/// <summary>
|
||||||
|
/// 所有动画轨道
|
||||||
|
/// </summary>
|
||||||
|
private List<TrackAsset> trackAssets = new();
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
playableDirector = transform.GetComponent<PlayableDirector>();
|
||||||
|
if(storageManage == null)
|
||||||
|
{
|
||||||
|
storageManage = ApplicationBoot.Instance.GetBean<LocationStorageManage>();
|
||||||
|
}
|
||||||
|
|
||||||
|
playableDirector.Stop();
|
||||||
|
StopActionClip();
|
||||||
|
|
||||||
|
var graph = playableDirector.playableAsset as TimelineAsset;
|
||||||
|
if (graph == null)
|
||||||
|
{
|
||||||
|
throw new Exception(name + ":未找到 TimelineAsset 资源");
|
||||||
|
}
|
||||||
|
trackAssets = new List<TrackAsset>(graph.GetRootTracks().ToArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
//堆垛机本体移动
|
||||||
|
StackerBodyMove();
|
||||||
|
//载货台移动
|
||||||
|
ForkCargoVerticalMove();
|
||||||
|
//伸叉后起升或下降一段距离
|
||||||
|
ForkCargoUpOrDown();
|
||||||
|
|
||||||
|
//货叉动作执行
|
||||||
|
ExtendForkActionHandle();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ForkCargoUpOrDown()
|
||||||
|
{
|
||||||
|
if (!allowUpOrDown)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
forkCargo.transform.Translate(Vector3.up * upOrDownSpeed * forkCargoUpOrDownSpeed * Time.deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 堆垛机主体移动
|
||||||
|
/// </summary>
|
||||||
|
private void StackerBodyMove()
|
||||||
|
{
|
||||||
|
//排列成层 有其一值为0则不处理
|
||||||
|
if(stackerData.frontRow == 0 || stackerData.special1 == 0 || stackerData.frontLayer == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//获取库位坐标
|
||||||
|
string row = stackerData.frontRow.ToString("D2");
|
||||||
|
string column = stackerData.special1.ToString("D2");
|
||||||
|
string layer = stackerData.frontLayer.ToString("D2");
|
||||||
|
//当取货或方法是站台列,直接目的地就是站台列
|
||||||
|
if(stackerData.toColumn >= 200)
|
||||||
|
{
|
||||||
|
column = stackerData.toColumn.ToString();
|
||||||
|
layer = stackerData.toLayer.ToString("D2");
|
||||||
|
}
|
||||||
|
|
||||||
|
string storageName = string.Format("{0}-{1}-{2}", row, column, layer);
|
||||||
|
|
||||||
|
GameObject storageObject = storageManage.GetStorageByName(storageName);
|
||||||
|
if (storageObject == null)
|
||||||
|
{
|
||||||
|
throw new System.Exception(string.Format("【{1}】没有找到库位【{0}】坐标",storageName,name));
|
||||||
|
}
|
||||||
|
//解析堆垛机可用坐标
|
||||||
|
Vector3 target = Vector3.zero;
|
||||||
|
if (moveDirection == Direction.X)
|
||||||
|
{
|
||||||
|
target = new Vector3(storageObject.transform.position.x + forkCargoOffset.x,transform.position.y,transform.position.z);
|
||||||
|
}
|
||||||
|
if (moveDirection == Direction.Z)
|
||||||
|
{
|
||||||
|
target = new Vector3(transform.position.x, transform.position.y, storageObject.transform.position.z+ forkCargoOffset.z);
|
||||||
|
}
|
||||||
|
if(target == Vector3.zero)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//往目标点移动
|
||||||
|
transform.position = Vector3.MoveTowards(transform.position,target, speed * Time.deltaTime);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 载货台垂直移动
|
||||||
|
/// </summary>
|
||||||
|
private void ForkCargoVerticalMove()
|
||||||
|
{
|
||||||
|
//货叉动作是静止的才允许提升
|
||||||
|
if(StackerForkActionEnum.ForkRest == stackerData.frontForkAction )
|
||||||
|
{
|
||||||
|
//排列层 有其一值为0则不处理
|
||||||
|
//if (stackerData.frontRow == 0 || stackerData.special1 == 0 || stackerData.frontLayer == 0)
|
||||||
|
//{
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
if (stackerData.toRow == 0 || stackerData.toColumn == 0 || stackerData.toLayer == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Vector3 target = ForkCargoTarget();
|
||||||
|
//往目标点移动
|
||||||
|
forkCargo.transform.position = Vector3.MoveTowards(forkCargo.transform.position, target, speed * Time.deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Vector3 ForkCargoTarget()
|
||||||
|
{
|
||||||
|
|
||||||
|
//获取库位坐标
|
||||||
|
string row = stackerData.toRow.ToString("D2");
|
||||||
|
string column = stackerData.toColumn.ToString("D2");
|
||||||
|
string layer = stackerData.toLayer.ToString("D2");
|
||||||
|
|
||||||
|
//当取货或方法是站台列,直接目的地就是站台列
|
||||||
|
//if (stackerData.toColumn >= 200)
|
||||||
|
//{
|
||||||
|
// column = stackerData.toColumn.ToString();
|
||||||
|
// layer = stackerData.toLayer.ToString("D2");
|
||||||
|
//}
|
||||||
|
|
||||||
|
string storageName = string.Format("{0}-{1}-{2}", row, column, layer);
|
||||||
|
|
||||||
|
GameObject storageObject = storageManage.GetStorageByName(storageName);
|
||||||
|
if (storageObject == null)
|
||||||
|
{
|
||||||
|
throw new System.Exception(string.Format("【{1}】没有找到库位【{0}】坐标", storageName, name));
|
||||||
|
}
|
||||||
|
//这里因为取货或者放货要保持抬起跟下降动作,增加额外值
|
||||||
|
float targetY = stackerData.frontForkHasGoods == true ? forkCargoOffset.y : 0;
|
||||||
|
float forkCargoBodyY = int.Parse(column) >= 200 ? isDeviceforkCargoYOffset : isStorageforkCargoYOffset;
|
||||||
|
//解析货叉可用坐标
|
||||||
|
Vector3 target = new Vector3(forkCargo.transform.position.x, storageObject.transform.position.y + forkCargoBodyY + targetY, forkCargo.transform.position.z);
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 货叉伸叉动作处理
|
||||||
|
/// </summary>
|
||||||
|
private void ExtendForkActionHandle()
|
||||||
|
{
|
||||||
|
//向左伸叉
|
||||||
|
if(stackerData.frontForkAction == StackerForkActionEnum.LeftExtendFork)
|
||||||
|
{
|
||||||
|
if(lastforkActionEnum != StackerForkActionEnum.LeftExtendFork)
|
||||||
|
{
|
||||||
|
//播放动画
|
||||||
|
PlayTrackGroup(GetForkActionName(StackerForkActionEnum.LeftExtendFork));
|
||||||
|
lastforkActionEnum = StackerForkActionEnum.LeftExtendFork;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//向右伸叉
|
||||||
|
if (stackerData.frontForkAction == StackerForkActionEnum.RightExtendFork)
|
||||||
|
{
|
||||||
|
if (lastforkActionEnum != StackerForkActionEnum.RightExtendFork)
|
||||||
|
{
|
||||||
|
//播放动画
|
||||||
|
string name = GetForkActionName(StackerForkActionEnum.RightExtendFork);
|
||||||
|
PlayTrackGroup(GetForkActionName(StackerForkActionEnum.RightExtendFork));
|
||||||
|
lastforkActionEnum = StackerForkActionEnum.RightExtendFork;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//向右缩叉
|
||||||
|
if (stackerData.frontForkAction == StackerForkActionEnum.RightRetractFork)
|
||||||
|
{
|
||||||
|
if (lastforkActionEnum != StackerForkActionEnum.RightRetractFork)
|
||||||
|
{
|
||||||
|
//缩动画播放之前,绑定容器
|
||||||
|
CheckAndBindContainer();
|
||||||
|
//继续播放
|
||||||
|
string name = GetForkActionName(StackerForkActionEnum.RightRetractFork);
|
||||||
|
PlayTrackGroup(name,false);
|
||||||
|
lastforkActionEnum = StackerForkActionEnum.RightRetractFork;
|
||||||
|
allowUpOrDown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//向左缩叉
|
||||||
|
if (stackerData.frontForkAction == StackerForkActionEnum.LeftRetractFork)
|
||||||
|
{
|
||||||
|
if (lastforkActionEnum != StackerForkActionEnum.LeftRetractFork)
|
||||||
|
{
|
||||||
|
|
||||||
|
CheckAndBindContainer();
|
||||||
|
//继续播放
|
||||||
|
PlayTrackGroup(GetForkActionName(StackerForkActionEnum.LeftRetractFork), false);
|
||||||
|
lastforkActionEnum = StackerForkActionEnum.LeftRetractFork;
|
||||||
|
allowUpOrDown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//清空货叉状态
|
||||||
|
if (stackerData.frontForkAction == StackerForkActionEnum.ForkRest)
|
||||||
|
{
|
||||||
|
if(lastforkActionEnum != StackerForkActionEnum.ForkRest)
|
||||||
|
{
|
||||||
|
lastforkActionEnum = StackerForkActionEnum.ForkRest;
|
||||||
|
//StopActionClip();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 货叉缩叉动作完成处理(缩叉完成后自动触发)
|
||||||
|
/// </summary>
|
||||||
|
public void RetractForkActionFinishHandle()
|
||||||
|
{
|
||||||
|
//清空状态
|
||||||
|
//StopActionClip();
|
||||||
|
|
||||||
|
Debug.LogWarning("清理货叉状态");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 货叉缩叉动作处理(当伸叉到位后会自动触发)
|
||||||
|
/// </summary>
|
||||||
|
public void ForkActionStopHandle(float speed)
|
||||||
|
{
|
||||||
|
//劫持动画,让其暂停
|
||||||
|
|
||||||
|
upOrDownSpeed = stackerData.frontForkHasGoods ? -speed*2 : speed;
|
||||||
|
|
||||||
|
playableDirector.Pause();
|
||||||
|
}
|
||||||
|
public void ForkActionStartHandle()
|
||||||
|
{
|
||||||
|
//开始动画
|
||||||
|
allowUpOrDown = false;
|
||||||
|
//针对放货
|
||||||
|
if (stackerData.frontForkHasGoods)
|
||||||
|
{
|
||||||
|
ForkBindContainer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void StopActionClip()
|
||||||
|
{
|
||||||
|
playableDirector.time = 0;
|
||||||
|
playableDirector.Stop();
|
||||||
|
|
||||||
|
foreach (var track in trackAssets)
|
||||||
|
{
|
||||||
|
track.muted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 绑定容器到货叉
|
||||||
|
/// </summary>
|
||||||
|
private void CheckAndBindContainer()
|
||||||
|
{
|
||||||
|
if (!allowUpOrDown && stackerData.frontForkHasGoods)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ForkBindContainer();
|
||||||
|
}
|
||||||
|
private void ForkBindContainer()
|
||||||
|
{
|
||||||
|
|
||||||
|
//直接获取容器
|
||||||
|
Container container = containersManage.GetContainerByCode(stackerData.frontContainerCode);
|
||||||
|
Debug.Log(string.Format("容器号 【{0},场景实例 【{1}】】", stackerData.frontContainerCode, container));
|
||||||
|
if (container != null)
|
||||||
|
{
|
||||||
|
if (stackerData.frontForkHasGoods == true)
|
||||||
|
{
|
||||||
|
//绑定库位
|
||||||
|
string storageName = string.Format("{0}-{1}-{2}", stackerData.toRow.ToString("D2"), stackerData.toColumn.ToString("D2"), stackerData.toLayer.ToString("D2"));
|
||||||
|
GameObject storage = storageManage.GetStorageByName(storageName);
|
||||||
|
if (storage == null)
|
||||||
|
{
|
||||||
|
throw new Exception(string.Format("设备【{1}】未找到库位【{0}】",storageName,name));
|
||||||
|
}
|
||||||
|
if(stackerData.toColumn >= 200)
|
||||||
|
{
|
||||||
|
//暂停代理
|
||||||
|
container.Agent.isStopped = false;
|
||||||
|
//启用
|
||||||
|
container.Agent.enabled = true;
|
||||||
|
}
|
||||||
|
container.transform.parent = storage.transform;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//暂停代理
|
||||||
|
container.Agent.isStopped = true;
|
||||||
|
//清空身上代理路径
|
||||||
|
container.Agent.ResetPath();
|
||||||
|
//关闭唤醒状态
|
||||||
|
container.isAwke = false;
|
||||||
|
container.Agent.enabled = false;
|
||||||
|
//绑定到货叉
|
||||||
|
container.transform.parent = fork.transform;
|
||||||
|
Debug.LogWarning(name + ":绑定容器 =" + container);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string GetForkActionName(StackerForkActionEnum forkActionEnum)
|
||||||
|
{
|
||||||
|
string row = stackerData.toRow.ToString("D2");
|
||||||
|
//左伸
|
||||||
|
if (StackerForkActionEnum.LeftExtendFork == forkActionEnum || StackerForkActionEnum.RightRetractFork == forkActionEnum)
|
||||||
|
{
|
||||||
|
//左浅
|
||||||
|
if (string.Equals(forkActionMap.leftShaollow, row))
|
||||||
|
{
|
||||||
|
return stackerData.frontForkHasGoods == true ? ForkActionNameConstant.leftPutShaollw : ForkActionNameConstant.leftTakeShaollw;
|
||||||
|
}
|
||||||
|
//左深
|
||||||
|
if (string.Equals(forkActionMap.leftDeeps, row))
|
||||||
|
{
|
||||||
|
return stackerData.frontForkHasGoods == true ? ForkActionNameConstant.leftPutDeep : ForkActionNameConstant.leftTakeDeep;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//右伸
|
||||||
|
if (StackerForkActionEnum.RightExtendFork == forkActionEnum || StackerForkActionEnum.LeftRetractFork == forkActionEnum)
|
||||||
|
{
|
||||||
|
//右浅
|
||||||
|
if (string.Equals(forkActionMap.rightShaollow, row))
|
||||||
|
{
|
||||||
|
return stackerData.frontForkHasGoods == true ? ForkActionNameConstant.RightPutShaollw : ForkActionNameConstant.RightTakeShaollw;
|
||||||
|
}
|
||||||
|
|
||||||
|
//右深
|
||||||
|
if (string.Equals(forkActionMap.rightDeeps, row))
|
||||||
|
{
|
||||||
|
return stackerData.frontForkHasGoods == true ? ForkActionNameConstant.RightPutDeep : ForkActionNameConstant.RightTakeDeep;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Exception(name + ":未配置伸叉映射");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void MouseSingleClick()
|
||||||
|
{
|
||||||
|
base.MouseSingleClick();
|
||||||
|
isOpenPop = !isOpenPop;
|
||||||
|
stackerPopUI.Open(this, isOpenPop);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取要播放动画名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="actionEnum"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private string GetActionAnimationName(StackerForkActionEnum actionEnum)
|
||||||
|
{
|
||||||
|
return forkActionBinding.Find(v => v.forkActionEnum == actionEnum).actionClipName;
|
||||||
|
}
|
||||||
|
public override void DataHandle(object data, object other = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
//接收数据
|
||||||
|
stackerData = JsonConvert.DeserializeObject<StackerData>(JsonConvert.SerializeObject(data));
|
||||||
|
frontHasGoodsDesc = stackerData.frontForkHasGoods == true ? "前叉有货" : "无货";
|
||||||
|
deviceData = JsonConvert.DeserializeObject<DeviceData>(JsonConvert.SerializeObject(other));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ProcessCompleted()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
[System.Serializable]
|
||||||
|
public class StackerForkActionBinding
|
||||||
|
{
|
||||||
|
public StackerForkActionEnum forkActionEnum;
|
||||||
|
public string actionClipName;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 播放分组
|
||||||
|
/// </summary>
|
||||||
|
private void PlayTrackGroup(string groupName, bool isRest = true)
|
||||||
|
{
|
||||||
|
var graph = playableDirector.playableAsset as TimelineAsset;
|
||||||
|
if (graph == null)
|
||||||
|
{
|
||||||
|
throw new Exception(name+":未找到 TimelineAsset 资源");
|
||||||
|
}
|
||||||
|
if (isRest)
|
||||||
|
{
|
||||||
|
List<TrackAsset> others = new List<TrackAsset>();
|
||||||
|
foreach (var track in trackAssets)
|
||||||
|
{
|
||||||
|
if (string.Equals(track.name, groupName))
|
||||||
|
{
|
||||||
|
track.muted = false;
|
||||||
|
|
||||||
|
foreach (var clip in track.GetClips())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
others.Add(track);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//关闭其他动画
|
||||||
|
others.ForEach(v => v.muted = true);
|
||||||
|
playableDirector.Stop();
|
||||||
|
}
|
||||||
|
playableDirector.Play();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override T DynamicData<T>()
|
||||||
|
{
|
||||||
|
return (T)(object)stackerData;
|
||||||
|
}
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class ForkActionMap
|
||||||
|
{
|
||||||
|
public string leftShaollow;
|
||||||
|
public string leftDeeps;
|
||||||
|
public string rightShaollow;
|
||||||
|
public string rightDeeps;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 堆垛机动作动画名称常量
|
||||||
|
/// </summary>
|
||||||
|
private class ForkActionNameConstant
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 左浅取货
|
||||||
|
/// </summary>
|
||||||
|
public static string leftTakeShaollw = "Lef_take_shallow";
|
||||||
|
/// <summary>
|
||||||
|
/// 左深取货
|
||||||
|
/// </summary>
|
||||||
|
public static string leftTakeDeep = "Lef_take_deep";
|
||||||
|
/// <summary>
|
||||||
|
/// 左浅放货
|
||||||
|
/// </summary>
|
||||||
|
public static string leftPutShaollw = "Left_put_shallow";
|
||||||
|
/// <summary>
|
||||||
|
/// 左深放货
|
||||||
|
/// </summary>
|
||||||
|
public static string leftPutDeep = "Left_put_deep";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 右浅取货
|
||||||
|
/// </summary>
|
||||||
|
public static string RightTakeShaollw = "Right_take_shallow";
|
||||||
|
/// <summary>
|
||||||
|
/// 右深取货
|
||||||
|
/// </summary>
|
||||||
|
public static string RightTakeDeep = "Right_take_deep";
|
||||||
|
/// <summary>
|
||||||
|
/// 右浅放货
|
||||||
|
/// </summary>
|
||||||
|
public static string RightPutShaollw = "Right_put_shallow";
|
||||||
|
/// <summary>
|
||||||
|
/// 右深放货
|
||||||
|
/// </summary>
|
||||||
|
public static string RightPutDeep = "Right_put_deep";
|
||||||
|
|
||||||
|
public static string ForkCargoUp = "载货台上升";
|
||||||
|
public static string ForkCargoDown = "载货台下降";
|
||||||
|
}
|
||||||
|
}
|
11
Assets/script/device/stacker/StackerDevice.cs.meta
Normal file
11
Assets/script/device/stacker/StackerDevice.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f309d8a55ccc9354b85287201e04d36a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
31
Assets/script/device/stacker/StackerForkActionEnum.cs
Normal file
31
Assets/script/device/stacker/StackerForkActionEnum.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/// <summary>
|
||||||
|
/// 堆垛机货叉申叉信号
|
||||||
|
/// </summary>
|
||||||
|
[System.Serializable]
|
||||||
|
public enum StackerForkActionEnum
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 右伸叉
|
||||||
|
/// </summary>
|
||||||
|
RightExtendFork = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// 左缩叉
|
||||||
|
/// </summary>
|
||||||
|
LeftRetractFork = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 左伸叉
|
||||||
|
/// </summary>
|
||||||
|
LeftExtendFork = 3,
|
||||||
|
/// <summary>
|
||||||
|
/// 右缩叉
|
||||||
|
/// </summary>
|
||||||
|
RightRetractFork = 4,
|
||||||
|
/// <summary>
|
||||||
|
/// 静止
|
||||||
|
/// </summary>
|
||||||
|
ForkRest = 0
|
||||||
|
|
||||||
|
|
||||||
|
}
|
11
Assets/script/device/stacker/StackerForkActionEnum.cs.meta
Normal file
11
Assets/script/device/stacker/StackerForkActionEnum.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 60b4ab64c2192bd4fb0984d7b007f872
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
29
Assets/script/device/stacker/StackerForkCargoEnum.cs
Normal file
29
Assets/script/device/stacker/StackerForkCargoEnum.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 堆垛机探货光电
|
||||||
|
/// </summary>
|
||||||
|
[System.Serializable]
|
||||||
|
public enum StackerForkCargoEnum
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 左浅有货
|
||||||
|
/// </summary>
|
||||||
|
LeftShallow = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// 原位有货
|
||||||
|
/// </summary>
|
||||||
|
ForkCargo = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// 右浅有货
|
||||||
|
/// </summary>
|
||||||
|
RightShallow = 2,
|
||||||
|
/// <summary>
|
||||||
|
/// 左深有货
|
||||||
|
/// </summary>
|
||||||
|
LeftDeep = 4,
|
||||||
|
/// <summary>
|
||||||
|
/// 右深有货
|
||||||
|
/// </summary>
|
||||||
|
RightDeep = 3,
|
||||||
|
|
||||||
|
}
|
11
Assets/script/device/stacker/StackerForkCargoEnum.cs.meta
Normal file
11
Assets/script/device/stacker/StackerForkCargoEnum.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 66ea810e9bdf3a14f8b72d72ef7bf7e0
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
46
Assets/script/device/stacker/stackerTimeline.playable
Normal file
46
Assets/script/device/stacker/stackerTimeline.playable
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
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: bfda56da833e2384a9677cd3c976a436, type: 3}
|
||||||
|
m_Name: stackerTimeline
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Version: 0
|
||||||
|
m_Tracks:
|
||||||
|
- {fileID: 4415083915600886586}
|
||||||
|
m_FixedDuration: 0
|
||||||
|
m_EditorSettings:
|
||||||
|
m_Framerate: 60
|
||||||
|
m_ScenePreview: 1
|
||||||
|
m_DurationMode: 0
|
||||||
|
m_MarkerTrack: {fileID: 0}
|
||||||
|
--- !u!114 &4415083915600886586
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
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: d0fc6f5187a81dc47999eefade6f0935, type: 3}
|
||||||
|
m_Name: LeftExtendFork
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Version: 3
|
||||||
|
m_AnimClip: {fileID: 0}
|
||||||
|
m_Locked: 0
|
||||||
|
m_Muted: 0
|
||||||
|
m_CustomPlayableFullTypename:
|
||||||
|
m_Curves: {fileID: 0}
|
||||||
|
m_Parent: {fileID: 11400000}
|
||||||
|
m_Children: []
|
||||||
|
m_Clips: []
|
||||||
|
m_Markers:
|
||||||
|
m_Objects: []
|
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 66032b99a8abdaf48ae3ece22636d98a
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
337
Assets/script/device/stacker/右浅伸.anim
Normal file
337
Assets/script/device/stacker/右浅伸.anim
Normal file
@ -0,0 +1,337 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!74 &7400000
|
||||||
|
AnimationClip:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: "\u53F3\u6D45\u4F38"
|
||||||
|
serializedVersion: 7
|
||||||
|
m_Legacy: 0
|
||||||
|
m_Compressed: 0
|
||||||
|
m_UseHighQualityCurve: 1
|
||||||
|
m_RotationCurves: []
|
||||||
|
m_CompressedRotationCurves: []
|
||||||
|
m_EulerCurves: []
|
||||||
|
m_PositionCurves:
|
||||||
|
- curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: {x: 0, y: 0.0067, z: 0.08000162}
|
||||||
|
inSlope: {x: 0, y: 0, z: 0}
|
||||||
|
outSlope: {x: 0, y: 0, z: 0}
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.8333333
|
||||||
|
value: {x: 0, y: 0.0067, z: -0.33}
|
||||||
|
inSlope: {x: 0, y: 0, z: -0.4545012}
|
||||||
|
outSlope: {x: 0, y: 0, z: -0.4545012}
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1.3333334
|
||||||
|
value: {x: 0, y: 0.0067, z: -0.526}
|
||||||
|
inSlope: {x: 0, y: 0, z: 0}
|
||||||
|
outSlope: {x: 0, y: 0, z: 0}
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
path: Caro-parent/Cargo/fork/k
|
||||||
|
- curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: {x: 31.3795, y: -0.5468, z: 18.135}
|
||||||
|
inSlope: {x: 0, y: 0, z: 0}
|
||||||
|
outSlope: {x: 0, y: 0, z: 0}
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.8333333
|
||||||
|
value: {x: 31.3795, y: -0.5468, z: 17.866}
|
||||||
|
inSlope: {x: 0, y: 0, z: 0}
|
||||||
|
outSlope: {x: 0, y: 0, z: 0}
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
path: Caro-parent/Cargo/fork/geo_gunmetal_1.002 (1)
|
||||||
|
m_ScaleCurves: []
|
||||||
|
m_FloatCurves: []
|
||||||
|
m_PPtrCurves: []
|
||||||
|
m_SampleRate: 60
|
||||||
|
m_WrapMode: 0
|
||||||
|
m_Bounds:
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
m_Extent: {x: 0, y: 0, z: 0}
|
||||||
|
m_ClipBindingConstant:
|
||||||
|
genericBindings:
|
||||||
|
- serializedVersion: 2
|
||||||
|
path: 3906954733
|
||||||
|
attribute: 1
|
||||||
|
script: {fileID: 0}
|
||||||
|
typeID: 4
|
||||||
|
customType: 0
|
||||||
|
isPPtrCurve: 0
|
||||||
|
isIntCurve: 0
|
||||||
|
isSerializeReferenceCurve: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
path: 1921414330
|
||||||
|
attribute: 1
|
||||||
|
script: {fileID: 0}
|
||||||
|
typeID: 4
|
||||||
|
customType: 0
|
||||||
|
isPPtrCurve: 0
|
||||||
|
isIntCurve: 0
|
||||||
|
isSerializeReferenceCurve: 0
|
||||||
|
pptrCurveMapping: []
|
||||||
|
m_AnimationClipSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||||
|
m_AdditiveReferencePoseTime: 0
|
||||||
|
m_StartTime: 0
|
||||||
|
m_StopTime: 1.3333334
|
||||||
|
m_OrientationOffsetY: 0
|
||||||
|
m_Level: 0
|
||||||
|
m_CycleOffset: 0
|
||||||
|
m_HasAdditiveReferencePose: 0
|
||||||
|
m_LoopTime: 0
|
||||||
|
m_LoopBlend: 0
|
||||||
|
m_LoopBlendOrientation: 0
|
||||||
|
m_LoopBlendPositionY: 0
|
||||||
|
m_LoopBlendPositionXZ: 0
|
||||||
|
m_KeepOriginalOrientation: 0
|
||||||
|
m_KeepOriginalPositionY: 1
|
||||||
|
m_KeepOriginalPositionXZ: 0
|
||||||
|
m_HeightFromFeet: 0
|
||||||
|
m_Mirror: 0
|
||||||
|
m_EditorCurves:
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.8333333
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1.3333334
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.x
|
||||||
|
path: Caro-parent/Cargo/fork/k
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0.0067
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.8333333
|
||||||
|
value: 0.0067
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1.3333334
|
||||||
|
value: 0.0067
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.y
|
||||||
|
path: Caro-parent/Cargo/fork/k
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0.08000162
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.8333333
|
||||||
|
value: -0.33
|
||||||
|
inSlope: -0.4545012
|
||||||
|
outSlope: -0.4545012
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1.3333334
|
||||||
|
value: -0.526
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.z
|
||||||
|
path: Caro-parent/Cargo/fork/k
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 31.3795
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.8333333
|
||||||
|
value: 31.3795
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.x
|
||||||
|
path: Caro-parent/Cargo/fork/geo_gunmetal_1.002 (1)
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: -0.5468
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.8333333
|
||||||
|
value: -0.5468
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.y
|
||||||
|
path: Caro-parent/Cargo/fork/geo_gunmetal_1.002 (1)
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
- serializedVersion: 2
|
||||||
|
curve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 18.135
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0.8333333
|
||||||
|
value: 17.866
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 136
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
attribute: m_LocalPosition.z
|
||||||
|
path: Caro-parent/Cargo/fork/geo_gunmetal_1.002 (1)
|
||||||
|
classID: 4
|
||||||
|
script: {fileID: 0}
|
||||||
|
flags: 0
|
||||||
|
m_EulerEditorCurves: []
|
||||||
|
m_HasGenericRootTransform: 0
|
||||||
|
m_HasMotionFloatCurves: 0
|
||||||
|
m_Events: []
|
8
Assets/script/device/stacker/右浅伸.anim.meta
Normal file
8
Assets/script/device/stacker/右浅伸.anim.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e9fa085935da61b4ba9a30d5b095cb45
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 7400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user