cohtml.CohtmlSamplesImporter

Inherits from AssetPostprocessor

Public Classes

Name
classCategory
classCreateAppWindow
classJsonData
classSample

Public Functions

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.

Public Properties

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.

Public Functions Documentation

function LoadSamplesData

static void LoadSamplesData()

Read the samples json files and fill the SampleMap object.

function OnPostprocessAllAssets

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

function ImportAllSamples

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.

function RemoveAllSamples

static void RemoveAllSamples()

Remove all Cohtml samples from the project.

function ImportHelloTemplate

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.

function RemoveHelloTemplate

static void RemoveHelloTemplate()

Remove Hello template from the project.

function ImportFrontendSamples

static void ImportFrontendSamples()

Import front-end samples folder into the UIResources folder.

function RemoveFrontendSamples

static void RemoveFrontendSamples()

Remove front-end samples folder from the project.

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.

function RemoveSamplesFromPackageJson

static void RemoveSamplesFromPackageJson()

Remove samples from the Cohtml UPM package.json

function IncludeSceneToBuildSettings

static void IncludeSceneToBuildSettings(
    string scenePath
)

Include scene into Build Settings.

Parameters:

  • scenePath The sample scene path

function RemoveScenesFromBuildSettings

static void RemoveScenesFromBuildSettings(
    string [] scenesToRemove
)

Remove a collection of scenes from the Build Settings.

Parameters:

  • scenesToRemove Scenes which will remove.

Public Property Documentation

property CohtmlPackageInfo

static PackageInfo CohtmlPackageInfo;

The Cohtml Package info object.

property SamplesMap

static Dictionary< string, Sample > SamplesMap;

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