本文整理汇总了C#中Effect.ExtraDetachActions方法的典型用法代码示例。如果您正苦于以下问题:C# Effect.ExtraDetachActions方法的具体用法?C# Effect.ExtraDetachActions怎么用?C# Effect.ExtraDetachActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Effect
的用法示例。
在下文中一共展示了Effect.ExtraDetachActions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DetachTurnEffect
/**
* Remove a turn effect from this player and revert all its effects on this player
*
* Arguments
* - TurnEffect effect - The turn effect to remove
*/
public void DetachTurnEffect(Effect effect)
{
switch (effect.GetTurnEffectType()) { // Detach the effect on this player depending on type
case TurnEffectType.STATEFFECT: // Can only reset the vision stat
if (effect.GetStatAffected() == Stat.VISION)
stats[Stat.VISION] = playerClass.GetStat(Stat.VISION);
break;
case TurnEffectType.STATMULTIPLIEREFFECT: // Can rese the stat multiplier now
playerClass.RestoreDefaultStat(effect.GetStatAffected());
break;
case TurnEffectType.ITEMEFFECT: // Need to reset affected items
foreach (Item item in inventory) {
if (item != null && item.GetType().Equals(effect.GetAffectedItemType())) {
/* Reset item cool down and turn settings */
item.ResetCoolDown();
item.ResetCoolDownSetting();
item.ResetUsePerTurn();
if (item.RemainingCoolDownTurns() == 0) // Reduce the cool down of the item to be sure
item.ReduceCoolDown();
}
}
break;
case TurnEffectType.MATERIALEFFECT:
GetComponent<PhotonView>().RPC("ResetMaterial", PhotonTargets.All, null);
break;
case TurnEffectType.MODELCHANGEEFFECT: goto case TurnEffectType.COMPONENTEFFECT;// Need complex detach routine
case TurnEffectType.COMPONENTEFFECT: // Need complex detaching actions
effect.ExtraDetachActions();
break;
default: break; // Unknown
}
effectPanelScript.RemoveTurnEffect(effect);
turnEffects.Remove(effect);
}