Skip to content
SiteEmail

cohtml.Editor.CohtmlSamplesImporter

Inherits from AssetPostprocessor

Name
classCategory
classCreateAppWindow
classJsonData
classSample
Name
voidLoadSamplesData()
Read the samples json files and fill the SampleMap object.
voidOnPostprocessAllAssets(string [] importedAssets, string [] deletedAssets, string [] movedAssets, string [] movedFromAssetPaths)
Monitors for sample files imported into the project via the UPM (Unity Package Manager) functionality. Once detected, copies the UIResources to the “StreamingAssets/CohtmlUIResources/Sample Name” folder.
string []ImportAllSamples(params Sample [] excludeSamples)
Imports all assets from the Cohtml package.
voidRemoveAllSamples()
Remove all Cohtml samples from the project.
voidImportHelloTemplate(bool forceImport =false)
Add the Hello template page to the UIResources folder. Show dialog box for confirmation.
voidRemoveHelloTemplate()
Remove Hello template from the project.
voidImportFrontendSamples()
Import front-end samples folder into the UIResources folder.
voidRemoveFrontendSamples()
Remove front-end samples folder from the project.
voidPermanentDeleteSamplesFromPackage()
Permanently remove all Cohtml sample files and the Cohtml UPM package from the project. A confirmation dialog box will be displayed before proceeding.
voidRemoveSamplesFromPackageJson()
Remove samples from the Cohtml UPM package.json
voidIncludeSceneToBuildSettings(string scenePath)
Include scene into Build Settings.
voidRemoveScenesFromBuildSettings(string [] scenesToRemove)
Remove a collection of scenes from the Build Settings.
Name
PackageInfoCohtmlPackageInfo
The Cohtml Package info object.
Dictionary< string, Sample >SamplesMap
Get the samples from the UPM package. To read the samples data use the LoadSamplesData() method first.
static void LoadSamplesData()

Read the samples json files and fill the SampleMap object.

static void OnPostprocessAllAssets(
string [] importedAssets,
string [] deletedAssets,
string [] movedAssets,
string [] movedFromAssetPaths
)

Monitors for sample files imported into the project via the UPM (Unity Package Manager) functionality. Once detected, copies the UIResources to the “StreamingAssets/CohtmlUIResources/Sample Name” folder.

Parameters:

  • importedAssets Imported assets to check.
  • deletedAssets Not used
  • movedAssets Not used
  • movedFromAssetPaths Not used
static string [] ImportAllSamples(
params Sample [] excludeSamples
)

Imports all assets from the Cohtml package.

Parameters:

  • excludeSamples Excludes a collection of samples from the import process.

Return: A collection of the names of the imported samples.

static void RemoveAllSamples()

Remove all Cohtml samples from the project.

static void ImportHelloTemplate(
bool forceImport =false
)

Add the Hello template page to the UIResources folder. Show dialog box for confirmation.

Parameters:

  • forceImport If true, will import without the dialog box.
static void RemoveHelloTemplate()

Remove Hello template from the project.

static void ImportFrontendSamples()

Import front-end samples folder into the UIResources folder.

static void RemoveFrontendSamples()

Remove front-end samples folder from the project.

function PermanentDeleteSamplesFromPackage

Section titled “function PermanentDeleteSamplesFromPackage”
static void PermanentDeleteSamplesFromPackage()

Permanently remove all Cohtml sample files and the Cohtml UPM package from the project. A confirmation dialog box will be displayed before proceeding.

static void RemoveSamplesFromPackageJson()

Remove samples from the Cohtml UPM package.json

static void IncludeSceneToBuildSettings(
string scenePath
)

Include scene into Build Settings.

Parameters:

  • scenePath The sample scene path
static void RemoveScenesFromBuildSettings(
string [] scenesToRemove
)

Remove a collection of scenes from the Build Settings.

Parameters:

  • scenesToRemove Scenes which will remove.
static PackageInfo CohtmlPackageInfo;

The Cohtml Package info object.

static Dictionary< string, Sample > SamplesMap;

Get the samples from the UPM package. To read the samples data use the LoadSamplesData() method first.