Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

SharedTableData.IsSmart

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public bool IsSmart(long id);

Parameters

Parameter Description
id The stable key id.

Returns

bool true when the key's values are Smart Strings; otherwise, false.

Description

Returns whether a key is marked as a Smart String.

Equivalent to testing the SharedEntryFlags.Smart flag on the key's entry. Returns false when the id is absent.

Additional resources: SharedEntryFlags, SharedTableData.SharedTableEntry.IsSmart

<para>Check whether a key uses Smart Strings.</para>

using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples { public class SharedTableDataIsSmartExample { public void Run() { var sharedData = ScriptableObject.CreateInstance<SharedTableData>(); var entry = sharedData.AddKey("GREETING"); entry.IsSmart = true;

Debug.Log(sharedData.IsSmart(entry.Id)); // True } } }