Breakroom is now Sinewave Campus. Book a meeting

SModularVehicle

客户端组件
在此类中ForceSetOwner
  1. 函数
  2. ForceSetOwner
  3. ForceActivate
  4. ForceDeactivate
  5. SuppressTimeout
  6. OverrideOnClick
  7. 属性
  8. VerticalInput
  9. HorizontalInput
  10. StrafeInput
  11. DepthInput
  12. IgnoreUserInput
  13. Driver
  14. GameObject
成员 12
函数ForceSetOwnerForce player of the id owned this vehicle, but only between this spawned vehicle.
函数ForceActivateForce player drive on this vehicle
函数ForceDeactivateForce player out of the vehicle.
函数SuppressTimeoutDisable the vehicle automatic respawn
函数OverrideOnClickAdd onClick method to this vehicle,onClick have to be a closure.
属性VerticalInputForce vertical offset value, it would be added to vertical control and never set to zero.
属性HorizontalInputForce horizontal offset value, it would be added to horizontal control and never set to zero.
属性StrafeInputForce strafe offset value,it would be added to strafe control and never set to zero.
属性DepthInputForce depth offset value, it would be added to depth control and never set to zero.
属性IgnoreUserInputIf this option is enabled, user input would be ignored until disable this.
属性DriverGet the player avatar component.
属性GameObjectReturns the GameObject of this Vehicle component.

函数​

ForceSetOwner​

void ForceSetOwner(int newOwner, int vehicleId)

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.

参数

名称类型默认值
newOwnerint–
vehicleIdint–

返回值

void

示例

Lua
Space.Host.ExecutingObject.Vehicle.ForceSetOwner(AvatarID)

ForceActivate​

void ForceActivate()

Force player drive on this vehicle

返回值

void

示例

Lua
Space.Host.ExecutingObject.Vehicle.ForceActivate()

ForceDeactivate​

void ForceDeactivate()

Force player out of the vehicle.

返回值

void

示例

Lua
Space.Host.ExecutingObject.Vehicle.ForceDeactivate()

SuppressTimeout​

void SuppressTimeout()

Disable the vehicle automatic respawn

返回值

void

示例

Lua
Space.Host.ExecutingObject.Vehicle.SuppressTimeout()

OverrideOnClick​

void OverrideOnClick(Closure onClick)

Add onClick method to this vehicle,onClick have to be a closure.

参数

名称类型默认值
onClickClosure–

返回值

void

示例

Lua
Space.Host.ExecutingObject.Vehicle.OverrideOnClick(NewOnClickFunction)

属性​

VerticalInput​

float VerticalInput {get; set; }

Force vertical offset value, it would be added to vertical control and never set to zero.

示例

Lua
Space.Host.ExecutingObject.Vehicle.VerticalInput = 0.5

HorizontalInput​

float HorizontalInput {get; set; }

Force horizontal offset value, it would be added to horizontal control and never set to zero.

示例

Lua
Space.Host.ExecutingObject.Vehicle.HorizontalInput = 0.5

StrafeInput​

float StrafeInput {get; set; }

Force strafe offset value,it would be added to strafe control and never set to zero.

示例

Lua
Space.Host.ExecutingObject.Vehicle.StrafeInput = 0.5

DepthInput​

float DepthInput {get; set; }

Force depth offset value, it would be added to depth control and never set to zero.

示例

Lua
Space.Host.ExecutingObject.Vehicle.DepthInput = 0.5

IgnoreUserInput​

bool IgnoreUserInput {get; set; }

If this option is enabled, user input would be ignored until disable this.

示例

Lua
Space.Host.ExecutingObject.Vehicle.IgnoreUserInput = true

Driver只读​

SAvatar Driver {get; }

Get the player avatar component.

示例

Lua
DriverAvatar = Space.Host.ExecutingObject.Vehicle.Driver

GameObject只读​

SGameObject GameObject {get; }

Returns the GameObject of this Vehicle component.

示例

Lua
VehicleGameObject = Space.Host.ExecutingObject.Vehicle.GameObject