PowerQuest 0.19.1
|
Prop: Contains functions and data for manipluating Props in rooms. Eg.
P.GoldKey.Hide(); P.Ball.MoveTo(10,20,5); P.Door.PlayAnimation("SlamShut"); P.Door.Animation = "Closed";
Inherits IQuestClickableInterface.
Properties | |
string | Description [get, set] |
Gets/Sets the name shown to players. | |
string | ScriptName [get] |
The name used in scripts. | |
MonoBehaviour | Instance [get] |
Access to the actual game object component in the scene. | |
bool | Visible [get, set] |
Gets or sets whether the object is visible. | |
bool | Clickable [get, set] |
Gets or Sets whether the prop is collidable (NB: Not yet implemented, can use hotspots and set as not Walkable instead) | |
Vector2 | Position [get, set] |
The location of the prop. | |
bool | Moving [get] |
Returns true while the prop is moving. | |
float | Baseline [get, set] |
Gets or sets the baseline used for sorting. | |
Vector2 | WalkToPoint [get, set] |
Gets or sets the walk to point. | |
Vector2 | LookAtPoint [get, set] |
Gets or sets the look at point. | |
string | Cursor [get, set] |
Gets or sets the cursor to show when hovering over the object. If empty, default active cursor will be used. | |
bool | FirstUse [get] |
Returns true the first time the player "uses" the object. | |
bool | FirstLook [get] |
Returns true the first time the player "looked" at the object. | |
int | UseCount [get] |
Returns the number of times player has "used" at the object. 0 when it's the first click on the object. | |
int | LookCount [get] |
Returns the number of times player has "looked" at the object. 0 when it's the first click on the object. | |
string | Animation [get, set] |
The prop's animation, change this to change the visuals of the prop. | |
bool | Animating [get] |
Whether an animation is currently playing on the prop. | |
UnityEngine.Video.VideoPlayer | VideoPlayer [get] |
Gets the prop's VideoPlayer component (if it has one). This can be used to pause/resume/stop video playback. | |
float | Alpha [get, set] |
Gets/Sets the transparency of the prop. | |
Prop | Data [get] |
Access to the base class with extra functionality used by the PowerQuest. | |
Public Member Functions | |
void | SetPosition (float x, float y) |
Set the location of the prop. | |
void | SetPosition (Vector2 position) |
Set the location of the prop. | |
Coroutine | MoveTo (float x, float y, float speed, eEaseCurve curve=eEaseCurve.None) |
Move the prop over time. | |
Coroutine | MoveTo (Vector2 toPos, float speed, eEaseCurve curve=eEaseCurve.None) |
Move the prop over time. | |
void | MoveToBG (Vector2 toPos, float speed, eEaseCurve curve=eEaseCurve.None) |
Move the prop over time, non-blocking. | |
void | Show (bool clickable=true) |
Set's visible & clickable (Same as Enable() ) | |
void | Hide () |
Set's invisible & non-clickable (Same as Disable() ) | |
void | Enable (bool clickable=true) |
Set's visible & clickable. | |
void | Disable () |
Set's invisible & non-clickable. | |
Coroutine | PlayAnimation (string animName) |
Plays an animation on the prop. Will return to playing Animation once it ends. | |
void | PlayAnimationBG (string animName) |
Plays an animation on the prop. Will return to playing Animation once it ends (Non-blocking) | |
void | PauseAnimation () |
Pauses the currently playing animation. | |
void | ResumeAnimation () |
Resumes the currently paused animation. | |
Coroutine | PlayVideo (float skippableAfterTime=-1) |
Starts video playback if the prop has a video component. Returns once the video has completed, or on mouse click if skippableAfterTime is greater than zero. | |
void | PlayVideoBG () |
Starts video playback if the prop has a video component. | |
void | AddAnimationTrigger (string triggerName, bool removeAfterTriggering, System.Action action) |
Adds a function to be called on an animation event here. Eg: to play a sound or effect on an animation tag. | |
void | RemoveAnimationTrigger (string triggerName) |
Removes an existing animation trigger. | |
Coroutine | WaitForAnimTrigger (string eventName) |
Waits until an Event/Tag in the current animation is reached. | |
Coroutine | Fade (float start, float end, float duration, eEaseCurve curve=eEaseCurve.Smooth) |
Fade the sprite's alpha. | |
void | FadeBG (float start, float end, float duration, eEaseCurve curve=eEaseCurve.InOutSmooth) |
Fade the sprite's alpha (non-blocking) | |
|
getset |
Gets/Sets the name shown to players.
|
get |
The name used in scripts.
|
get |
Access to the actual game object component in the scene.
|
getset |
Gets or sets whether the object is visible.
|
getset |
Gets or Sets whether the prop is collidable (NB: Not yet implemented, can use hotspots and set as not Walkable instead)
Gets or Sets whether clicking on the object triggers an event
|
getset |
The location of the prop.
|
get |
Returns true while the prop is moving.
|
getset |
Gets or sets the baseline used for sorting.
|
getset |
Gets or sets the walk to point.
|
getset |
Gets or sets the look at point.
|
getset |
Gets or sets the cursor to show when hovering over the object. If empty, default active cursor will be used.
|
get |
Returns true the first time the player "uses" the object.
|
get |
Returns true the first time the player "looked" at the object.
|
get |
Returns the number of times player has "used" at the object. 0 when it's the first click on the object.
|
get |
Returns the number of times player has "looked" at the object. 0 when it's the first click on the object.
|
getset |
The prop's animation, change this to change the visuals of the prop.
|
get |
Whether an animation is currently playing on the prop.
|
get |
Gets the prop's VideoPlayer component (if it has one). This can be used to pause/resume/stop video playback.
|
getset |
Gets/Sets the transparency of the prop.
|
get |
Access to the base class with extra functionality used by the PowerQuest.
void SetPosition | ( | float | x, |
float | y ) |
Set the location of the prop.
void SetPosition | ( | Vector2 | position | ) |
Set the location of the prop.
Coroutine MoveTo | ( | float | x, |
float | y, | ||
float | speed, | ||
eEaseCurve | curve = eEaseCurve.None ) |
Move the prop over time.
Coroutine MoveTo | ( | Vector2 | toPos, |
float | speed, | ||
eEaseCurve | curve = eEaseCurve.None ) |
Move the prop over time.
void MoveToBG | ( | Vector2 | toPos, |
float | speed, | ||
eEaseCurve | curve = eEaseCurve.None ) |
Move the prop over time, non-blocking.
void Show | ( | bool | clickable = true | ) |
Set's visible & clickable (Same as Enable()
)
void Hide | ( | ) |
Set's invisible & non-clickable (Same as Disable()
)
void Enable | ( | bool | clickable = true | ) |
Set's visible & clickable.
void Disable | ( | ) |
Set's invisible & non-clickable.
Coroutine PlayAnimation | ( | string | animName | ) |
Plays an animation on the prop. Will return to playing Animation once it ends.
NB: Animation play/pause/resume/stop stuff doesn't get saved. If you want to permanently change anim, set the Animation property
void PlayAnimationBG | ( | string | animName | ) |
Plays an animation on the prop. Will return to playing Animation once it ends (Non-blocking)
NB: Animation play/pause/resume/stop stuff doesn't get saved. If you want to permanently change anim, set the Animation property
void PauseAnimation | ( | ) |
Pauses the currently playing animation.
void ResumeAnimation | ( | ) |
Resumes the currently paused animation.
Coroutine PlayVideo | ( | float | skippableAfterTime = -1 | ) |
Starts video playback if the prop has a video component. Returns once the video has completed, or on mouse click if skippableAfterTime is greater than zero.
NB: Video playback position isn't currently saved
void PlayVideoBG | ( | ) |
Starts video playback if the prop has a video component.
void AddAnimationTrigger | ( | string | triggerName, |
bool | removeAfterTriggering, | ||
System.Action | action ) |
Adds a function to be called on an animation event here. Eg: to play a sound or effect on an animation tag.
Usage: Add an event to the anim with the name you want (eg: "boom") Then add the trigger with the same name Prop("dynamite").AddAnimationTrigger( "boom", true, ()=>Audio.PlaySound("explode") );
void RemoveAnimationTrigger | ( | string | triggerName | ) |
Removes an existing animation trigger.
Coroutine WaitForAnimTrigger | ( | string | eventName | ) |
Waits until an Event/Tag in the current animation is reached.
Usage: Add an event to the anim with the name you want (eg: "boom") Then call yield return Prop("dynamite").WaitForAnimTrigger("boom");
Coroutine Fade | ( | float | start, |
float | end, | ||
float | duration, | ||
eEaseCurve | curve = eEaseCurve.Smooth ) |
Fade the sprite's alpha.
void FadeBG | ( | float | start, |
float | end, | ||
float | duration, | ||
eEaseCurve | curve = eEaseCurve.InOutSmooth ) |
Fade the sprite's alpha (non-blocking)