Experience(GS2 UIKit for Unity) sample
Implement experience weight and level functionality.
Open the project and you will see the above.
Run it and you will see the current level, level cap, and progress bar like this.
At the bottom of the screen, there is a button for operating experience.
Let’s add 100 experience with “Add Experience(100)”.
Experience has been added and the level has increased from 1 to 3.
Let’s add 100 to the experience value again with “Add Experience(100)”.
The level has increased to 5 and the level cap has been reached. To make it easier to understand this status, the level value has been changed from black to red.
Let’s press “Add Rank Cap” to raise the level cap.
The level cap has been raised from 5 to 6. As a result, the current level has not reached the level cap, so the level notation has also been changed back from red to black.
Note the hierarchy of the scene.
Specifies the experience model to be handled by the node under this GameObject.
In this case, we specify an experience model named Experience in the namespace experience-0001 in GS2-Experience.
Specifies the status of itself handled by the node under this GameObject.
This time, we specify an experience model named Experience and a property ID named player in the namespace experience-0001 in GS2-Experience.
Gets the status specified in Gs2ExperienceOwnStatusContext.
Enables/disables ValueContainer / Slider depending on status loading.
Enables or disables Value / ReachMaxValue depending on whether the status rank has reached or not reached the maximum value.
The current rank value and rank cap value are formatted in the format specified by Format. The formatted result is called back to OnUpdate(String) and is reflected in the Text component. The Text component here specifies black as the text color.
The current rank value and rank cap value are formatted in the format specified by Format. The formatted result is called back to OnUpdate(String) and is reflected in the Text component. The Text component here specifies red for the text color.
Returns the progress from 0.0 to 1.0 in the current rank until the next rank up experience is reached in the OnUpdate(Single) callback. The value is reflected in Slider.value.
Sets the GS2-Exchange exchange rate that adds 10 to the experience value.
Here we specify an exchange rate named AddExperience in the GS2-Exchange namespace named exchange-0006.
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.
Canvas/ExperienceWindow/Input/AddExperience Sets the GS2-Exchange exchange rate that adds 10 to the experience value as in.
Set the exchange quantity to 10.
Sets the GS2-Exchange exchange rate at which to add one rank cap.
A prefab is set up to perform the login process.
sample of Account, please refer to the explanation there.