55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using Simulator.Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UVC.Data.Core;
|
|
|
|
namespace Simulator.Data
|
|
{
|
|
public class QueueComponent : ComponentBase
|
|
{
|
|
QueueDataClass queueData;
|
|
public GameObject entitySocket;
|
|
public void SetComponent(QueueDataClass queueData)
|
|
{
|
|
this.queueData = queueData;
|
|
data = queueData;
|
|
FitCollider();
|
|
SetPosition();
|
|
SetRotation();
|
|
}
|
|
|
|
public override void GetModelData(DataObject modelData)
|
|
{
|
|
Debug.Log("실행되어선 안되는 함수입니다");
|
|
}
|
|
|
|
public override void SetEntity(string key, string name = "")
|
|
{
|
|
var entity=EntityManager.Instance.GetEntity(key, name);
|
|
PlaceEntity(entity);
|
|
}
|
|
public void PlaceEntity(Entity entity)
|
|
{
|
|
if (entitySocket == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
entity.transform.SetParent(entitySocket.transform, worldPositionStays: false);
|
|
float stepZ = EntityManager.Instance.ObjectSize.z;
|
|
entity.transform.localPosition = new Vector3(0f, 0f, 0f);
|
|
entity.transform.localRotation = Quaternion.identity;
|
|
}
|
|
|
|
protected override void OnDestroy()
|
|
{
|
|
base.OnDestroy();
|
|
}
|
|
|
|
public override void GetPath()
|
|
{
|
|
onComponentClicked?.Invoke(componentType, queueData);
|
|
}
|
|
}
|
|
} |