当前位置: 首页>>代码示例>>C#>>正文


C# Ability.GetType方法代码示例

本文整理汇总了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;
         }
     }
 }
开发者ID:EternalGB,项目名称:platforming-combat-roguelike,代码行数:30,代码来源:Buff.cs

示例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);
         }
     }
 }
开发者ID:EternalGB,项目名称:platforming-combat-roguelike,代码行数:21,代码来源:Dash.cs

示例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;
         }
     }
 }
开发者ID:EternalGB,项目名称:platforming-combat-roguelike,代码行数:30,代码来源:CloseBlast.cs

示例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;
         }
     }
 }
开发者ID:EternalGB,项目名称:platforming-combat-roguelike,代码行数:22,代码来源:ClusterShower.cs

示例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;
         }
     }
 }
开发者ID:EternalGB,项目名称:platforming-combat-roguelike,代码行数:21,代码来源:OrbGenerator.cs


注:本文中的Ability.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。