我正在制作游戏的能力,我需要添加动画(我知道该怎么做)。我的问题是我需要一种方法来创建动画的引用,而无需分配特定的动画。我有一个基类以及一个基础逻辑(这是我需要一个通用引用的地方,因为一个异能需要一个动画),然后当我想创造一个能力时,我创建一个新的类继承基础,然后创建这种能力(这是我将分配动画的地方)。团结动画C#
//Default logic for abilities
public virtual void abilityEffects(hero caster, hero target){
this.caster = caster;
this.target = target;
float DMG = damage * this.caster.heroAttPow;
//Ability should not be on cooldown the first time it is used
if (firstUse == true)
{
//sets the total damage to take into account the ability damage plus the hero power
//need general reference to animation here
//when animation is over, deal damage
this.target.HP -= DMG;
firstUse = false;
//cooldown begins
SpellStart = Time.time;
}
if(firstUse == false)
{
if (Time.time > SpellStart + SpellCooldown)
{
//sets the total damage to take into account the ability damage plus the hero power
//need general reference to animation here
//when animation is over, deal damage
this.target.HP -= DMG;
//cooldown begins
SpellStart = Time.time;
}
}
}
是否使用Mecani米到动画? –
如果您知道如何进行动画制作,那么该学习使用Mecanim参数和事件了。 – Vancete
@SergioOrmeño我使用Blender制作动画,然后将其导出为.fbx文件 –