IInstanceBase interface

Ashley's avatar
Medal
Construct Team Founder
Published 14 Nov, 2017
183 words
<1 min

The IInstanceBase interface is used as the base class for instances in the SDK. For "world" type plugins, instances instead derive from IWorldInstanceBase, which itself derives from IInstanceBase.

IInstanceBase cannot be directly constructed; it should only be used as a base class.

Properties

this._sdkType

Reference to the associated SDK type class.

this._inst

Reference to the IObjectInstance interface, or IWorldInstance interface for "world" type plugins, representing this instance in the editor. This allows access to Construct's built-in features for instances.

Methods

Release()

Optional override for when an instance is released.

OnCreate()

Optional override for when an instance is created in the editor.

OnPropertyChanged(id, value)

Optional override for when a property with the given ID is changed. The value the property was changed to is also passed.

LoadC2Property(name, valueString)

Optional override to use custom logic for importing properties from a Construct 2 project referencing a Construct 2 version of this plugin.

GetProject()

Return the IProject representing the instance's associated project.

GetObjectType()

Convenience method to return the IObjectType interface representing Construct's object type class.

GetInstance()

Return the IObjectInstance corresponding to this instance.