本文整理汇总了C#中Base.removeHiredSoldier方法的典型用法代码示例。如果您正苦于以下问题:C# Base.removeHiredSoldier方法的具体用法?C# Base.removeHiredSoldier怎么用?C# Base.removeHiredSoldier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base.removeHiredSoldier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGUI
//.........这里部分代码省略.........
GUI.skin = employeeSkin;
// Everything under here will be inside the ScollGui View
if(soldierToggle){
//GUI for left side of screen
LinkedList<Soldier> hired = curBase.getHiredSoldiers();
Soldier[] tempArray1=new Soldier[hired.Count];
hired.CopyTo (tempArray1,0);
for(int i = 0;i<hired.Count;i++){
if(tempArray1[i].getId()==selectedSoldier){
GUI.skin = selectedEmployeeSkin;
}else{
GUI.skin = employeeSkin;
}
if(GUI.Button (new Rect(Screen.width/2*0.1f,Screen.height*0.10f+(60*i),Screen.width/4*0.90f,50), tempArray1[i].getName ())){
selectedSoldier=tempArray1[i].getId ();
selectionSoldierExist = true;
}
GUI.skin = selectedEmployee;
if(GUI.Button(new Rect(Screen.width/2*0.60f,Screen.height*0.10f+(60*i),30,30),"")){
if(curBase.isSoldierInAircraft(tempArray1[i])){
popUpWindow=true;
soldierInAircraft=true;
}else{
// dequip soldier's weapon and armor
if (tempArray1[i].getWeapon() != null) {
gameManager.Instance.getCurrentBase().dequip(tempArray1[i].getWeapon());
tempArray1[i].setWeapon (null);
}
if (tempArray1[i].getArmor() != null) {
gameManager.Instance.getCurrentBase().dequip(tempArray1[i].getArmor());
tempArray1[i].setArmor(null);
}
afhSoldiers.AddLast (tempArray1[i]);
curBase.removeHiredSoldier (tempArray1[i]);
curBase.freeLivingSpace();
DateTime temp1 = gameManager.Instance.getTime (),temp2 = new DateTime(temp1.Year+1,1,1);
TimeSpan span= temp2.Subtract(temp1);
int salary = (int)((Double)SALARIES[tempArray1[i].getRank ()] * span.TotalDays/365.242199);
gameManager.Instance.updateMoney (gameManager.Instance.getMoney () + salary);
}
}
GUI.skin=employeeSkin;
}
createAfhSoldiers();
Soldier[] tempArray2=new Soldier[afhSoldiers.Count];
afhSoldiers.CopyTo (tempArray2,0);
for(int i = 0;i<tempArray2.Length;i++){
if(tempArray2[i].getId()==selectedSoldier){
GUI.skin = selectedEmployeeSkin;
}else{
GUI.skin = employeeSkin;
}
if(GUI.Button (new Rect(Screen.width/2*0.1f,Screen.height*0.10f+(60*hired.Count)+(60*i),Screen.width/4*0.90f,50), tempArray2[i].getName())){
selectedSoldier=tempArray2[i].getId();
selectionSoldierExist = true;
}
GUI.skin = unselectedEmployee;
if(GUI.Button(new Rect(Screen.width/2*0.60f,Screen.height*0.10f+(60*hired.Count)+(60*i),30,30),"")){
if((curBase.getLivingSpace()-curBase.getOccupiedLivingSpace())<=0){
popUpWindow=true;
moreLivingQuarters=true;
}else{
DateTime temp1 = gameManager.Instance.getTime (),temp2 = new DateTime(temp1.Year+1,1,1);
TimeSpan span= temp2.Subtract(temp1);
int salary = (int)((Double)SALARIES[tempArray2[i].getRank ()] * span.TotalDays/365.242199);
if((gameManager.Instance.getMoney () - salary) <0){