From 52e4e32dde7aec87d29f5d0ee6ab673869c7c67e Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:00:21 +0200 Subject: [PATCH] Platform handler fundamentals --- Assets/Resources/Games/nightWalkAgb.prefab | 82 ++++--------------- .../Games/NightWalkAgb/AgbPlatformHandler.cs | 18 ++++ .../NightWalkAgb/AgbPlatformHandler.cs.meta | 11 +++ 3 files changed, 47 insertions(+), 64 deletions(-) create mode 100644 Assets/Scripts/Games/NightWalkAgb/AgbPlatformHandler.cs create mode 100644 Assets/Scripts/Games/NightWalkAgb/AgbPlatformHandler.cs.meta diff --git a/Assets/Resources/Games/nightWalkAgb.prefab b/Assets/Resources/Games/nightWalkAgb.prefab index d7c276e49..724674a58 100644 --- a/Assets/Resources/Games/nightWalkAgb.prefab +++ b/Assets/Resources/Games/nightWalkAgb.prefab @@ -41,6 +41,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 669597767286590995} + - component: {fileID: 6715217060937385611} m_Layer: 0 m_Name: JumpPlatformHolder m_TagString: Untagged @@ -59,11 +60,26 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.6, y: 0.6, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 4669837724394807000} + m_Children: [] m_Father: {fileID: 3309616054814014854} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6715217060937385611 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 909896576730141613} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fc6d77daa4e399f4fbac22c2f7de8777, type: 3} + m_Name: + m_EditorClassIdentifier: + platformRef: {fileID: 1815905863429998752, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} + defaultYPos: -11.76 + platformDistance: 3.8 + platformAmount: 15 --- !u!1 &955264990193298390 GameObject: m_ObjectHideFlags: 0 @@ -1479,65 +1495,3 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!1001 &4462826151413051848 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 669597767286590995} - m_Modifications: - - target: {fileID: 1815905863429998752, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_Name - value: JumpPlatform - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalPosition.y - value: -11.76 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} ---- !u!4 &4669837724394807000 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 9016694733661613840, guid: 73364b4dafdbd914f83c316a1fcf8dd7, type: 3} - m_PrefabInstance: {fileID: 4462826151413051848} - m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scripts/Games/NightWalkAgb/AgbPlatformHandler.cs b/Assets/Scripts/Games/NightWalkAgb/AgbPlatformHandler.cs new file mode 100644 index 000000000..f0728b9a7 --- /dev/null +++ b/Assets/Scripts/Games/NightWalkAgb/AgbPlatformHandler.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace HeavenStudio.Games.Scripts_AgbNightWalk +{ + public class AgbPlatformHandler : MonoBehaviour + { + [Header("Properties")] + [SerializeField] private GameObject platformRef; + [SerializeField] private float defaultYPos = -11.76f; + [SerializeField] private float platformDistance = 3.80f; + [SerializeField] private float playerXPos = -6.78f; + [Range(1, 100)] + [SerializeField] private int platformAmount = 15; + } +} + diff --git a/Assets/Scripts/Games/NightWalkAgb/AgbPlatformHandler.cs.meta b/Assets/Scripts/Games/NightWalkAgb/AgbPlatformHandler.cs.meta new file mode 100644 index 000000000..e5ee40a37 --- /dev/null +++ b/Assets/Scripts/Games/NightWalkAgb/AgbPlatformHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc6d77daa4e399f4fbac22c2f7de8777 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: