当前位置: 首页>>代码示例>>C#>>正文


C# Base.removeHiredPilot方法代码示例

本文整理汇总了C#中Base.removeHiredPilot方法的典型用法代码示例。如果您正苦于以下问题:C# Base.removeHiredPilot方法的具体用法?C# Base.removeHiredPilot怎么用?C# Base.removeHiredPilot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Base的用法示例。


在下文中一共展示了Base.removeHiredPilot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnGUI


//.........这里部分代码省略.........
                    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);
                    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{//Pilot Toggle\
                if(nameSelectedEmployee.Length>=7){
                    string check = nameSelectedEmployee.Substring (0,8);
                    if(check.Equals ("Captain ")){
                        string tempName = nameSelectedEmployee;
                        nameSelectedEmployee = nameSelectedEmployee.Substring(8, nameSelectedEmployee.Length-8);
                        nameSelectedEmployee = GUI.TextField(new Rect(Screen.width/2*1.1f,Screen.height*0.35f+25,Screen.width/2*0.8f,20),nameSelectedEmployee,40);
                        nameSelectedEmployee = "Captain "+nameSelectedEmployee;
                        if (tempName!=nameSelectedEmployee){
                            if(afhPilots.Remove(tempName)){
                                afhPilots.AddLast (nameSelectedEmployee);
                            }else{
                                curBase.removeHiredPilot(tempName);
                                curBase.addHiredPilot(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);
            }
        }
        if(soldierToggle){
            //GUI for right side of screen

            if(selectionSoldierExist){
                Soldier tempSoldier = getSoldier (selectedSoldier);
                /*
                if(GUI.Button (new Rect(Screen.width/2*1.5f,Screen.height*0.3f+(25)*12,Screen.width/4,Screen.height*0.1f),"Equip Soldier")){
                    //OPEN MENU FOR EQUIPPING SOLDIERS
                    equipMenu = true;
                }
                */
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f,Screen.width/2*0.8f,20),"Health: "+tempSoldier.getHealth());
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f+(25),Screen.width/2*0.8f,20),"Accuracy: "+tempSoldier.getAccuracy());
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f+(25)*2,Screen.width/2*0.8f,20),"Mind state: "+tempSoldier.getMind());
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f+(25)*3,Screen.width/2*0.8f,20),"Sniping Skills: "+tempSoldier.getSnipePower());
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f+(25)*4,Screen.width/2*0.8f,20),"Assault Skills: "+tempSoldier.getAssaultPower());
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f+(25)*5,Screen.width/2*0.8f,20),"Close Combat Skills: "+tempSoldier.getCloseCombatPower());
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f+(25)*6,Screen.width/2*0.8f,20),"Number of Aliens Killed: "+tempSoldier.getAliens());
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f+(25)*7,Screen.width/2*0.8f,20),"Number of Missions done: "+tempSoldier.getMissions());
                GUI.Label (new Rect(Screen.width/2*1.2f,Screen.height*0.3f+(25)*8,Screen.width/2*0.8f,20),"Rank: "+ranks[tempSoldier.getRank ()]);
开发者ID:jshamash,项目名称:psalmon-xcom,代码行数:67,代码来源:EmployeeScript.cs


注:本文中的Base.removeHiredPilot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。