Esempio n. 1
0
 public void CloneUnit(Unit oldClone)
 {
     isSelectable = oldClone.isSelectable;
     isSelected = oldClone.isSelected;
     id = oldClone.id;
     enemyName = oldClone.enemyName;
     leader = oldClone.leader;
     uName = oldClone.uName;
     teamColor = oldClone.teamColor;
     label = oldClone.label;
     status = oldClone.status;
     movementType = oldClone.movementType;
     kills = oldClone.kills;
     lastDamager = oldClone.lastDamager;
     health = oldClone.health;
     weapon = oldClone.weapon;
     _initialWeapon = oldClone._initialWeapon;
     aBase = oldClone.aBase;
     raycastIgnoreLayers = Commander.player.raycastIgnoreLayers;
     weapon.Pickup(this);
     leader.ReplaceUnit(id, this);
     if (isSelected)
         SetOutlineColor(selectedColor);
     else
         SetOutlineColor(outlineColor);
     orderData = oldClone.orderData;
     if (orderData != null)
         orderData.SetUnit(this);
     skipSpawn = true;
     SetTeamColor();
     Invoke("AllowSpawn", 5.0f);
 }