C# Класс ProjectStorms.AirshipControlBehaviour

This is the basic airship control. It manages pitch, yaw, and roll. Syncs up to ship animations. In time this script will probably be changed a lot. Many of the movement features here were expanded upon and derived from the Unity Standard Vehicle Assets - Plane Controller. Unlike the old Storms Project, this game moves Non-Kinematic Rigidbodies through Physics (unlike Kinematic Rigidbody via direct control).
Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
adjustableMass float
airshipMainCam AirshipCamBehaviour
animLowThrottleMult float
animThrottleMult float
audioControl AirshipAudio
engineAudioControl EngineAudio
generalSpeed float
highControlMult float
highControlSpeedThreshold float
killY float
pitchForce float
pitchLimitMult float
reverseSpeedMult float
rollForce float
rollLimitMult float
rudderJoint HingeJointScript
shipPartConns ShipPartInputConnection[]
stallY float
trapdoorRumbleCooldown float
yawForce float

Открытые методы

Метод Описание
Awake ( ) : void
ClearPropellerAnim ( ) : void
FixedUpdate ( ) : void
OnTriggerStay ( Collider a_other ) : void

Called each physics tick that other objects are colliding with this trigger.

PlayerInputs ( float a_Vertical, float a_Horizontal, float a_camVertical, float a_camHorizontal, float a_triggers, bool a_bumperLeft, bool a_bumperRight, bool a_faceUp, bool a_faceDown, bool a_faceLeft, bool a_faceRight, float a_dPadHorizontal, float a_dPadVertical ) : void
Start ( ) : void
TrapdoorRumblePulse ( ) : void

Executes a pulse of rumble, repeats if button is still held down.

Update ( ) : void
Vibrate ( ) : void

Приватные методы

Метод Описание
CalcHandlingMassMult ( ) : float

Calculates the multiplier for ship handling values (throttle, roll, pitch, yaw, etc.).

CalculateRightingForce ( ) : void

Attempts to auto-level the player's ship. Counters roll more-so than pitch, ignores yaw.

CalculateTorque ( ) : void

Calculates the rotation forces on the ship, see the standard assets example for more.

ClampInputs ( ) : void

Clamps the input values into the [-1, 1] range.

GetPartInputMults ( ShipPartDestroy a_partType, float &ao_primMult, float &ao_auxMult ) : bool

Returns the part input multipliers for the input ship part type.

TestVerticalLimits ( ) : void
ThrottleMovement ( ) : void

Moves the player's ship forward with either their constant movement speed or their inputted throttle.

Описание методов

Awake() публичный Метод

public Awake ( ) : void
Результат void

ClearPropellerAnim() публичный Метод

public ClearPropellerAnim ( ) : void
Результат void

FixedUpdate() публичный Метод

public FixedUpdate ( ) : void
Результат void

OnTriggerStay() публичный Метод

Called each physics tick that other objects are colliding with this trigger.
public OnTriggerStay ( Collider a_other ) : void
a_other UnityEngine.Collider
Результат void

PlayerInputs() публичный Метод

public PlayerInputs ( float a_Vertical, float a_Horizontal, float a_camVertical, float a_camHorizontal, float a_triggers, bool a_bumperLeft, bool a_bumperRight, bool a_faceUp, bool a_faceDown, bool a_faceLeft, bool a_faceRight, float a_dPadHorizontal, float a_dPadVertical ) : void
a_Vertical float
a_Horizontal float
a_camVertical float
a_camHorizontal float
a_triggers float
a_bumperLeft bool
a_bumperRight bool
a_faceUp bool
a_faceDown bool
a_faceLeft bool
a_faceRight bool
a_dPadHorizontal float
a_dPadVertical float
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

TrapdoorRumblePulse() публичный Метод

Executes a pulse of rumble, repeats if button is still held down.
public TrapdoorRumblePulse ( ) : void
Результат void

Update() публичный Метод

public Update ( ) : void
Результат void

Vibrate() публичный Метод

public Vibrate ( ) : void
Результат void

Описание свойств

adjustableMass публичное свойство

Change the mass of the Airship in editor here
public float adjustableMass
Результат float

airshipMainCam публичное свойство

Handle to the airship camera script.
public AirshipCamBehaviour,ProjectStorms airshipMainCam
Результат AirshipCamBehaviour

animLowThrottleMult публичное свойство

Percentage of the base propeller animation speed to apply when braking.
public float animLowThrottleMult
Результат float

animThrottleMult публичное свойство

Percentage of the base propeller animation speed to apply when moving.
public float animThrottleMult
Результат float

audioControl публичное свойство

Bounce the input variables to the Audio Controller script under 'Particles and Effects' hierarchy branch.
public AirshipAudio,ProjectStorms audioControl
Результат AirshipAudio

engineAudioControl публичное свойство

public EngineAudio,ProjectStorms engineAudioControl
Результат EngineAudio

generalSpeed публичное свойство

Movement speed of the airship. Try 50 here and see how we go.
public float generalSpeed
Результат float

highControlMult публичное свойство

Multiplier for each contro axis when moving slowly.
public float highControlMult
Результат float

highControlSpeedThreshold публичное свойство

Speed threshold to consider for high control multipliers.
public float highControlSpeedThreshold
Результат float

killY публичное свойство

If the player ship goes below this, they will die.
public float killY
Результат float

pitchForce публичное свойство

How much pitching the vehicle will affect its facing.
public float pitchForce
Результат float

pitchLimitMult публичное свойство

Multiplier for the pitch auto-level force.
public float pitchLimitMult
Результат float

reverseSpeedMult публичное свойство

Speed multiplier for the reverse throttle value.
public float reverseSpeedMult
Результат float

rollForce публичное свойство

How much rolling the vehicle will affect its facing.
public float rollForce
Результат float

rollLimitMult публичное свойство

Multiplier for the pitch auto-level force.
public float rollLimitMult
Результат float

rudderJoint публичное свойство

Reference to rudder joint script, for inversing rudder rotation while reversing.
public HingeJointScript,ProjectStorms rudderJoint
Результат HingeJointScript

shipPartConns публичное свойство

Multiplier values for when various ship parts get destroyed.
public ShipPartInputConnection[] shipPartConns
Результат ShipPartInputConnection[]

stallY публичное свойство

If the player ship goes above this, they will stall.
public float stallY
Результат float

trapdoorRumbleCooldown публичное свойство

Time to wait between each drop rumble pulse.
public float trapdoorRumbleCooldown
Результат float

yawForce публичное свойство

How much yawing the vehicle will affect its facing.
public float yawForce
Результат float