Moved scripts to submodule
This commit is contained in:
parent
2fd48d1475
commit
f2355fc782
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "CoreSystems",
|
||||
"rootNamespace": "AsteroidGame",
|
||||
"references": [
|
||||
"GUID:eb3099ff524d60545a136315a154d67b"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5d38ea13ae8f69a4395d425d401a557a
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 45bb6db30a5284f47ab4bf3079628eef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
namespace AsteroidGame.CoreSystems
|
||||
{
|
||||
public interface IBuildable
|
||||
{
|
||||
public int GetCost();
|
||||
public int SetCost(int newCost);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 99361805272d7f6419384097857e2bd6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
|||
namespace AsteroidGame.CoreSystems
|
||||
{
|
||||
public interface IDamageable
|
||||
{
|
||||
#region Methods
|
||||
|
||||
public void ModifyHealth(int healthChange);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Setters
|
||||
|
||||
public void SetCurrentHealth(int newHealth);
|
||||
|
||||
public void SetMaxHealth(int newHealth);
|
||||
|
||||
public void SetInvulnerable(bool newState);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Getters
|
||||
|
||||
public int GetCurrentHealth();
|
||||
|
||||
public int GetMaxHealth();
|
||||
|
||||
public float GetHealthFactor();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d0290b6d2e8462547a0d40b67a1076e3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,17 @@
|
|||
namespace AsteroidGame.CoreSystems
|
||||
{
|
||||
public interface IPowerSystem
|
||||
{
|
||||
public bool IsGenerator { get; }
|
||||
|
||||
public bool IsConsumer { get; }
|
||||
|
||||
public void SetMaxPower(int newValue);
|
||||
|
||||
public int GetMaxPower();
|
||||
|
||||
public int GetCurrentPower();
|
||||
|
||||
public float GetPowerFactor();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c3e9b410a74a04f4ab85e908d2a684a8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,11 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.CoreSystems
|
||||
{
|
||||
public interface ITargetable
|
||||
{
|
||||
public Vector3 GetCenterPosition();
|
||||
|
||||
public Vector3 GetBasePosition();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3d338501124dcf349b3852a83d20dbe4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
namespace AsteroidGame.CoreSystems
|
||||
{
|
||||
public interface IWeapon
|
||||
{
|
||||
public float FireRate { get; set; }
|
||||
public float Damage { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a4d06a75a5a64c83aa191a8610f5080f
|
||||
timeCreated: 1664621279
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e7c9c9dd27534804094d63a678cdb663
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3ba0c810efb9bc34697d807fc63a2b84
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,44 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.CoreSystems
|
||||
{
|
||||
public class Damageable : MonoBehaviour, IDamageable
|
||||
{
|
||||
[field: Header("Health")]
|
||||
[field: SerializeField] public int CurrentHealth { get; private set; }
|
||||
[field: SerializeField] public int MaxHealth { get; private set; }
|
||||
|
||||
[field: Header("Modifiers")]
|
||||
[field: SerializeField] public bool IsInvulnerable { get; private set; }
|
||||
|
||||
#region Methods
|
||||
|
||||
public void ModifyHealth(int healthChange)
|
||||
{
|
||||
if (IsInvulnerable) return;
|
||||
CurrentHealth += healthChange;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Setters
|
||||
|
||||
public void SetCurrentHealth(int newHealth) => CurrentHealth = newHealth;
|
||||
|
||||
public void SetMaxHealth(int newHealth) => MaxHealth = newHealth;
|
||||
|
||||
public void SetInvulnerable(bool newState) => IsInvulnerable = newState;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Getters
|
||||
|
||||
public int GetCurrentHealth() => CurrentHealth;
|
||||
|
||||
public int GetMaxHealth() => MaxHealth;
|
||||
|
||||
public float GetHealthFactor() => (float)CurrentHealth / (float)MaxHealth;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a845ca774f1a2d341b32451b100c0d1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,15 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.CoreSystems
|
||||
{
|
||||
public class Targetable : MonoBehaviour, ITargetable
|
||||
{
|
||||
[Header("TargetPositions")]
|
||||
[SerializeField] private Transform _centerPosition;
|
||||
[SerializeField] private Transform _basePosition;
|
||||
|
||||
public Vector3 GetCenterPosition() => _centerPosition.transform.position;
|
||||
|
||||
public Vector3 GetBasePosition() => _basePosition.transform.position;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8410932d22e18624787af61d3a4cd191
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue