本文整理汇总了C#中BuildingBlock.LookupShortPrefabName方法的典型用法代码示例。如果您正苦于以下问题:C# BuildingBlock.LookupShortPrefabName方法的具体用法?C# BuildingBlock.LookupShortPrefabName怎么用?C# BuildingBlock.LookupShortPrefabName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BuildingBlock
的用法示例。
在下文中一共展示了BuildingBlock.LookupShortPrefabName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessBuildingDamage
void ProcessBuildingDamage(BuildingBlock block, HitInfo hitInfo)
{
var multiplier = 1.0f;
var isHighWall = block.LookupShortPrefabName().Contains("wall.external");
string type = "other";
switch (block.grade)
{
case BuildingGrade.Enum.Twigs:
multiplier = c_twigMultiplier;
type = "twig";
break;
case BuildingGrade.Enum.Wood:
if (isHighWall)
{
multiplier = c_highWoodWallMultiplier;
type = "high wood wall";
}
else
{
multiplier = c_woodMultiplier;
type = "wood";
}
break;
case BuildingGrade.Enum.Stone:
if (isHighWall)
{
multiplier = c_highStoneWallMultiplier;
type = "high stone wall";
}
else
{
multiplier = c_stoneMultiplier;
type = "stone";
}
break;
case BuildingGrade.Enum.Metal:
multiplier = c_sheetMultiplier;
type = "sheet";
break;
case BuildingGrade.Enum.TopTier:
multiplier = c_armoredMultiplier;
type = "armored";
break;
};
var before = hitInfo.damageTypes.Get(Rust.DamageType.Decay);
hitInfo.damageTypes.Scale(Rust.DamageType.Decay, multiplier);
if (c_outputToRcon)
Puts($"Decay ({type}) before: {before} after: {hitInfo.damageTypes.Get(Rust.DamageType.Decay)}");
}