本文整理汇总了C#中Base.addHiredWorker方法的典型用法代码示例。如果您正苦于以下问题:C# Base.addHiredWorker方法的具体用法?C# Base.addHiredWorker怎么用?C# Base.addHiredWorker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base.addHiredWorker方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGUI
void OnGUI()
{
//Try to create a pop-up window
if(popUpWindow){
GUI.Window (1,new Rect(Screen.width/3,Screen.height/3,Screen.width/3,Screen.height/3),createPopUpWindow,"");
}
if(equipMenu){
//GUI.Window (2,new Rect(Screen.width/4,Screen.height/4,Screen.width/2,Screen.height/2),createEquipWindow,"");
}
curBase = gameManager.Instance.getCurrentBase();
//Left portion of screen
GUI.skin = toggleSkin;
if(GUI.Toggle (new Rect(0,0,Screen.width/8,Screen.height*0.1f),soldierToggle,"Soldier")){
soldierToggle=true;
scientistToggle=false;
workerToggle=false;
pilotToggle=false;
}
if(GUI.Toggle(new Rect(Screen.width*1/8,0,Screen.width/8,Screen.height*0.1f),scientistToggle,"Scientist")){
soldierToggle=false;
scientistToggle=true;
workerToggle=false;
pilotToggle=false;
}
if(GUI.Toggle(new Rect(Screen.width*2/8,0,Screen.width/8,Screen.height*0.1f),workerToggle,"Worker")){
soldierToggle=false;
scientistToggle=false;
workerToggle=true;
pilotToggle=false;
}
if(GUI.Toggle(new Rect(Screen.width*3/8,0,Screen.width/8,Screen.height*0.1f),pilotToggle,"Pilot")){
soldierToggle=false;
scientistToggle=false;
workerToggle=false;
pilotToggle=true;
}
//GUI for the Right Side of the Screen
GUI.Label (new Rect(Screen.width/2+Screen.width*1/10,0,Screen.width*2/10,Screen.height*0.1f),"Money: "+gameManager.Instance.getMoney ());
GUI.skin = null;
if(GUI.Button (new Rect(Screen.width/2+Screen.width*4/10,0,Screen.width/10,Screen.height*0.1f),"Back")){
//Changing state to get back to base manager
gameManager.Instance.setLevel("BaseManager");
}
GUI.Box (new Rect(Screen.width/2,Screen.height*0.1f+2,Screen.width/2,Screen.height*0.1f),"");
//GUI.Box(new Rect(Screen.width/2,Screen.height*0.3f+2,Screen.width/2,Screen.height*0.7f-2),"Employee Information");
if(selectionSoldierExist){
if(soldierToggle){
GUI.Label (new Rect(Screen.width/2*1.1f,Screen.height*0.2f,200,20),"Employee Name:");
string tempName = getSoldier(selectedSoldier).getName();
string newName = tempName;
//GUI.TextField(new Rect(Screen.width/2*1.1f,Screen.height*0.35f+25,Screen.width/2*0.8f,20),newName);
newName = GUI.TextField(new Rect(Screen.width/2*1.1f,Screen.height*0.2f+20,Screen.width/2*0.8f,20),newName,40);
if(tempName!=newName){
changeSoldierName(selectedSoldier,newName);
}
}
}
if(selectionNameExist&&!soldierToggle){
GUI.Label (new Rect(Screen.width/2*1.1f,Screen.height*0.35f,200,20),"Employee Name:");
if(scientistToggle){
string check = nameSelectedEmployee.Substring (0,4);
if(check.Equals ("Dr. ")){
string tempName = nameSelectedEmployee;
nameSelectedEmployee = nameSelectedEmployee.Substring(4, nameSelectedEmployee.Length-4);
nameSelectedEmployee = GUI.TextField(new Rect(Screen.width/2*1.1f,Screen.height*0.35f+25,Screen.width/2*0.8f,20),nameSelectedEmployee,40);
nameSelectedEmployee = "Dr. "+nameSelectedEmployee;
if (tempName!=nameSelectedEmployee){
if(afhScientists.Remove(tempName)){
afhScientists.AddLast (nameSelectedEmployee);
}else{
curBase.removeHiredScientist(tempName);
curBase.addHiredScientist(nameSelectedEmployee);
}
}
GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.5f+(25)*10,Screen.width/2*0.8f,20),"Yearly Salary: $"+EMPLOYEEWAGE);
DateTime temp1 = gameManager.Instance.getTime (),temp2 = new DateTime(temp1.Year+1,1,1);
TimeSpan span= temp2.Subtract(temp1);
int salary = (int)((Double)EMPLOYEEWAGE * span.TotalDays/365.242199);
GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.5f+(25)*11,Screen.width/2*0.8f,20),"Cost of hiring till end of current year: $"+salary);
}
}else if(workerToggle){
if(nameSelectedEmployee.Length>=6){
string check = nameSelectedEmployee.Substring (0,7);
if(check.Equals ("Worker ")){
string tempName = nameSelectedEmployee;
nameSelectedEmployee = nameSelectedEmployee.Substring(7, nameSelectedEmployee.Length-7);
nameSelectedEmployee = GUI.TextField(new Rect(Screen.width/2*1.1f,Screen.height*0.35f+25,Screen.width/2*0.8f,20),nameSelectedEmployee,40);
nameSelectedEmployee = "Worker "+nameSelectedEmployee;
if (tempName!=nameSelectedEmployee){
if(afhWorkers.Remove(tempName)){
afhWorkers.AddLast (nameSelectedEmployee);
}else{
curBase.removeHiredWorker(tempName);
curBase.addHiredWorker(nameSelectedEmployee);
}
}
}
GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.5f+(25)*10,Screen.width/2*0.8f,20),"Yearly Salary: $"+EMPLOYEEWAGE);
//.........这里部分代码省略.........