Какие штуки

This commit is contained in:
ThomasCharester committed 2025-10-28 13:49:01 +03:00
1 parent b4655c5665
commit 64aa63f4ed
8 files changed
+48 -2

No files matched your search

@@ -1,5 +1,4 @@
using Code.App.StateMachine;
using Code.Configs;
using Code.Input;
using Code.Scenes;
using Code.StaticData;
@@ -5,7 +5,6 @@ namespace Code.Configs
[CreateAssetMenu(menuName = "Config/Player", fileName = "PlayerConfig")]
public class PlayerConfig : ScriptableObject
{
public Player playerPrefab;
public int maxHealth;
}
}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e4901b413afd4d7da914edf2a1e51f8f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 58441fe5bc46071fab2546105689c70b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,27 @@
namespace Code.Gameplay.Player
{
public class PlayerHealth
{
public delegate void OnDeathDelegate();
public event OnDeathDelegate OnDeath;
public delegate void OnDamageDelegate(int damage);
public event OnDamageDelegate OnDamage;
private int _healthPoints;
public int HealthPoints => _healthPoints;
public void GetDamage(int count)
{
_healthPoints -= count;
OnDamage?.Invoke(count);
if (_healthPoints <= 0) OnDeath?.Invoke();
}
public PlayerHealth(int healthPoints = 1) => _healthPoints = healthPoints;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3873d746bf1595618802b853c6920616
@@ -9,5 +9,6 @@ namespace Code.StaticData
InputConfig InputConfig { get; }
AppConfig AppConfig { get; }
UIConfig UIConfig { get; }
CharacterCameraConfig CharacterCameraConfig { get; }
}
}
@@ -9,11 +9,13 @@ namespace Code.StaticData
public AppConfig AppConfig { get; private set; }
public InputConfig InputConfig { get; private set; }
public UIConfig UIConfig { get; private set; }
public CharacterCameraConfig CharacterCameraConfig { get; private set; }
public void Load()
{
InputConfig = Resources.Load<InputConfig>(string.Format(StringPaths.ConfigSingle, "App", "InputConfig"));
AppConfig = Resources.Load<AppConfig>(string.Format(StringPaths.ConfigSingle, "App", "AppConfig"));
CharacterCameraConfig = Resources.Load<CharacterCameraConfig>(string.Format(StringPaths.ConfigSingle, "App", "CharacterCameraConfig"));
UIConfig = Resources.Load<UIConfig>(string.Format(StringPaths.ConfigSingle, "App", "UIConfig"));
}
}