reckfellENGINE

Script

A class stored as a resource.

On this page
class ScriptReckfellSharpInherits Resource

A class stored as a resource.

A class stored as a resource. A script extends the functionality of all objects that instantiate it. This is the base class for all scripts and should not be used directly. Trying to create a new script with this class will result in an error. The new method of a script subclass creates a new instance. ReckfellObject.SetScript extends an existing object, if that object's class matches one of the script's base classes.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties1

SourceCodeProperty
# SourceCode
C#
public string SourceCode { get; set; }

The script source code or an empty string if source code is not available. When set, does not reload the class implementation automatically.

Methods19

CanInstantiatebool
# CanInstantiate
C#
public bool CanInstantiate();

Returns true if the script can be instantiated.

Returns bool
GetBaseScriptScript
# GetBaseScript
C#
public Script GetBaseScript();

Returns the script directly inherited by this script.

Returns Script
GetGlobalNameStringName
# GetGlobalName
C#
public StringName GetGlobalName();

Returns the class name associated with the script, if there is one. Returns an empty string otherwise. To give the script a global name, you can use the class_name keyword in C# and the GlobalClass attribute in C#.

C#
using Reckfell;

[GlobalClass]
public partial class MyNode : Entity
{
}
Returns StringName
GetInstanceBaseTypeStringName
# GetInstanceBaseType
C#
public StringName GetInstanceBaseType();

Returns the script's base type.

Returns StringName
GetPropertyDefaultValueVariant
# GetPropertyDefaultValue
C#
public Variant GetPropertyDefaultValue(StringName property);

Returns the default value of the specified property. Note: In C# and C#, this method returns null outside of editor builds.

Parameters
NameTypeDefault
propertyStringName—
Returns Variant
GetRpcConfigVariant
# GetRpcConfig
C#
public Variant GetRpcConfig();

Returns a Reckfell.Collections.Dictionary mapping method names to their RPC configuration defined by this script.

Returns Variant
GetScriptConstantMapReckfell.Collections.Dictionary
# GetScriptConstantMap
C#
public Reckfell.Collections.Dictionary GetScriptConstantMap();

Returns a dictionary containing constant names and their values.

Returns Reckfell.Collections.Dictionary
GetScriptMethodListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetScriptMethodList
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetScriptMethodList();

Returns the list of methods in this Script. Note: The dictionaries returned by this method are formatted identically to those returned by ReckfellObject.GetMethodList.

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
GetScriptPropertyListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetScriptPropertyList
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetScriptPropertyList();

Returns the list of properties in this Script. Note: The dictionaries returned by this method are formatted identically to those returned by ReckfellObject.GetPropertyList.

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
GetScriptSignalListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetScriptSignalList
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetScriptSignalList();

Returns the list of signals defined in this Script. Note: The dictionaries returned by this method are formatted identically to those returned by ReckfellObject.GetSignalList.

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
GetSourceCodestring
# GetSourceCode
C#
public string GetSourceCode();
Returns string
HasScriptMethodbool
# HasScriptMethod
C#
public bool HasScriptMethod(StringName methodName);

Returns true if the script, or a base class, defines a method with the given name.

Parameters
NameTypeDefault
methodNameStringName—
Returns bool
HasScriptSignalbool
# HasScriptSignal
C#
public bool HasScriptSignal(StringName signalName);

Returns true if the script, or a base class, defines a signal with the given name.

Parameters
NameTypeDefault
signalNameStringName—
Returns bool
HasSourceCodebool
# HasSourceCode
C#
public bool HasSourceCode();

Returns true if the script contains non-empty source code. Note: If a script does not have source code, this does not mean that it is invalid or unusable. For example, a Script.CanInstantiate.

Returns bool
InstanceHasbool · Deprecated
# InstanceHas
C#
public bool InstanceHas(ReckfellObject baseObject);

Returns true if base_object is an instance of this script.

Parameters
NameTypeDefault
baseObjectReckfellObject—
Returns bool
IsAbstractbool
# IsAbstract
C#
public bool IsAbstract();

Returns true if the script is an abstract script. An abstract script does not have a constructor and cannot be instantiated.

Returns bool
IsToolbool
# IsTool
C#
public bool IsTool();

Returns true if the script is a tool script. A tool script can run in the editor.

Returns bool
ReloadError
# Reload
C#
public Error Reload(bool keepState = false);

Reloads the script's class implementation. Returns an error code.

Parameters
NameTypeDefault
keepStateboolfalse
Returns Error
SetSourceCodevoid
# SetSourceCode
C#
public void SetSourceCode(string source);
Parameters
NameTypeDefault
sourcestring—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.