-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example UI #94
Open
nzagorchev
wants to merge
53
commits into
develop
Choose a base branch
from
example_ui
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Example UI #94
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add firebase integration to Example UI Android project
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Add Example app with UI.
The app supports tracking (events, profile properties, user login), variables and app inbox.
Functionalities:
Tracking
Variables
App Inbox
Toast
Shows toast-like popups.
In-Game Debug Console
Integrates In-Game Debug Console package to see and filter the console logs in the app. The console can be shown or hidden.
Implementation
The SDK is launched in the
App
script. The account settings can be set on theApp
game object.UI
The app has a
MainScene
with a bottom tab bar navigation. It has four panels. Each panel is scrollable. The content inside the panels is created programmatically by the panel Script Component.The More tab opens a panel which has Options sub menu.
The app uses prefabs for the main components.
Input Panel
- Title, InputField, Button. The InputField resizes vertically based on the input text entered. This resizes the whole component to fit the content. Additional button can be added to the component using script.Button
- simple prefab with a button.KeyValue
- Panel with two texts - key and value. The key takes 30% and value takes 70% of the horizontal space. The component resizes vertically depending on the text set to either key or value. The text boxes use auto resize with min and max font size.Additonal scripts are added to help improve the UI.
RefreshContentHelper
- refreshes content to display objects correctly. Needed when content is added dynamically and objects haveContentSizeFitter
set to preferred.ClickableText
- script to handle pointer clicks and provide delegate, used inKeyValue
.MouseWheelScrollRect
- customScrollRect
that enables mouse wheel scroll over elements.ScrollInputFieldFixer
- enables scroll over input fields, drag and end drag scroll and mouse wheel scroll.Toast
- displays a Toast. It uses a resource. It does not need to be added to the scene. Show using theToast.Show
static method. The toasts are queued. The toast duration and position is customizable.The elements rounded corners are done using an Image component with a sprite. Different rounded options are added as sprites in the Sprite folder.
Scripts
Each menu and panel has a separate script that builds its UI. The scripts instantiate different prefabs and set the delegates/actions.
App
- initializes the SDK.NavigationMenu
- the main menu.Logger
- custom logger that uses Unity Debug Log but adds a prefix.AdHoc - the Ad hoc tracking (analytics) tab scripts.
AppInbox - the App Inbox panel.
Variables - the Variables panel.
QA SDK - the More tab menu and scripts.
Prefabs - the prefab scripts
Utilities - util scripts
Toast - the Toast object and the UI manager for it.