Sample of Dictionary(GS2 UIKit for Unity)
Implement the Pictorial Book function.
Open the project and you will see the above.
Run it and you will see the availability of the 5 characters from A to E. Since none of the characters have been obtained now, they are all grayed out.
The buttons to obtain each character are placed at the bottom of the screen. First, let’s press the “A” button.
Having obtained the “A” character, it will be displayed in color and the time of obtaining it will be displayed. Let’s press the “C” button as well.
The “C” character will also be displayed in color.
Note the hierarchy of the scene.
Specifies the namespace to be handled by the node under this GameObject.
This time, dictionary-0001 is specified.
Gets the entry model list for the namespace specified by NamespaceContext.
Generates the entry models obtained by Gs2DictionaryEntryModelListFetcher by assigning them to the specified prefab. Specify the maximum number of prefabs to generate for Maximum Items.
This time, the Entry in the child node is specified as the prefab. If the GameObject specified as a prefab is in the scene, that GameObject will be disabled and the number of GameObjects specified in Maximum Items will be created in addition to the GameObjects specified as prefabs.
Specifies the entry to be handled by the node under this GameObject. The content of the context is assigned by Gs2DictionaryEntryModelList.
Gets the model for the entry specified by Gs2DictionaryEntryModelContext.
Gets the own entry of the entry model specified in Gs2DictionaryEntryModelContext.
Enables a GameObject to display the date and time it was obtained, depending on the Entry’s loading status. If the Entry is not obtained, it will not be Loaded and will only be enabled if it is obtained.
Enables a GameObject that displays the name of the entry depending on the EntryModel loading status.
Displays the icon image of the character. However, the type of image displayed must vary depending on the entry to be listed.
Enables or disables GameObjects according to the name of the entry model obtained by Gs2DictionaryEntryModelFetcher. In the sample, five entry models are placed, and only the entry node corresponding to “A” to “E” is set to be enabled.
GameObjects “A” to “E” are set, but in principle they have the same structure.
It branches in the same way as the part that displays the date and time of acquisition, enabling Active if it has been acquired and Disabled if it has not been acquired.
In Disabled, GrayScaleMaterial is specified for Material, which uses shaders to gray out the image.
Displays the name of the entry model.
Formats the contents of the entry model in the format specified by Format. The formatted text is called back to OnUpdate(String), from which the value is reflected in the Text component.
Displays the date and time the entry was obtained.
Formats the entry content in the format specified by Format. The formatted text is called back to OnUpdate(String), from which the value is reflected in the Text component.
Sets the GS2-Exchange exchange rate at which the entry will be made available.
Here, the A-rate model in the exchange-0004 namespace of GS2-Exchange is set to exchange.
You can add a prefab from this context menu.
By specifying the exchange quantity in Count and activating the prefab, the exchange rate specified in Gs2ExchangeRateModelContext will be executed.
can be set to a callback when the exchange process is successfully completed, and disables itself.
A prefab is set up to perform the login process.
sample of Account, please refer to the explanation there.