Tutorials/MeleeSystem02
From NeoAxisWiki
Melee Basics
Creating Multiple Attack Animation Fields
In order to create a melee combat system we must utilize multiple animations for our attack function. All the player animation fields are located in Weapon.cs and are used by Meleeweapon.cs
In Weapon.cs add the following code:
[FieldSerialize]
string fireUnitAnimationName2 = "";
[FieldSerialize]
string fireUnitAnimationName3 = "";
Around Line 50 under
string fireUnitAnimationName = "";
Then near Line 103 add:
public string FireUnitAnimationName2
{
get { return fireUnitAnimationName2; }
set { fireUnitAnimationName2 = value; }
}
public string FireUnitAnimationName2
{
get { return fireUnitAnimationName3; }
set { fireUnitAnimationName3 = value; }
}
These few lines of code will add 2 extra player attack animation fields to a weapon.
Next, open the resource editor and locate TestSword.type. This MeleeWeapon will now contain the properties FireUnitAnimationName2 ad FireUnitAnimationName3. In FireUnitAnimationName2 type in attack2 and in FireUnitAnimationName3 type in attack3. Save and close the resource editor.
