SModularVehicle
| 函数 | ForceSetOwner | Force player of the id owned this vehicle, but only between this spawned vehicle. |
| 函数 | ForceActivate | Force player drive on this vehicle |
| 函数 | ForceDeactivate | Force player out of the vehicle. |
| 函数 | SuppressTimeout | Disable the vehicle automatic respawn |
| 函数 | OverrideOnClick | Add onClick method to this vehicle,onClick have to be a closure. |
| 属性 | VerticalInput | Force vertical offset value, it would be added to vertical control and never set to zero. |
| 属性 | HorizontalInput | Force horizontal offset value, it would be added to horizontal control and never set to zero. |
| 属性 | StrafeInput | Force strafe offset value,it would be added to strafe control and never set to zero. |
| 属性 | DepthInput | Force depth offset value, it would be added to depth control and never set to zero. |
| 属性 | IgnoreUserInput | If this option is enabled, user input would be ignored until disable this. |
| 属性 | Driver | Get the player avatar component. |
| 属性 | GameObject | Returns the GameObject of this Vehicle component. |
函数
ForceSetOwner
Force player of the id owned this vehicle, but only between this spawned vehicle. But it seems the new owner can’t drive on this vehicle.
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| newOwner | int | – |
| vehicleId | int | – |
返回值
void
示例
Space.Host.ExecutingObject.Vehicle.ForceSetOwner(AvatarID)
ForceActivate
Force player drive on this vehicle
返回值
void
示例
Space.Host.ExecutingObject.Vehicle.ForceActivate()
ForceDeactivate
Force player out of the vehicle.
返回值
void
示例
Space.Host.ExecutingObject.Vehicle.ForceDeactivate()
SuppressTimeout
Disable the vehicle automatic respawn
返回值
void
示例
Space.Host.ExecutingObject.Vehicle.SuppressTimeout()
OverrideOnClick
Add onClick method to this vehicle,onClick have to be a closure.
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| onClick | Closure | – |
返回值
void
示例
Space.Host.ExecutingObject.Vehicle.OverrideOnClick(NewOnClickFunction)
属性
VerticalInput
Force vertical offset value, it would be added to vertical control and never set to zero.
示例
Space.Host.ExecutingObject.Vehicle.VerticalInput = 0.5
HorizontalInput
Force horizontal offset value, it would be added to horizontal control and never set to zero.
示例
Space.Host.ExecutingObject.Vehicle.HorizontalInput = 0.5
StrafeInput
Force strafe offset value,it would be added to strafe control and never set to zero.
示例
Space.Host.ExecutingObject.Vehicle.StrafeInput = 0.5
DepthInput
Force depth offset value, it would be added to depth control and never set to zero.
示例
Space.Host.ExecutingObject.Vehicle.DepthInput = 0.5
IgnoreUserInput
If this option is enabled, user input would be ignored until disable this.
示例
Space.Host.ExecutingObject.Vehicle.IgnoreUserInput = true
Driver只读
Get the player avatar component.
示例
DriverAvatar = Space.Host.ExecutingObject.Vehicle.Driver
GameObject只读
Returns the GameObject of this Vehicle component.
示例
VehicleGameObject = Space.Host.ExecutingObject.Vehicle.GameObject



