Class ProductServices
Class ProductServices.
Namespace: UnityEditor.Industrial.Configuring.UI
Syntax
public static class ProductServices
Methods
AddProduct(GameObject)
Adds the product.
Declaration
public static Product AddProduct(GameObject gameObject)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | The game object. |
Returns
Type | Description |
---|---|
Product | Product. |
AddProductPrefabToConfigurator(AssetReferenceGameObject)
Adds the product prefab to configurator.
Declaration
public static void AddProductPrefabToConfigurator(AssetReferenceGameObject assetReference)
Parameters
Type | Name | Description |
---|---|---|
AssetReferenceGameObject | assetReference | The asset reference. |
AddProductPrefabToConfigurator(GameObject)
Adds the product prefab to configurator.
Declaration
public static void AddProductPrefabToConfigurator(GameObject productPrefab)
Parameters
Type | Name | Description |
---|---|---|
GameObject | productPrefab | The product prefab. |
AddProductToGameObject(GameObject, ProductSettings)
Adds the product to game object.
Declaration
public static Product AddProductToGameObject(GameObject gameObject, ProductSettings productSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | The game object. |
ProductSettings | productSettings | The product settings. |
Returns
Type | Description |
---|---|
Product | Product. |
AddProductVariant(Object, Product)
Adds the product variant.
Declaration
public static void AddProductVariant(Object modelSource, Product originalProduct)
Parameters
Type | Name | Description |
---|---|---|
Object | modelSource | The model source. |
Product | originalProduct | The original product. |
AddProductVariant(Object, ProductVariantProfile)
Adds the product variant.
Declaration
public static void AddProductVariant(Object modelSource, ProductVariantProfile originalProductVariant)
Parameters
Type | Name | Description |
---|---|---|
Object | modelSource | The model source. |
ProductVariantProfile | originalProductVariant | The original product variant. |
ChangeFeatures(Configurator, UIFeatureOptionChangeEventArgs)
Changes the features.
Declaration
public static void ChangeFeatures(Configurator configurator, UIFeatureOptionChangeEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Configurator | configurator | The configurator. |
UIFeatureOptionChangeEventArgs | args | The UIFeatureOptionChangeEventArgs instance containing the event data. |
CreateDefaultThumbnail(ProductVariantProfile)
Creates the default thumbnail.
Declaration
public static void CreateDefaultThumbnail(ProductVariantProfile productVariant)
Parameters
Type | Name | Description |
---|---|---|
ProductVariantProfile | productVariant | The product variant. |
CreateProductAndModelQueriesPrefabs(GameObject, GameObject, GameObject, Product, String)
Creates the product and model queries prefabs.
Declaration
public static (GameObject, GameObject, Product) CreateProductAndModelQueriesPrefabs(GameObject sourceModelGO, GameObject modelSetInstance, GameObject productInstance, Product product, string savedPath = "")
Parameters
Type | Name | Description |
---|---|---|
GameObject | sourceModelGO | The source model go. |
GameObject | modelSetInstance | The model set instance. |
GameObject | productInstance | The product instance. |
Product | product | The product. |
String | savedPath | The saved path. |
Returns
Type | Description |
---|---|
ValueTuple<GameObject, GameObject, Product> | System.ValueTuple<GameObject, GameObject, Product>. |
CreateProductForModel(GameObject, String)
Creates the product for model.
Declaration
public static (GameObject, GameObject) CreateProductForModel(GameObject sourceModelObject, string savedPath = "")
Parameters
Type | Name | Description |
---|---|---|
GameObject | sourceModelObject | The source model object. |
String | savedPath | The saved path. |
Returns
Type | Description |
---|---|
ValueTuple<GameObject, GameObject> | System.ValueTuple<GameObject, GameObject>. |
FindAllAddressableProductInProject()
Finds all addressable product in project.
Declaration
public static List<Product> FindAllAddressableProductInProject()
Returns
Type | Description |
---|---|
List<Product> | List<Product>. |
FindCurrentProduct()
Finds the current product.
Declaration
public static Product FindCurrentProduct()
Returns
Type | Description |
---|---|
Product | Product. |
GetAssetReferenceFromGameObject(GameObject)
Gets the asset reference from game object.
Declaration
public static AssetReferenceGameObject GetAssetReferenceFromGameObject(GameObject productPrefab)
Parameters
Type | Name | Description |
---|---|---|
GameObject | productPrefab | The product prefab. |
Returns
Type | Description |
---|---|
AssetReferenceGameObject | AssetReferenceGameObject. |
GetCurrentProduct(Configurator)
Gets the current product.
Declaration
public static Product GetCurrentProduct(Configurator configurator)
Parameters
Type | Name | Description |
---|---|---|
Configurator | configurator | The configurator. |
Returns
Type | Description |
---|---|
Product | Product. |
GetProductList(Configurator)
Gets the product list.
Declaration
public static IEnumerable<AssetProductReference> GetProductList(Configurator configurator)
Parameters
Type | Name | Description |
---|---|---|
Configurator | configurator | The configurator. |
Returns
Type | Description |
---|---|
IEnumerable<AssetProductReference> | IEnumerable<AssetProductReference>. |
GetVariantAssigmentByMaterial(Product, Material)
Gets the variant assigment by material.
Declaration
public static (List<Variant>, List<MaterialAssignment>) GetVariantAssigmentByMaterial(this Product product, Material material)
Parameters
Type | Name | Description |
---|---|---|
Product | product | The product. |
Material | material | The material. |
Returns
Type | Description |
---|---|
ValueTuple<List<Variant>, List<MaterialAssignment>> | System.ValueTuple<List<Variant>, List<MaterialAssignment>>. |
ImportUnityObjects(IEnumerable<Object>)
Imports Unity Prefabs into Configurator
Declaration
public static Task<IEnumerable<Product>> ImportUnityObjects(IEnumerable<Object> objects)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Object> | objects | The objects. |
Returns
Type | Description |
---|---|
Task<IEnumerable<Product>> | IEnumerable<Product>. |
IsAddressable(Object)
Determines whether the specified prefab is addressable.
Declaration
public static bool IsAddressable(Object prefab)
Parameters
Type | Name | Description |
---|---|---|
Object | prefab | The prefab. |
Returns
Type | Description |
---|---|
Boolean |
|
MakePrefabAddressable(GameObject)
Makes the prefab addressable.
Declaration
public static void MakePrefabAddressable(GameObject productPrefab)
Parameters
Type | Name | Description |
---|---|---|
GameObject | productPrefab | The product prefab. |
MakeProductAndPrefabs(GameObject, String)
Makes the product and prefabs.
Declaration
public static GameObject MakeProductAndPrefabs(GameObject gameObject, string savePath = "")
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | The game object. |
String | savePath | The save path. |
Returns
Type | Description |
---|---|
GameObject | GameObject. |
MakeProductDataAddressable(GameObject)
Makes the product data addressable.
Declaration
public static void MakeProductDataAddressable(GameObject productPrefab)
Parameters
Type | Name | Description |
---|---|---|
GameObject | productPrefab | The product prefab. |
Exceptions
Type | Condition |
---|---|
Exception | GameObject is not a product. |
MoveAddressableAssetsToProductGroup(GameObject, List<Object>)
Moves the addressable assets to product group.
Declaration
public static void MoveAddressableAssetsToProductGroup(GameObject productPrefab, List<Object> assets)
Parameters
Type | Name | Description |
---|---|---|
GameObject | productPrefab | The product prefab. |
List<Object> | assets | The assets. |
Exceptions
Type | Condition |
---|---|
Exception | GameObject is not a product. |
Exception | Product Group not found |
ObjectToProduct(Object, Product)
Objects to product.
Declaration
public static (AssetReferenceGameObject, GameObject, Product, Product) ObjectToProduct(Object obj, Product productSource = null)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object. |
Product | productSource | The product source. |
Returns
Type | Description |
---|---|
ValueTuple<AssetReferenceGameObject, GameObject, Product, Product> | System.ValueTuple<AssetReferenceGameObject, GameObject, Product, Product>. |
OnDropped()
Called when [dropped].
Declaration
public static void OnDropped()
PrefabObjectToProduct(GameObject, Product)
Prefabs the object to product.
Declaration
public static (GameObject, Product) PrefabObjectToProduct(GameObject sourceModelPrefab, Product productSource = null)
Parameters
Type | Name | Description |
---|---|---|
GameObject | sourceModelPrefab | The source model prefab. |
Product | productSource | The product source. |
Returns
Type | Description |
---|---|
ValueTuple<GameObject, Product> | System.ValueTuple<GameObject, Product>. |
PrepareForImport()
Prepares for import.
Declaration
public static void PrepareForImport()
RefreshFeatures(Configurator)
Refreshes the features.
Declaration
public static void RefreshFeatures(Configurator configurator)
Parameters
Type | Name | Description |
---|---|---|
Configurator | configurator | The configurator. |
SavePrefab()
Saves the prefab.
Declaration
public static void SavePrefab()
SaveProductPrefab(GameObject, String)
Saves the product prefab.
Declaration
public static GameObject SaveProductPrefab(GameObject gameObject, string path)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | The game object. |
String | path | The path. |
Returns
Type | Description |
---|---|
GameObject | GameObject. |
SetProductPreview(Configurator, Int32, Boolean)
Sets the product preview.
Declaration
public static Product SetProductPreview(Configurator configurator, int productIndex = 0, bool forceLoad = false)
Parameters
Type | Name | Description |
---|---|---|
Configurator | configurator | The configurator. |
Int32 | productIndex | Index of the product. |
Boolean | forceLoad | if set to |
Returns
Type | Description |
---|---|
Product | Product. |
SetStandardProductRuntimeData(Product)
Sets the standard product runtime data.
Declaration
public static void SetStandardProductRuntimeData(Product product)
Parameters
Type | Name | Description |
---|---|---|
Product | product | The product. |
SetupProductPreview(Configurator)
Setups the product preview.
Declaration
public static ProductPreview SetupProductPreview(Configurator configurator)
Parameters
Type | Name | Description |
---|---|---|
Configurator | configurator | The configurator. |
Returns
Type | Description |
---|---|
ProductPreview | ProductPreview. |
TryGetProduct(GameObject, out Product)
Tries the get product.
Declaration
public static bool TryGetProduct(GameObject gameObject, out Product product)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | The game object. |
Product | product | The product. |
Returns
Type | Description |
---|---|
Boolean |
|
UpdateProductModel(ProductVariantProfile, Object)
Updates the product model.
Declaration
public static void UpdateProductModel(ProductVariantProfile productVariantProfile, Object pickedObject)
Parameters
Type | Name | Description |
---|---|---|
ProductVariantProfile | productVariantProfile | The product variant profile. |
Object | pickedObject | The picked object. |