Right now I have two parts of my code I need to connect, an equipment system and a player character who swaps weapons using interfaces via code that looks like this
(It just loops between the two weapons for now, just made to test the viability of interfaces. The grand idea is to have an array of equipped attacks then sort them...
How to use scriptable objects for equipping weapons (Classes - IAttack interface)
Code (CSharp):
- IAttack _currentAttack;
- IAttack _nextAttack;
- IAttack memoryAttack = _currentAttack;
- _currentAttack = _nextAttack;
- _nextAttack = memoryAttack;
How to use scriptable objects for equipping weapons (Classes - IAttack interface)