Game engines
A product in Unity as a working configurator: its model, finishes, option rules and prices, for a game, an app or an installation.
Set up Unity
Unity 2021.3 or later, on a workspace with game engine packages (the Pro plan and up).
-
Download
huesix for Unity
(
huesix-unity.unitypackage) and open it with your project open, or Assets → Import Package → Custom Package. It needs glTFast (com.unity.cloud.gltfast): huesix → Import Product… offers to install it the first time. - Choose huesix → Connect…, sign in to huesix in your browser and choose the workspace.
- Choose huesix → Import Product… and pick one of its live products (products with a model; not modular systems). It opens in a new scene with an orbit camera and an options panel: press Play.
Only people signed in to the workspace get its products’ files. Disconnect an editor from the huesix menu, or in Studio → Integrations → AI assistants, where connected editors are listed.
The HuesixConfigurator component
It works out rules and prices exactly as the web configurator does, and reads and writes the same share codes, so a design made in Unity opens on the web and the other way round.
using Huesix;
using UnityEngine;
public class RingPicker : MonoBehaviour
{
public HuesixConfigurator configurator;
// Awake, not Start: an imported product loads in its own Start, which can run first.
void Awake()
{
configurator.Ready += OnReady;
if (configurator.IsReady) OnReady();
configurator.Changed += _ =>
Debug.Log($"{configurator.Price.Display} {configurator.Price.Currency}: {configurator.Code}");
configurator.Blocked += (option, reason) => Debug.Log($"{option}: {reason}");
}
void OnReady() => Debug.Log($"{configurator.State.Count} option groups");
public void RoseGold() => configurator.Select("metal:rose-gold");
// A design from the web (its share code).
public void Open(string shareCode) => configurator.SetCode(shareCode);
}
-
Select(ref),Deselect(ref),Toggle(ref)andSetCode(code)change the design, and returnfalsewhen the rules don’t allow it (or before the product has loaded:IsReadysays).ResetToDefaults()puts the starting design back. -
Code(the share code),Price(Subtotal,Tax,Total,Display,Lines),Summary,BomandState(each group and option:Visible,Available,Selected,Reason) read it. -
SetPersonalText(id, text),SetPersonalLogo(id, logoId)(a logo already uploaded, by its id: 6 to 40 lowercase letters and digits) andClearPersonal(id)fill in personalisations. -
Events:
Ready,ChangedandBlockedin code,onReady,onChanged(with the share code) andonBlockedin the Inspector.
Selling from Unity? Charge what the quote API says for the share code, never the price worked out on the device.
Other engines
Unity is the engine huesix offers today. For anything else, the web embed runs in any web view, and the app SDKs in native apps.