From eab76a866fd041f49ceca8cfad4f884da0d94d89 Mon Sep 17 00:00:00 2001 From: JoshuaReason Date: Thu, 3 Oct 2019 14:50:08 +1000 Subject: [PATCH] fixed hookshot serialization + added isvisible function --- Assets/Data/Logic Blocks/Hook Shot.asset | 4 +- .../{Scripts/Components.meta => Models.meta} | 2 +- .../Plugins/IngameDebugConsole/Android.meta | 8 + .../Plugins/IngameDebugConsole/Prefabs.meta | 8 + .../Plugins/IngameDebugConsole/Scripts.meta | 8 + .../IngameDebugConsole/Sprites/Unused.meta | 8 + .../Map Sections/Start 4-player.prefab | 509 +++++++++--------- Assets/Scripts/LevelBlocks/Block.cs | 23 + .../Logic/Blocks/{Lasso.cs => HookShot.cs} | 49 +- .../{Lasso.cs.meta => HookShot.cs.meta} | 0 Assets/Scripts/LogicBlocks.meta | 8 + 11 files changed, 362 insertions(+), 265 deletions(-) rename Assets/{Scripts/Components.meta => Models.meta} (77%) create mode 100644 Assets/Plugins/IngameDebugConsole/Android.meta create mode 100644 Assets/Plugins/IngameDebugConsole/Prefabs.meta create mode 100644 Assets/Plugins/IngameDebugConsole/Scripts.meta create mode 100644 Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta rename Assets/Scripts/Logic/Blocks/{Lasso.cs => HookShot.cs} (71%) rename Assets/Scripts/Logic/Blocks/{Lasso.cs.meta => HookShot.cs.meta} (100%) create mode 100644 Assets/Scripts/LogicBlocks.meta diff --git a/Assets/Data/Logic Blocks/Hook Shot.asset b/Assets/Data/Logic Blocks/Hook Shot.asset index dd9a6a7..c63d71c 100644 --- a/Assets/Data/Logic Blocks/Hook Shot.asset +++ b/Assets/Data/Logic Blocks/Hook Shot.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6ec305514476b4c131faf5803a317bd1a57c1a8fed9c0e5e4c80f32620f08b7c -size 626 +oid sha256:946b4189e3b5ea7400bc41121fc5ca3cdb380d0c2b3641856c9ef7893d3b0907 +size 599 diff --git a/Assets/Scripts/Components.meta b/Assets/Models.meta similarity index 77% rename from Assets/Scripts/Components.meta rename to Assets/Models.meta index 5a95b09..5346456 100644 --- a/Assets/Scripts/Components.meta +++ b/Assets/Models.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8d7394d70ec233849a60a26da5f23b75 +guid: 296bd90e667df1f4697823a0aa45acf0 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/IngameDebugConsole/Android.meta b/Assets/Plugins/IngameDebugConsole/Android.meta new file mode 100644 index 0000000..12049b6 --- /dev/null +++ b/Assets/Plugins/IngameDebugConsole/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d7d7a61a5341904eb3c65af025b1d86 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/IngameDebugConsole/Prefabs.meta b/Assets/Plugins/IngameDebugConsole/Prefabs.meta new file mode 100644 index 0000000..6aa8bf2 --- /dev/null +++ b/Assets/Plugins/IngameDebugConsole/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7dbc36665bc0d684db9a4447e27a7a4b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/IngameDebugConsole/Scripts.meta b/Assets/Plugins/IngameDebugConsole/Scripts.meta new file mode 100644 index 0000000..72dcaac --- /dev/null +++ b/Assets/Plugins/IngameDebugConsole/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 860c08388401a6d4e858fe4910ea9337 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta b/Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta new file mode 100644 index 0000000..f3769b1 --- /dev/null +++ b/Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f6caae32d463529478f2186f47c2e3fe +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Map Sections/Start 4-player.prefab b/Assets/Prefabs/Map Sections/Start 4-player.prefab index a3ef8b3..256e781 100644 --- a/Assets/Prefabs/Map Sections/Start 4-player.prefab +++ b/Assets/Prefabs/Map Sections/Start 4-player.prefab @@ -269,6 +269,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (1) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 4 @@ -325,14 +333,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (1) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &77755287756461615 stripped @@ -659,6 +659,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 4829339738487549321} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_Spawn (2) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 4 @@ -715,14 +723,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_Spawn (2) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: isSpawnable @@ -749,6 +749,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (15) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 7 @@ -805,18 +817,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (15) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &341837504244963938 stripped @@ -838,6 +838,11 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 2936725396817118767} m_Modifications: + - target: {fileID: 4380075252948432824, guid: 125772d94eff8224a8f3a327ec632883, + type: 3} + propertyPath: m_Name + value: Cube_GroundWall + objectReference: {fileID: 0} - target: {fileID: 3615111875144653457, guid: 125772d94eff8224a8f3a327ec632883, type: 3} propertyPath: m_LocalPosition.x @@ -893,22 +898,17 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4380075252948432824, guid: 125772d94eff8224a8f3a327ec632883, - type: 3} - propertyPath: m_Name - value: Cube_GroundWall - objectReference: {fileID: 0} - - target: {fileID: 4721100610124675, guid: 125772d94eff8224a8f3a327ec632883, type: 3} + - target: {fileID: 4721099343502762, guid: 125772d94eff8224a8f3a327ec632883, type: 3} propertyPath: m_LocalPosition.y - value: -2 + value: -1 objectReference: {fileID: 0} - target: {fileID: 4721099741402202, guid: 125772d94eff8224a8f3a327ec632883, type: 3} propertyPath: m_LocalPosition.y value: -3 objectReference: {fileID: 0} - - target: {fileID: 4721099343502762, guid: 125772d94eff8224a8f3a327ec632883, type: 3} + - target: {fileID: 4721100610124675, guid: 125772d94eff8224a8f3a327ec632883, type: 3} propertyPath: m_LocalPosition.y - value: -1 + value: -2 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 125772d94eff8224a8f3a327ec632883, type: 3} @@ -2111,6 +2111,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (20) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 2 @@ -2167,14 +2175,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (20) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &1202583072437050576 stripped @@ -2501,6 +2501,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 4829339738487549321} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_Spawn (4) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 1 @@ -2557,14 +2565,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_Spawn (4) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: isSpawnable @@ -2840,6 +2840,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 4829339738487549321} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_Spawn (3) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 0.99999976 @@ -2896,14 +2904,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_Spawn (3) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: isSpawnable @@ -3502,6 +3502,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 4829339738487549321} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_Spawn (1) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -3558,14 +3566,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_Spawn (1) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: isSpawnable @@ -3969,6 +3969,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (9) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -4025,14 +4033,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (9) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &3117670910531676972 stripped @@ -4353,6 +4353,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 4829339738487549321} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_Spawn + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 2 @@ -4409,14 +4417,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_Spawn - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: isSpawnable @@ -5061,6 +5061,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (5) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -5117,14 +5125,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (5) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &4051932373191597238 stripped @@ -5201,6 +5201,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (13) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 7 @@ -5257,18 +5269,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (13) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!1 &4092222053451757873 stripped @@ -5479,6 +5479,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (12) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 7 @@ -5535,18 +5547,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (12) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &4232599670123336491 stripped @@ -5568,6 +5568,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (8) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -5624,14 +5632,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (8) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &4242030873576873262 stripped @@ -5891,6 +5891,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (17) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 3 @@ -5947,13 +5955,10 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (17) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured + - target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291, + type: 3} + propertyPath: isSpawnable + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} @@ -6336,6 +6341,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (2) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 4 @@ -6392,14 +6405,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (2) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &4899922527931319962 stripped @@ -6476,6 +6481,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (3) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 4 @@ -6532,14 +6545,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (3) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &5041177841079145247 stripped @@ -7299,6 +7304,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (7) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -7355,14 +7368,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (7) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &5442835673180186480 stripped @@ -7628,6 +7633,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (19) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 2 @@ -7684,14 +7697,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (19) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &5761916687388593647 stripped @@ -7707,6 +7712,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (21) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 6 @@ -7763,18 +7780,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (21) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &5800026486250745050 stripped @@ -8345,6 +8350,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (16) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 3 @@ -8401,14 +8414,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (16) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &6016065885788391185 stripped @@ -9418,6 +9423,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (6) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -9474,14 +9487,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (6) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &6658195644538220356 stripped @@ -9497,6 +9502,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (10) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 6 @@ -9553,18 +9570,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (10) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &6679452468557135731 stripped @@ -10385,6 +10390,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (4) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -10441,14 +10454,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (4) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &7334881821171137284 stripped @@ -10592,6 +10597,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (11) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 7 @@ -10648,18 +10665,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (11) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &7483891194873893175 stripped @@ -10925,6 +10930,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (18) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 3 @@ -10981,14 +10994,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (18) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &7608847752118040944 stripped @@ -11501,6 +11506,14 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 4 @@ -11557,14 +11570,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!4 &8170813349328216782 stripped @@ -12013,6 +12018,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 7044888458090244523} m_Modifications: + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_Name + value: Cube_GroundWGrass (14) + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_TagString + value: Coloured + objectReference: {fileID: 0} + - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4490970058520500, guid: d7698c69246c64044ab2a94628bf0291, type: 3} propertyPath: m_LocalPosition.x value: 7 @@ -12069,18 +12086,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 1 objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_Name - value: Cube_GroundWGrass (14) - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_TagString - value: Coloured - objectReference: {fileID: 0} - - target: {fileID: 1141756196039588, guid: d7698c69246c64044ab2a94628bf0291, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3} --- !u!1 &8701602830887103451 stripped diff --git a/Assets/Scripts/LevelBlocks/Block.cs b/Assets/Scripts/LevelBlocks/Block.cs index 4e91db8..8119989 100644 --- a/Assets/Scripts/LevelBlocks/Block.cs +++ b/Assets/Scripts/LevelBlocks/Block.cs @@ -42,6 +42,8 @@ public class Block : MonoBehaviour /// List of current players on this block /// public Character CurrentPlayer { get; protected set; } + + private Renderer renderer; #endregion Private Functions #region ReadOnly Properties @@ -121,6 +123,10 @@ public class Block : MonoBehaviour } } + public bool isVisible() + { + return isPositionVisible(position); + } #endregion Public Functions @@ -248,6 +254,23 @@ public class Block : MonoBehaviour return newBlock.GetComponent(); } + public static bool isPositionVisible(Vector3 position) + { + Camera camera = Camera.main; + Vector2 screenPos = camera.WorldToViewportPoint(position); + if (screenPos.x > 1 || screenPos.x < 0) + { + return false; + } + + if (screenPos.y > 1 || screenPos.y < 0) + { + return false; + } + + return true; + } + #endregion } diff --git a/Assets/Scripts/Logic/Blocks/Lasso.cs b/Assets/Scripts/Logic/Blocks/HookShot.cs similarity index 71% rename from Assets/Scripts/Logic/Blocks/Lasso.cs rename to Assets/Scripts/Logic/Blocks/HookShot.cs index 32f8935..cb89379 100644 --- a/Assets/Scripts/Logic/Blocks/Lasso.cs +++ b/Assets/Scripts/Logic/Blocks/HookShot.cs @@ -2,21 +2,16 @@ using System.Collections.Generic; using UnityEngine; -[CreateAssetMenu(menuName = "Major Project/Pick Ups/Lasso Block")] +[CreateAssetMenu(menuName = "Major Project/Pick Ups/HookShot Block")] [System.Serializable] -public class Lasso : LogicBlock +public class HookShot : LogicBlock { - - [SerializeField] - [Header("Max distance checked before returning")] - private int MaxDistance = 30; - [SerializeField] [Header("Direction to shoot in")] private Direction Direction; [SerializeField] - private GameObject ShotPrefab; + private string ResourceName; [SerializeField] private float ShotSpeed = 1; @@ -29,11 +24,15 @@ public class Lasso : LogicBlock Block retVal = startBlock; //block we'll actually move to //Check blocks in front until we hit an obstruction or went the distance - for (int i = 1; i <= MaxDistance; i++) + for (int i = 1; i <= 30; i++) { //Next position to MoveTo position = startBlock.position + (Direction.ToVector(transform) * i); + //if position is off the screen there is nothing to hit + if (!Block.isPositionVisible(position)) + return startBlock; + //if hit player return block they are standing on if (Block.isBlockAtPosition(position, 1, layerMask, out hit)) { if (hit.CurrentPlayer != null) @@ -95,6 +94,36 @@ public class Lasso : LogicBlock target.position = endPosition; } - + public override void CopyToken(BlockToken token) + { + base.CopyToken(token); + Direction = ((HookShotToken)token).Direction; + ResourceName = ((HookShotToken)token).ResourceName; + ShotSpeed = ((HookShotToken)token).ShotSpeed; + } + + public override BlockToken ToToken(BlockToken token = null) + { + if (token == null) + token = new HookShotToken(this); + + HookShotToken retVal = (HookShotToken)base.ToToken(token); + retVal.Direction = Direction; + retVal.ResourceName = ResourceName; + retVal.ShotSpeed = ShotSpeed; + + return retVal; + } + +} + +[System.Serializable] +public class HookShotToken : BlockToken +{ + public Direction Direction; + public string ResourceName; + public float ShotSpeed; + + public HookShotToken(LogicBlock block) : base(block) { } } diff --git a/Assets/Scripts/Logic/Blocks/Lasso.cs.meta b/Assets/Scripts/Logic/Blocks/HookShot.cs.meta similarity index 100% rename from Assets/Scripts/Logic/Blocks/Lasso.cs.meta rename to Assets/Scripts/Logic/Blocks/HookShot.cs.meta diff --git a/Assets/Scripts/LogicBlocks.meta b/Assets/Scripts/LogicBlocks.meta new file mode 100644 index 0000000..98af9d1 --- /dev/null +++ b/Assets/Scripts/LogicBlocks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8936b441d7647f74884c94f97bfb8931 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: