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


C# Vehicle.SetMod方法代码示例

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


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

示例1: pimpmyride

 private void pimpmyride(Vehicle veh)
 {
     veh.CanTiresBurst = false;
     veh.IsStolen = false;
     veh.DirtLevel = 0f;
     veh.SetMod(VehicleMod.Armor, 5, false);
     veh.SetMod(VehicleMod.Brakes, 3, false);
     veh.SetMod(VehicleMod.Engine, 4, false);
     veh.SetMod(VehicleMod.Suspension, 4, false);
     veh.SetMod(VehicleMod.Transmission, 3, false);
     veh.ToggleMod(VehicleToggleMod.Turbo, true);
     veh.ToggleMod(VehicleToggleMod.XenonHeadlights, true);
     veh.ToggleMod(VehicleToggleMod.TireSmoke, true);
 }
开发者ID:ardaozkal,项目名称:YoloNet-GTAV,代码行数:14,代码来源:yolonet.cs

示例2: SublimeVehicleModWheelTypesMenu

    private void SublimeVehicleModWheelTypesMenu(Vehicle currentVehicle)
    {
        List<MenuButton> wheelTypesList = new List<MenuButton>();
        foreach (VehicleWheelType wheelType in Enum.GetValues(typeof(VehicleWheelType)))
        {
            var buttonWheels = new MenuButton(wheelType.ToString());
            buttonWheels.Activated += (sender, args) =>
            {
                List<MenuButton> wheelsList = new List<MenuButton>();

                Function.Call(Hash.SET_VEHICLE_WHEEL_TYPE, currentVehicle, (int) wheelType);

                int numFrontWheels = Function.Call<int>(Hash.GET_NUM_VEHICLE_MODS, currentVehicle, (int) VehicleMod.FrontWheels);

                for (int wheelIndex = 0; wheelIndex < numFrontWheels; wheelIndex++)
                {
                    string getModLocalizationText = Function.Call<string>(Hash.GET_MOD_TEXT_LABEL, currentVehicle, (int) VehicleMod.FrontWheels, wheelIndex);
                    string getModDisplayText = Function.Call<string>(Hash._GET_LABEL_TEXT, getModLocalizationText);

                    int value = wheelIndex;

                    var buttonSetVehicleWheel = new MenuButton(getModDisplayText);
                    buttonSetVehicleWheel.Description = string.Format("Wheel {0} / {1}", wheelIndex + 1, numFrontWheels);
                    buttonSetVehicleWheel.Activated += (subSender, subArgs) =>
                    {
                        currentVehicle.SetMod(VehicleMod.FrontWheels, value, false);
                    };
                    wheelsList.Add(buttonSetVehicleWheel);
                }

                ListMenu vehicleWheelsMenu = new ListMenu(buttonWheels.Caption, wheelsList.ToArray(), 20);
                DrawMenu(vehicleWheelsMenu, true);
            };
            wheelTypesList.Add(buttonWheels);
        }

        var vehicleModWheelTypesMenu = new GTA.Menu("Wheel Types", wheelTypesList.ToArray());
        DrawMenu(vehicleModWheelTypesMenu);
    }
开发者ID:frodzet,项目名称:Sublime,代码行数:39,代码来源:VehicleModMenu.cs

示例3: depimpmyride

 private void depimpmyride(Vehicle veh)
 {
     //out of range = stock
     veh.CanTiresBurst = true;
     veh.SetMod(VehicleMod.Armor, 999, false);
     veh.SetMod(VehicleMod.Brakes, 999, false);
     veh.SetMod(VehicleMod.Engine, 999, false);
     veh.SetMod(VehicleMod.Suspension, 999, false);
     veh.SetMod(VehicleMod.Transmission, 999, false);
     veh.ToggleMod(VehicleToggleMod.Turbo, false);
     veh.ToggleMod(VehicleToggleMod.XenonHeadlights, false);
     veh.ToggleMod(VehicleToggleMod.TireSmoke, false);
 }
开发者ID:ardaozkal,项目名称:YoloNet-GTAV,代码行数:13,代码来源:yolonet.cs


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