PowerQuest
IProp Interface Reference

Detailed Description

Prop: Contains functions and data for manipluating Props in rooms.

Inherits IQuestClickableInterface.

Properties

string Description [get, set]
 Gets/Sets the name shown to players. More...
 
string ScriptName [get]
 The name used in scripts. More...
 
MonoBehaviour Instance [get]
 Access to the actual game object component in the scene. More...
 
bool Visible [get, set]
 Gets or sets whether the object is visible. More...
 
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) More...
 
Vector2 Position [get, set]
 The location of the prop. More...
 
float Baseline [get, set]
 Gets or sets the baseline used for sorting. More...
 
Vector2 WalkToPoint [get, set]
 Gets or sets the walk to point. More...
 
Vector2 LookAtPoint [get, set]
 Gets or sets the look at point. More...
 
string Cursor [get, set]
 Gets or sets the cursor to show when hovering over the object. If empty, default active cursor will be used. More...
 
bool FirstUse [get]
 Returns true the first time the player "uses" the object. More...
 
bool FirstLook [get]
 Returns true the first time the player "looked" at the object. More...
 
int UseCount [get]
 Returns the number of times player has "used" at the object. 0 when it's the first click on the object. More...
 
int LookCount [get]
 Returns the number of times player has "looked" at the object. 0 when it's the first click on the object. More...
 
string Animation [get, set]
 The prop's animation, change this to change the visuals of the prop. More...
 
bool Animating [get]
 Whether an animation is currently playing on the prop. More...
 
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. More...
 
Prop Data [get]
 Access to the base class with extra functionality used by the PowerQuest. More...
 

Public Member Functions

void SetPosition (float x, float y)
 Set the location of the prop. More...
 
Coroutine MoveTo (float x, float y, float speed)
 Move the prop over time. More...
 
Coroutine MoveTo (Vector2 toPos, float speed)
 Move the prop over time. More...
 
void MoveToBG (Vector2 toPos, float speed)
 Move the prop over time, non-blocking. More...
 
void Enable (bool visible=true, bool clickable=true)
 shortcut to setting visible/clickable More...
 
void Disable ()
 shortcut to making invisible/non-clicable More...
 
Coroutine PlayAnimation (string animName)
 Plays an animation on the prop. Will return to playing Animation once it ends. More...
 
void PlayAnimationBG (string animName)
 Plays an animation on the prop. Will return to playing Animation once it ends (Non-blocking) More...
 
void PauseAnimation ()
 Pauses the currently playing animation. More...
 
void ResumeAnimation ()
 Resumes the currently paused animation. More...
 
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. More...
 
void PlayVideoBG ()
 Starts video playback if the prop has a video component. More...
 
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. More...
 
void RemoveAnimationTrigger (string triggerName)
 Removes an existing animation trigger. More...
 
Coroutine WaitForAnimTrigger (string eventName)
 Waits until an Event/Tag in the current animation is reached. More...
 
Coroutine Fade (float start, float end, float duration)
 Fade the sprite's alpha. More...
 
void FadeBG (float start, float end, float duration)
 Fade the sprite's alpha (non-blocking) More...
 

Property Documentation

◆ Description

string Description
getset

Gets/Sets the name shown to players.

◆ ScriptName

string ScriptName
get

The name used in scripts.

◆ Instance

MonoBehaviour Instance
get

Access to the actual game object component in the scene.

◆ Visible

bool Visible
getset

Gets or sets whether the object is visible.

◆ Clickable

bool Clickable
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

◆ Position

Vector2 Position
getset

The location of the prop.

◆ Baseline

float Baseline
getset

Gets or sets the baseline used for sorting.

◆ WalkToPoint

Vector2 WalkToPoint
getset

Gets or sets the walk to point.

◆ LookAtPoint

Vector2 LookAtPoint
getset

Gets or sets the look at point.

◆ Cursor

string Cursor
getset

Gets or sets the cursor to show when hovering over the object. If empty, default active cursor will be used.

◆ FirstUse

bool FirstUse
get

Returns true the first time the player "uses" the object.

◆ FirstLook

bool FirstLook
get

Returns true the first time the player "looked" at the object.

◆ UseCount

int UseCount
get

Returns the number of times player has "used" at the object. 0 when it's the first click on the object.

◆ LookCount

int LookCount
get

Returns the number of times player has "looked" at the object. 0 when it's the first click on the object.

◆ Animation

string Animation
getset

The prop's animation, change this to change the visuals of the prop.

◆ Animating

bool Animating
get

Whether an animation is currently playing on the prop.

◆ VideoPlayer

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.

◆ Data

Prop Data
get

Access to the base class with extra functionality used by the PowerQuest.

Member Function Documentation

◆ SetPosition()

void SetPosition ( float  x,
float  y 
)

Set the location of the prop.

◆ MoveTo() [1/2]

Coroutine MoveTo ( float  x,
float  y,
float  speed 
)

Move the prop over time.

◆ MoveTo() [2/2]

Coroutine MoveTo ( Vector2  toPos,
float  speed 
)

Move the prop over time.

◆ MoveToBG()

void MoveToBG ( Vector2  toPos,
float  speed 
)

Move the prop over time, non-blocking.

◆ Enable()

void Enable ( bool  visible = true,
bool  clickable = true 
)

shortcut to setting visible/clickable

◆ Disable()

void Disable ( )

shortcut to making invisible/non-clicable

◆ PlayAnimation()

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

◆ PlayAnimationBG()

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

◆ PauseAnimation()

void PauseAnimation ( )

Pauses the currently playing animation.

◆ ResumeAnimation()

void ResumeAnimation ( )

Resumes the currently paused animation.

◆ PlayVideo()

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

◆ PlayVideoBG()

void PlayVideoBG ( )

Starts video playback if the prop has a video component.

◆ AddAnimationTrigger()

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 called "Trigger" with a string matching the tag you want (eg: "boom") Then call Prop("dynamite").AddAnimationTrigger( "boom", true, ()=>Audio.PlaySound("explode") );

◆ RemoveAnimationTrigger()

void RemoveAnimationTrigger ( string  triggerName)

Removes an existing animation trigger.

◆ WaitForAnimTrigger()

Coroutine WaitForAnimTrigger ( string  eventName)

Waits until an Event/Tag in the current animation is reached.

Usage: Add an event to the anim called "Trigger" with a string matching the tag you want (eg: "boom") Then call yield return Prop("dynamite").WaitForAnimTrigger("boom");

◆ Fade()

Coroutine Fade ( float  start,
float  end,
float  duration 
)

Fade the sprite's alpha.

◆ FadeBG()

void FadeBG ( float  start,
float  end,
float  duration 
)

Fade the sprite's alpha (non-blocking)