Adventure Creator  1.68.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.Moveable_PickUp Class Reference
Inheritance diagram for AC.Moveable_PickUp:
AC.DragBase AC.Moveable

Public Member Functions

override void UpdateMovement ()
 
override void Grab (Vector3 grabPosition)
 Attaches the object to the player's control. More...
 
override void LetGo ()
 
override bool CanToggleCursor ()
 
override void ApplyDragForce (Vector3 force, Vector3 _screenMousePosition, float _distanceToCamera)
 Applies a drag force on the object, based on the movement of the cursor. More...
 
void UnsetFixedJoint ()
 
- Public Member Functions inherited from AC.DragBase
void TurnOn ()
 
void TurnOff ()
 
virtual void DrawGrabIcon ()
 
bool IsOnScreen ()
 Checks if the the point of contact is visible on-screen. More...
 
bool IsCloseToCamera (float maxDistance)
 Checks if the point of contact is close enough to the camera to continue being held. More...
 
Vector3 GetGrabPosition ()
 Gets the point of contact on the object, once grabbed. More...
 
bool PlayerIsWithinBoundary ()
 Checks if the Player is within the draggables's interactableBoundary, if assigned. More...
 
- Public Member Functions inherited from AC.Moveable
void StopMoving ()
 
bool IsMoving (TransformType transformType)
 
void EndMovement ()
 
void Move (Vector3 _newVector, MoveMethod _moveMethod, bool _inWorldSpace, float _transitionTime, TransformType _transformType, bool _doEulerRotation, AnimationCurve _timeCurve, bool clearExisting)
 Moves the GameObject by referencing a Vector3 as its target Transform. More...
 
void Move (Marker _marker, MoveMethod _moveMethod, bool _inWorldSpace, float _transitionTime, AnimationCurve _timeCurve)
 Moves the GameObject by referencing a Marker component as its target Transform. More...
 
MoveableData SaveData (MoveableData saveData)
 Updates a MoveableData class with its own variables that need saving. More...
 
void LoadData (MoveableData saveData)
 Updates its own variables from a MoveableData class. More...
 

Public Attributes

bool allowRotation = false
 
float breakForce = 300f
 
bool allowThrow = false
 
float chargeTime = 0.5f
 
float pullbackDistance = 0.6f
 
float throwForce = 400f
 
Interaction interactionOnGrab
 
float initialLift = 0.05f
 
- Public Attributes inherited from AC.DragBase
InteractiveBoundary interactiveBoundary
 
bool isHeld = false
 
bool invertInput = false
 
float maxSpeed = 200f
 
float playerMovementReductionFactor = 0f
 
float playerMovementInfluence = 1f
 
bool allowZooming = false
 
float zoomSpeed = 60f
 
float minZoom = 1f
 
float maxZoom = 3f
 
float rotationFactor = 1f
 
Rigidbody _rigidbody
 
bool showIcon = false
 
int iconID = -1
 
AudioClip moveSoundClip
 
AudioClip collideSoundClip
 
float slideSoundThreshold = 0.03f
 
float slidePitchFactor = 1f
 
bool onlyPlayLowerCollisionSound = false
 
bool ignoreMoveableRigidbodies
 
bool ignorePlayerCollider
 
bool childrenShareLayer
 

Protected Member Functions

override void Start ()
 
void LimitCollisions ()
 
- Protected Member Functions inherited from AC.DragBase
virtual void Awake ()
 
void BaseOnCollisionEnter (Collision collision)
 
void PlayMoveSound (float speed, float trackValue)
 
void UpdateZoom ()
 
void LimitZoom ()
 

Additional Inherited Members

- Protected Attributes inherited from AC.DragBase
Transform grabPoint
 
Transform cameraTransform
 
float distanceToCamera
 
float speedFactor = 0.16f
 
float originalDrag
 
float originalAngularDrag
 
int numCollisions = 0
 
CursorIconBase icon
 
Sound collideSound
 
Sound moveSound
 

Detailed Description

Attaching this component to a GameObject allows it to be picked up and manipulated freely by the player.

Member Function Documentation

◆ ApplyDragForce()

override void AC.Moveable_PickUp.ApplyDragForce ( Vector3  force,
Vector3  _screenMousePosition,
float  _distanceToCamera 
)
virtual

Applies a drag force on the object, based on the movement of the cursor.

Parameters
forceThe force vector to apply
_screenMousePositionThe position of the mouse
_distanceToCameraThe distance between the object's centre and the camera

Reimplemented from AC.DragBase.

◆ CanToggleCursor()

override bool AC.Moveable_PickUp.CanToggleCursor ( )
virtual

If True, 'ToggleCursor' can be used while the object is held.

Reimplemented from AC.DragBase.

◆ Grab()

override void AC.Moveable_PickUp.Grab ( Vector3  grabPosition)
virtual

Attaches the object to the player's control.

Parameters
grabPositionThe point of contact on the object

Reimplemented from AC.DragBase.

◆ LetGo()

override void AC.Moveable_PickUp.LetGo ( )
virtual

Detaches the object from the player's control.

Reimplemented from AC.DragBase.

◆ UnsetFixedJoint()

void AC.Moveable_PickUp.UnsetFixedJoint ( )

Unsets the FixedJoint used to hold the object in place

◆ UpdateMovement()

override void AC.Moveable_PickUp.UpdateMovement ( )
virtual

Called every frame by StateHandler.

Reimplemented from AC.DragBase.

Member Data Documentation

◆ allowRotation

bool AC.Moveable_PickUp.allowRotation = false

If True, the object can be rotated

◆ allowThrow

bool AC.Moveable_PickUp.allowThrow = false

If True, the object can be thrown

◆ breakForce

float AC.Moveable_PickUp.breakForce = 300f

The maximum force magnitude that can be applied by the player - if exceeded, control will be removed

◆ chargeTime

float AC.Moveable_PickUp.chargeTime = 0.5f

How long a "charge" takes, if the object cen be thrown

◆ initialLift

float AC.Moveable_PickUp.initialLift = 0.05f

The lift to give objects picked up, so that they aren't touching the ground when initially held

◆ interactionOnGrab

Interaction AC.Moveable_PickUp.interactionOnGrab

The Interaction to run whenever the object is picked up by the player

◆ pullbackDistance

float AC.Moveable_PickUp.pullbackDistance = 0.6f

How far the object is pulled back while chargine, if the object can be thrown

◆ throwForce

float AC.Moveable_PickUp.throwForce = 400f

How far the object can be thrown