Arma Reforger Script API
|
Static Public Member Functions | |
static ResourceName | ClonePrefab (ResourceName sourcePrefab, string absoluteFilePath) |
Create a clone of the provided prefab at the provided destination, overriding file if any Destination directory is created if it does not exist. | |
static ResourceName | CreateChildPrefab (ResourceName sourcePrefab, string absoluteFilePath) |
Create a child of the provided prefab at the provided destination, overriding file if any Destination directory is created if it does not exist. | |
static array< ResourceName > | CreatePrefabsFromXOBs (notnull array< ResourceName > xobs, string absoluteDirPath, ResourceName parentPrefab=string.Empty, bool createBasePrefab=false) |
Create Prefabs from the provided XOBs - only setting MeshObject to these Prefabs. | |
static ResourceName | CreatePrefabFromXOB (ResourceName xob, string absoluteDestinationPath, ResourceName parentPrefab=string.Empty, bool createBasePrefab=false) |
Create Prefab from the provided XOB - only setting MeshObject to the Prefab. | |
static IEntitySource | CreateEntitySource (ResourceName parentPrefab=string.Empty) |
Create an entity and return an IEntitySource Keeps the entity in the world, does NOT delete the entity itself. | |
static IEntityComponentSource | CreateEntitySourceComponentIfNeeded (notnull IEntitySource entitySource, string componentClassname) |
Create and add a Component to the provided entitySource if not present. | |
static string | GetResourceNameAbsolutePath (ResourceName resourceName, bool mustExist=true) |
Get the absolute file path of the provided resourceName. | |
static string | GetRelativeParentDirectory (string relativeSourceDirectory, string relativeTargetDirectory) |
Gives the target's directory the source directory's hierarchy/path Relative paths are expected, so separator must be slash (/) | |
static ResourceName | SaveEntitySourceAsPrefab (notnull IEntitySource entitySource, string absoluteDirPath, string prefabFileName, bool createBasePrefab=false) |
Save a Prefab from the provided IEntitySource, with a _base Prefab or not Destination directory is created if it does not exist Keeps the entity in the world, does NOT delete the entity itself. | |
static bool | UpdatePrefab (IEntitySource actualPrefab) |
Update a Prefab. | |
Static Public Attributes | |
static const string | PREFAB_BASE_SUFFIX = "_base" |
Static Protected Member Functions | |
static IEntitySource | CreateEntitySourceWithoutEntity (ResourceName parentPrefab=string.Empty) |
A wrapper method for CreateEntitySource + DeleteEntityFromSource and World Editor action management. | |
static IEntitySource | CreateEntitySourceFromXOB (ResourceName xob, ResourceName parentPrefab=string.Empty) |
Create an entity from an XOB and return an IEntitySource Keeps the entity in the world, does NOT delete the entity itself. | |
static string | FormatRelativePath (string relativePath) |
Format provided relative path, removing leading and trailing slashes, replacing antislashes by slashes, etc. | |
static bool | BeginEntityAction () |
Begin an Entity Action in World Editor API if required. | |
static void | EndEntityAction (bool manageEditAction) |
End an Entity Action in World Editor API if required. | |
Static Protected Attributes | |
static const string | MESHOBJECT_CLASSNAME = "MeshObject" |
static const string | DEFAULT_PARENT_PREFAB = "GenericEntity" |
static const string | PREFAB_DOTTED_EXTENSION = ".et" |
|
staticprotected |
Begin an Entity Action in World Editor API if required.
|
static |
Create a clone of the provided prefab at the provided destination, overriding file if any Destination directory is created if it does not exist.
[in] | absoluteFilePath | the directory is automatically created if needed and a trailing '.et' is automatically added if missing |
|
static |
Create a child of the provided prefab at the provided destination, overriding file if any Destination directory is created if it does not exist.
[in] | absoluteFilePath | the directory is automatically created if needed and a trailing '.et' is automatically added if missing |
|
static |
Create an entity and return an IEntitySource Keeps the entity in the world, does NOT delete the entity itself.
[in] | parentPrefab | if not provided, GenericEntity is used |
|
static |
Create and add a Component to the provided entitySource if not present.
[in] | entitySource | |
[in] | componentClassname |
|
staticprotected |
Create an entity from an XOB and return an IEntitySource Keeps the entity in the world, does NOT delete the entity itself.
[in] | xob | path of the XOB to import |
[in] | parentPrefab | if not provided, GenericEntity is used |
|
staticprotected |
A wrapper method for CreateEntitySource + DeleteEntityFromSource and World Editor action management.
[in] | parentPrefab | if not provided, GenericEntity is used |
|
static |
Create Prefab from the provided XOB - only setting MeshObject to the Prefab.
Destination directory is created if it does not exist The difference with CreatePrefabsFromXOBs is that providing the .et path extracts the final file name the base prefab (if requested) will be named accordingly (name without extension + '_base.et')
[in] | xob | path of the XOB to import |
[in] | absoluteDestinationPath | can be either a directory (a trailing '/' is automatically added if missing) or a file path (.et), the directory is automatically created if needed |
[in] | parentPrefab | if not provided, GenericEntity is used |
[in] | createBasePrefab | if a prefab_base.et should be created (from which prefab.et inherits) |
|
static |
Create Prefabs from the provided XOBs - only setting MeshObject to these Prefabs.
Destination directory is created if it does not exist The difference with CreatePrefabFromXOB is that prefabs here cannot be named, their name will be based on XOB filename
[in] | xobs | list of XOBs to import |
[in] | absoluteDirPath | a trailing '/' is automatically added if missing |
[in] | parentPrefab | if not provided, GenericEntity is used |
[in] | createBasePrefab | if a prefab_base.et should be created (from which prefab.et inherits) |
|
staticprotected |
End an Entity Action in World Editor API if required.
[in] | manageEditAction | if World Editor Entity Action should be terminated, result of an earlier BeginEntityAction call |
|
staticprotected |
Format provided relative path, removing leading and trailing slashes, replacing antislashes by slashes, etc.
[in] | relativePath | the relative path |
|
static |
Gives the target's directory the source directory's hierarchy/path Relative paths are expected, so separator must be slash (/)
See SCR_PrefabHelper.FormatRelativePath
[in] | relativeSourceDirectory | the relative source directory, e.g Assets/Rocks/Granite |
[in] | relativeTargetDirectory | the relative target directory, e.g Prefabs/Miniatures |
|
static |
Get the absolute file path of the provided resourceName.
[in] | resourceName | the resourceName from which to obtain the absolute file path |
[in] | mustExist | if true, the file MUST exist to return a valid value |
|
static |
Save a Prefab from the provided IEntitySource, with a _base Prefab or not Destination directory is created if it does not exist Keeps the entity in the world, does NOT delete the entity itself.
[in] | absoluteDirPath | a trailing '/' is automatically added if missing |
[in] | prefabFileName | a trailing '.et' is automatically added if missing |
|
static |
Update a Prefab.
[in] | actualPrefab | the spawned Prefab's IEntitySource ancestor |
|
staticprotected |
|
staticprotected |
|
static |
|
staticprotected |