From 8bc0696bd440a191e4241055a4799a997a344882 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 3 Jun 2022 12:28:05 +0300 Subject: [PATCH] create balance scriptable object --- .../Balance/BalanceScriptableObject.cs | 34 +++++++++++++ .../Balance/BalanceScriptableObject.cs.meta | 11 ++++ .../Scripts/Balance/EnemiesBalance.asset | 50 +++++++++++++++++++ .../Scripts/Balance/EnemiesBalance.asset.meta | 8 +++ 4 files changed, 103 insertions(+) create mode 100644 ldjam50/Assets/Scripts/Balance/BalanceScriptableObject.cs create mode 100644 ldjam50/Assets/Scripts/Balance/BalanceScriptableObject.cs.meta create mode 100644 ldjam50/Assets/Scripts/Balance/EnemiesBalance.asset create mode 100644 ldjam50/Assets/Scripts/Balance/EnemiesBalance.asset.meta diff --git a/ldjam50/Assets/Scripts/Balance/BalanceScriptableObject.cs b/ldjam50/Assets/Scripts/Balance/BalanceScriptableObject.cs new file mode 100644 index 0000000..b211ae5 --- /dev/null +++ b/ldjam50/Assets/Scripts/Balance/BalanceScriptableObject.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Serialization; + +public class BalanceScriptableObject : MonoBehaviour +{ + [CreateAssetMenu(fileName = "Data", menuName = "Game Data/Enemies Balance", order = 1)] + public class SpawnManagerScriptableObject : ScriptableObject + { + public enum EnemyTypeEnum + { + Standart, + Heavy, + Light, + Group + } + + [Serializable] + public struct EnemyRow + { + public EnemyTypeEnum enemyTypeEnum; + public int count; + public int health; + public int damage; + public float speed; + public float upgradePoints; + public float floatTimeAfterDeath; + } + + [SerializeField] public List enemiesList; + } +} diff --git a/ldjam50/Assets/Scripts/Balance/BalanceScriptableObject.cs.meta b/ldjam50/Assets/Scripts/Balance/BalanceScriptableObject.cs.meta new file mode 100644 index 0000000..fe4d838 --- /dev/null +++ b/ldjam50/Assets/Scripts/Balance/BalanceScriptableObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43de2f99e8d8aee00b99f37effd52dbd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ldjam50/Assets/Scripts/Balance/EnemiesBalance.asset b/ldjam50/Assets/Scripts/Balance/EnemiesBalance.asset new file mode 100644 index 0000000..9a7e011 --- /dev/null +++ b/ldjam50/Assets/Scripts/Balance/EnemiesBalance.asset @@ -0,0 +1,50 @@ +%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: 0} + m_Name: EnemiesBalance + m_EditorClassIdentifier: Assembly-CSharp::BalanceScriptableObject/SpawnManagerScriptableObject + enemiesList: + - enemyTypeEnum: 0 + count: 1 + health: 100 + damage: 10 + speed: 2 + upgradePoints: 1 + floatTimeAfterDeath: 0.005 + - enemyTypeEnum: 1 + count: 1 + health: 200 + damage: 20 + speed: 1.5 + upgradePoints: 2 + floatTimeAfterDeath: 0.01 + - enemyTypeEnum: 2 + count: 1 + health: 50 + damage: 5 + speed: 2.5 + upgradePoints: 2 + floatTimeAfterDeath: 0.01 + - enemyTypeEnum: 3 + count: 4 + health: 0 + damage: 0 + speed: 0 + upgradePoints: 0 + floatTimeAfterDeath: 0 + - enemyTypeEnum: 0 + count: 4 + health: 625 + damage: 625 + speed: 1.88 + upgradePoints: 0.5 + floatTimeAfterDeath: 0.0025 diff --git a/ldjam50/Assets/Scripts/Balance/EnemiesBalance.asset.meta b/ldjam50/Assets/Scripts/Balance/EnemiesBalance.asset.meta new file mode 100644 index 0000000..05ddf96 --- /dev/null +++ b/ldjam50/Assets/Scripts/Balance/EnemiesBalance.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 145dbaa0f1d2a2ff797b13ec2fdc78bf +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: