Implemented new dungeon scene pipeline.
|
|
@ -2698,7 +2698,7 @@ GameObject:
|
||||||
- component: {fileID: 4019891345885281529}
|
- component: {fileID: 4019891345885281529}
|
||||||
- component: {fileID: -1465197196826248026}
|
- component: {fileID: -1465197196826248026}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Boss Room
|
m_Name: BossRoom
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
|
@ -2734,6 +2734,7 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
AdjacentRooms: []
|
AdjacentRooms: []
|
||||||
|
IsEntrance: 0
|
||||||
roomReward: {fileID: 0}
|
roomReward: {fileID: 0}
|
||||||
numberTextObject: {fileID: 8119019481281764985}
|
numberTextObject: {fileID: 8119019481281764985}
|
||||||
healthTickObject: {fileID: 2885337975627474754}
|
healthTickObject: {fileID: 2885337975627474754}
|
||||||
|
|
@ -5208,7 +5209,7 @@ Transform:
|
||||||
m_GameObject: {fileID: 5396399303394593232}
|
m_GameObject: {fileID: 5396399303394593232}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: -0.08, y: -0.04, z: 0}
|
m_LocalPosition: {x: -0.12, y: -0.06, z: 0}
|
||||||
m_LocalScale: {x: 0.94, y: 0.94, z: 1}
|
m_LocalScale: {x: 0.94, y: 0.94, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
|
|
@ -6806,8 +6807,8 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 0, y: 0}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 0.071, y: 0.0224}
|
m_AnchoredPosition: {x: 0.1136, y: 0}
|
||||||
m_SizeDelta: {x: 5424.8545, y: 3256.9202}
|
m_SizeDelta: {x: 5342.413, y: 3256.9202}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!223 &5098311427343145193
|
--- !u!223 &5098311427343145193
|
||||||
Canvas:
|
Canvas:
|
||||||
|
|
@ -778,7 +778,7 @@ GameObject:
|
||||||
- component: {fileID: 4019891345885281529}
|
- component: {fileID: 4019891345885281529}
|
||||||
- component: {fileID: -1465197196826248026}
|
- component: {fileID: -1465197196826248026}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Monster Room
|
m_Name: MonsterRoom
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
|
@ -793,7 +793,7 @@ Transform:
|
||||||
m_GameObject: {fileID: 2435349004046080434}
|
m_GameObject: {fileID: 2435349004046080434}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
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, z: 0}
|
m_LocalPosition: {x: -0.02, 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:
|
||||||
|
|
@ -814,6 +814,7 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
AdjacentRooms: []
|
AdjacentRooms: []
|
||||||
|
IsEntrance: 0
|
||||||
roomReward: {fileID: 0}
|
roomReward: {fileID: 0}
|
||||||
numberTextObject: {fileID: 8119019481281764985}
|
numberTextObject: {fileID: 8119019481281764985}
|
||||||
healthTickObject: {fileID: 2885337975627474754}
|
healthTickObject: {fileID: 2885337975627474754}
|
||||||
33
PuzzleGameProject/Assets/Resources/RoomsParent.prefab
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &8535447066146729502
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 4672082587870130080}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: RoomsParent
|
||||||
|
m_TagString: RoomsParent
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &4672082587870130080
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8535447066146729502}
|
||||||
|
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}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: a388df093cb6eff4b9ad245712b8ae4a
|
guid: dd193ef859dde2a4db279dd16d78ed0d
|
||||||
PrefabImporter:
|
PrefabImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|
@ -702,7 +702,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 85fe57d438ef1ec4fa8b36b9c17c11a4, type: 3}
|
m_Script: {fileID: 11500000, guid: 85fe57d438ef1ec4fa8b36b9c17c11a4, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
rooms: {fileID: 378821222}
|
rooms: {fileID: 0}
|
||||||
diceRoller: {fileID: 150116548}
|
diceRoller: {fileID: 150116548}
|
||||||
passManager: {fileID: 895359724}
|
passManager: {fileID: 895359724}
|
||||||
player: {fileID: 1476127625}
|
player: {fileID: 1476127625}
|
||||||
|
|
@ -1186,68 +1186,6 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 281533970}
|
m_GameObject: {fileID: 281533970}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
--- !u!1001 &378821221
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TransformParent: {fileID: 0}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 3124355464429156679, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: Rooms (1)
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: -5.563501
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 1.9766169
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 0.0070788427
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 5637652337918422344, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_RemovedGameObjects: []
|
|
||||||
m_AddedGameObjects: []
|
|
||||||
m_AddedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
--- !u!1 &378821222 stripped
|
|
||||||
GameObject:
|
|
||||||
m_CorrespondingSourceObject: {fileID: 3124355464429156679, guid: a388df093cb6eff4b9ad245712b8ae4a, type: 3}
|
|
||||||
m_PrefabInstance: {fileID: 378821221}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
--- !u!1001 &408992220
|
--- !u!1001 &408992220
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -4944,7 +4882,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!4 &1820284206
|
--- !u!4 &1820284206
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -5735,4 +5673,3 @@ SceneRoots:
|
||||||
- {fileID: 1820284206}
|
- {fileID: 1820284206}
|
||||||
- {fileID: 812815656}
|
- {fileID: 812815656}
|
||||||
- {fileID: 281326036}
|
- {fileID: 281326036}
|
||||||
- {fileID: 378821221}
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ba805102762282d4f99fa139a7f45c8b
|
guid: c85e4c795228a664690af5ef1033c607
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
3476
PuzzleGameProject/Assets/Scenes/Templates/NewDungeon.unity
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 957e77b4be7e2f54b9b04d056f0755ab
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
%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: 13966, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_Name: NewDungeonTemplate
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
templateScene: {fileID: 102900000, guid: 957e77b4be7e2f54b9b04d056f0755ab, type: 3}
|
||||||
|
templateName: NewDungeonTemplate
|
||||||
|
description: Used when wanting to load a dungeon from a JSON file and create a
|
||||||
|
level out of it.
|
||||||
|
preview: {fileID: 0}
|
||||||
|
dependencies:
|
||||||
|
- dependency: {fileID: 2800000, guid: 5255dd000b122c04cb2e575fd2b0eca8, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: 3028dc075ba8c584d9bc7d1e0255e038, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: 2d46de0706254504faa584fcf9ea94bb, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: 2fd6421f253b4ef1a19526541f9ffc0c, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2435349004046080434, guid: c902621f4d7a49348bfab382716c9a6b, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 11400000, guid: 2e498d1c8094910479dc3e1b768306a4, type: 2}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 7874367151511621086, guid: ca942b415faef4e1ca2ca32043893efd, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: 901918d3a0101a74fbb13f0bf0d4b6cf, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2435349004046080434, guid: dffcf67f187414eacb9e7abf6d8cf39b, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 6007503688929917977, guid: 2d3967bed0790c44c88fabab60350749, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 7874367151511621086, guid: de405f9dca058480ab9e8433965408b2, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: 2d98aa58d76f5af459f0c1e7f329082f, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2435349004046080434, guid: 92d87e25cc40b3e448e62e8ba0328315, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: c431b2386ac294746ae0af5f26c2f383, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 6167039396952026974, guid: 5e46b071ca9c11745a7893c22faf6976, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: 6fb6744825150e948986fec95b6f1d07, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: ee148e281f3c41c5b4ff5f8a5afe5a6c, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 2800000, guid: 1b4f3e1088ae0e948936fc8e2552e78b, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 6167039396952026974, guid: 66fcddbe7a3c341c5b9ca4f8801259a6, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
- dependency: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
|
||||||
|
instantiationMode: 1
|
||||||
|
templatePipeline: {fileID: 11500000, guid: 11fdc8c46972f4347896cd02867779a9, type: 3}
|
||||||
|
badge: {fileID: 0}
|
||||||
|
addToDefaults: 0
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d8f5e883fb5b4024d8fdb0bf8b95ff31
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
using DungeonGenerator;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.SceneTemplate;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
public class NewDungeonTemplatePipeline : ISceneTemplatePipeline
|
||||||
|
{
|
||||||
|
public virtual bool IsValidTemplateForInstantiation(SceneTemplateAsset sceneTemplateAsset)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void BeforeTemplateInstantiation(SceneTemplateAsset sceneTemplateAsset, bool isAdditive, string sceneName)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void AfterTemplateInstantiation(SceneTemplateAsset sceneTemplateAsset, Scene scene, bool isAdditive, string sceneName)
|
||||||
|
{
|
||||||
|
Debug.Log("Scene Template Instantiated: " + sceneName);
|
||||||
|
|
||||||
|
// Load a prefab from the Resources folder
|
||||||
|
GameObject roomsParent = Resources.Load<GameObject>("RoomsParent");
|
||||||
|
|
||||||
|
if (roomsParent != null)
|
||||||
|
{
|
||||||
|
// Instantiate the prefab inside the scene
|
||||||
|
GameObject instantiatedRoomsParent = Object.Instantiate(roomsParent);
|
||||||
|
SceneManager.MoveGameObjectToScene(instantiatedRoomsParent, scene); // Ensure it's part of the scene
|
||||||
|
|
||||||
|
DungeonMapLoader mapLoader = new DungeonMapLoader();
|
||||||
|
string dungeonMapPath = EditorUtility.OpenFilePanel("Select Dungeon", "Assets", "json");
|
||||||
|
mapLoader.AddDungeonRoomsToGameObject(instantiatedRoomsParent, dungeonMapPath);
|
||||||
|
|
||||||
|
Debug.Log("Dungeon loaded from file.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("DungeonPrefab not found in Resources!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 11fdc8c46972f4347896cd02867779a9
|
||||||
345
PuzzleGameProject/Assets/Scenes/TestDungeons/01.unity
Normal file
|
|
@ -0,0 +1,345 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!29 &1
|
||||||
|
OcclusionCullingSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_OcclusionBakeSettings:
|
||||||
|
smallestOccluder: 5
|
||||||
|
smallestHole: 0.25
|
||||||
|
backfaceThreshold: 100
|
||||||
|
m_SceneGUID: 00000000000000000000000000000000
|
||||||
|
m_OcclusionCullingData: {fileID: 0}
|
||||||
|
--- !u!104 &2
|
||||||
|
RenderSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 10
|
||||||
|
m_Fog: 0
|
||||||
|
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||||
|
m_FogMode: 3
|
||||||
|
m_FogDensity: 0.01
|
||||||
|
m_LinearFogStart: 0
|
||||||
|
m_LinearFogEnd: 300
|
||||||
|
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||||
|
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||||
|
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||||
|
m_AmbientIntensity: 1
|
||||||
|
m_AmbientMode: 3
|
||||||
|
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||||
|
m_SkyboxMaterial: {fileID: 0}
|
||||||
|
m_HaloStrength: 0.5
|
||||||
|
m_FlareStrength: 1
|
||||||
|
m_FlareFadeSpeed: 3
|
||||||
|
m_HaloTexture: {fileID: 0}
|
||||||
|
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
m_DefaultReflectionMode: 0
|
||||||
|
m_DefaultReflectionResolution: 128
|
||||||
|
m_ReflectionBounces: 1
|
||||||
|
m_ReflectionIntensity: 1
|
||||||
|
m_CustomReflection: {fileID: 0}
|
||||||
|
m_Sun: {fileID: 0}
|
||||||
|
m_UseRadianceAmbientProbe: 0
|
||||||
|
--- !u!157 &3
|
||||||
|
LightmapSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 13
|
||||||
|
m_BakeOnSceneLoad: 0
|
||||||
|
m_GISettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_BounceScale: 1
|
||||||
|
m_IndirectOutputScale: 1
|
||||||
|
m_AlbedoBoost: 1
|
||||||
|
m_EnvironmentLightingMode: 0
|
||||||
|
m_EnableBakedLightmaps: 0
|
||||||
|
m_EnableRealtimeLightmaps: 0
|
||||||
|
m_LightmapEditorSettings:
|
||||||
|
serializedVersion: 12
|
||||||
|
m_Resolution: 2
|
||||||
|
m_BakeResolution: 40
|
||||||
|
m_AtlasSize: 1024
|
||||||
|
m_AO: 0
|
||||||
|
m_AOMaxDistance: 1
|
||||||
|
m_CompAOExponent: 1
|
||||||
|
m_CompAOExponentDirect: 0
|
||||||
|
m_ExtractAmbientOcclusion: 0
|
||||||
|
m_Padding: 2
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_LightmapsBakeMode: 1
|
||||||
|
m_TextureCompression: 1
|
||||||
|
m_ReflectionCompression: 2
|
||||||
|
m_MixedBakeMode: 2
|
||||||
|
m_BakeBackend: 1
|
||||||
|
m_PVRSampling: 1
|
||||||
|
m_PVRDirectSampleCount: 32
|
||||||
|
m_PVRSampleCount: 512
|
||||||
|
m_PVRBounces: 2
|
||||||
|
m_PVREnvironmentSampleCount: 256
|
||||||
|
m_PVREnvironmentReferencePointCount: 2048
|
||||||
|
m_PVRFilteringMode: 1
|
||||||
|
m_PVRDenoiserTypeDirect: 1
|
||||||
|
m_PVRDenoiserTypeIndirect: 1
|
||||||
|
m_PVRDenoiserTypeAO: 1
|
||||||
|
m_PVRFilterTypeDirect: 0
|
||||||
|
m_PVRFilterTypeIndirect: 0
|
||||||
|
m_PVRFilterTypeAO: 0
|
||||||
|
m_PVREnvironmentMIS: 1
|
||||||
|
m_PVRCulling: 1
|
||||||
|
m_PVRFilteringGaussRadiusDirect: 1
|
||||||
|
m_PVRFilteringGaussRadiusIndirect: 1
|
||||||
|
m_PVRFilteringGaussRadiusAO: 1
|
||||||
|
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||||
|
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||||
|
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||||
|
m_ExportTrainingData: 0
|
||||||
|
m_TrainingDataDestination: TrainingData
|
||||||
|
m_LightProbeSampleCountMultiplier: 4
|
||||||
|
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_LightingSettings: {fileID: 0}
|
||||||
|
--- !u!196 &4
|
||||||
|
NavMeshSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_BuildSettings:
|
||||||
|
serializedVersion: 3
|
||||||
|
agentTypeID: 0
|
||||||
|
agentRadius: 0.5
|
||||||
|
agentHeight: 2
|
||||||
|
agentSlope: 45
|
||||||
|
agentClimb: 0.4
|
||||||
|
ledgeDropHeight: 0
|
||||||
|
maxJumpAcrossDistance: 0
|
||||||
|
minRegionArea: 2
|
||||||
|
manualCellSize: 0
|
||||||
|
cellSize: 0.16666667
|
||||||
|
manualTileSize: 0
|
||||||
|
tileSize: 256
|
||||||
|
buildHeightMesh: 0
|
||||||
|
maxJobWorkers: 0
|
||||||
|
preserveTilesOutsideBounds: 0
|
||||||
|
debug:
|
||||||
|
m_Flags: 0
|
||||||
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1 &584762237
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 584762240}
|
||||||
|
- component: {fileID: 584762239}
|
||||||
|
- component: {fileID: 584762238}
|
||||||
|
- component: {fileID: 584762241}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Main Camera
|
||||||
|
m_TagString: MainCamera
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!81 &584762238
|
||||||
|
AudioListener:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 584762237}
|
||||||
|
m_Enabled: 1
|
||||||
|
--- !u!20 &584762239
|
||||||
|
Camera:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 584762237}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ClearFlags: 1
|
||||||
|
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||||
|
m_projectionMatrixMode: 1
|
||||||
|
m_GateFitMode: 2
|
||||||
|
m_FOVAxisMode: 0
|
||||||
|
m_Iso: 200
|
||||||
|
m_ShutterSpeed: 0.005
|
||||||
|
m_Aperture: 16
|
||||||
|
m_FocusDistance: 10
|
||||||
|
m_FocalLength: 50
|
||||||
|
m_BladeCount: 5
|
||||||
|
m_Curvature: {x: 2, y: 11}
|
||||||
|
m_BarrelClipping: 0.25
|
||||||
|
m_Anamorphism: 0
|
||||||
|
m_SensorSize: {x: 36, y: 24}
|
||||||
|
m_LensShift: {x: 0, y: 0}
|
||||||
|
m_NormalizedViewPortRect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 1
|
||||||
|
height: 1
|
||||||
|
near clip plane: 0.3
|
||||||
|
far clip plane: 1000
|
||||||
|
field of view: 60
|
||||||
|
orthographic: 1
|
||||||
|
orthographic size: 5
|
||||||
|
m_Depth: -1
|
||||||
|
m_CullingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_RenderingPath: -1
|
||||||
|
m_TargetTexture: {fileID: 0}
|
||||||
|
m_TargetDisplay: 0
|
||||||
|
m_TargetEye: 3
|
||||||
|
m_HDR: 1
|
||||||
|
m_AllowMSAA: 1
|
||||||
|
m_AllowDynamicResolution: 0
|
||||||
|
m_ForceIntoRT: 0
|
||||||
|
m_OcclusionCulling: 1
|
||||||
|
m_StereoConvergence: 10
|
||||||
|
m_StereoSeparation: 0.022
|
||||||
|
--- !u!4 &584762240
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 584762237}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||||
|
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 &584762241
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 584762237}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_RenderShadows: 1
|
||||||
|
m_RequiresDepthTextureOption: 2
|
||||||
|
m_RequiresOpaqueTextureOption: 2
|
||||||
|
m_CameraType: 0
|
||||||
|
m_Cameras: []
|
||||||
|
m_RendererIndex: -1
|
||||||
|
m_VolumeLayerMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 1
|
||||||
|
m_VolumeTrigger: {fileID: 0}
|
||||||
|
m_VolumeFrameworkUpdateModeOption: 2
|
||||||
|
m_RenderPostProcessing: 0
|
||||||
|
m_Antialiasing: 0
|
||||||
|
m_AntialiasingQuality: 2
|
||||||
|
m_StopNaN: 0
|
||||||
|
m_Dithering: 0
|
||||||
|
m_ClearDepth: 1
|
||||||
|
m_AllowXRRendering: 1
|
||||||
|
m_AllowHDROutput: 1
|
||||||
|
m_UseScreenCoordOverride: 0
|
||||||
|
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_RequiresDepthTexture: 0
|
||||||
|
m_RequiresColorTexture: 0
|
||||||
|
m_Version: 2
|
||||||
|
m_TaaSettings:
|
||||||
|
m_Quality: 3
|
||||||
|
m_FrameInfluence: 0.1
|
||||||
|
m_JitterScale: 1
|
||||||
|
m_MipBias: 0
|
||||||
|
m_VarianceClampScale: 0.9
|
||||||
|
m_ContrastAdaptiveSharpening: 0
|
||||||
|
--- !u!1 &1019076778
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1019076780}
|
||||||
|
- component: {fileID: 1019076779}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: DungeonLoader
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1019076779
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1019076778}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: ae0fded700e8a14439ad0c8179b3e7f5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
pathToDungeonMap: C:\Users\User\repos\PuzzleGame\Dungeons\dungeon07.json
|
||||||
|
roomsParent: {fileID: 1771926038}
|
||||||
|
monsterRoomPrefab: {fileID: 2435349004046080434, guid: dffcf67f187414eacb9e7abf6d8cf39b, type: 3}
|
||||||
|
bossRoomPrefab: {fileID: 2435349004046080434, guid: c902621f4d7a49348bfab382716c9a6b, type: 3}
|
||||||
|
normalRoomPrefab: {fileID: 2435349004046080434, guid: 92d87e25cc40b3e448e62e8ba0328315, type: 3}
|
||||||
|
--- !u!4 &1019076780
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1019076778}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -5.563501, y: 1.9766169, z: 0.0070788427}
|
||||||
|
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!1 &1771926038
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1771926039}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Rooms
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1771926039
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1771926038}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -5.563501, y: 1.9766169, z: 0.0070788427}
|
||||||
|
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!1660057539 &9223372036854775807
|
||||||
|
SceneRoots:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_Roots:
|
||||||
|
- {fileID: 584762240}
|
||||||
|
- {fileID: 1019076780}
|
||||||
|
- {fileID: 1771926039}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 42c7800d491123e4a9326e57286ad040
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
3557
PuzzleGameProject/Assets/Scenes/TestDungeons/02.unity
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 40efe291f74888b43b961432e6cf55e5
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -3,68 +3,72 @@ using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using DungeonMapGenerator;
|
using DungeonMapGenerator;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
|
|
||||||
namespace DungeonGenerator
|
namespace DungeonGenerator
|
||||||
{
|
{
|
||||||
public class DungeonMapLoader : MonoBehaviour
|
public class DungeonMapLoader
|
||||||
{
|
{
|
||||||
[SerializeField] private string pathToDungeonMap;
|
private const string ROOMS_PARENT = "RoomsParent";
|
||||||
[SerializeField] private GameObject roomsParent;
|
private const string MONSTER_ROOM = "Rooms\\MonsterRoom";
|
||||||
[SerializeField] private GameObject monsterRoomPrefab;
|
private const string BOSS_ROOM = "Rooms\\BossRoom";
|
||||||
[SerializeField] private GameObject bossRoomPrefab;
|
private const string NORMAL_ROOM = "Rooms\\Room";
|
||||||
[SerializeField] private GameObject normalRoomPrefab;
|
|
||||||
|
|
||||||
private Dictionary<int, GameObject> roomIdToGameObject = new Dictionary<int, GameObject>();
|
private Dictionary<int, GameObject> _roomIdToGameObject = new Dictionary<int, GameObject>();
|
||||||
|
|
||||||
private void Start()
|
public void AddDungeonRoomsToGameObject(GameObject gameObject, string pathToDungeonFile)
|
||||||
{
|
{
|
||||||
DungeonMap map = DungeonMapSerializer.DeserializeFromFile(pathToDungeonMap);
|
DungeonMap map = DungeonMapSerializer.DeserializeFromFile(pathToDungeonFile);
|
||||||
|
GameObject bossRoomPrefab = Resources.Load<GameObject>(BOSS_ROOM);
|
||||||
GameObject bossRoomGO = Instantiate(bossRoomPrefab,
|
GameObject monsterRoomPrefab = Resources.Load<GameObject>(MONSTER_ROOM);
|
||||||
|
GameObject normalRoomPrefab = Resources.Load<GameObject>(NORMAL_ROOM);
|
||||||
|
|
||||||
|
GameObject bossRoomGO = Object.Instantiate(bossRoomPrefab,
|
||||||
ConvertToUnityPosition(map.GetBossRoom().GetCenterOfRoom(), map.Width, map.Height),
|
ConvertToUnityPosition(map.GetBossRoom().GetCenterOfRoom(), map.Width, map.Height),
|
||||||
Quaternion.identity,
|
Quaternion.identity,
|
||||||
roomsParent.transform);
|
gameObject.transform);
|
||||||
roomIdToGameObject[map.GetBossRoom().Id] = bossRoomGO;
|
_roomIdToGameObject[map.GetBossRoom().Id] = bossRoomGO;
|
||||||
|
|
||||||
foreach (var monsterRoom in map.GetMonsterRooms())
|
foreach (var monsterRoom in map.GetMonsterRooms())
|
||||||
{
|
{
|
||||||
GameObject monsterRoomGO = Instantiate(
|
GameObject monsterRoomGO = Object.Instantiate(
|
||||||
monsterRoomPrefab,
|
monsterRoomPrefab,
|
||||||
ConvertToUnityPosition(monsterRoom.GetCenterOfRoom(), map.Width, map.Height),
|
ConvertToUnityPosition(monsterRoom.GetCenterOfRoom(), map.Width, map.Height),
|
||||||
Quaternion.identity,
|
Quaternion.identity,
|
||||||
roomsParent.transform);
|
gameObject.transform);
|
||||||
roomIdToGameObject[monsterRoom.Id] = monsterRoomGO;
|
_roomIdToGameObject[monsterRoom.Id] = monsterRoomGO;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var normalRoom in map.GetNormalRooms())
|
foreach (var normalRoom in map.GetNormalRooms())
|
||||||
{
|
{
|
||||||
GameObject normalRoomGO = Instantiate(
|
GameObject normalRoomGO = Object.Instantiate(
|
||||||
normalRoomPrefab,
|
normalRoomPrefab,
|
||||||
ConvertToUnityPosition(normalRoom.GetCenterOfRoom(), map.Width, map.Height),
|
ConvertToUnityPosition(normalRoom.GetCenterOfRoom(), map.Width, map.Height),
|
||||||
Quaternion.identity,
|
Quaternion.identity,
|
||||||
roomsParent.transform);
|
gameObject.transform);
|
||||||
roomIdToGameObject[normalRoom.Id] = normalRoomGO;
|
_roomIdToGameObject[normalRoom.Id] = normalRoomGO;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var entranceRoom in map.GetEntranceRooms())
|
foreach (var entranceRoom in map.GetEntranceRooms())
|
||||||
{
|
{
|
||||||
GameObject entranceRoomGO = Instantiate(
|
GameObject entranceRoomGO = Object.Instantiate(
|
||||||
normalRoomPrefab,
|
normalRoomPrefab,
|
||||||
ConvertToUnityPosition(entranceRoom.GetCenterOfRoom(), map.Width, map.Height),
|
ConvertToUnityPosition(entranceRoom.GetCenterOfRoom(), map.Width, map.Height),
|
||||||
Quaternion.identity,
|
Quaternion.identity,
|
||||||
roomsParent.transform);
|
gameObject.transform);
|
||||||
entranceRoomGO.GetComponent<Room>().IsEntrance = true;
|
entranceRoomGO.GetComponent<Room>().IsEntrance = true;
|
||||||
roomIdToGameObject[entranceRoom.Id] = entranceRoomGO;
|
_roomIdToGameObject[entranceRoom.Id] = entranceRoomGO;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var mapRoom in map.GetAllRooms())
|
foreach (var mapRoom in map.GetAllRooms())
|
||||||
{
|
{
|
||||||
HashSet<int> adjacentRoomsIds = mapRoom.GetAdjacentRoomIds();
|
HashSet<int> adjacentRoomsIds = mapRoom.GetAdjacentRoomIds();
|
||||||
Room roomComponent = roomIdToGameObject[mapRoom.Id].GetComponent<Room>();
|
Room roomComponent = _roomIdToGameObject[mapRoom.Id].GetComponent<Room>();
|
||||||
foreach (var id in adjacentRoomsIds)
|
foreach (var id in adjacentRoomsIds)
|
||||||
{
|
{
|
||||||
roomComponent.AdjacentRooms.Add(roomIdToGameObject[id]);
|
roomComponent.AdjacentRooms.Add(_roomIdToGameObject[id]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ public class GameManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
diceRoller.diceRolled += DiceRolled;
|
diceRoller.diceRolled += DiceRolled;
|
||||||
passManager.PassRequested += PassRequested;
|
passManager.PassRequested += PassRequested;
|
||||||
|
rooms = GameObject.FindWithTag("RoomsParent");
|
||||||
foreach (Transform roomTransform in rooms.transform)
|
foreach (Transform roomTransform in rooms.transform)
|
||||||
{
|
{
|
||||||
roomTransform.gameObject.GetComponent<Room>().RoomExploredByDice += HandleRoomExploredByDice;
|
roomTransform.gameObject.GetComponent<Room>().RoomExploredByDice += HandleRoomExploredByDice;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ using UnityEngine.Serialization;
|
||||||
public abstract class Room : MonoBehaviour
|
public abstract class Room : MonoBehaviour
|
||||||
{
|
{
|
||||||
[FormerlySerializedAs("adjacentRooms")] [SerializeField] public List<GameObject> AdjacentRooms;
|
[FormerlySerializedAs("adjacentRooms")] [SerializeField] public List<GameObject> AdjacentRooms;
|
||||||
[SerializeField] public bool IsEntrance { get; set; }
|
public bool IsEntrance;
|
||||||
[SerializeField] protected RoomReward roomReward;
|
[SerializeField] protected RoomReward roomReward;
|
||||||
public event EventHandler<Room> RoomExploredByDice;
|
public event EventHandler<Room> RoomExploredByDice;
|
||||||
public static event Action<Room> RoomExploredByTorch;
|
public static event Action<Room> RoomExploredByTorch;
|
||||||
|
|
|
||||||
8
PuzzleGameProject/Assets/Sprites.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 40a67a0e67093a342ac5729500c42cb8
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
|
|
@ -6,6 +6,7 @@ TagManager:
|
||||||
tags:
|
tags:
|
||||||
- WhiteDie
|
- WhiteDie
|
||||||
- BlackDie
|
- BlackDie
|
||||||
|
- RoomsParent
|
||||||
layers:
|
layers:
|
||||||
- Default
|
- Default
|
||||||
- TransparentFX
|
- TransparentFX
|
||||||
|
|
|
||||||