Compare commits
2 Commits
eaa0060a1f
...
b96ae8a277
| Author | SHA1 | Date | |
|---|---|---|---|
| b96ae8a277 | |||
| 78741a18d0 |
46
Assets/Resources/Prefabs/FunctionObject/Equipment.prefab
Normal file
46
Assets/Resources/Prefabs/FunctionObject/Equipment.prefab
Normal file
@@ -0,0 +1,46 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &8758756404333995054
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8609072778481320991}
|
||||
- component: {fileID: 6131395041002174933}
|
||||
m_Layer: 0
|
||||
m_Name: Equipment
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8609072778481320991
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8758756404333995054}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &6131395041002174933
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8758756404333995054}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2df93fa6e7631384cafc4feb7eea7570, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 85c18124e071198409409aa95b5cd210
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/Resources/Prefabs/FunctionObject/Port.prefab
Normal file
46
Assets/Resources/Prefabs/FunctionObject/Port.prefab
Normal file
@@ -0,0 +1,46 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5411280148695288908
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5143446108178832792}
|
||||
- component: {fileID: 8763499551060147834}
|
||||
m_Layer: 0
|
||||
m_Name: Port
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5143446108178832792
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5411280148695288908}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &8763499551060147834
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5411280148695288908}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2e47a0e413d2b5c4589219a26e4d5114, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
7
Assets/Resources/Prefabs/FunctionObject/Port.prefab.meta
Normal file
7
Assets/Resources/Prefabs/FunctionObject/Port.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 301f54894aa29c74bb834d0b9a9eb40f
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/Resources/Prefabs/FunctionObject/Stacker.prefab
Normal file
46
Assets/Resources/Prefabs/FunctionObject/Stacker.prefab
Normal file
@@ -0,0 +1,46 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &66947612143645641
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1112511769680313102}
|
||||
- component: {fileID: 467380774940458219}
|
||||
m_Layer: 0
|
||||
m_Name: Stacker
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1112511769680313102
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 66947612143645641}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &467380774940458219
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 66947612143645641}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ff0ca629c950c664f98ef2f6dbe6cc29, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c7b20b400887d744b341778352edacd
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -85,7 +85,6 @@ namespace Studio.AssetTool
|
||||
|
||||
private IEnumerator LoadAssetFiles(List<string> filePaths, Action onComplete)
|
||||
{
|
||||
List<CustomAssetData> loadedTargets = new();
|
||||
foreach (var file in filePaths)
|
||||
{
|
||||
var assetName = Path.GetFileNameWithoutExtension(file);
|
||||
@@ -105,27 +104,14 @@ namespace Studio.AssetTool
|
||||
assetData.folderName = folderName;
|
||||
|
||||
assetData.LoadLocalFBX(file);
|
||||
//yield return new WaitUntil(() => (assetData.isLoadComplete && assetData.progress == 1) || assetData.isLoadError);
|
||||
yield return new WaitUntil(() => (assetData.isLoadComplete && assetData.progress == 1) || assetData.isLoadError);
|
||||
|
||||
assetData.OnLoadComplete();
|
||||
|
||||
Texture2D thumbnail = RuntimePreviewGenerator.GenerateModelPreview(assetData.loadedObject.transform, 320, 200);
|
||||
thumbnail = TextureUtil.MakeReadableTexture(thumbnail);
|
||||
assetData.thumbnail = thumbnail;
|
||||
|
||||
}
|
||||
|
||||
while (loadedTargets.Count > 0)
|
||||
{
|
||||
foreach(var assetData in loadedTargets)
|
||||
{
|
||||
if (assetData.isLoadComplete && assetData.progress == 1)
|
||||
{
|
||||
OnLoadComplete(assetData);
|
||||
loadedTargets.Remove(assetData);
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
OnLoadComplete(assetData);
|
||||
}
|
||||
|
||||
onComplete?.Invoke(); // 한 폴더 끝나면 알림
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Studio.AssetTool;
|
||||
using Studio.Core;
|
||||
@@ -51,5 +51,6 @@ namespace Studio.Manage
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
65
Assets/Scripts/Studio/TwinObject/StaticObject/Equipment.cs
Normal file
65
Assets/Scripts/Studio/TwinObject/StaticObject/Equipment.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using Studio.AssetTool;
|
||||
using Studio.Manage;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio
|
||||
{
|
||||
public class Equipment : AbstractFunctionObject
|
||||
{
|
||||
public Action<Dictionary<string, string>> onDataUpdate;
|
||||
public Dictionary<string, string> CurrentEntity;
|
||||
|
||||
private CustomAssetRenderObject renderObject;
|
||||
private string curType;
|
||||
|
||||
public override Dictionary<string, string> Info
|
||||
{
|
||||
get
|
||||
{
|
||||
//ToDo 보고싶은 정보 나열한.. 리스트 목록 가져온다..
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
|
||||
public override Dictionary<string, string> Label
|
||||
{
|
||||
get
|
||||
{
|
||||
//ToDo 보고싶은 정보 나열한.. 리스트 목록 가져온다..
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
public override void AfterAwake()
|
||||
{
|
||||
ManagerHub.instance.Get<RunManager>().onRun += OnPlayStart;
|
||||
}
|
||||
public void OnPlayStart()
|
||||
{
|
||||
renderObject = GetComponent<CustomAssetRenderObject>();
|
||||
curType = renderObject.topic;
|
||||
StudioService.instance.AddTypeIdListener(curType, transform.name, OnUpdateData);
|
||||
}
|
||||
|
||||
public override void ChangeAutoID(bool isAuto)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public override void OnUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
CurrentEntity = e.Entity;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (ManagerHub.instance == null)
|
||||
return;
|
||||
ManagerHub.instance.Get<RunManager>().onRun -= OnPlayStart;
|
||||
if (curType == null)
|
||||
return;
|
||||
StudioService.instance.RemoveTypeIdListener(curType, transform.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2df93fa6e7631384cafc4feb7eea7570
|
||||
65
Assets/Scripts/Studio/TwinObject/StaticObject/Port.cs
Normal file
65
Assets/Scripts/Studio/TwinObject/StaticObject/Port.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using Studio.AssetTool;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Studio.Manage;
|
||||
|
||||
namespace Studio
|
||||
{
|
||||
public class Port : AbstractFunctionObject
|
||||
{
|
||||
public Action<Dictionary<string, string>> onDataUpdate;
|
||||
public Dictionary<string, string> CurrentEntity;
|
||||
|
||||
private CustomAssetRenderObject renderObject;
|
||||
private string curType;
|
||||
|
||||
public override Dictionary<string, string> Info
|
||||
{
|
||||
get
|
||||
{
|
||||
//ToDo 보고싶은 정보 나열한.. 리스트 목록 가져온다..
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
|
||||
public override Dictionary<string, string> Label
|
||||
{
|
||||
get
|
||||
{
|
||||
//ToDo 보고싶은 정보 나열한.. 리스트 목록 가져온다..
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
public override void AfterAwake()
|
||||
{
|
||||
ManagerHub.instance.Get<RunManager>().onRun += OnPlayStart;
|
||||
}
|
||||
public void OnPlayStart()
|
||||
{
|
||||
renderObject = GetComponent<CustomAssetRenderObject>();
|
||||
curType = renderObject.topic;
|
||||
StudioService.instance.AddTypeIdListener(curType, transform.name, OnUpdateData);
|
||||
}
|
||||
|
||||
public override void ChangeAutoID(bool isAuto)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public override void OnUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
CurrentEntity = e.Entity;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (ManagerHub.instance == null)
|
||||
return;
|
||||
ManagerHub.instance.Get<RunManager>().onRun -= OnPlayStart;
|
||||
if (curType == null)
|
||||
return;
|
||||
StudioService.instance.RemoveTypeIdListener(curType, transform.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e47a0e413d2b5c4589219a26e4d5114
|
||||
64
Assets/Scripts/Studio/TwinObject/StaticObject/Stacker.cs
Normal file
64
Assets/Scripts/Studio/TwinObject/StaticObject/Stacker.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using Studio.AssetTool;
|
||||
using Studio.Manage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Studio
|
||||
{
|
||||
public class Stacker : AbstractFunctionObject
|
||||
{
|
||||
public Action<Dictionary<string, string>> onDataUpdate;
|
||||
public Dictionary<string, string> CurrentEntity;
|
||||
|
||||
private CustomAssetRenderObject renderObject;
|
||||
private string curType;
|
||||
|
||||
public override Dictionary<string, string> Info
|
||||
{
|
||||
get
|
||||
{
|
||||
//ToDo 보고싶은 정보 나열한.. 리스트 목록 가져온다..
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
|
||||
public override Dictionary<string, string> Label
|
||||
{
|
||||
get
|
||||
{
|
||||
//ToDo 보고싶은 정보 나열한.. 리스트 목록 가져온다..
|
||||
return CurrentEntity;
|
||||
}
|
||||
}
|
||||
public override void AfterAwake()
|
||||
{
|
||||
ManagerHub.instance.Get<RunManager>().onRun += OnPlayStart;
|
||||
}
|
||||
public void OnPlayStart()
|
||||
{
|
||||
renderObject = GetComponent<CustomAssetRenderObject>();
|
||||
curType = renderObject.topic;
|
||||
StudioService.instance.AddTypeIdListener(curType, transform.name, OnUpdateData);
|
||||
}
|
||||
public override void ChangeAutoID(bool isAuto)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public override void OnUpdateData(object sender, StudioServiceIdEventArgs e)
|
||||
{
|
||||
CurrentEntity = e.Entity;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (ManagerHub.instance == null)
|
||||
return;
|
||||
ManagerHub.instance.Get<RunManager>().onRun -= OnPlayStart;
|
||||
if (curType == null)
|
||||
return;
|
||||
StudioService.instance.RemoveTypeIdListener(curType, transform.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff0ca629c950c664f98ef2f6dbe6cc29
|
||||
Reference in New Issue
Block a user