Make chest creating more flexible II

This commit is contained in:
kabix09 2022-12-21 23:32:51 +01:00
parent 8e3f89a6f7
commit 2591ed3e74
15 changed files with 515 additions and 169 deletions

View File

@ -1,5 +1,66 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &3212952009026652943
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8363154141198799061}
- component: {fileID: 3631264059268387612}
- component: {fileID: 7496089892055061797}
m_Layer: 0
m_Name: Chest1-InteractionMSG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8363154141198799061
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3212952009026652943}
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: 4669568061092186073}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!58 &3631264059268387612
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3212952009026652943}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.021246195, y: -0.084985375}
serializedVersion: 2
m_Radius: 1.7960162
--- !u!114 &7496089892055061797
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3212952009026652943}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a532f2b712a01fc4fad02346f1a69e39, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &4669568061092186072 --- !u!1 &4669568061092186072
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -30,7 +91,8 @@ Transform:
m_LocalPosition: {x: 58.59589, y: 32.941498, z: 20} m_LocalPosition: {x: 58.59589, y: 32.941498, z: 20}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children:
- {fileID: 8363154141198799061}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -128,6 +190,6 @@ MonoBehaviour:
id: 0 id: 0
name: name:
description: description:
chestModel: {fileID: 0} chestModel: {fileID: 4669568061092186072}
ChestType: 0 ChestType: 2
Content: [] Content: []

View File

@ -27,7 +27,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 805898524} m_GameObject: {fileID: 805898524}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.095890045, y: -0.058502197, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -213,6 +213,6 @@ MonoBehaviour:
id: 0 id: 0
name: name:
description: description:
chestModel: {fileID: 0} chestModel: {fileID: 4669568061092186072}
ChestType: 0 ChestType: 2
Content: [] Content: []

View File

@ -10,7 +10,6 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 584661738} - component: {fileID: 584661738}
- component: {fileID: 584661740} - component: {fileID: 584661740}
- component: {fileID: 584661739}
- component: {fileID: 6369310084342855511} - component: {fileID: 6369310084342855511}
m_Layer: 0 m_Layer: 0
m_Name: Chest0-InteractionMSG m_Name: Chest0-InteractionMSG
@ -27,7 +26,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584661737} m_GameObject: {fileID: 584661737}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.19999695, z: -1.8041458} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -50,28 +49,6 @@ CircleCollider2D:
m_Offset: {x: -0.058876753, y: -0.084985375} m_Offset: {x: -0.058876753, y: -0.084985375}
serializedVersion: 2 serializedVersion: 2
m_Radius: 1.8336468 m_Radius: 1.8336468
--- !u!114 &584661739
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584661737}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 19883581ad8bbd9458fc7bc8c4bb3279, type: 3}
m_Name:
m_EditorClassIdentifier:
Panel: {fileID: 1131349084736352762, guid: bd644a38094b0334b979c0234699f069, type: 3}
OtherPanel: {fileID: 5331092055018478733, guid: 2b46aee216d4b304f8aebcb303ebf4f4, type: 3}
SecondPanel: {fileID: 4888099765917562817, guid: c5397665a1fef4d4e8de420a7ee4ad74, type: 3}
PanelAbove: {fileID: 4787883790006063180, guid: b224f3239791233448271af67a076b03, type: 3}
_tmpPanel: {fileID: 0}
_tmpOtherPanel: {fileID: 0}
_tmpSecondPanel: {fileID: 0}
_tmpPanelAbove: {fileID: 0}
obj: {fileID: 5754902894522036729}
isAllowedToShowPanels: 1
--- !u!114 &6369310084342855511 --- !u!114 &6369310084342855511
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -213,6 +190,6 @@ MonoBehaviour:
id: 0 id: 0
name: name:
description: description:
chestModel: {fileID: 0} chestModel: {fileID: 5754902894522036729}
ChestType: 0 ChestType: 3
Content: [] Content: []

View File

@ -0,0 +1,218 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &584661737
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 584661738}
- component: {fileID: 584661740}
- component: {fileID: 584661739}
- component: {fileID: 6369310084342855511}
m_Layer: 0
m_Name: Chest0-InteractionMSG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &584661738
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584661737}
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: 5754902894522036728}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!58 &584661740
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584661737}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.058876753, y: -0.084985375}
serializedVersion: 2
m_Radius: 1.8336468
--- !u!114 &584661739
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584661737}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 19883581ad8bbd9458fc7bc8c4bb3279, type: 3}
m_Name:
m_EditorClassIdentifier:
Panel: {fileID: 1131349084736352762, guid: bd644a38094b0334b979c0234699f069, type: 3}
OtherPanel: {fileID: 5331092055018478733, guid: 2b46aee216d4b304f8aebcb303ebf4f4, type: 3}
SecondPanel: {fileID: 4888099765917562817, guid: c5397665a1fef4d4e8de420a7ee4ad74, type: 3}
PanelAbove: {fileID: 4787883790006063180, guid: b224f3239791233448271af67a076b03, type: 3}
_tmpPanel: {fileID: 0}
_tmpOtherPanel: {fileID: 0}
_tmpSecondPanel: {fileID: 0}
_tmpPanelAbove: {fileID: 0}
obj: {fileID: 5754902894522036729}
isAllowedToShowPanels: 1
--- !u!114 &6369310084342855511
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584661737}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a532f2b712a01fc4fad02346f1a69e39, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &5754902894522036729
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5754902894522036728}
- component: {fileID: 5754902894522036731}
- component: {fileID: 5754902894522036730}
- component: {fileID: 1539754125081080905}
m_Layer: 0
m_Name: Prize
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5754902894522036728
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5754902894522036729}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 16, y: 51.2, z: 18.195854}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 584661738}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &5754902894522036731
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5754902894522036729}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 3
m_Sprite: {fileID: -471958427270782953, guid: 7aa335ae36a8a8a478192b6105ddf5ab, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1.35, y: 1.1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!61 &5754902894522036730
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5754902894522036729}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 1.35, y: 1.1}
newSize: {x: 1.35, y: 1.1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1.35, y: 1.1}
m_EdgeRadius: 0
--- !u!114 &1539754125081080905
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5754902894522036729}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 89637c42dcc6baf4abb590f571640a32, type: 3}
m_Name:
m_EditorClassIdentifier:
Chest:
id: 0
name:
description:
chestModel: {fileID: 5754902894522036729}
ChestType: 3
Content: []

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6ace82e50dfe07f4ea6bd584da9456b3 guid: 5225a70fbdf66e745b2ef443328a6a53
PrefabImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -31,7 +31,8 @@ Transform:
m_LocalPosition: {x: -8.45, y: -3.9, z: 10} m_LocalPosition: {x: -8.45, y: -3.9, z: 10}
m_LocalScale: {x: 1, y: 1, z: 2} m_LocalScale: {x: 1, y: 1, z: 2}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children:
- {fileID: 2040639819227648951}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -155,6 +156,67 @@ MonoBehaviour:
id: 0 id: 0
name: name:
description: description:
chestModel: {fileID: 0} chestModel: {fileID: 3972494989842158579}
ChestType: 0 ChestType: 0
Content: [] Content: []
--- !u!1 &6979447088390353274
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2040639819227648951}
- component: {fileID: 3179850518690222637}
- component: {fileID: 9085025176585602454}
m_Layer: 0
m_Name: Chest1-InteractionMSG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2040639819227648951
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6979447088390353274}
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: 0.5}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3972494989842158580}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!58 &3179850518690222637
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6979447088390353274}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.058876753, y: -0.084985375}
serializedVersion: 2
m_Radius: 1.8336468
--- !u!114 &9085025176585602454
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6979447088390353274}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a532f2b712a01fc4fad02346f1a69e39, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@ -1,89 +1,5 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &1698721846
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1698721847}
- component: {fileID: 1698721849}
- component: {fileID: 1698721848}
- component: {fileID: 3574830714698708195}
m_Layer: 0
m_Name: Chest3-InteractionMSG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1698721847
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1698721846}
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: 3972494989842158580}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!58 &1698721849
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1698721846}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.021246195, y: -0.084985375}
serializedVersion: 2
m_Radius: 1.7960162
--- !u!114 &1698721848
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1698721846}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 19883581ad8bbd9458fc7bc8c4bb3279, type: 3}
m_Name:
m_EditorClassIdentifier:
Panel: {fileID: 1131349084736352762, guid: bd644a38094b0334b979c0234699f069, type: 3}
OtherPanel: {fileID: 5331092055018478733, guid: 2b46aee216d4b304f8aebcb303ebf4f4, type: 3}
SecondPanel: {fileID: 4888099765917562817, guid: c5397665a1fef4d4e8de420a7ee4ad74, type: 3}
PanelAbove: {fileID: 4787883790006063180, guid: b224f3239791233448271af67a076b03, type: 3}
_tmpPanel: {fileID: 0}
_tmpOtherPanel: {fileID: 0}
_tmpSecondPanel: {fileID: 0}
_tmpPanelAbove: {fileID: 0}
obj: {fileID: 3972494989842158579}
isAllowedToShowPanels: 1
--- !u!114 &3574830714698708195
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1698721846}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a532f2b712a01fc4fad02346f1a69e39, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &3972494989842158579 --- !u!1 &3972494989842158579
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -96,9 +12,9 @@ GameObject:
- component: {fileID: 3972494989842158473} - component: {fileID: 3972494989842158473}
- component: {fileID: 3972494989842158583} - component: {fileID: 3972494989842158583}
- component: {fileID: 3972494989842158582} - component: {fileID: 3972494989842158582}
- component: {fileID: 8326308579546157189} - component: {fileID: 6216344267889095310}
m_Layer: 0 m_Layer: 0
m_Name: Wood m_Name: Wooden
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -116,7 +32,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 2} m_LocalScale: {x: 1, y: 1, z: 2}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 1698721847} - {fileID: 3343843920455804694}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -224,7 +140,7 @@ BoxCollider2D:
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.95, y: 1.5900776} m_Size: {x: 0.95, y: 1.5900776}
m_EdgeRadius: 0 m_EdgeRadius: 0
--- !u!114 &8326308579546157189 --- !u!114 &6216344267889095310
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
@ -240,6 +156,90 @@ MonoBehaviour:
id: 0 id: 0
name: name:
description: description:
chestModel: {fileID: 0} chestModel: {fileID: 3972494989842158579}
ChestType: 0 ChestType: 0
Content: [] Content: []
--- !u!1 &5564756746198341403
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3343843920455804694}
- component: {fileID: 4990899881619722179}
- component: {fileID: 5390010098290360696}
- component: {fileID: 2316520128883550360}
m_Layer: 0
m_Name: Chest1-InteractionMSG
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3343843920455804694
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5564756746198341403}
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: 0.5}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3972494989842158580}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!58 &4990899881619722179
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5564756746198341403}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.058876753, y: -0.084985375}
serializedVersion: 2
m_Radius: 1.8336468
--- !u!114 &5390010098290360696
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5564756746198341403}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 19883581ad8bbd9458fc7bc8c4bb3279, type: 3}
m_Name:
m_EditorClassIdentifier:
Panel: {fileID: 1131349084736352762, guid: bd644a38094b0334b979c0234699f069, type: 3}
OtherPanel: {fileID: 5331092055018478733, guid: 2b46aee216d4b304f8aebcb303ebf4f4, type: 3}
SecondPanel: {fileID: 4888099765917562817, guid: c5397665a1fef4d4e8de420a7ee4ad74, type: 3}
PanelAbove: {fileID: 4787883790006063180, guid: b224f3239791233448271af67a076b03, type: 3}
_tmpPanel: {fileID: 0}
_tmpOtherPanel: {fileID: 0}
_tmpSecondPanel: {fileID: 0}
_tmpPanelAbove: {fileID: 0}
obj: {fileID: 0}
isAllowedToShowPanels: 1
--- !u!114 &2316520128883550360
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5564756746198341403}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a532f2b712a01fc4fad02346f1a69e39, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3b367639d6e16b344a70f1827fde7c79
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1451,12 +1451,20 @@ MonoBehaviour:
Content: [] Content: []
UiManager: {fileID: 0} UiManager: {fileID: 0}
ChestsToBuildOnScene: ChestsToBuildOnScene:
- ChestName: Prize chest 2 - ChestName: Wodden Chest
ChestPrefab: {fileID: 5754902894522036729, guid: 3c4c4514921bad449bbfab46d86ee881, type: 3} ChestPrefab: {fileID: 3972494989842158579, guid: 3b367639d6e16b344a70f1827fde7c79, type: 3}
Position: {x: 0, y: 0, z: 0} Position: {x: -23.5, y: 20.5, z: 10}
Content: Content:
- Key: 0 - Key: 2
Value: {fileID: 11400000, guid: 6e4f9a44bbdb0b5418932889316a45eb, type: 2} Value: {fileID: 11400000, guid: 5935777f7ac390a4187e03f34e7cafdd, type: 2}
- ChestName: Prize Chest
ChestPrefab: {fileID: 5754902894522036729, guid: 5225a70fbdf66e745b2ef443328a6a53, type: 3}
Position: {x: 0.6, y: 75.6, z: 10}
Content: []
- ChestName: Gold2
ChestPrefab: {fileID: 4669568061092186072, guid: 5cf1cdd5626b6894f824d7c7edcdc166, type: 3}
Position: {x: 56.6, y: 0.8, z: 10}
Content: []
convertedData: [] convertedData: []
--- !u!1 &131599442 --- !u!1 &131599442
GameObject: GameObject:

View File

@ -38189,20 +38189,11 @@ MonoBehaviour:
ChestType: 0 ChestType: 0
Content: [] Content: []
UiManager: {fileID: 0} UiManager: {fileID: 0}
ElementsToBuildOnSceneList: ChestsToBuildOnScene:
- Name: - ChestName: Wooden 2
PrefabAssetName: ChestPrefab: {fileID: 3972494989842158579, guid: 7e5ccad877bb9da41a844878dab01357, type: 3}
Position: Position: {x: 5.85, y: -6, z: 10}
- 5.85 Content: []
- -6
- 10
ChestData:
id: 0
name: Wooden Chest
modelName: Wooden Chest
description:
type: 0
content: []
convertedData: [] convertedData: []
--- !u!1 &2063226728 --- !u!1 &2063226728
GameObject: GameObject:

View File

@ -114,7 +114,6 @@ public class SceneChestDataManager : SceneBaseDataManager<ChestPrefabAsset>
LoadDynamicData(); LoadDynamicData();
// VERy VERY provisional SOLUTION // VERy VERY provisional SOLUTION
if (DynamicDataList.GetList().Count == 0) if (DynamicDataList.GetList().Count == 0)
{ {
@ -122,17 +121,11 @@ public class SceneChestDataManager : SceneBaseDataManager<ChestPrefabAsset>
return; return;
} }
ChestBuilder.ElementsToBuildOnSceneList = ChestsToBuildOnScene; // DynamicDataList.GetList(); ChestBuilder.ElementsToBuildOnSceneList = ChestBuildModel.ConvertPrefabAssetListToBuildModelList(DynamicDataList.GetList());
ChestBuilder.BuildList(); ChestBuilder.BuildList();
foreach (ChestBuildModel ChestToBuild in ChestsToBuildOnScene)
{
convertedData.Add(ChestToBuild.MapBuildModelToPrefabAssetModel());
}
List<Chest> tmp = new List<Chest>(); List<Chest> tmp = new List<Chest>();
foreach (ChestPrefabAsset asset in convertedData) { tmp.Add(asset.Chest); } foreach (ChestPrefabAsset asset in DynamicDataList.GetList()) { tmp.Add(asset.Chest); }
UiManager.SetList(tmp); UiManager.SetList(tmp);
} }

View File

@ -73,13 +73,13 @@ public abstract class SceneBaseDataLoader<T> : SceneDataLoaderInterface<T>
protected virtual bool SaveDynamicData(List<T> _elements) protected virtual bool SaveDynamicData(List<T> _elements)
{ {
try /* try
{ {*/
SaveModelSystem.SaveModelList(_elements); SaveModelSystem.SaveModelList(_elements);
return true; return true;
} /* }
catch (Exception e) { Debug.LogError(e.Message); } catch (Exception e) { Debug.LogError(e.Message); }*/
return false; return false;
} }

View File

@ -111,15 +111,15 @@ public abstract class SceneBaseDataManager<T> : MonoBehaviour
protected virtual bool SaveData(List<T> _elements, SceneElementTypeEnum type) protected virtual bool SaveData(List<T> _elements, SceneElementTypeEnum type)
{ {
try /* try
{ {*/
DataLoader.SaveData(_elements, type); DataLoader.SaveData(_elements, type);
return true; return true;
} /* }
catch (Exception e) { catch (Exception e) {
Debug.LogError(e.Message); Debug.LogError(e.Message);*/
} /* }*/
return false; return false;
} }

View File

@ -14,8 +14,23 @@ public class ChestBuildModel
[SerializeField] public Vector3 Position; [SerializeField] public Vector3 Position;
[SerializeField] public List<IndexValuePair<Item>> Content; [SerializeField] public List<IndexValuePair<Item>> Content = new List<IndexValuePair<Item>>();
public ChestBuildModel(ChestPrefabAsset chestPrefabAsset)
{
ChestName = chestPrefabAsset.Chest.Name;
ChestPrefab = chestPrefabAsset.Chest.ChestModel;
Position = chestPrefabAsset.Position;
Content.Clear();
foreach (IndexValuePair<EquippableItem> item in chestPrefabAsset.Chest.Content)
{
Content.Add(
new IndexValuePair<Item>(item.Key, item.Value)
);
}
}
public ChestPrefabAsset MapBuildModelToPrefabAssetModel() public ChestPrefabAsset MapBuildModelToPrefabAssetModel()
{ {
@ -27,10 +42,10 @@ public class ChestBuildModel
chestPrefabAsset.Chest = new Chest(ChestPrefab.GetComponent<ChestWrapper>().Chest); chestPrefabAsset.Chest = new Chest(ChestPrefab.GetComponent<ChestWrapper>().Chest);
Debug.Log(chestPrefabAsset.Chest); chestPrefabAsset.Chest.ChestModel = ChestPrefab;
chestPrefabAsset.Chest.Name = ChestName; chestPrefabAsset.Chest.Name = ChestName;
Debug.Log(chestPrefabAsset.Chest.Name);
chestPrefabAsset.Chest.Content = new List<IndexValuePair<EquippableItem>>(); chestPrefabAsset.Chest.Content = new List<IndexValuePair<EquippableItem>>();
foreach (var ChestElement in Content) foreach (var ChestElement in Content)
@ -47,8 +62,23 @@ public class ChestBuildModel
); );
} }
Debug.Log(chestPrefabAsset.Chest.Content.Count);
Debug.Log(chestPrefabAsset.Chest);
return chestPrefabAsset; return chestPrefabAsset;
} }
public static List<ChestBuildModel> ConvertPrefabAssetListToBuildModelList(List<ChestPrefabAsset> chestPrefabAssetList)
{
List<ChestBuildModel> convertedList = new List<ChestBuildModel>();
foreach(var element in chestPrefabAssetList)
{
convertedList.Add(ChestBuildModel.ConvertPrefabAssetModelToBuildModel(element));
}
return convertedList;
}
public static ChestBuildModel ConvertPrefabAssetModelToBuildModel(ChestPrefabAsset chestPrefabAsset)
{
return new ChestBuildModel(chestPrefabAsset);
}
} }

View File

@ -57,9 +57,7 @@ public class NPCManager : MonoBehaviour
foreach (var thug in thugs) foreach (var thug in thugs)
{ {
var ThugClone = GameObject.Instantiate(model, thug.position, Quaternion.identity, NPCCollection.transform); var ThugClone = GameObject.Instantiate(model, thug.position, Quaternion.identity, NPCCollection.transform);
Debug.Log(thug.position);
ThugClone.name = thug.name; ThugClone.name = thug.name;
ThugClone.transform.SetParent(NPCCollection.transform); ThugClone.transform.SetParent(NPCCollection.transform);