Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

How to use scriptable objects for equipping weapons (Classes - IAttack interface)

$
0
0
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
Code (CSharp):
  1. IAttack _currentAttack;
  2. IAttack _nextAttack;
  3.  
  4. IAttack memoryAttack = _currentAttack;
  5. _currentAttack = _nextAttack;
  6. _nextAttack = memoryAttack;
(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)

Viewing all articles
Browse latest Browse all 1466670

Trending Articles