Manages CMS imports. Saves necessary states.
- Build destination path
- Target languages (array)
- Currently used
CuvClient
Determines which CMS to use and which model to employ. Once implemented, it shows up in the dropdown of CuvImporter
.
- Cockpit CMS
- Google Sheets
- Direct reference
- Reference from Addressables
When specified, it will not be displayed in the dropdown list of CuvImporter
.
[IgnoreImporter] // <--
public sealed class TestCockpitCuvClient : CockpitCuvClient<TestCockpitModel, TestCockpitCuvModelList>
{
protected override JsonConverter<TestCockpitModel> CreateConverter()
=> new CuvModelConverter<TestCockpitModel>();
}
When specified, it allows you to change the name displayed in the dropdown list of CuvImporter
.
[CuvDisplayName("YourCustomName")] // <--
public sealed class TestCockpitCuvClient : CockpitCuvClient<TestCockpitModel, TestCockpitCuvModelList>
{
protected override JsonConverter<TestCockpitModel> CreateConverter()
=> new CuvModelConverter<TestCockpitModel>();
}
Generated by CuvClient
. Saves data in target language-specific ScriptableObject
. The model is stored in arrays and can be obtained with a Key
.
Model. Corresponds to one article of data in CMS.
Determines how to reference the CuvModelList
and creates a CuvReference
. Once implemented, it shows up in the dropdown of CuvImporter
.
- Direct reference
- Reference from Addressables
A ScriptableObject
that manages references to the CuvModelList<T>
stored by language. The user extracts data from here.
Although it's fine to use the created CuvReference
directly, it's convenient to use this component because it displays a drop-down list of the configured Key
.
Pass the field name of the CuvReference
you want to reference as an argument.
public abstract class Test : MonoBehaviour
{
[SerializeField] GoogleSheetCuvReference _reference;
[SerializeField, CuvModelKey("_reference")] string _key;
A class that wraps the CuvModelKey
to simplify usage.
using CMSuniVortex.Compornents;
using CMSuniVortex.GoogleSheet;
using UnityEngine;
using UnityEngine.UI;
public sealed class TestText : CuvComponent<GoogleSheetCuvReference>
{
[SerializeField] Text _text;
protected override void OnChangeLanguage(GoogleSheetCuvReference reference, string key)
{
if (reference.GetList().TryGetByKey(key, out var model))
{
_text.text = model.Text;
}
}
}
Asynchronous version of the CuvComponent
.
By enclosing it with {}
, you can embed parameters.
- Statement
You have earned {number} coins.
- Display
You have earned 5 coins.
var text = model.Text.SetParam("number", 5);