Changed naming scheme of ScriptableObjects
This commit is contained in:
parent
35d80db948
commit
357e02ff4f
|
@ -6,14 +6,14 @@ namespace AsteroidGame.Entities
|
|||
{
|
||||
public class EnemyBase : EntityBase
|
||||
{
|
||||
[SerializeField] private SEntityBaseRuntimeSet _enemyBaseSet;
|
||||
[SerializeField] private SoEntityBaseRuntimeSet _enemyBaseSet;
|
||||
|
||||
[Header("Targeter")]
|
||||
[SerializeField] private STargeterConfig _targeterConfig;
|
||||
[SerializeField] private Targeter _targeter;
|
||||
[SerializeField] private EntityBase _target;
|
||||
|
||||
[Header("NavMeshAgent")]
|
||||
[SerializeField] private SoTargeterConfig _targeterConfig;
|
||||
[SerializeField] private NavMeshAgent _navMeshAgent;
|
||||
|
||||
protected override void OnEnable()
|
||||
|
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.Entities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newEnemyList", menuName = "Enemies/EnemyList")]
|
||||
public class SEnemyBaseList : ScriptableObject
|
||||
public class SoEnemyBaseList : ScriptableObject
|
||||
{
|
||||
public List<EnemyBase> _list;
|
||||
}
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.Entities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newEnemyBaseRuntimeSet", menuName = "RuntimeSet/EnemyBase")]
|
||||
public class SEnemyBaseRuntimeSet : SRuntimeSet<EnemyBase>
|
||||
public class SoEnemyBaseRuntimeSet : SRuntimeSet<EnemyBase>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.Entities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newEntityBaseRuntimeSet", menuName = "RuntimeSet/EntityBase")]
|
||||
public class SEntityBaseRuntimeSet : SRuntimeSet<EntityBase>
|
||||
public class SoEntityBaseRuntimeSet : SRuntimeSet<EntityBase>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.Entities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newPowerBaseRuntimeSet", menuName = "RuntimeSet/PowerBase")]
|
||||
public class SPowerBaseRuntimeSet : SRuntimeSet<PowerBase>
|
||||
public class SoPowerBaseRuntimeSet : SRuntimeSet<PowerBase>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,12 +1,11 @@
|
|||
using AsteroidGame.Interfaces;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newPowerConfiguration", menuName = "Configuration/Power")]
|
||||
public class SPowerConfig : ScriptableObject
|
||||
public class SoPowerConfig : ScriptableObject
|
||||
{
|
||||
public SPowerBaseRuntimeSet _activePowerStructures;
|
||||
public SoPowerBaseRuntimeSet _activePowerStructures;
|
||||
public bool isGenerator;
|
||||
public bool isConsumer;
|
||||
public int maxPower;
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.Entities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newStructureList", menuName = "Structures/StructureList")]
|
||||
public class SStructureBaseList : ScriptableObject
|
||||
public class SoStructureBaseList : ScriptableObject
|
||||
{
|
||||
public List<StructureBase> _structureList;
|
||||
}
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
|||
namespace AsteroidGame.Entities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newStructureBaseRuntimeSet", menuName = "RuntimeSet/StructureBase")]
|
||||
public class SStructureBaseRuntimeSet : SRuntimeSet<StructureBase>
|
||||
public class SoStructureBaseRuntimeSet : SRuntimeSet<StructureBase>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
using AsteroidGame.Interfaces;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
{
|
||||
[CreateAssetMenu(fileName = "newTargeterConfiguration", menuName = "Configuration/Targeter")]
|
||||
public class STargeterConfig : ScriptableObject
|
||||
public class SoTargeterConfig : ScriptableObject
|
||||
{
|
||||
public float _range;
|
||||
public TargetStrategy _selectedTargetStrategy;
|
||||
public SEntityBaseRuntimeSet _activeEntities;
|
||||
public SoEntityBaseRuntimeSet _activeEntities;
|
||||
|
||||
public enum TargetStrategy
|
||||
{
|
||||
LowestRange,
|
|
@ -1,9 +1,9 @@
|
|||
using AsteroidGame.Interfaces;
|
||||
using AsteroidGame.CoreSystems;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AsteroidGame.Entities
|
||||
{
|
||||
public class SWeaponConfig : ScriptableObject, IWeapon
|
||||
public class SoWeaponConfig : ScriptableObject, IWeapon
|
||||
{
|
||||
[SerializeField] private float _fireRate;
|
||||
[SerializeField] private float _damage;
|
|
@ -18,7 +18,7 @@ namespace AsteroidGame.Entities
|
|||
[SerializeField] protected string _uiFriendlyName;
|
||||
|
||||
[Space]
|
||||
[SerializeField] private SEntityBaseRuntimeSet _entityBaseSet;
|
||||
[SerializeField] private SoEntityBaseRuntimeSet _entityBaseSet;
|
||||
|
||||
#region Props
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace AsteroidGame.Entities
|
|||
[SerializeField] protected int _maxPower;
|
||||
[SerializeField] protected int _currentPower;
|
||||
|
||||
public void SetConfig(SPowerConfig config)
|
||||
public void SetConfig(SoPowerConfig config)
|
||||
{
|
||||
_isGenerator = config.isGenerator;
|
||||
_isConsumer = config.isConsumer;
|
||||
|
|
|
@ -5,14 +5,14 @@ namespace AsteroidGame.Entities
|
|||
public class Targeter : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float _range;
|
||||
[SerializeField] private STargeterConfig.TargetStrategy _targetStrategy;
|
||||
[SerializeField] private SEntityBaseRuntimeSet _activeEntities;
|
||||
[SerializeField] private EntityBase _targeterParent;
|
||||
[SerializeField] private EntityBase _targetEntity;
|
||||
[SerializeField] private SoTargeterConfig.TargetStrategy _targetStrategy;
|
||||
[SerializeField] private SoEntityBaseRuntimeSet _activeEntities;
|
||||
|
||||
public void SetParent(EntityBase newParent) => _targeterParent = newParent;
|
||||
|
||||
public void SetConfig(STargeterConfig config)
|
||||
public void SetConfig(SoTargeterConfig config)
|
||||
{
|
||||
_range = config._range;
|
||||
_targetStrategy = config._selectedTargetStrategy;
|
||||
|
@ -39,7 +39,7 @@ namespace AsteroidGame.Entities
|
|||
{
|
||||
switch (_targetStrategy)
|
||||
{
|
||||
case STargeterConfig.TargetStrategy.LowestRange:
|
||||
case SoTargeterConfig.TargetStrategy.LowestRange:
|
||||
{
|
||||
bool isClosest = distanceToTarget < currentBestValue;
|
||||
if (isClosest)
|
||||
|
@ -51,7 +51,7 @@ namespace AsteroidGame.Entities
|
|||
|
||||
break;
|
||||
}
|
||||
case STargeterConfig.TargetStrategy.LowestHealth:
|
||||
case SoTargeterConfig.TargetStrategy.LowestHealth:
|
||||
{
|
||||
float enemyHealth = targetEntity.GetHealth();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace AsteroidGame.Entities
|
|||
public class Disabler : MonoBehaviour
|
||||
{
|
||||
[FormerlySerializedAs("Set")]
|
||||
[SerializeField] private SStructureBaseRuntimeSet _set;
|
||||
[SerializeField] private SoStructureBaseRuntimeSet _set;
|
||||
|
||||
[ContextMenu("Disable All")]
|
||||
public void DisableAll()
|
||||
|
|
|
@ -12,11 +12,11 @@ namespace AsteroidGame.Entities
|
|||
[SerializeField] protected float _buildTimer;
|
||||
|
||||
[Header("Configuration")]
|
||||
[SerializeField] private SEntityBaseRuntimeSet _structureBaseSet;
|
||||
[SerializeField] private SPowerBaseRuntimeSet _powerBaseSet;
|
||||
[SerializeField] private SoEntityBaseRuntimeSet _structureBaseSet;
|
||||
[SerializeField] private SoPowerBaseRuntimeSet _powerBaseSet;
|
||||
|
||||
[Header("Power")]
|
||||
[SerializeField] private SPowerConfig _powerConfig;
|
||||
[SerializeField] private SoPowerConfig _powerConfig;
|
||||
[SerializeField] private PowerBase _power;
|
||||
|
||||
#region Publics
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace AsteroidGame.Entities
|
|||
[SerializeField] private Transform _barrel;
|
||||
|
||||
[Header("Targeter")]
|
||||
[SerializeField] private STargeterConfig _targeterConfig;
|
||||
[SerializeField] private SoTargeterConfig _targeterConfig;
|
||||
[SerializeField] private Targeter _targeter;
|
||||
[SerializeField] private EntityBase _target;
|
||||
|
||||
|
|
|
@ -16,9 +16,10 @@ namespace AsteroidGame.Handlers
|
|||
[SerializeField] private bool _isBuilding;
|
||||
[SerializeField] private int _buildingSelector;
|
||||
|
||||
[FormerlySerializedAs("_availableSStructures")]
|
||||
[FormerlySerializedAs("_availableStructures")]
|
||||
[Header("Structures")]
|
||||
[SerializeField] private SStructureBaseList _availableSStructures;
|
||||
[SerializeField] private SoStructureBaseList _availableSoStructures;
|
||||
|
||||
#region Private
|
||||
|
||||
|
@ -103,7 +104,7 @@ namespace AsteroidGame.Handlers
|
|||
|
||||
private void SpawnGhostStructure()
|
||||
{
|
||||
_ghostStructure = Instantiate(_availableSStructures._structureList[_buildingSelector], GetPlanePoint(),
|
||||
_ghostStructure = Instantiate(_availableSoStructures._structureList[_buildingSelector], GetPlanePoint(),
|
||||
Quaternion.identity,
|
||||
transform);
|
||||
_ghostStructure.name = "GhostStructure";
|
||||
|
@ -128,7 +129,7 @@ namespace AsteroidGame.Handlers
|
|||
|
||||
private void SpawnStructure()
|
||||
{
|
||||
_tempStructure = Instantiate(_availableSStructures._structureList[_buildingSelector], GetPlanePoint(),
|
||||
_tempStructure = Instantiate(_availableSoStructures._structureList[_buildingSelector], GetPlanePoint(),
|
||||
Quaternion.identity,
|
||||
transform);
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace AsteroidGame.Handlers
|
|||
[SerializeField] private int _objectPoolSize = 15;
|
||||
|
||||
[Header("Configuration")]
|
||||
[SerializeField] private SEnemyBaseList _availableEnemies;
|
||||
[SerializeField] private SoEnemyBaseList _availableEnemies;
|
||||
|
||||
[Header("Lists")]
|
||||
[SerializeField] private SEntityBaseRuntimeSet _activeEnemies;
|
||||
[SerializeField] private SoEntityBaseRuntimeSet _activeEnemies;
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@ namespace AsteroidGame.Handlers
|
|||
[SerializeField] private float _powerFactor;
|
||||
|
||||
[Header("Connections")]
|
||||
[SerializeField] private SPowerBaseRuntimeSet _activePowerStructures;
|
||||
[SerializeField] private SoPowerBaseRuntimeSet _activePowerStructures;
|
||||
|
||||
|
||||
private void Update()
|
||||
|
|
|
@ -9,9 +9,10 @@ namespace AsteroidGame.UI
|
|||
{
|
||||
public class BuildMenuUiController : MonoBehaviour
|
||||
{
|
||||
[FormerlySerializedAs("_availableSStructuresObject")]
|
||||
[FormerlySerializedAs("_availableStructuresObject")]
|
||||
[Header("Structures")]
|
||||
[SerializeField] private SStructureBaseList _availableSStructuresObject;
|
||||
[SerializeField] private SoStructureBaseList _availableSoStructuresObject;
|
||||
|
||||
private VisualElement _mRoot;
|
||||
private VisualElement _mSlotContainer;
|
||||
|
@ -20,7 +21,7 @@ namespace AsteroidGame.UI
|
|||
|
||||
private void OnEnable()
|
||||
{
|
||||
_buildings = _availableSStructuresObject._structureList;
|
||||
_buildings = _availableSoStructuresObject._structureList;
|
||||
_buildingHandler = FindObjectOfType<BuildingHandler>();
|
||||
|
||||
//Store the root from the UI Document component
|
||||
|
|
Loading…
Reference in New Issue