本文整理汇总了C#中Ability.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Ability.GetType方法的具体用法?C# Ability.GetType怎么用?C# Ability.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ability
的用法示例。
在下文中一共展示了Ability.GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: upgradeOtherAbility
protected override void upgradeOtherAbility(Ability other)
{
print(abilityName + " upgrading " + other.abilityName);
if(other.GetType().BaseType == typeof(ProjectileAttack)) {
ProjectileAttack pa = (ProjectileAttack)other;
effectSize = -effectSize;
pa.onCollision = doBuff;
} else if(other.GetType().BaseType == typeof(CloseBlast)) {
CloseBlast cb = (CloseBlast)other;
effectSize = -effectSize;
cb.onHitByBurst = doBuff;
} else if(other.GetType().BaseType == typeof(Buff)) {
Buff b = (Buff)other;
b.buffs.Add(buffEffect,undoBuff);
b.buffDurations.Add(buffEffect,buffDuration);
} else if(other.GetType().BaseType == typeof(Special)) {
if(other.GetType() == typeof(Dash)) {
Dash d = (Dash)other;
d.preDashAction = activeEffect;
} else if(other.GetType() == typeof(ClusterShower)) {
ClusterShower cs = (ClusterShower)other;
effectSize = -effectSize;
cs.onCollision = doBuff;
} else if(other.GetType() == typeof(OrbGenerator)) {
OrbGenerator og = (OrbGenerator)other;
effectSize -= effectSize;
og.onCollision = doBuff;
}
}
}
示例2: upgradeOtherAbility
protected override void upgradeOtherAbility(Ability other)
{
if(other.GetType().BaseType == typeof(ProjectileAttack)) {
ProjectileAttack pa = (ProjectileAttack)other;
pa.bulletVelocity += speedScaling*effectSize;
} else if(other.GetType().BaseType == typeof(CloseBlast)) {
CloseBlast cb = (CloseBlast)other;
cb.onHitByBurst = knockback;
} else if(other.GetType().BaseType == typeof(Buff)) {
Buff b = (Buff)other;
b.effectSize += effectSize/5;
} else if(other.GetType().BaseType == typeof(Special)) {
if(other.GetType() == typeof(ClusterShower)) {
ClusterShower cs = (ClusterShower)other;
cs.onCollision = knockback;
} else if(other.GetType() == typeof(OrbGenerator)) {
OrbGenerator og = (OrbGenerator)other;
og.IncreaseOrbSpeed(effectSize);
}
}
}
示例3: upgradeOtherAbility
protected override void upgradeOtherAbility(Ability other)
{
print(abilityName + " upgrading " + other.abilityName);
if(other.GetType().BaseType == typeof(ProjectileAttack)) {
ProjectileAttack pa = (ProjectileAttack)other;
pa.onCollision = createBlastFromProjCollision;
pa.onCollisionTargets = burstTargets;
} else if(other.GetType().BaseType == typeof(CloseBlast)) {
CloseBlast cb = (CloseBlast)other;
cb.onHitByBurst = onHitByBurst;
cb.burstTargets = burstTargets;
} else if(other.GetType().BaseType == typeof(Buff)) {
Buff b = (Buff)other;
onHitByBurst = b.buffEffect;
b.activeFunc = activeEffect;
} else if(other.GetType().BaseType == typeof(Special)) {
if(other.GetType() == typeof(Dash)) {
Dash d = (Dash)other;
d.preDashAction = activeEffect;
} else if(other.GetType() == typeof(ClusterShower)) {
ClusterShower cs = (ClusterShower)other;
cs.onCollision = createBlast;
cs.onCollisionTargets = burstTargets;
} else if(other.GetType() == typeof(OrbGenerator)) {
OrbGenerator og = (OrbGenerator)other;
og.onCollision = createBlast;
og.onCollisionTargets = burstTargets;
}
}
}
示例4: upgradeOtherAbility
protected override void upgradeOtherAbility(Ability other)
{
if(other.GetType().BaseType == typeof(ProjectileAttack)) {
ProjectileAttack pa = (ProjectileAttack)other;
pa.onCollision = upgradeSpray;
} else if(other.GetType().BaseType == typeof(CloseBlast)) {
CloseBlast cb = (CloseBlast)other;
cb.onHitByBurst = upgradeSpray;
} else if(other.GetType().BaseType == typeof(Buff)) {
Buff b = (Buff)other;
onCollision = b.buffEffect;
b.activeFunc = activeEffect;
} else if(other.GetType().BaseType == typeof(Special)) {
if(other.GetType() == typeof(Dash)) {
Dash d = (Dash)other;
d.preDashAction = sprayClusters;
} else if(other.GetType() == typeof(OrbGenerator)) {
OrbGenerator og = (OrbGenerator)other;
og.onCollision = upgradeSpray;
}
}
}
示例5: upgradeOtherAbility
protected override void upgradeOtherAbility(Ability other)
{
if(other.GetType().BaseType == typeof(ProjectileAttack)) {
ProjectileAttack pa = (ProjectileAttack)other;
pa.onCollision = defaultCollision;
} else if(other.GetType().BaseType == typeof(CloseBlast)) {
CloseBlast cb = (CloseBlast)other;
cb.onHitByBurst = defaultCollision;
} else if(other.GetType().BaseType == typeof(Buff)) {
Buff b = (Buff)other;
b.effectSize += effectSize/5;
} else if(other.GetType().BaseType == typeof(Special)) {
if(other.GetType() == typeof(ClusterShower)) {
ClusterShower cs = (ClusterShower)other;
cs.onCollision = defaultCollision;
} else if(other.GetType() == typeof(Dash)) {
Dash d = (Dash)other;
d.preDashAction = activeEffect;
}
}
}