cohtml.Editor.CohtmlSamplesImporter
Inherits from AssetPostprocessor
Public Classes
Section titled “Public Classes”| Name | |
|---|---|
| class | Category |
| class | CreateAppWindow |
| class | JsonData |
| class | Sample |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| void | LoadSamplesData() Read the samples json files and fill the SampleMap object. |
| 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. |
| string [] | ImportAllSamples(params Sample [] excludeSamples) Imports all assets from the Cohtml package. |
| void | RemoveAllSamples() Remove all Cohtml samples from the project. |
| void | ImportHelloTemplate(bool forceImport =false) Add the Hello template page to the UIResources folder. Show dialog box for confirmation. |
| void | RemoveHelloTemplate() Remove Hello template from the project. |
| void | ImportFrontendSamples() Import front-end samples folder into the UIResources folder. |
| void | RemoveFrontendSamples() Remove front-end samples folder from the project. |
| 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. |
| void | RemoveSamplesFromPackageJson() Remove samples from the Cohtml UPM package.json |
| void | IncludeSceneToBuildSettings(string scenePath) Include scene into Build Settings. |
| void | RemoveScenesFromBuildSettings(string [] scenesToRemove) Remove a collection of scenes from the Build Settings. |
Public Properties
Section titled “Public Properties”| Name | |
|---|---|
| PackageInfo | CohtmlPackageInfo 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
Section titled “Public Functions Documentation”function LoadSamplesData
Section titled “function LoadSamplesData”static void LoadSamplesData()Read the samples json files and fill the SampleMap object.
function OnPostprocessAllAssets
Section titled “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
Section titled “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
Section titled “function RemoveAllSamples”static void RemoveAllSamples()Remove all Cohtml samples from the project.
function ImportHelloTemplate
Section titled “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
Section titled “function RemoveHelloTemplate”static void RemoveHelloTemplate()Remove Hello template from the project.
function ImportFrontendSamples
Section titled “function ImportFrontendSamples”static void ImportFrontendSamples()Import front-end samples folder into the UIResources folder.
function RemoveFrontendSamples
Section titled “function RemoveFrontendSamples”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.
function RemoveSamplesFromPackageJson
Section titled “function RemoveSamplesFromPackageJson”static void RemoveSamplesFromPackageJson()Remove samples from the Cohtml UPM package.json
function IncludeSceneToBuildSettings
Section titled “function IncludeSceneToBuildSettings”static void IncludeSceneToBuildSettings( string scenePath)Include scene into Build Settings.
Parameters:
- scenePath The sample scene path
function RemoveScenesFromBuildSettings
Section titled “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
Section titled “Public Property Documentation”property CohtmlPackageInfo
Section titled “property CohtmlPackageInfo”static PackageInfo CohtmlPackageInfo;The Cohtml Package info object.
property SamplesMap
Section titled “property SamplesMap”static Dictionary< string, Sample > SamplesMap;Get the samples from the UPM package. To read the samples data use the LoadSamplesData() method first.
© 2026 Coherent Labs. All rights reserved.