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


C# Vehicle.IsToggleModOn方法代码示例

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


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

示例1: SaveCarToFile

    private void SaveCarToFile(Vehicle veh, string name)
    {
        if (!Directory.Exists("scripts//yolonetvehiclefiles//"))
        {
            Directory.CreateDirectory("scripts//yolonetvehiclefiles//");
            //if it doesn't exist, make it
        }
        if (File.Exists("scripts//yolonetvehiclefiles//" + name))
        {
            if (name.EndsWith(")"))
            {
                string oldnumber = name.Substring(name.IndexOf("("), (name.IndexOf(")") - name.IndexOf("(")));

                SaveCarToFile(veh, (name + "(" + (int.Parse(oldnumber) + 1) + ")"));
                //this is just me showing my dev skills, if it was already marked as (2), next will be (3), then (4), and going on.
            }
            else
            {
                SaveCarToFile(veh, (name + "(2)"));
            }
        }
        else
        {
            string tosave = "";
            tosave += veh.GetHashCode() + Environment.NewLine;
            tosave += veh.BodyHealth + Environment.NewLine;
            tosave += veh.CanTiresBurst + Environment.NewLine;
            tosave += veh.IsPrimaryColorCustom + Environment.NewLine;
            tosave += veh.CustomPrimaryColor + Environment.NewLine;
            tosave += veh.IsSecondaryColorCustom + Environment.NewLine;
            tosave += veh.CustomSecondaryColor + Environment.NewLine;
            tosave += veh.EngineHealth + Environment.NewLine;
            tosave += veh.Health + Environment.NewLine;
            tosave += veh.LightsOn + Environment.NewLine;
            tosave += veh.Livery + Environment.NewLine;
            tosave += veh.NeonLightsColor + Environment.NewLine;
            tosave += veh.PearlescentColor + Environment.NewLine;
            tosave += veh.PetrolTankHealth + Environment.NewLine;
            tosave += veh.PrimaryColor + Environment.NewLine;
            tosave += veh.RimColor + Environment.NewLine;
            tosave += veh.RoofState + Environment.NewLine;
            tosave += veh.SearchLightOn + Environment.NewLine;
            tosave += veh.SecondaryColor + Environment.NewLine;
            tosave += veh.SirenActive + Environment.NewLine;
            tosave += veh.TaxiLightOn + Environment.NewLine;
            tosave += veh.TireSmokeColor + Environment.NewLine;
            tosave += veh.WheelType + Environment.NewLine;
            tosave += veh.WindowTint + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Armor) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.BackWheels) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Brakes) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Engine) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Exhaust) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Fender) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Frame) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.FrontBumper) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.FrontWheels) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Grille) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Hood) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Horns) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.RearBumper) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.RightFender) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Roof) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.SideSkirt) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Spoilers) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Suspension) + Environment.NewLine;
            tosave += veh.GetMod(VehicleMod.Transmission) + Environment.NewLine;
            tosave += veh.IsToggleModOn(VehicleToggleMod.TireSmoke) + Environment.NewLine;
            tosave += veh.IsToggleModOn(VehicleToggleMod.Turbo) + Environment.NewLine;
            tosave += veh.IsToggleModOn(VehicleToggleMod.XenonHeadlights) + Environment.NewLine;
            File.Create("scripts//yolonetvehiclefiles//" + name).Close();
            File.WriteAllText(("scripts//yolonetvehiclefiles//" + name), tosave);
            //TODO: Add objects to object and peds to ped list by aiming. object.GetHashCode().
        }
    }
开发者ID:ardaozkal,项目名称:YoloNet-GTAV,代码行数:75,代码来源:yolonet.cs


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