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


C# Gun.SetRange方法代码示例

本文整理汇总了C#中Gun.SetRange方法的典型用法代码示例。如果您正苦于以下问题:C# Gun.SetRange方法的具体用法?C# Gun.SetRange怎么用?C# Gun.SetRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gun的用法示例。


在下文中一共展示了Gun.SetRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FillController


//.........这里部分代码省略.........
                splitCount++;
            //homing - above 0.0 and it will home, the number describes the strength of the pull
            float pTrapHome = (float)(double)pdata["trapHoming"];
            if (pTrapHome > trapHoming)
                trapHoming = pTrapHome;
            if (pTrapHome > 0.0f)
                homeCount++;
            //arc - above 0.0 and it'll arc, the number describes the damage bonus
            float pTrapArc = (float)(double)pdata["trapArc"];
            if (pTrapArc > trapArc)
                trapArc = pTrapArc;
            if (pTrapArc > 0.0f)
                arcCount++;
        }

        penetrationBonusCount = Math.Min(speedCount,peneCount);
        splashBonusCount = Math.Min(splashCount,rangeCount);
        regenBonusCount = Math.Min(shredCount,slowCount);
        hijackRegenBonus = Math.Min (drainCount,peneCount) > 0;
        chainStunBonus = Math.Min (stunCount,knockbackCount) > 0;
        chainPoisonBonus = Math.Min (spreadCount,poisonCount) > 0;
        lethargyPoisonBonus = Math.Min (slowCount,poisonCount) > 0;
        recursiveSplitBonus = Math.Min (splitCount,spreadCount) > 0;
        circleExplosionBonus = Math.Min (arcCount,splashCount) > 0;

        //DONE GETTING RAW VALUES

        //Set tower stats based on these values
        if(gc.GetTowerType().Equals ("Bullet")){
            //Debug.Log("speed is " + ((1f/speed) * SPEED_CONSTANT));
            //Damage
            gc.SetDmg (damage);
            //Range
            gc.SetRange (range);
            //Speed
            gc.SetSpeed ((1f/speed) * SPEED_CONSTANT);
            //Cooldown
            gc.SetCooldown (cooldown);
            //Poison
            gc.SetPoison (poison);
            //Debug.Log (gc.buttonID + " poison value is set to " + poison);
            gc.SetPoisonDur (3f);
            gc.SetChainPoison(chainPoisonBonus);
            gc.SetLeeches(hijackRegenBonus);
            //Slowdown
            gc.SetSlowdown (1f-slowdownMax); //for now.  eventually add in that scaling system for slow/fast enemies?
            //Debug.Log (slowdownMax + "is max slowdown");
            gc.SetSlowDur (0.75f);
            //Knockback
            gc.SetKnockback(knockback);
            //Lifedrain
            gc.SetLifeDrain (lifeDrain);
            //Splash
            gc.SetSplash (splash);
            gc.SetSplashRadiusBonus(splashBonusCount * PERCENT_AOE_RANGE_PER_PAIR);
            //Stun
            gc.SetStun (stun);
            //Penetration
            gc.SetPenetration (penetration);
            gc.SetPiercing(penetrationBonusCount);
            //Shieldshred
            gc.SetShieldShred (shieldShred);
            gc.SetShieldSlow(regenBonusCount*PERCENT_SHIELD_REGEN_SLOW_PER_PAIR);
            //Spread
            gc.SetSpread(spread);
            //SplitCount
开发者ID:Benedict-SC,项目名称:doom-dial,代码行数:67,代码来源:PieceParser.cs


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