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


C# Base.isPilotInAircraft方法代码示例

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


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

示例1: OnGUI


//.........这里部分代码省略.........
                    nameSelectedEmployee=tempArray2[i];
                    selectionNameExist = 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)EMPLOYEEWAGE * span.TotalDays/365.242199);
                        if((gameManager.Instance.getMoney () - salary) <0){
                            popUpWindow=true;
                            notEnoughMoney=true;
                        }else{
                            curBase.addHiredWorker (tempArray2[i]);
                            afhWorkers.Remove(tempArray2[i]);
                            curBase.occupyLivingSpace();
                            gameManager.Instance.updateMoney (gameManager.Instance.getMoney () - salary);
                        }
                    }
                }

                GUI.skin=employeeSkin;
            }
            scrollbarSize = (afhWorkers.Count+hired.Count)*70;
        }else if(pilotToggle){
            LinkedList<string> hired = curBase.getHiredPilots();
            string[] tempArray1=new string[hired.Count];
            hired.CopyTo (tempArray1,0);
            for(int i = 0;i<hired.Count;i++){
                if(tempArray1[i]==nameSelectedEmployee){
                    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])){
                    nameSelectedEmployee=tempArray1[i];
                    selectionNameExist = true;
                }
                GUI.skin = selectedEmployee;
                if(GUI.Button(new Rect(Screen.width/2*0.60f,Screen.height*0.10f+(60*i),30,30),"")){
                    if(curBase.isPilotInAircraft(tempArray1[i])){
                        popUpWindow=true;
                        pilotInAircraft=true;
                    }else{
                        afhPilots.AddLast (tempArray1[i]);
                        curBase.removeHiredPilot(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)EMPLOYEEWAGE * span.TotalDays/365.242199);
                        gameManager.Instance.updateMoney (gameManager.Instance.getMoney () + salary);
                    }
                }
                GUI.skin=employeeSkin;
            }
            createAfhPilots();
            string[] tempArray2=new string[afhPilots.Count];
            afhPilots.CopyTo (tempArray2,0);
            for(int i = 0;i<tempArray2.Length;i++){
                if(tempArray2[i]==nameSelectedEmployee){
                    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])){
                    nameSelectedEmployee=tempArray2[i];
                    selectionNameExist = 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)EMPLOYEEWAGE * span.TotalDays/365.242199);
                        if((gameManager.Instance.getMoney () - salary) <0){
                            popUpWindow=true;
                            notEnoughMoney=true;
                        }else{
                            curBase.addHiredPilot (tempArray2[i]);
                            afhPilots.Remove(tempArray2[i]);
                            curBase.occupyLivingSpace();
                            gameManager.Instance.updateMoney (gameManager.Instance.getMoney () - salary);
                        }
                    }
                }

                GUI.skin=employeeSkin;
            }
            scrollbarSize = (afhPilots.Count+hired.Count)*70;
        }
        GUI.skin = null;
        // End the scroll view that we began above.
        GUI.EndScrollView ();
    }
开发者ID:jshamash,项目名称:psalmon-xcom,代码行数:101,代码来源:EmployeeScript.cs


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