var use = itemAbility as Use;
if (use == null) {
return;
}
for (int i = 0; i < use.UsableItems.length; ++i) {
}
Make sure you are subscribing to OnDeath on the main character GameObject. OnDeath is used in a decent amount of locations so if you search through the code you can find a few examples.also I can't get the OnDeath event working at all.
for (int i = 0; i < use.UsableItems.length; ++i) {
if (use.UsableItems[i] == null) {
continue;
}
var shootableWeapon = use.UsableItems[i] as ShootableWeapon;
if (shootableWeapon == null) {
continue;
}
// Do stuff.
}