SaveGame.Copy

Description

Copies a identifier to another identifier, also, can be used for duplicating or replacing.

You can copy folders and files, here is the conditions:

If the first identifier is a file and the second one is a file and the second file is exists, then the second identifier will be replaced.

If the first identifier is a file and the second one is a file and the second file is not exists, then the first identifier will be duplicated.

If the first identifier is a file and the second one is a folder, then the first identifier will be copied into the folder.

If the first identifier is a folder and the second one is a folder and the second folder is exists, then the first identifier will be copied into the second folder.

If the first identifier is a folder and the second one is a folder and the second folder is not exists, then the first identifier will be duplicated.

Parameters

Name Type Description Required
fromIdentifier string The identifier to copy from required
toIdentifier string The identifier to copy to required
settings SaveGameSettings The optional settings optional

Examples

Copy Simple Identifier

SaveGame.Copy ( "simple.txt", "simple-copy.txt" );

Copy to Folder

SaveGame.Copy ( "simple.txt", "myFolder" );

Copy Folder

SaveGame.Copy ( "myFolder", "myCopyFolder" );

Copy to Folder with Custom Name

SaveGame.Copy ( "simple.txt", "myFolder/simple-copy.txt" );