Refactor character attributes system; replace individual attributes with a dictionary-based approach for better scalability and maintainability
This commit is contained in:
@@ -3,6 +3,7 @@ using Data;
|
||||
using KBCore.Refs;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using Attribute = Data.Attribute;
|
||||
|
||||
namespace Systems
|
||||
{
|
||||
@@ -43,7 +44,7 @@ namespace Systems
|
||||
{
|
||||
if (!rb) return;
|
||||
|
||||
var velocity = new Vector2(movementInput.x, movementInput.y).normalized * character.attributes.MoveSpeed;
|
||||
var velocity = new Vector2(movementInput.x, movementInput.y).normalized * character.attributes.Get(Attribute.MoveSpeed);
|
||||
rb.linearVelocity = velocity;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user