Пример #1
0
 /**
  * Attach a single turn effect to this player
  *
  * Arguments
  * - TurnEffect toAdd - Effect to add
  */
 public void AttachTurnEffect(Effect toAdd)
 {
     switch (toAdd.GetTurnEffectType()) { // Apply turn effects immediately if needed
     case TurnEffectType.STATEFFECT: goto default; // Only apply stat effects in the next turn
     case TurnEffectType.MATERIALEFFECT:
         GetComponent<PhotonView>().RPC("SetNewMaterial", PhotonTargets.All,
                 new object[] {
                     toAdd.GetMaterialPath()
                 }
         );
         break;
     case TurnEffectType.ITEMEFFECT: // Apply item effects immediately
         foreach (Item item in inventory) {
             if (item != null)
                 toAdd.ApplyEffectToItem(item);
         }
         break;
     case TurnEffectType.MODELCHANGEEFFECT: goto case TurnEffectType.COMPONENTEFFECT;// Need complex attach routine
     case TurnEffectType.COMPONENTEFFECT: // Need a complex attach routine
         toAdd.ExtraAttachActions();
         break;
     default: break; // Don't do anything
     }
     turnEffects.Add(toAdd);
     effectPanelScript.AddTurnEffect(toAdd);
 }