├── .gitignore ├── .gitmodules ├── .vscode └── settings.json ├── Assets ├── Dependencies │ └── TSTableView │ │ ├── ITableViewDataSource.cs │ │ ├── ITableViewDataSource.cs.meta │ │ ├── LICENSE │ │ ├── LICENSE.meta │ │ ├── README.md │ │ ├── README.md.meta │ │ ├── TableView.cs │ │ ├── TableView.cs.meta │ │ ├── TableViewCell.cs │ │ └── TableViewCell.cs.meta ├── Prefabs │ ├── InventoryCellPrefab.prefab │ ├── InventoryCellPrefab.prefab.meta │ ├── ModalAlertPrefab.prefab │ ├── ModalAlertPrefab.prefab.meta │ ├── ScoreCellPrefab.prefab │ └── ScoreCellPrefab.prefab.meta ├── Resources │ ├── lemons.png │ ├── lemons.png.meta │ ├── medicine.png │ ├── medicine.png.meta │ ├── melons.png │ ├── melons.png.meta │ ├── strawberries.png │ └── strawberries.png.meta ├── Scenes │ ├── HighscoresDemo.unity │ ├── HighscoresDemo.unity.meta │ ├── InventoryDemo.unity │ └── InventoryDemo.unity.meta └── Scripts │ ├── DataModels.meta │ ├── DataModels │ ├── Highscore.cs │ ├── Highscore.cs.meta │ ├── Inventory.cs │ ├── Inventory.cs.meta │ ├── Message.cs │ └── Message.cs.meta │ ├── HighscoresDemo.cs │ ├── HighscoresDemo.cs.meta │ ├── InventoryDemo.cs │ ├── InventoryDemo.cs.meta │ ├── UI.meta │ └── UI │ ├── ModalAlert.cs │ ├── ModalAlert.cs.meta │ ├── TableViewCells.meta │ └── TableViewCells │ ├── InventoryCell.cs │ ├── InventoryCell.cs.meta │ ├── ScoreCell.cs │ └── ScoreCell.cs.meta ├── LICENSE ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Unity 2 | [Ll]ibrary/ 3 | [Tt]emp/ 4 | [Oo]bj/ 5 | [Bb]uild/ 6 | 7 | # Windows 8 | UWP/ 9 | Assets/*.pfx 10 | 11 | # Builds 12 | *.unitypackage 13 | 14 | # Android 15 | *.apk 16 | 17 | # Autogenerated VS/MD solution and project files 18 | *.csproj 19 | *.unityproj 20 | *.sln 21 | *.suo 22 | *.tmp 23 | *.user 24 | *.userprefs 25 | *.pidb 26 | *.booproj 27 | *.svd 28 | 29 | # Source control temp files 30 | *.orig 31 | 32 | # Unity3D generated meta files in directories 33 | *.pidb.meta 34 | *.meta 35 | 36 | # Save all .meta files in Assets folder and sub directories 37 | #!Assets/**/*.meta 38 | 39 | # Save only .meta files referenced in Unity Editor to prevent missing scripts, prefabs and resources 40 | !Assets/[Pp]refabs/**/*.meta 41 | !Assets/[Rr]esources/**/*.meta 42 | !Assets/[Ss]cenes/**/*.meta 43 | !Assets/[Ss]cripts/**/*.meta 44 | !Assets/TSTableView/**/*.meta 45 | 46 | # Unity3D Generated File On Crash Reports 47 | sysinfo.txt 48 | 49 | # OS generated 50 | .DS_Store 51 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Assets/Dependencies/AppServices"] 2 | path = Assets/Dependencies/AppServices 3 | url = https://github.com/Unity3dAzure/AppServices 4 | [submodule "Assets/Dependencies/RESTClient"] 5 | path = Assets/Dependencies/RESTClient 6 | url = https://github.com/Unity3dAzure/RESTClient 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/ITableViewDataSource.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | 5 | namespace Tacticsoft 6 | { 7 | /// 8 | /// An interface for a data source to a TableView 9 | /// 10 | public interface ITableViewDataSource 11 | { 12 | /// 13 | /// Get the number of rows that a certain table should display 14 | /// 15 | int GetNumberOfRowsForTableView(TableView tableView); 16 | 17 | /// 18 | /// Get the height of a row of a certain cell in the table view 19 | /// 20 | float GetHeightForRowInTableView(TableView tableView, int row); 21 | 22 | /// 23 | /// Create a cell for a certain row in a table view. 24 | /// Callers should use tableView.GetReusableCell to cache objects 25 | /// 26 | TableViewCell GetCellForRowInTableView(TableView tableView, int row); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/ITableViewDataSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e94670764bcd5470d8a20298fe20e02b 3 | timeCreated: 1472559286 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Tacticsoft Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a14dbfffdc4a4f18a138da5eeaa75be 3 | timeCreated: 1472559285 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/README.md: -------------------------------------------------------------------------------- 1 | # TSTableView by [Tacticsoft](http://www.tacticsoft.net)# 2 | 3 | TSTableView is a plugin for Unity 4.6's new UI system that implements a Table with an API inspired by Apple's [UITableView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView_Class/index.html) while obeying the standards set by Unity 4.6's GUI system. 4 | 5 | ### Introduction ### 6 | 7 | * Unity 4.6 introducted a new UI system, but it lacks a ready for use table component. 8 | * This implementation is built to support tables with a large number of rows, and makes use of lazy loading and object pooling to perform well. 9 | 10 | ### Features ### 11 | 12 | * Reusable (vertical) Table component, following MVC paradigm 13 | * No external dependencies, very small footprint 14 | * Can handle tables with large amounts of rows 15 | * Native iOS / Mac developers will feel at home 16 | 17 | ### Setting up ### 18 | 19 | * If you would like to get a standalone Unity project of this component, consider cloning [TSTableViewPackage](https://bitbucket.org/tacticsoft/tstableviewpackage) instead. Don't forget to update submodules for the code itself to be included. 20 | * This repository contains just the code assets, so you can submodule / clone it directly into a directory of choice in your unity Assets directory. 21 | * You can also [download the repository](https://bitbucket.org/tacticsoft/tstableview/downloads) and place the files in your project. 22 | * Open the Examples directory to see example uses of the component. 23 | 24 | ### Code Tutorial ### 25 | 26 | * The main component introduced is the *TableView* component. The rows inside the table view are created programmatically by the data source which creates generates *TableViewCells* when asked. 27 | * The intended usage of this component is to implement *ITableViewDataSource* with one behavior (the controller), and subclass *TableViewCell* (the view). It makes sense to create a prefab of the game object hierarchy containing the *TableViewCell* and instantiate that from the *GetCellForRowInTableView* call. Make sure to check for reusable cells before instantiating again. 28 | * The TableView component assumes a certain hierarchy structure, see the *TableView Template* prefab for details. 29 | * *TableView* should be placed later than "Default" in Script Execution Order 30 | 31 | ### Missing features ### 32 | 33 | * Currently only vertical tables are supported, with one item per row 34 | * Performance can be better, but is already good enough for thousands of rows. 35 | * The VerticalLayoutGroup's spacing property can't change during runtime and must be smaller than the row height 36 | 37 | ### Contribution guidelines ### 38 | 39 | * Create pull requests! 40 | 41 | ### Who do I talk to? ### 42 | 43 | * Email [tech@tacticsoft.net](mailto:tech@tacticsoft.net) with comments, requests and suggestions 44 | * [@noamgat](http://www.twitter.com/noamgat) -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ac3b0e384f99493f91317747bbb086c 3 | timeCreated: 1472559286 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/TableView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections.Generic; 4 | using UnityEngine.UI; 5 | using UnityEngine.Events; 6 | using UnityEngine.SocialPlatforms; 7 | using UnityEngine.Profiling; 8 | 9 | namespace Tacticsoft 10 | { 11 | /// 12 | /// A reusable table for for (vertical) tables. API inspired by Cocoa's UITableView 13 | /// Hierarchy structure should be : 14 | /// GameObject + TableView (this) + Mask + Scroll Rect (point to child) 15 | /// - Child GameObject + Vertical Layout Group 16 | /// This class should be after Unity's internal UI components in the Script Execution Order 17 | /// 18 | [RequireComponent(typeof(ScrollRect))] 19 | public class TableView : MonoBehaviour 20 | { 21 | 22 | #region Public API 23 | /// 24 | /// The data source that will feed this table view with information. Required. 25 | /// 26 | public ITableViewDataSource dataSource 27 | { 28 | get { return m_dataSource; } 29 | set { m_dataSource = value; m_requiresReload = true; } 30 | } 31 | 32 | [System.Serializable] 33 | public class CellVisibilityChangeEvent : UnityEvent { } 34 | /// 35 | /// This event will be called when a cell's visibility changes 36 | /// First param (int) is the row index, second param (bool) is whether or not it is visible 37 | /// 38 | public CellVisibilityChangeEvent onCellVisibilityChanged; 39 | 40 | /// 41 | /// Get a cell that is no longer in use for reusing 42 | /// 43 | /// The identifier for the cell type 44 | /// A prepared cell if available, null if none 45 | public TableViewCell GetReusableCell(string reuseIdentifier) { 46 | LinkedList cells; 47 | if (!m_reusableCells.TryGetValue(reuseIdentifier, out cells)) { 48 | return null; 49 | } 50 | if (cells.Count == 0) { 51 | return null; 52 | } 53 | TableViewCell cell = cells.First.Value; 54 | cells.RemoveFirst(); 55 | return cell; 56 | } 57 | 58 | public bool isEmpty { get; private set; } 59 | 60 | /// 61 | /// Reload the table view. Manually call this if the data source changed in a way that alters the basic layout 62 | /// (number of rows changed, etc) 63 | /// 64 | public void ReloadData() { 65 | Profiler.BeginSample("TableView.ReloadData for dataSource:" + m_dataSource.GetType().Name, this); 66 | 67 | if (m_verticalLayoutGroup == null) { 68 | Debug.LogError("Vertical Layout Group is null"); 69 | return; 70 | } 71 | m_rowHeights = new float[m_dataSource.GetNumberOfRowsForTableView(this)]; 72 | this.isEmpty = m_rowHeights.Length == 0; 73 | ClearAllRows(); 74 | if (this.isEmpty) { 75 | // reset content size when empty 76 | var rect = m_scrollRect.content.GetComponent (); 77 | rect.localPosition = Vector2.zero; 78 | rect.sizeDelta = Vector2.zero; 79 | m_requiresReload = false; 80 | return; 81 | } 82 | m_cumulativeRowHeights = new float[m_rowHeights.Length]; 83 | m_cleanCumulativeIndex = -1; 84 | 85 | for (int i = 0; i < m_rowHeights.Length; i++) { 86 | m_rowHeights[i] = m_dataSource.GetHeightForRowInTableView(this, i); 87 | if (i > 0) { 88 | m_rowHeights[i] += m_verticalLayoutGroup.spacing; 89 | } 90 | } 91 | 92 | m_scrollRect.content.sizeDelta = new Vector2(m_scrollRect.content.sizeDelta[0], 93 | GetCumulativeRowHeight(m_rowHeights.Length - 1) + m_verticalLayoutGroup.padding.vertical); 94 | 95 | // https://bitbucket.org/tacticsoft/tstableview/pull-requests/2/tableviewreloaddata-not-working/diff 96 | float relativeScroll = 1 - m_scrollRect.verticalNormalizedPosition; 97 | m_scrollY = relativeScroll * scrollableHeight; 98 | 99 | RecalculateVisibleRowsFromScratch(); 100 | m_requiresReload = false; 101 | 102 | Profiler.EndSample(); 103 | 104 | } 105 | 106 | /// 107 | /// Get cell at a specific row (if active). Returns null if not. 108 | /// 109 | public TableViewCell GetCellAtRow(int row) 110 | { 111 | TableViewCell retVal = null; 112 | m_visibleCells.TryGetValue(row, out retVal); 113 | return retVal; 114 | } 115 | 116 | /// 117 | /// Get the range of the currently visible rows 118 | /// 119 | public Range visibleRowRange { 120 | get { return m_visibleRowRange; } 121 | } 122 | 123 | /// 124 | /// Notify the table view that one of its rows changed size 125 | /// 126 | public void NotifyCellDimensionsChanged(int row) { 127 | float oldHeight = m_rowHeights[row]; 128 | m_rowHeights[row] = m_dataSource.GetHeightForRowInTableView(this, row); 129 | if (row > 0) { 130 | m_rowHeights[row] += m_verticalLayoutGroup.spacing; 131 | } 132 | m_cleanCumulativeIndex = Mathf.Min(m_cleanCumulativeIndex, row - 1); 133 | TableViewCell cell = GetCellAtRow(row); 134 | if (cell != null) { 135 | cell.GetComponent().preferredHeight = m_rowHeights[row]; 136 | if (row > 0) { 137 | cell.GetComponent().preferredHeight -= m_verticalLayoutGroup.spacing; 138 | } 139 | } 140 | float heightDelta = m_rowHeights[row] - oldHeight; 141 | m_scrollRect.content.sizeDelta = new Vector2(m_scrollRect.content.sizeDelta.x, 142 | m_scrollRect.content.sizeDelta.y + heightDelta); 143 | m_requiresRefresh = true; 144 | } 145 | 146 | /// 147 | /// Get the maximum scrollable height of the table. scrollY property will never be more than this. 148 | /// 149 | public float scrollableHeight { 150 | get { 151 | return m_scrollRect.content.rect.height - (this.transform as RectTransform).rect.height; 152 | } 153 | } 154 | 155 | /// 156 | /// Get or set the current scrolling position of the table 157 | /// 158 | public float scrollY { 159 | get { 160 | return m_scrollY; 161 | } 162 | set { 163 | if (this.isEmpty) { 164 | return; 165 | } 166 | value = Mathf.Clamp(value, 0, GetScrollYForRow(m_rowHeights.Length - 1, true)); 167 | if (m_scrollY != value) { 168 | m_scrollY = value; 169 | m_requiresRefresh = true; 170 | float relativeScroll = value / this.scrollableHeight; 171 | m_scrollRect.verticalNormalizedPosition = 1 - relativeScroll; 172 | } 173 | } 174 | } 175 | 176 | /// 177 | /// Get the y that the table would need to scroll to to have a certain row at the top 178 | /// 179 | /// The desired row 180 | /// Should the top of the table be above the row or below the row? 181 | /// The y position to scroll to, can be used with scrollY property 182 | public float GetScrollYForRow(int row, bool above) { 183 | float retVal = GetCumulativeRowHeight(row); 184 | retVal += m_verticalLayoutGroup.padding.top; 185 | if (above) { 186 | retVal -= m_rowHeights[row]; 187 | } 188 | return retVal; 189 | } 190 | 191 | #endregion 192 | 193 | #region Private implementation 194 | 195 | private ITableViewDataSource m_dataSource; 196 | private bool m_requiresReload; 197 | 198 | private VerticalLayoutGroup m_verticalLayoutGroup; 199 | private ScrollRect m_scrollRect; 200 | private LayoutElement m_topContentPlaceHolder; 201 | private LayoutElement m_bottomContentPlaceholder; 202 | 203 | private float[] m_rowHeights; 204 | //cumulative[i] = sum(rowHeights[j] for 0 <= j <= i) 205 | private float[] m_cumulativeRowHeights; 206 | private int m_cleanCumulativeIndex; 207 | 208 | private Dictionary m_visibleCells; 209 | private Range m_visibleRowRange; 210 | 211 | private RectTransform m_reusableCellContainer; 212 | private Dictionary> m_reusableCells; 213 | 214 | private float m_scrollY; 215 | 216 | private bool m_requiresRefresh; 217 | 218 | private void ScrollViewValueChanged(Vector2 newScrollValue) { 219 | float relativeScroll = 1 - newScrollValue.y; 220 | m_scrollY = relativeScroll * scrollableHeight; 221 | m_requiresRefresh = true; 222 | //Debug.Log(m_scrollY.ToString(("0.00"))); 223 | } 224 | 225 | private void RecalculateVisibleRowsFromScratch() { 226 | ClearAllRows(); 227 | SetInitialVisibleRows(); 228 | } 229 | 230 | private void ClearAllRows() { 231 | while (m_visibleCells.Count > 0) { 232 | HideRow(false); 233 | } 234 | m_visibleRowRange = new Range(0, 0); 235 | } 236 | 237 | void Awake() 238 | { 239 | isEmpty = true; 240 | m_scrollRect = GetComponent(); 241 | m_verticalLayoutGroup = GetComponentInChildren(); 242 | m_topContentPlaceHolder = CreateEmptyContentPlaceHolderElement("TopContentPlaceHolder"); 243 | m_topContentPlaceHolder.transform.SetParent(m_scrollRect.content, false); 244 | m_bottomContentPlaceholder = CreateEmptyContentPlaceHolderElement("BottomContentPlaceHolder"); 245 | m_bottomContentPlaceholder.transform.SetParent(m_scrollRect.content, false); 246 | m_visibleCells = new Dictionary(); 247 | 248 | m_reusableCellContainer = new GameObject("ReusableCells", typeof(RectTransform)).GetComponent(); 249 | m_reusableCellContainer.SetParent(this.transform, false); 250 | m_reusableCellContainer.gameObject.SetActive(false); 251 | m_reusableCells = new Dictionary>(); 252 | } 253 | 254 | void Update() 255 | { 256 | if (m_requiresReload) { 257 | ReloadData(); 258 | } 259 | } 260 | 261 | void LateUpdate() { 262 | if (m_requiresRefresh) { 263 | RefreshVisibleRows(); 264 | } 265 | } 266 | 267 | void OnEnable() { 268 | m_scrollRect.onValueChanged.AddListener(ScrollViewValueChanged); 269 | } 270 | 271 | void OnDisable() { 272 | m_scrollRect.onValueChanged.RemoveListener(ScrollViewValueChanged); 273 | } 274 | 275 | private Range CalculateCurrentVisibleRowRange() 276 | { 277 | 278 | float startY = Math.Max(m_scrollY - m_verticalLayoutGroup.padding.top, 0); 279 | 280 | var visibleTopPadding = Math.Max(m_verticalLayoutGroup.padding.top - m_scrollY, 0); 281 | float endY = startY + (this.transform as RectTransform).rect.height - visibleTopPadding; 282 | 283 | int startIndex = FindIndexOfRowAtY(startY); 284 | int endIndex = FindIndexOfRowAtY(endY); 285 | 286 | return new Range(startIndex, endIndex - startIndex + 1); 287 | } 288 | 289 | private void SetInitialVisibleRows() 290 | { 291 | Range visibleRows = CalculateCurrentVisibleRowRange(); 292 | for (int i = 0; i < visibleRows.count; i++) 293 | { 294 | AddRow(visibleRows.from + i, true); 295 | } 296 | m_visibleRowRange = visibleRows; 297 | UpdatePaddingElements(); 298 | } 299 | 300 | private void AddRow(int row, bool atEnd) 301 | { 302 | TableViewCell newCell = m_dataSource.GetCellForRowInTableView(this, row); 303 | newCell.transform.SetParent(m_scrollRect.content, false); 304 | 305 | LayoutElement layoutElement = newCell.GetComponent(); 306 | if (layoutElement == null) { 307 | layoutElement = newCell.gameObject.AddComponent(); 308 | } 309 | layoutElement.preferredHeight = m_rowHeights[row]; 310 | if (row > 0) { 311 | layoutElement.preferredHeight -= m_verticalLayoutGroup.spacing; 312 | } 313 | 314 | m_visibleCells[row] = newCell; 315 | if (atEnd) { 316 | newCell.transform.SetSiblingIndex(m_scrollRect.content.childCount - 2); //One before bottom padding 317 | } else { 318 | newCell.transform.SetSiblingIndex(1); //One after the top padding 319 | } 320 | this.onCellVisibilityChanged.Invoke(row, true); 321 | } 322 | 323 | private void RefreshVisibleRows() 324 | { 325 | m_requiresRefresh = false; 326 | 327 | if (this.isEmpty) { 328 | return; 329 | } 330 | 331 | Range newVisibleRows = CalculateCurrentVisibleRowRange(); 332 | int oldTo = m_visibleRowRange.Last(); 333 | int newTo = newVisibleRows.Last(); 334 | 335 | if (newVisibleRows.from > oldTo || newTo < m_visibleRowRange.from) { 336 | //We jumped to a completely different segment this frame, destroy all and recreate 337 | RecalculateVisibleRowsFromScratch(); 338 | return; 339 | } 340 | 341 | //Remove rows that disappeared to the top 342 | for (int i = m_visibleRowRange.from; i < newVisibleRows.from; i++) 343 | { 344 | HideRow(false); 345 | } 346 | //Remove rows that disappeared to the bottom 347 | for (int i = newTo; i < oldTo; i++) 348 | { 349 | HideRow(true); 350 | } 351 | //Add rows that appeared on top 352 | for (int i = m_visibleRowRange.from - 1; i >= newVisibleRows.from; i--) { 353 | AddRow(i, false); 354 | } 355 | //Add rows that appeared on bottom 356 | for (int i = oldTo + 1; i <= newTo; i++) { 357 | AddRow(i, true); 358 | } 359 | m_visibleRowRange = newVisibleRows; 360 | UpdatePaddingElements(); 361 | } 362 | 363 | private void UpdatePaddingElements() { 364 | float hiddenElementsHeightSum = 0; 365 | 366 | for (int i = 0; i < m_visibleRowRange.from; i++) { 367 | hiddenElementsHeightSum += m_rowHeights[i]; 368 | } 369 | var topContentPlaceHolderHeight = hiddenElementsHeightSum; 370 | m_topContentPlaceHolder.preferredHeight = topContentPlaceHolderHeight; 371 | m_topContentPlaceHolder.gameObject.SetActive(m_topContentPlaceHolder.preferredHeight > 0); 372 | for (int i = m_visibleRowRange.from; i <= m_visibleRowRange.Last(); i++) { 373 | hiddenElementsHeightSum += m_rowHeights[i]; 374 | } 375 | float bottomContentPlaceHolderHeight = m_scrollRect.content.rect.height - hiddenElementsHeightSum; 376 | bottomContentPlaceHolderHeight -= m_verticalLayoutGroup.padding.top; 377 | bottomContentPlaceHolderHeight -= m_verticalLayoutGroup.padding.bottom; 378 | m_bottomContentPlaceholder.preferredHeight = bottomContentPlaceHolderHeight - m_verticalLayoutGroup.spacing; 379 | m_bottomContentPlaceholder.gameObject.SetActive( 380 | m_bottomContentPlaceholder.preferredHeight > 0); 381 | } 382 | 383 | private void HideRow(bool last) 384 | { 385 | //Debug.Log("Hiding row at scroll y " + m_scrollY.ToString("0.00")); 386 | 387 | int row = last ? m_visibleRowRange.Last() : m_visibleRowRange.from; 388 | TableViewCell removedCell = m_visibleCells[row]; 389 | StoreCellForReuse(removedCell); 390 | m_visibleCells.Remove(row); 391 | m_visibleRowRange.count -= 1; 392 | if (!last) { 393 | m_visibleRowRange.from += 1; 394 | } 395 | this.onCellVisibilityChanged.Invoke(row, false); 396 | } 397 | 398 | private LayoutElement CreateEmptyContentPlaceHolderElement(string name) 399 | { 400 | GameObject go = new GameObject(name, typeof(RectTransform), typeof(LayoutElement)); 401 | LayoutElement le = go.GetComponent(); 402 | return le; 403 | } 404 | 405 | private int FindIndexOfRowAtY(float y) { 406 | //TODO : Binary search if inside clean cumulative row height area, else walk until found. 407 | return FindIndexOfRowAtY(y, 0, m_cumulativeRowHeights.Length - 1); 408 | } 409 | 410 | private int FindIndexOfRowAtY(float y, int startIndex, int endIndex) { 411 | if (startIndex >= endIndex) { 412 | return startIndex; 413 | } 414 | int midIndex = (startIndex + endIndex) / 2; 415 | if (GetCumulativeRowHeight(midIndex) >= y) { 416 | return FindIndexOfRowAtY(y, startIndex, midIndex); 417 | } else { 418 | return FindIndexOfRowAtY(y, midIndex + 1, endIndex); 419 | } 420 | } 421 | 422 | private float GetCumulativeRowHeight(int row) { 423 | while (m_cleanCumulativeIndex < row) { 424 | m_cleanCumulativeIndex++; 425 | //Debug.Log("Cumulative index : " + m_cleanCumulativeIndex.ToString()); 426 | m_cumulativeRowHeights[m_cleanCumulativeIndex] = m_rowHeights[m_cleanCumulativeIndex]; 427 | if (m_cleanCumulativeIndex > 0) { 428 | m_cumulativeRowHeights[m_cleanCumulativeIndex] += m_cumulativeRowHeights[m_cleanCumulativeIndex - 1]; 429 | } 430 | } 431 | return m_cumulativeRowHeights[row]; 432 | } 433 | 434 | private void StoreCellForReuse(TableViewCell cell) { 435 | string reuseIdentifier = cell.reuseIdentifier; 436 | 437 | if (string.IsNullOrEmpty(reuseIdentifier)) { 438 | GameObject.Destroy(cell.gameObject); 439 | return; 440 | } 441 | 442 | if (!m_reusableCells.ContainsKey(reuseIdentifier)) { 443 | m_reusableCells.Add(reuseIdentifier, new LinkedList()); 444 | } 445 | m_reusableCells[reuseIdentifier].AddLast(cell); 446 | cell.transform.SetParent(m_reusableCellContainer, false); 447 | } 448 | 449 | #endregion 450 | 451 | 452 | 453 | } 454 | 455 | internal static class RangeExtensions 456 | { 457 | public static int Last(this Range range) 458 | { 459 | if (range.count == 0) 460 | { 461 | throw new System.InvalidOperationException("Empty range has no to()"); 462 | } 463 | return (range.from + range.count - 1); 464 | } 465 | 466 | public static bool Contains(this Range range, int num) { 467 | return num >= range.from && num < (range.from + range.count); 468 | } 469 | } 470 | } 471 | -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/TableView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18010fb76e0c342e686e1143110d6ac5 3 | timeCreated: 1472559286 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/TableViewCell.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | 5 | namespace Tacticsoft 6 | { 7 | /// 8 | /// The base class for cells in a TableView. ITableViewDataSource returns pointers 9 | /// to these objects 10 | /// 11 | public class TableViewCell : MonoBehaviour 12 | { 13 | /// 14 | /// TableView will cache unused cells and reuse them according to their 15 | /// reuse identifier. Override this to add custom cache grouping logic. 16 | /// 17 | public virtual string reuseIdentifier { 18 | get { 19 | return this.GetType().Name; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Dependencies/TSTableView/TableViewCell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 747424aa8325b4e66b1519f6d0c53d81 3 | timeCreated: 1472559286 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prefabs/InventoryCellPrefab.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000012312357288} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000010437920800 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 224: {fileID: 224000013570101424} 22 | - 222: {fileID: 222000010248140310} 23 | - 114: {fileID: 114000013572872882} 24 | - 114: {fileID: 114000011147225522} 25 | m_Layer: 5 26 | m_Name: Button 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!1 &1000012312357288 33 | GameObject: 34 | m_ObjectHideFlags: 0 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | serializedVersion: 4 38 | m_Component: 39 | - 224: {fileID: 224000010748435472} 40 | - 114: {fileID: 114000012629349416} 41 | m_Layer: 5 42 | m_Name: InventoryCellPrefab 43 | m_TagString: Untagged 44 | m_Icon: {fileID: 0} 45 | m_NavMeshLayer: 0 46 | m_StaticEditorFlags: 0 47 | m_IsActive: 1 48 | --- !u!1 &1000012472386446 49 | GameObject: 50 | m_ObjectHideFlags: 0 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 100100000} 53 | serializedVersion: 4 54 | m_Component: 55 | - 224: {fileID: 224000010502354110} 56 | - 222: {fileID: 222000011855083494} 57 | - 114: {fileID: 114000013534120506} 58 | m_Layer: 5 59 | m_Name: Image 60 | m_TagString: Untagged 61 | m_Icon: {fileID: 0} 62 | m_NavMeshLayer: 0 63 | m_StaticEditorFlags: 0 64 | m_IsActive: 1 65 | --- !u!1 &1000012623759948 66 | GameObject: 67 | m_ObjectHideFlags: 0 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | serializedVersion: 4 71 | m_Component: 72 | - 224: {fileID: 224000010248830086} 73 | - 222: {fileID: 222000010202508964} 74 | - 114: {fileID: 114000013939998824} 75 | m_Layer: 5 76 | m_Name: Name 77 | m_TagString: Untagged 78 | m_Icon: {fileID: 0} 79 | m_NavMeshLayer: 0 80 | m_StaticEditorFlags: 0 81 | m_IsActive: 1 82 | --- !u!1 &1000013357142448 83 | GameObject: 84 | m_ObjectHideFlags: 0 85 | m_PrefabParentObject: {fileID: 0} 86 | m_PrefabInternal: {fileID: 100100000} 87 | serializedVersion: 4 88 | m_Component: 89 | - 224: {fileID: 224000012647149042} 90 | - 222: {fileID: 222000014251763454} 91 | - 114: {fileID: 114000011077488226} 92 | m_Layer: 5 93 | m_Name: Amount 94 | m_TagString: Untagged 95 | m_Icon: {fileID: 0} 96 | m_NavMeshLayer: 0 97 | m_StaticEditorFlags: 0 98 | m_IsActive: 1 99 | --- !u!114 &114000011077488226 100 | MonoBehaviour: 101 | m_ObjectHideFlags: 1 102 | m_PrefabParentObject: {fileID: 0} 103 | m_PrefabInternal: {fileID: 100100000} 104 | m_GameObject: {fileID: 1000013357142448} 105 | m_Enabled: 1 106 | m_EditorHideFlags: 0 107 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 108 | m_Name: 109 | m_EditorClassIdentifier: 110 | m_Material: {fileID: 0} 111 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 112 | m_RaycastTarget: 1 113 | m_OnCullStateChanged: 114 | m_PersistentCalls: 115 | m_Calls: [] 116 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 117 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 118 | m_FontData: 119 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 120 | m_FontSize: 14 121 | m_FontStyle: 0 122 | m_BestFit: 0 123 | m_MinSize: 10 124 | m_MaxSize: 40 125 | m_Alignment: 4 126 | m_AlignByGeometry: 0 127 | m_RichText: 1 128 | m_HorizontalOverflow: 0 129 | m_VerticalOverflow: 0 130 | m_LineSpacing: 1 131 | m_Text: 0 132 | --- !u!114 &114000011147225522 133 | MonoBehaviour: 134 | m_ObjectHideFlags: 1 135 | m_PrefabParentObject: {fileID: 0} 136 | m_PrefabInternal: {fileID: 100100000} 137 | m_GameObject: {fileID: 1000010437920800} 138 | m_Enabled: 1 139 | m_EditorHideFlags: 0 140 | m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 141 | m_Name: 142 | m_EditorClassIdentifier: 143 | m_Navigation: 144 | m_Mode: 3 145 | m_SelectOnUp: {fileID: 0} 146 | m_SelectOnDown: {fileID: 0} 147 | m_SelectOnLeft: {fileID: 0} 148 | m_SelectOnRight: {fileID: 0} 149 | m_Transition: 0 150 | m_Colors: 151 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 152 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 153 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 154 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 155 | m_ColorMultiplier: 1 156 | m_FadeDuration: 0.1 157 | m_SpriteState: 158 | m_HighlightedSprite: {fileID: 0} 159 | m_PressedSprite: {fileID: 0} 160 | m_DisabledSprite: {fileID: 0} 161 | m_AnimationTriggers: 162 | m_NormalTrigger: Normal 163 | m_HighlightedTrigger: Highlighted 164 | m_PressedTrigger: Pressed 165 | m_DisabledTrigger: Disabled 166 | m_Interactable: 1 167 | m_TargetGraphic: {fileID: 114000013572872882} 168 | m_OnClick: 169 | m_PersistentCalls: 170 | m_Calls: 171 | - m_Target: {fileID: 0} 172 | m_MethodName: OnSelectedRow 173 | m_Mode: 2 174 | m_Arguments: 175 | m_ObjectArgument: {fileID: 114000011147225522} 176 | m_ObjectArgumentAssemblyTypeName: UnityEngine.UI.Button, UnityEngine.UI 177 | m_IntArgument: 0 178 | m_FloatArgument: 0 179 | m_StringArgument: 180 | m_BoolArgument: 0 181 | m_CallState: 2 182 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 183 | Culture=neutral, PublicKeyToken=null 184 | --- !u!114 &114000012629349416 185 | MonoBehaviour: 186 | m_ObjectHideFlags: 1 187 | m_PrefabParentObject: {fileID: 0} 188 | m_PrefabInternal: {fileID: 100100000} 189 | m_GameObject: {fileID: 1000012312357288} 190 | m_Enabled: 1 191 | m_EditorHideFlags: 0 192 | m_Script: {fileID: 11500000, guid: 177d64a8e263e4ca990b0b5b61fd989a, type: 3} 193 | m_Name: 194 | m_EditorClassIdentifier: 195 | Icon: {fileID: 114000013534120506} 196 | Name: {fileID: 114000013939998824} 197 | Amount: {fileID: 114000011077488226} 198 | Btn: {fileID: 114000011147225522} 199 | --- !u!114 &114000013534120506 200 | MonoBehaviour: 201 | m_ObjectHideFlags: 1 202 | m_PrefabParentObject: {fileID: 0} 203 | m_PrefabInternal: {fileID: 100100000} 204 | m_GameObject: {fileID: 1000012472386446} 205 | m_Enabled: 1 206 | m_EditorHideFlags: 0 207 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 208 | m_Name: 209 | m_EditorClassIdentifier: 210 | m_Material: {fileID: 0} 211 | m_Color: {r: 1, g: 1, b: 1, a: 1} 212 | m_RaycastTarget: 1 213 | m_OnCullStateChanged: 214 | m_PersistentCalls: 215 | m_Calls: [] 216 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 217 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 218 | m_Sprite: {fileID: 0} 219 | m_Type: 0 220 | m_PreserveAspect: 0 221 | m_FillCenter: 1 222 | m_FillMethod: 4 223 | m_FillAmount: 1 224 | m_FillClockwise: 1 225 | m_FillOrigin: 0 226 | --- !u!114 &114000013572872882 227 | MonoBehaviour: 228 | m_ObjectHideFlags: 1 229 | m_PrefabParentObject: {fileID: 0} 230 | m_PrefabInternal: {fileID: 100100000} 231 | m_GameObject: {fileID: 1000010437920800} 232 | m_Enabled: 1 233 | m_EditorHideFlags: 0 234 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 235 | m_Name: 236 | m_EditorClassIdentifier: 237 | m_Material: {fileID: 0} 238 | m_Color: {r: 1, g: 1, b: 1, a: 0} 239 | m_RaycastTarget: 1 240 | m_OnCullStateChanged: 241 | m_PersistentCalls: 242 | m_Calls: [] 243 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 244 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 245 | m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} 246 | m_Type: 1 247 | m_PreserveAspect: 0 248 | m_FillCenter: 1 249 | m_FillMethod: 4 250 | m_FillAmount: 1 251 | m_FillClockwise: 1 252 | m_FillOrigin: 0 253 | --- !u!114 &114000013939998824 254 | MonoBehaviour: 255 | m_ObjectHideFlags: 1 256 | m_PrefabParentObject: {fileID: 0} 257 | m_PrefabInternal: {fileID: 100100000} 258 | m_GameObject: {fileID: 1000012623759948} 259 | m_Enabled: 1 260 | m_EditorHideFlags: 0 261 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 262 | m_Name: 263 | m_EditorClassIdentifier: 264 | m_Material: {fileID: 0} 265 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 266 | m_RaycastTarget: 1 267 | m_OnCullStateChanged: 268 | m_PersistentCalls: 269 | m_Calls: [] 270 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 271 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 272 | m_FontData: 273 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 274 | m_FontSize: 14 275 | m_FontStyle: 0 276 | m_BestFit: 0 277 | m_MinSize: 10 278 | m_MaxSize: 40 279 | m_Alignment: 3 280 | m_AlignByGeometry: 0 281 | m_RichText: 1 282 | m_HorizontalOverflow: 0 283 | m_VerticalOverflow: 0 284 | m_LineSpacing: 1 285 | m_Text: Name 286 | --- !u!222 &222000010202508964 287 | CanvasRenderer: 288 | m_ObjectHideFlags: 1 289 | m_PrefabParentObject: {fileID: 0} 290 | m_PrefabInternal: {fileID: 100100000} 291 | m_GameObject: {fileID: 1000012623759948} 292 | --- !u!222 &222000010248140310 293 | CanvasRenderer: 294 | m_ObjectHideFlags: 1 295 | m_PrefabParentObject: {fileID: 0} 296 | m_PrefabInternal: {fileID: 100100000} 297 | m_GameObject: {fileID: 1000010437920800} 298 | --- !u!222 &222000011855083494 299 | CanvasRenderer: 300 | m_ObjectHideFlags: 1 301 | m_PrefabParentObject: {fileID: 0} 302 | m_PrefabInternal: {fileID: 100100000} 303 | m_GameObject: {fileID: 1000012472386446} 304 | --- !u!222 &222000014251763454 305 | CanvasRenderer: 306 | m_ObjectHideFlags: 1 307 | m_PrefabParentObject: {fileID: 0} 308 | m_PrefabInternal: {fileID: 100100000} 309 | m_GameObject: {fileID: 1000013357142448} 310 | --- !u!224 &224000010248830086 311 | RectTransform: 312 | m_ObjectHideFlags: 1 313 | m_PrefabParentObject: {fileID: 0} 314 | m_PrefabInternal: {fileID: 100100000} 315 | m_GameObject: {fileID: 1000012623759948} 316 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 317 | m_LocalPosition: {x: 0, y: 0, z: 0} 318 | m_LocalScale: {x: 1, y: 1, z: 1} 319 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 320 | m_Children: [] 321 | m_Father: {fileID: 224000010748435472} 322 | m_RootOrder: 0 323 | m_AnchorMin: {x: 0, y: 0.5} 324 | m_AnchorMax: {x: 0, y: 0.5} 325 | m_AnchoredPosition: {x: 110, y: 0} 326 | m_SizeDelta: {x: 150, y: 30} 327 | m_Pivot: {x: 0, y: 0.5} 328 | --- !u!224 &224000010502354110 329 | RectTransform: 330 | m_ObjectHideFlags: 1 331 | m_PrefabParentObject: {fileID: 0} 332 | m_PrefabInternal: {fileID: 100100000} 333 | m_GameObject: {fileID: 1000012472386446} 334 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 335 | m_LocalPosition: {x: 0, y: 0, z: 0} 336 | m_LocalScale: {x: 1, y: 1, z: 1} 337 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 338 | m_Children: [] 339 | m_Father: {fileID: 224000010748435472} 340 | m_RootOrder: 2 341 | m_AnchorMin: {x: 0, y: 1} 342 | m_AnchorMax: {x: 0, y: 1} 343 | m_AnchoredPosition: {x: 0, y: 0} 344 | m_SizeDelta: {x: 100, y: 100} 345 | m_Pivot: {x: 0, y: 1} 346 | --- !u!224 &224000010748435472 347 | RectTransform: 348 | m_ObjectHideFlags: 1 349 | m_PrefabParentObject: {fileID: 0} 350 | m_PrefabInternal: {fileID: 100100000} 351 | m_GameObject: {fileID: 1000012312357288} 352 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 353 | m_LocalPosition: {x: 0, y: 0, z: 0} 354 | m_LocalScale: {x: 1, y: 1, z: 1} 355 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 356 | m_Children: 357 | - {fileID: 224000010248830086} 358 | - {fileID: 224000012647149042} 359 | - {fileID: 224000010502354110} 360 | - {fileID: 224000013570101424} 361 | m_Father: {fileID: 0} 362 | m_RootOrder: 0 363 | m_AnchorMin: {x: 0, y: 1} 364 | m_AnchorMax: {x: 1, y: 1} 365 | m_AnchoredPosition: {x: 0, y: 0} 366 | m_SizeDelta: {x: 0, y: 100} 367 | m_Pivot: {x: 0.5, y: 1} 368 | --- !u!224 &224000012647149042 369 | RectTransform: 370 | m_ObjectHideFlags: 1 371 | m_PrefabParentObject: {fileID: 0} 372 | m_PrefabInternal: {fileID: 100100000} 373 | m_GameObject: {fileID: 1000013357142448} 374 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 375 | m_LocalPosition: {x: 0, y: 0, z: 0} 376 | m_LocalScale: {x: 1, y: 1, z: 1} 377 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 378 | m_Children: [] 379 | m_Father: {fileID: 224000010748435472} 380 | m_RootOrder: 1 381 | m_AnchorMin: {x: 1, y: 0.5} 382 | m_AnchorMax: {x: 1, y: 0.5} 383 | m_AnchoredPosition: {x: -10, y: 0} 384 | m_SizeDelta: {x: 40, y: 30} 385 | m_Pivot: {x: 1, y: 0.5} 386 | --- !u!224 &224000013570101424 387 | RectTransform: 388 | m_ObjectHideFlags: 1 389 | m_PrefabParentObject: {fileID: 0} 390 | m_PrefabInternal: {fileID: 100100000} 391 | m_GameObject: {fileID: 1000010437920800} 392 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 393 | m_LocalPosition: {x: 0, y: 0, z: 0} 394 | m_LocalScale: {x: 1, y: 1, z: 1} 395 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 396 | m_Children: [] 397 | m_Father: {fileID: 224000010748435472} 398 | m_RootOrder: 3 399 | m_AnchorMin: {x: 0, y: 0} 400 | m_AnchorMax: {x: 1, y: 1} 401 | m_AnchoredPosition: {x: 0, y: 0} 402 | m_SizeDelta: {x: 0, y: 0} 403 | m_Pivot: {x: 0.5, y: 0.5} 404 | -------------------------------------------------------------------------------- /Assets/Prefabs/InventoryCellPrefab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12c9eea2c160344a6a029a56e0f71554 3 | timeCreated: 1472734344 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/ModalAlertPrefab.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000012070912898} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000011089776920 15 | GameObject: 16 | m_ObjectHideFlags: 1 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 224: {fileID: 224000014215961246} 22 | - 222: {fileID: 222000010257610410} 23 | - 114: {fileID: 114000011498193156} 24 | m_Layer: 5 25 | m_Name: Titlebar 26 | m_TagString: Untagged 27 | m_Icon: {fileID: 0} 28 | m_NavMeshLayer: 0 29 | m_StaticEditorFlags: 0 30 | m_IsActive: 1 31 | --- !u!1 &1000011716008726 32 | GameObject: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | serializedVersion: 4 37 | m_Component: 38 | - 224: {fileID: 224000010569778424} 39 | - 222: {fileID: 222000013252428076} 40 | - 114: {fileID: 114000010813270782} 41 | - 114: {fileID: 114000011232059918} 42 | m_Layer: 5 43 | m_Name: Panel 44 | m_TagString: Untagged 45 | m_Icon: {fileID: 0} 46 | m_NavMeshLayer: 0 47 | m_StaticEditorFlags: 0 48 | m_IsActive: 1 49 | --- !u!1 &1000011755443164 50 | GameObject: 51 | m_ObjectHideFlags: 1 52 | m_PrefabParentObject: {fileID: 0} 53 | m_PrefabInternal: {fileID: 100100000} 54 | serializedVersion: 4 55 | m_Component: 56 | - 224: {fileID: 224000011274004814} 57 | - 222: {fileID: 222000013754946306} 58 | - 114: {fileID: 114000011998085786} 59 | - 114: {fileID: 114000012078576088} 60 | m_Layer: 5 61 | m_Name: Button 62 | m_TagString: Untagged 63 | m_Icon: {fileID: 0} 64 | m_NavMeshLayer: 0 65 | m_StaticEditorFlags: 0 66 | m_IsActive: 1 67 | --- !u!1 &1000012063562160 68 | GameObject: 69 | m_ObjectHideFlags: 1 70 | m_PrefabParentObject: {fileID: 0} 71 | m_PrefabInternal: {fileID: 100100000} 72 | serializedVersion: 4 73 | m_Component: 74 | - 224: {fileID: 224000010746157822} 75 | - 222: {fileID: 222000012143035968} 76 | - 114: {fileID: 114000011798170782} 77 | m_Layer: 5 78 | m_Name: Message 79 | m_TagString: Untagged 80 | m_Icon: {fileID: 0} 81 | m_NavMeshLayer: 0 82 | m_StaticEditorFlags: 0 83 | m_IsActive: 1 84 | --- !u!1 &1000012070912898 85 | GameObject: 86 | m_ObjectHideFlags: 0 87 | m_PrefabParentObject: {fileID: 0} 88 | m_PrefabInternal: {fileID: 100100000} 89 | serializedVersion: 4 90 | m_Component: 91 | - 224: {fileID: 224000010049342376} 92 | - 225: {fileID: 225000012675650068} 93 | - 114: {fileID: 114000010377488140} 94 | m_Layer: 5 95 | m_Name: ModalAlertPrefab 96 | m_TagString: Untagged 97 | m_Icon: {fileID: 0} 98 | m_NavMeshLayer: 0 99 | m_StaticEditorFlags: 0 100 | m_IsActive: 1 101 | --- !u!1 &1000012495228148 102 | GameObject: 103 | m_ObjectHideFlags: 0 104 | m_PrefabParentObject: {fileID: 0} 105 | m_PrefabInternal: {fileID: 100100000} 106 | serializedVersion: 4 107 | m_Component: 108 | - 224: {fileID: 224000011290247416} 109 | - 222: {fileID: 222000013497035356} 110 | - 114: {fileID: 114000012577181270} 111 | m_Layer: 5 112 | m_Name: Panel 113 | m_TagString: Untagged 114 | m_Icon: {fileID: 0} 115 | m_NavMeshLayer: 0 116 | m_StaticEditorFlags: 0 117 | m_IsActive: 1 118 | --- !u!1 &1000012848247716 119 | GameObject: 120 | m_ObjectHideFlags: 1 121 | m_PrefabParentObject: {fileID: 0} 122 | m_PrefabInternal: {fileID: 100100000} 123 | serializedVersion: 4 124 | m_Component: 125 | - 224: {fileID: 224000013830866636} 126 | - 222: {fileID: 222000013332170004} 127 | - 114: {fileID: 114000010679521068} 128 | m_Layer: 5 129 | m_Name: Title 130 | m_TagString: Untagged 131 | m_Icon: {fileID: 0} 132 | m_NavMeshLayer: 0 133 | m_StaticEditorFlags: 0 134 | m_IsActive: 1 135 | --- !u!1 &1000013097713182 136 | GameObject: 137 | m_ObjectHideFlags: 1 138 | m_PrefabParentObject: {fileID: 0} 139 | m_PrefabInternal: {fileID: 100100000} 140 | serializedVersion: 4 141 | m_Component: 142 | - 224: {fileID: 224000011202324464} 143 | - 114: {fileID: 114000014265073946} 144 | m_Layer: 5 145 | m_Name: ButtonActions 146 | m_TagString: Untagged 147 | m_Icon: {fileID: 0} 148 | m_NavMeshLayer: 0 149 | m_StaticEditorFlags: 0 150 | m_IsActive: 1 151 | --- !u!1 &1000013415775542 152 | GameObject: 153 | m_ObjectHideFlags: 0 154 | m_PrefabParentObject: {fileID: 0} 155 | m_PrefabInternal: {fileID: 100100000} 156 | serializedVersion: 4 157 | m_Component: 158 | - 224: {fileID: 224000011961785600} 159 | m_Layer: 5 160 | m_Name: ModalAlertContainer 161 | m_TagString: Untagged 162 | m_Icon: {fileID: 0} 163 | m_NavMeshLayer: 0 164 | m_StaticEditorFlags: 0 165 | m_IsActive: 1 166 | --- !u!1 &1000014242889718 167 | GameObject: 168 | m_ObjectHideFlags: 1 169 | m_PrefabParentObject: {fileID: 0} 170 | m_PrefabInternal: {fileID: 100100000} 171 | serializedVersion: 4 172 | m_Component: 173 | - 224: {fileID: 224000011453639008} 174 | - 222: {fileID: 222000011407594942} 175 | - 114: {fileID: 114000011516887694} 176 | m_Layer: 5 177 | m_Name: Text 178 | m_TagString: Untagged 179 | m_Icon: {fileID: 0} 180 | m_NavMeshLayer: 0 181 | m_StaticEditorFlags: 0 182 | m_IsActive: 1 183 | --- !u!114 &114000010377488140 184 | MonoBehaviour: 185 | m_ObjectHideFlags: 1 186 | m_PrefabParentObject: {fileID: 0} 187 | m_PrefabInternal: {fileID: 100100000} 188 | m_GameObject: {fileID: 1000012070912898} 189 | m_Enabled: 1 190 | m_EditorHideFlags: 0 191 | m_Script: {fileID: 11500000, guid: a8c37c862afa141ec965ca1369e5eb2f, type: 3} 192 | m_Name: 193 | m_EditorClassIdentifier: 194 | titleBox: {fileID: 114000010679521068} 195 | messageBox: {fileID: 114000011798170782} 196 | --- !u!114 &114000010679521068 197 | MonoBehaviour: 198 | m_ObjectHideFlags: 1 199 | m_PrefabParentObject: {fileID: 0} 200 | m_PrefabInternal: {fileID: 100100000} 201 | m_GameObject: {fileID: 1000012848247716} 202 | m_Enabled: 1 203 | m_EditorHideFlags: 0 204 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 205 | m_Name: 206 | m_EditorClassIdentifier: 207 | m_Material: {fileID: 0} 208 | m_Color: {r: 1, g: 1, b: 1, a: 1} 209 | m_RaycastTarget: 1 210 | m_OnCullStateChanged: 211 | m_PersistentCalls: 212 | m_Calls: [] 213 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 214 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 215 | m_FontData: 216 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 217 | m_FontSize: 14 218 | m_FontStyle: 1 219 | m_BestFit: 0 220 | m_MinSize: 10 221 | m_MaxSize: 40 222 | m_Alignment: 4 223 | m_AlignByGeometry: 0 224 | m_RichText: 1 225 | m_HorizontalOverflow: 0 226 | m_VerticalOverflow: 0 227 | m_LineSpacing: 1 228 | m_Text: Title 229 | --- !u!114 &114000010813270782 230 | MonoBehaviour: 231 | m_ObjectHideFlags: 1 232 | m_PrefabParentObject: {fileID: 0} 233 | m_PrefabInternal: {fileID: 100100000} 234 | m_GameObject: {fileID: 1000011716008726} 235 | m_Enabled: 1 236 | m_EditorHideFlags: 0 237 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 238 | m_Name: 239 | m_EditorClassIdentifier: 240 | m_Material: {fileID: 0} 241 | m_Color: {r: 0.5441177, g: 0.5441177, b: 0.5441177, a: 1} 242 | m_RaycastTarget: 1 243 | m_OnCullStateChanged: 244 | m_PersistentCalls: 245 | m_Calls: [] 246 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 247 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 248 | m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} 249 | m_Type: 1 250 | m_PreserveAspect: 0 251 | m_FillCenter: 1 252 | m_FillMethod: 4 253 | m_FillAmount: 1 254 | m_FillClockwise: 1 255 | m_FillOrigin: 0 256 | --- !u!114 &114000011232059918 257 | MonoBehaviour: 258 | m_ObjectHideFlags: 1 259 | m_PrefabParentObject: {fileID: 0} 260 | m_PrefabInternal: {fileID: 100100000} 261 | m_GameObject: {fileID: 1000011716008726} 262 | m_Enabled: 1 263 | m_EditorHideFlags: 0 264 | m_Script: {fileID: 1573420865, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 265 | m_Name: 266 | m_EditorClassIdentifier: 267 | m_EffectColor: {r: 0, g: 0, b: 0, a: 0.11764706} 268 | m_EffectDistance: {x: 2, y: -2} 269 | m_UseGraphicAlpha: 1 270 | --- !u!114 &114000011498193156 271 | MonoBehaviour: 272 | m_ObjectHideFlags: 1 273 | m_PrefabParentObject: {fileID: 0} 274 | m_PrefabInternal: {fileID: 100100000} 275 | m_GameObject: {fileID: 1000011089776920} 276 | m_Enabled: 1 277 | m_EditorHideFlags: 0 278 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 279 | m_Name: 280 | m_EditorClassIdentifier: 281 | m_Material: {fileID: 0} 282 | m_Color: {r: 0.27205884, g: 0.27205884, b: 0.27205884, a: 1} 283 | m_RaycastTarget: 1 284 | m_OnCullStateChanged: 285 | m_PersistentCalls: 286 | m_Calls: [] 287 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 288 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 289 | m_Sprite: {fileID: 0} 290 | m_Type: 0 291 | m_PreserveAspect: 0 292 | m_FillCenter: 1 293 | m_FillMethod: 4 294 | m_FillAmount: 1 295 | m_FillClockwise: 1 296 | m_FillOrigin: 0 297 | --- !u!114 &114000011516887694 298 | MonoBehaviour: 299 | m_ObjectHideFlags: 1 300 | m_PrefabParentObject: {fileID: 0} 301 | m_PrefabInternal: {fileID: 100100000} 302 | m_GameObject: {fileID: 1000014242889718} 303 | m_Enabled: 1 304 | m_EditorHideFlags: 0 305 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 306 | m_Name: 307 | m_EditorClassIdentifier: 308 | m_Material: {fileID: 0} 309 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 310 | m_RaycastTarget: 1 311 | m_OnCullStateChanged: 312 | m_PersistentCalls: 313 | m_Calls: [] 314 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 315 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 316 | m_FontData: 317 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 318 | m_FontSize: 14 319 | m_FontStyle: 0 320 | m_BestFit: 0 321 | m_MinSize: 10 322 | m_MaxSize: 40 323 | m_Alignment: 4 324 | m_AlignByGeometry: 0 325 | m_RichText: 1 326 | m_HorizontalOverflow: 0 327 | m_VerticalOverflow: 0 328 | m_LineSpacing: 1 329 | m_Text: OK 330 | --- !u!114 &114000011798170782 331 | MonoBehaviour: 332 | m_ObjectHideFlags: 1 333 | m_PrefabParentObject: {fileID: 0} 334 | m_PrefabInternal: {fileID: 100100000} 335 | m_GameObject: {fileID: 1000012063562160} 336 | m_Enabled: 1 337 | m_EditorHideFlags: 0 338 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 339 | m_Name: 340 | m_EditorClassIdentifier: 341 | m_Material: {fileID: 0} 342 | m_Color: {r: 1, g: 1, b: 1, a: 1} 343 | m_RaycastTarget: 1 344 | m_OnCullStateChanged: 345 | m_PersistentCalls: 346 | m_Calls: [] 347 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 348 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 349 | m_FontData: 350 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 351 | m_FontSize: 24 352 | m_FontStyle: 0 353 | m_BestFit: 0 354 | m_MinSize: 1 355 | m_MaxSize: 40 356 | m_Alignment: 0 357 | m_AlignByGeometry: 0 358 | m_RichText: 1 359 | m_HorizontalOverflow: 0 360 | m_VerticalOverflow: 0 361 | m_LineSpacing: 1 362 | m_Text: Message text 363 | --- !u!114 &114000011998085786 364 | MonoBehaviour: 365 | m_ObjectHideFlags: 1 366 | m_PrefabParentObject: {fileID: 0} 367 | m_PrefabInternal: {fileID: 100100000} 368 | m_GameObject: {fileID: 1000011755443164} 369 | m_Enabled: 1 370 | m_EditorHideFlags: 0 371 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 372 | m_Name: 373 | m_EditorClassIdentifier: 374 | m_Material: {fileID: 0} 375 | m_Color: {r: 1, g: 1, b: 1, a: 1} 376 | m_RaycastTarget: 1 377 | m_OnCullStateChanged: 378 | m_PersistentCalls: 379 | m_Calls: [] 380 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 381 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 382 | m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} 383 | m_Type: 1 384 | m_PreserveAspect: 0 385 | m_FillCenter: 1 386 | m_FillMethod: 4 387 | m_FillAmount: 1 388 | m_FillClockwise: 1 389 | m_FillOrigin: 0 390 | --- !u!114 &114000012078576088 391 | MonoBehaviour: 392 | m_ObjectHideFlags: 1 393 | m_PrefabParentObject: {fileID: 0} 394 | m_PrefabInternal: {fileID: 100100000} 395 | m_GameObject: {fileID: 1000011755443164} 396 | m_Enabled: 1 397 | m_EditorHideFlags: 0 398 | m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 399 | m_Name: 400 | m_EditorClassIdentifier: 401 | m_Navigation: 402 | m_Mode: 3 403 | m_SelectOnUp: {fileID: 0} 404 | m_SelectOnDown: {fileID: 0} 405 | m_SelectOnLeft: {fileID: 0} 406 | m_SelectOnRight: {fileID: 0} 407 | m_Transition: 1 408 | m_Colors: 409 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 410 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 411 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 412 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 413 | m_ColorMultiplier: 1 414 | m_FadeDuration: 0.1 415 | m_SpriteState: 416 | m_HighlightedSprite: {fileID: 0} 417 | m_PressedSprite: {fileID: 0} 418 | m_DisabledSprite: {fileID: 0} 419 | m_AnimationTriggers: 420 | m_NormalTrigger: Normal 421 | m_HighlightedTrigger: Highlighted 422 | m_PressedTrigger: Pressed 423 | m_DisabledTrigger: Disabled 424 | m_Interactable: 1 425 | m_TargetGraphic: {fileID: 114000011998085786} 426 | m_OnClick: 427 | m_PersistentCalls: 428 | m_Calls: 429 | - m_Target: {fileID: 114000010377488140} 430 | m_MethodName: Close 431 | m_Mode: 1 432 | m_Arguments: 433 | m_ObjectArgument: {fileID: 0} 434 | m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine 435 | m_IntArgument: 0 436 | m_FloatArgument: 0 437 | m_StringArgument: 438 | m_BoolArgument: 0 439 | m_CallState: 2 440 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 441 | Culture=neutral, PublicKeyToken=null 442 | --- !u!114 &114000012577181270 443 | MonoBehaviour: 444 | m_ObjectHideFlags: 1 445 | m_PrefabParentObject: {fileID: 0} 446 | m_PrefabInternal: {fileID: 100100000} 447 | m_GameObject: {fileID: 1000012495228148} 448 | m_Enabled: 1 449 | m_EditorHideFlags: 0 450 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 451 | m_Name: 452 | m_EditorClassIdentifier: 453 | m_Material: {fileID: 0} 454 | m_Color: {r: 0.375, g: 0.375, b: 0.375, a: 0.784} 455 | m_RaycastTarget: 1 456 | m_OnCullStateChanged: 457 | m_PersistentCalls: 458 | m_Calls: [] 459 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 460 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 461 | m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} 462 | m_Type: 1 463 | m_PreserveAspect: 0 464 | m_FillCenter: 1 465 | m_FillMethod: 4 466 | m_FillAmount: 1 467 | m_FillClockwise: 1 468 | m_FillOrigin: 0 469 | --- !u!114 &114000014265073946 470 | MonoBehaviour: 471 | m_ObjectHideFlags: 1 472 | m_PrefabParentObject: {fileID: 0} 473 | m_PrefabInternal: {fileID: 100100000} 474 | m_GameObject: {fileID: 1000013097713182} 475 | m_Enabled: 1 476 | m_EditorHideFlags: 0 477 | m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 478 | m_Name: 479 | m_EditorClassIdentifier: 480 | m_Padding: 481 | m_Left: 0 482 | m_Right: 0 483 | m_Top: 0 484 | m_Bottom: 0 485 | m_ChildAlignment: 0 486 | m_Spacing: 10 487 | m_ChildForceExpandWidth: 1 488 | m_ChildForceExpandHeight: 1 489 | --- !u!222 &222000010257610410 490 | CanvasRenderer: 491 | m_ObjectHideFlags: 1 492 | m_PrefabParentObject: {fileID: 0} 493 | m_PrefabInternal: {fileID: 100100000} 494 | m_GameObject: {fileID: 1000011089776920} 495 | --- !u!222 &222000011407594942 496 | CanvasRenderer: 497 | m_ObjectHideFlags: 1 498 | m_PrefabParentObject: {fileID: 0} 499 | m_PrefabInternal: {fileID: 100100000} 500 | m_GameObject: {fileID: 1000014242889718} 501 | --- !u!222 &222000012143035968 502 | CanvasRenderer: 503 | m_ObjectHideFlags: 1 504 | m_PrefabParentObject: {fileID: 0} 505 | m_PrefabInternal: {fileID: 100100000} 506 | m_GameObject: {fileID: 1000012063562160} 507 | --- !u!222 &222000013252428076 508 | CanvasRenderer: 509 | m_ObjectHideFlags: 1 510 | m_PrefabParentObject: {fileID: 0} 511 | m_PrefabInternal: {fileID: 100100000} 512 | m_GameObject: {fileID: 1000011716008726} 513 | --- !u!222 &222000013332170004 514 | CanvasRenderer: 515 | m_ObjectHideFlags: 1 516 | m_PrefabParentObject: {fileID: 0} 517 | m_PrefabInternal: {fileID: 100100000} 518 | m_GameObject: {fileID: 1000012848247716} 519 | --- !u!222 &222000013497035356 520 | CanvasRenderer: 521 | m_ObjectHideFlags: 1 522 | m_PrefabParentObject: {fileID: 0} 523 | m_PrefabInternal: {fileID: 100100000} 524 | m_GameObject: {fileID: 1000012495228148} 525 | --- !u!222 &222000013754946306 526 | CanvasRenderer: 527 | m_ObjectHideFlags: 1 528 | m_PrefabParentObject: {fileID: 0} 529 | m_PrefabInternal: {fileID: 100100000} 530 | m_GameObject: {fileID: 1000011755443164} 531 | --- !u!224 &224000010049342376 532 | RectTransform: 533 | m_ObjectHideFlags: 1 534 | m_PrefabParentObject: {fileID: 0} 535 | m_PrefabInternal: {fileID: 100100000} 536 | m_GameObject: {fileID: 1000012070912898} 537 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 538 | m_LocalPosition: {x: 0, y: 0, z: 0} 539 | m_LocalScale: {x: 1, y: 1, z: 1} 540 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 541 | m_Children: 542 | - {fileID: 224000011290247416} 543 | - {fileID: 224000011961785600} 544 | m_Father: {fileID: 0} 545 | m_RootOrder: 0 546 | m_AnchorMin: {x: 0, y: 0} 547 | m_AnchorMax: {x: 1, y: 1} 548 | m_AnchoredPosition: {x: 0, y: 0} 549 | m_SizeDelta: {x: 0, y: 0} 550 | m_Pivot: {x: 0.5, y: 0.5} 551 | --- !u!224 &224000010569778424 552 | RectTransform: 553 | m_ObjectHideFlags: 1 554 | m_PrefabParentObject: {fileID: 0} 555 | m_PrefabInternal: {fileID: 100100000} 556 | m_GameObject: {fileID: 1000011716008726} 557 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 558 | m_LocalPosition: {x: 0, y: 0, z: 0} 559 | m_LocalScale: {x: 1, y: 1, z: 1} 560 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 561 | m_Children: [] 562 | m_Father: {fileID: 224000011961785600} 563 | m_RootOrder: 0 564 | m_AnchorMin: {x: 0, y: 0} 565 | m_AnchorMax: {x: 1, y: 1} 566 | m_AnchoredPosition: {x: 0, y: 0} 567 | m_SizeDelta: {x: 0, y: 0} 568 | m_Pivot: {x: 0.5, y: 0.5} 569 | --- !u!224 &224000010746157822 570 | RectTransform: 571 | m_ObjectHideFlags: 1 572 | m_PrefabParentObject: {fileID: 0} 573 | m_PrefabInternal: {fileID: 100100000} 574 | m_GameObject: {fileID: 1000012063562160} 575 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 576 | m_LocalPosition: {x: 0, y: 0, z: 0} 577 | m_LocalScale: {x: 1, y: 1, z: 1} 578 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 579 | m_Children: [] 580 | m_Father: {fileID: 224000011961785600} 581 | m_RootOrder: 3 582 | m_AnchorMin: {x: 0, y: 1} 583 | m_AnchorMax: {x: 1, y: 1} 584 | m_AnchoredPosition: {x: 20, y: -40} 585 | m_SizeDelta: {x: -40, y: 60} 586 | m_Pivot: {x: 0, y: 1} 587 | --- !u!224 &224000011202324464 588 | RectTransform: 589 | m_ObjectHideFlags: 1 590 | m_PrefabParentObject: {fileID: 0} 591 | m_PrefabInternal: {fileID: 100100000} 592 | m_GameObject: {fileID: 1000013097713182} 593 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 594 | m_LocalPosition: {x: 0, y: 0, z: 0} 595 | m_LocalScale: {x: 1, y: 1, z: 1} 596 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 597 | m_Children: 598 | - {fileID: 224000011274004814} 599 | m_Father: {fileID: 224000011961785600} 600 | m_RootOrder: 4 601 | m_AnchorMin: {x: 0, y: 0} 602 | m_AnchorMax: {x: 1, y: 0} 603 | m_AnchoredPosition: {x: 20, y: 20} 604 | m_SizeDelta: {x: -40, y: 50} 605 | m_Pivot: {x: 0, y: 0} 606 | --- !u!224 &224000011274004814 607 | RectTransform: 608 | m_ObjectHideFlags: 1 609 | m_PrefabParentObject: {fileID: 0} 610 | m_PrefabInternal: {fileID: 100100000} 611 | m_GameObject: {fileID: 1000011755443164} 612 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 613 | m_LocalPosition: {x: 0, y: 0, z: 0} 614 | m_LocalScale: {x: 1, y: 1, z: 1} 615 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 616 | m_Children: 617 | - {fileID: 224000011453639008} 618 | m_Father: {fileID: 224000011202324464} 619 | m_RootOrder: 0 620 | m_AnchorMin: {x: 0, y: 0} 621 | m_AnchorMax: {x: 0, y: 0} 622 | m_AnchoredPosition: {x: 0, y: 0} 623 | m_SizeDelta: {x: 0, y: 0} 624 | m_Pivot: {x: 0.5, y: 0} 625 | --- !u!224 &224000011290247416 626 | RectTransform: 627 | m_ObjectHideFlags: 1 628 | m_PrefabParentObject: {fileID: 0} 629 | m_PrefabInternal: {fileID: 100100000} 630 | m_GameObject: {fileID: 1000012495228148} 631 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 632 | m_LocalPosition: {x: 0, y: 0, z: 0} 633 | m_LocalScale: {x: 1, y: 1, z: 1} 634 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 635 | m_Children: [] 636 | m_Father: {fileID: 224000010049342376} 637 | m_RootOrder: 0 638 | m_AnchorMin: {x: 0, y: 0} 639 | m_AnchorMax: {x: 1, y: 1} 640 | m_AnchoredPosition: {x: 0, y: 0} 641 | m_SizeDelta: {x: 0, y: 0} 642 | m_Pivot: {x: 0.5, y: 0.5} 643 | --- !u!224 &224000011453639008 644 | RectTransform: 645 | m_ObjectHideFlags: 1 646 | m_PrefabParentObject: {fileID: 0} 647 | m_PrefabInternal: {fileID: 100100000} 648 | m_GameObject: {fileID: 1000014242889718} 649 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 650 | m_LocalPosition: {x: 0, y: 0, z: 0} 651 | m_LocalScale: {x: 1, y: 1, z: 1} 652 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 653 | m_Children: [] 654 | m_Father: {fileID: 224000011274004814} 655 | m_RootOrder: 0 656 | m_AnchorMin: {x: 0, y: 0} 657 | m_AnchorMax: {x: 1, y: 1} 658 | m_AnchoredPosition: {x: 0, y: 0} 659 | m_SizeDelta: {x: 0, y: 0} 660 | m_Pivot: {x: 0.5, y: 0.5} 661 | --- !u!224 &224000011961785600 662 | RectTransform: 663 | m_ObjectHideFlags: 1 664 | m_PrefabParentObject: {fileID: 0} 665 | m_PrefabInternal: {fileID: 100100000} 666 | m_GameObject: {fileID: 1000013415775542} 667 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 668 | m_LocalPosition: {x: 0, y: 0, z: 0} 669 | m_LocalScale: {x: 1, y: 1, z: 1} 670 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 671 | m_Children: 672 | - {fileID: 224000010569778424} 673 | - {fileID: 224000014215961246} 674 | - {fileID: 224000013830866636} 675 | - {fileID: 224000010746157822} 676 | - {fileID: 224000011202324464} 677 | m_Father: {fileID: 224000010049342376} 678 | m_RootOrder: 1 679 | m_AnchorMin: {x: 0.5, y: 0.5} 680 | m_AnchorMax: {x: 0.5, y: 0.5} 681 | m_AnchoredPosition: {x: 0, y: 0} 682 | m_SizeDelta: {x: 280, y: 180} 683 | m_Pivot: {x: 0.5, y: 0.5} 684 | --- !u!224 &224000013830866636 685 | RectTransform: 686 | m_ObjectHideFlags: 1 687 | m_PrefabParentObject: {fileID: 0} 688 | m_PrefabInternal: {fileID: 100100000} 689 | m_GameObject: {fileID: 1000012848247716} 690 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 691 | m_LocalPosition: {x: 0, y: 0, z: 0} 692 | m_LocalScale: {x: 1, y: 1, z: 1} 693 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 694 | m_Children: [] 695 | m_Father: {fileID: 224000011961785600} 696 | m_RootOrder: 2 697 | m_AnchorMin: {x: 0, y: 1} 698 | m_AnchorMax: {x: 1, y: 1} 699 | m_AnchoredPosition: {x: 0, y: 0} 700 | m_SizeDelta: {x: 0, y: 30} 701 | m_Pivot: {x: 0, y: 1} 702 | --- !u!224 &224000014215961246 703 | RectTransform: 704 | m_ObjectHideFlags: 1 705 | m_PrefabParentObject: {fileID: 0} 706 | m_PrefabInternal: {fileID: 100100000} 707 | m_GameObject: {fileID: 1000011089776920} 708 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 709 | m_LocalPosition: {x: 0, y: 0, z: 0} 710 | m_LocalScale: {x: 1, y: 1, z: 1} 711 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 712 | m_Children: [] 713 | m_Father: {fileID: 224000011961785600} 714 | m_RootOrder: 1 715 | m_AnchorMin: {x: 0, y: 1} 716 | m_AnchorMax: {x: 1, y: 1} 717 | m_AnchoredPosition: {x: 0, y: 0} 718 | m_SizeDelta: {x: 0, y: 30} 719 | m_Pivot: {x: 0, y: 1} 720 | --- !u!225 &225000012675650068 721 | CanvasGroup: 722 | m_ObjectHideFlags: 1 723 | m_PrefabParentObject: {fileID: 0} 724 | m_PrefabInternal: {fileID: 100100000} 725 | m_GameObject: {fileID: 1000012070912898} 726 | m_Enabled: 1 727 | m_Alpha: 0 728 | m_Interactable: 0 729 | m_BlocksRaycasts: 0 730 | m_IgnoreParentGroups: 0 731 | -------------------------------------------------------------------------------- /Assets/Prefabs/ModalAlertPrefab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09f5ec84acf6e496b938dbc5f8be00c4 3 | timeCreated: 1472923710 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/ScoreCellPrefab.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000010065503426} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000010065503426 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 224: {fileID: 224000012661340202} 22 | - 114: {fileID: 114000011499391620} 23 | m_Layer: 5 24 | m_Name: ScoreCellPrefab 25 | m_TagString: Untagged 26 | m_Icon: {fileID: 0} 27 | m_NavMeshLayer: 0 28 | m_StaticEditorFlags: 0 29 | m_IsActive: 1 30 | --- !u!1 &1000010361891316 31 | GameObject: 32 | m_ObjectHideFlags: 0 33 | m_PrefabParentObject: {fileID: 0} 34 | m_PrefabInternal: {fileID: 100100000} 35 | serializedVersion: 4 36 | m_Component: 37 | - 224: {fileID: 224000012607420668} 38 | - 222: {fileID: 222000011729616188} 39 | - 114: {fileID: 114000010771103144} 40 | - 114: {fileID: 114000012066742954} 41 | m_Layer: 5 42 | m_Name: Button 43 | m_TagString: Untagged 44 | m_Icon: {fileID: 0} 45 | m_NavMeshLayer: 0 46 | m_StaticEditorFlags: 0 47 | m_IsActive: 1 48 | --- !u!1 &1000010839217768 49 | GameObject: 50 | m_ObjectHideFlags: 0 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 100100000} 53 | serializedVersion: 4 54 | m_Component: 55 | - 224: {fileID: 224000013943721908} 56 | - 222: {fileID: 222000010242933648} 57 | - 114: {fileID: 114000010627707176} 58 | m_Layer: 5 59 | m_Name: Rank 60 | m_TagString: Untagged 61 | m_Icon: {fileID: 0} 62 | m_NavMeshLayer: 0 63 | m_StaticEditorFlags: 0 64 | m_IsActive: 1 65 | --- !u!1 &1000011378305292 66 | GameObject: 67 | m_ObjectHideFlags: 0 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | serializedVersion: 4 71 | m_Component: 72 | - 224: {fileID: 224000010453011796} 73 | - 222: {fileID: 222000013791094868} 74 | - 114: {fileID: 114000010751498482} 75 | m_Layer: 5 76 | m_Name: Score 77 | m_TagString: Untagged 78 | m_Icon: {fileID: 0} 79 | m_NavMeshLayer: 0 80 | m_StaticEditorFlags: 0 81 | m_IsActive: 1 82 | --- !u!1 &1000013266769906 83 | GameObject: 84 | m_ObjectHideFlags: 0 85 | m_PrefabParentObject: {fileID: 0} 86 | m_PrefabInternal: {fileID: 100100000} 87 | serializedVersion: 4 88 | m_Component: 89 | - 224: {fileID: 224000010309407624} 90 | - 222: {fileID: 222000013604132774} 91 | - 114: {fileID: 114000010255118700} 92 | m_Layer: 5 93 | m_Name: Name 94 | m_TagString: Untagged 95 | m_Icon: {fileID: 0} 96 | m_NavMeshLayer: 0 97 | m_StaticEditorFlags: 0 98 | m_IsActive: 1 99 | --- !u!114 &114000010255118700 100 | MonoBehaviour: 101 | m_ObjectHideFlags: 1 102 | m_PrefabParentObject: {fileID: 0} 103 | m_PrefabInternal: {fileID: 100100000} 104 | m_GameObject: {fileID: 1000013266769906} 105 | m_Enabled: 1 106 | m_EditorHideFlags: 0 107 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 108 | m_Name: 109 | m_EditorClassIdentifier: 110 | m_Material: {fileID: 0} 111 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 112 | m_RaycastTarget: 1 113 | m_OnCullStateChanged: 114 | m_PersistentCalls: 115 | m_Calls: [] 116 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 117 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 118 | m_FontData: 119 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 120 | m_FontSize: 14 121 | m_FontStyle: 0 122 | m_BestFit: 0 123 | m_MinSize: 10 124 | m_MaxSize: 40 125 | m_Alignment: 3 126 | m_AlignByGeometry: 0 127 | m_RichText: 1 128 | m_HorizontalOverflow: 0 129 | m_VerticalOverflow: 0 130 | m_LineSpacing: 1 131 | m_Text: Name 132 | --- !u!114 &114000010627707176 133 | MonoBehaviour: 134 | m_ObjectHideFlags: 1 135 | m_PrefabParentObject: {fileID: 0} 136 | m_PrefabInternal: {fileID: 100100000} 137 | m_GameObject: {fileID: 1000010839217768} 138 | m_Enabled: 1 139 | m_EditorHideFlags: 0 140 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 141 | m_Name: 142 | m_EditorClassIdentifier: 143 | m_Material: {fileID: 0} 144 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 145 | m_RaycastTarget: 1 146 | m_OnCullStateChanged: 147 | m_PersistentCalls: 148 | m_Calls: [] 149 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 150 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 151 | m_FontData: 152 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 153 | m_FontSize: 14 154 | m_FontStyle: 0 155 | m_BestFit: 0 156 | m_MinSize: 10 157 | m_MaxSize: 40 158 | m_Alignment: 3 159 | m_AlignByGeometry: 0 160 | m_RichText: 1 161 | m_HorizontalOverflow: 0 162 | m_VerticalOverflow: 0 163 | m_LineSpacing: 1 164 | m_Text: 1 165 | --- !u!114 &114000010751498482 166 | MonoBehaviour: 167 | m_ObjectHideFlags: 1 168 | m_PrefabParentObject: {fileID: 0} 169 | m_PrefabInternal: {fileID: 100100000} 170 | m_GameObject: {fileID: 1000011378305292} 171 | m_Enabled: 1 172 | m_EditorHideFlags: 0 173 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 174 | m_Name: 175 | m_EditorClassIdentifier: 176 | m_Material: {fileID: 0} 177 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 178 | m_RaycastTarget: 1 179 | m_OnCullStateChanged: 180 | m_PersistentCalls: 181 | m_Calls: [] 182 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 183 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 184 | m_FontData: 185 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 186 | m_FontSize: 14 187 | m_FontStyle: 0 188 | m_BestFit: 0 189 | m_MinSize: 10 190 | m_MaxSize: 40 191 | m_Alignment: 4 192 | m_AlignByGeometry: 0 193 | m_RichText: 1 194 | m_HorizontalOverflow: 0 195 | m_VerticalOverflow: 0 196 | m_LineSpacing: 1 197 | m_Text: 0 198 | --- !u!114 &114000010771103144 199 | MonoBehaviour: 200 | m_ObjectHideFlags: 1 201 | m_PrefabParentObject: {fileID: 0} 202 | m_PrefabInternal: {fileID: 100100000} 203 | m_GameObject: {fileID: 1000010361891316} 204 | m_Enabled: 1 205 | m_EditorHideFlags: 0 206 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 207 | m_Name: 208 | m_EditorClassIdentifier: 209 | m_Material: {fileID: 0} 210 | m_Color: {r: 1, g: 1, b: 1, a: 0} 211 | m_RaycastTarget: 1 212 | m_OnCullStateChanged: 213 | m_PersistentCalls: 214 | m_Calls: [] 215 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 216 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 217 | m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} 218 | m_Type: 1 219 | m_PreserveAspect: 0 220 | m_FillCenter: 1 221 | m_FillMethod: 4 222 | m_FillAmount: 1 223 | m_FillClockwise: 1 224 | m_FillOrigin: 0 225 | --- !u!114 &114000011499391620 226 | MonoBehaviour: 227 | m_ObjectHideFlags: 1 228 | m_PrefabParentObject: {fileID: 0} 229 | m_PrefabInternal: {fileID: 100100000} 230 | m_GameObject: {fileID: 1000010065503426} 231 | m_Enabled: 1 232 | m_EditorHideFlags: 0 233 | m_Script: {fileID: 11500000, guid: b4156a15707484fa6b641b4692736092, type: 3} 234 | m_Name: 235 | m_EditorClassIdentifier: 236 | Rank: {fileID: 114000010627707176} 237 | Score: {fileID: 114000010751498482} 238 | Name: {fileID: 114000010255118700} 239 | Btn: {fileID: 114000012066742954} 240 | --- !u!114 &114000012066742954 241 | MonoBehaviour: 242 | m_ObjectHideFlags: 1 243 | m_PrefabParentObject: {fileID: 0} 244 | m_PrefabInternal: {fileID: 100100000} 245 | m_GameObject: {fileID: 1000010361891316} 246 | m_Enabled: 1 247 | m_EditorHideFlags: 0 248 | m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 249 | m_Name: 250 | m_EditorClassIdentifier: 251 | m_Navigation: 252 | m_Mode: 3 253 | m_SelectOnUp: {fileID: 0} 254 | m_SelectOnDown: {fileID: 0} 255 | m_SelectOnLeft: {fileID: 0} 256 | m_SelectOnRight: {fileID: 0} 257 | m_Transition: 0 258 | m_Colors: 259 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 260 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 261 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 262 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 263 | m_ColorMultiplier: 1 264 | m_FadeDuration: 0.1 265 | m_SpriteState: 266 | m_HighlightedSprite: {fileID: 0} 267 | m_PressedSprite: {fileID: 0} 268 | m_DisabledSprite: {fileID: 0} 269 | m_AnimationTriggers: 270 | m_NormalTrigger: Normal 271 | m_HighlightedTrigger: Highlighted 272 | m_PressedTrigger: Pressed 273 | m_DisabledTrigger: Disabled 274 | m_Interactable: 1 275 | m_TargetGraphic: {fileID: 114000010771103144} 276 | m_OnClick: 277 | m_PersistentCalls: 278 | m_Calls: 279 | - m_Target: {fileID: 0} 280 | m_MethodName: OnSelectedRow 281 | m_Mode: 1 282 | m_Arguments: 283 | m_ObjectArgument: {fileID: 0} 284 | m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine 285 | m_IntArgument: 0 286 | m_FloatArgument: 0 287 | m_StringArgument: 288 | m_BoolArgument: 0 289 | m_CallState: 2 290 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 291 | Culture=neutral, PublicKeyToken=null 292 | --- !u!222 &222000010242933648 293 | CanvasRenderer: 294 | m_ObjectHideFlags: 1 295 | m_PrefabParentObject: {fileID: 0} 296 | m_PrefabInternal: {fileID: 100100000} 297 | m_GameObject: {fileID: 1000010839217768} 298 | --- !u!222 &222000011729616188 299 | CanvasRenderer: 300 | m_ObjectHideFlags: 1 301 | m_PrefabParentObject: {fileID: 0} 302 | m_PrefabInternal: {fileID: 100100000} 303 | m_GameObject: {fileID: 1000010361891316} 304 | --- !u!222 &222000013604132774 305 | CanvasRenderer: 306 | m_ObjectHideFlags: 1 307 | m_PrefabParentObject: {fileID: 0} 308 | m_PrefabInternal: {fileID: 100100000} 309 | m_GameObject: {fileID: 1000013266769906} 310 | --- !u!222 &222000013791094868 311 | CanvasRenderer: 312 | m_ObjectHideFlags: 1 313 | m_PrefabParentObject: {fileID: 0} 314 | m_PrefabInternal: {fileID: 100100000} 315 | m_GameObject: {fileID: 1000011378305292} 316 | --- !u!224 &224000010309407624 317 | RectTransform: 318 | m_ObjectHideFlags: 1 319 | m_PrefabParentObject: {fileID: 0} 320 | m_PrefabInternal: {fileID: 100100000} 321 | m_GameObject: {fileID: 1000013266769906} 322 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 323 | m_LocalPosition: {x: 0, y: 0, z: 0} 324 | m_LocalScale: {x: 1, y: 1, z: 1} 325 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 326 | m_Children: [] 327 | m_Father: {fileID: 224000012661340202} 328 | m_RootOrder: 1 329 | m_AnchorMin: {x: 0, y: 0.5} 330 | m_AnchorMax: {x: 0, y: 0.5} 331 | m_AnchoredPosition: {x: 60, y: 0} 332 | m_SizeDelta: {x: 150, y: 30} 333 | m_Pivot: {x: 0, y: 0.5} 334 | --- !u!224 &224000010453011796 335 | RectTransform: 336 | m_ObjectHideFlags: 1 337 | m_PrefabParentObject: {fileID: 0} 338 | m_PrefabInternal: {fileID: 100100000} 339 | m_GameObject: {fileID: 1000011378305292} 340 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 341 | m_LocalPosition: {x: 0, y: 0, z: 0} 342 | m_LocalScale: {x: 1, y: 1, z: 1} 343 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 344 | m_Children: [] 345 | m_Father: {fileID: 224000012661340202} 346 | m_RootOrder: 2 347 | m_AnchorMin: {x: 1, y: 0.5} 348 | m_AnchorMax: {x: 1, y: 0.5} 349 | m_AnchoredPosition: {x: -10, y: 0} 350 | m_SizeDelta: {x: 90, y: 30} 351 | m_Pivot: {x: 1, y: 0.5} 352 | --- !u!224 &224000012607420668 353 | RectTransform: 354 | m_ObjectHideFlags: 1 355 | m_PrefabParentObject: {fileID: 0} 356 | m_PrefabInternal: {fileID: 100100000} 357 | m_GameObject: {fileID: 1000010361891316} 358 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 359 | m_LocalPosition: {x: 0, y: 0, z: 0} 360 | m_LocalScale: {x: 1, y: 1, z: 1} 361 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 362 | m_Children: [] 363 | m_Father: {fileID: 224000012661340202} 364 | m_RootOrder: 3 365 | m_AnchorMin: {x: 0, y: 0} 366 | m_AnchorMax: {x: 1, y: 1} 367 | m_AnchoredPosition: {x: 0, y: 0} 368 | m_SizeDelta: {x: 0, y: 0} 369 | m_Pivot: {x: 0.5, y: 0.5} 370 | --- !u!224 &224000012661340202 371 | RectTransform: 372 | m_ObjectHideFlags: 1 373 | m_PrefabParentObject: {fileID: 0} 374 | m_PrefabInternal: {fileID: 100100000} 375 | m_GameObject: {fileID: 1000010065503426} 376 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 377 | m_LocalPosition: {x: 0, y: 0, z: 0} 378 | m_LocalScale: {x: 1, y: 1, z: 1} 379 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 380 | m_Children: 381 | - {fileID: 224000013943721908} 382 | - {fileID: 224000010309407624} 383 | - {fileID: 224000010453011796} 384 | - {fileID: 224000012607420668} 385 | m_Father: {fileID: 0} 386 | m_RootOrder: 0 387 | m_AnchorMin: {x: 0, y: 1} 388 | m_AnchorMax: {x: 1, y: 1} 389 | m_AnchoredPosition: {x: 0, y: 0} 390 | m_SizeDelta: {x: 0, y: 50} 391 | m_Pivot: {x: 0.5, y: 1} 392 | --- !u!224 &224000013943721908 393 | RectTransform: 394 | m_ObjectHideFlags: 1 395 | m_PrefabParentObject: {fileID: 0} 396 | m_PrefabInternal: {fileID: 100100000} 397 | m_GameObject: {fileID: 1000010839217768} 398 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 399 | m_LocalPosition: {x: 0, y: 0, z: 0} 400 | m_LocalScale: {x: 1, y: 1, z: 1} 401 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 402 | m_Children: [] 403 | m_Father: {fileID: 224000012661340202} 404 | m_RootOrder: 0 405 | m_AnchorMin: {x: 0, y: 0.5} 406 | m_AnchorMax: {x: 0, y: 0.5} 407 | m_AnchoredPosition: {x: 10, y: 0} 408 | m_SizeDelta: {x: 40, y: 30} 409 | m_Pivot: {x: 0, y: 0.5} 410 | -------------------------------------------------------------------------------- /Assets/Prefabs/ScoreCellPrefab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02485548346c648dc90bda89ef805e28 3 | timeCreated: 1472564777 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/lemons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity3dAzure/AppServicesDemo/b2d9cd82b12826699758eac33d9385f7c27b7005/Assets/Resources/lemons.png -------------------------------------------------------------------------------- /Assets/Resources/lemons.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fff4fbc6fb8674db8b6931e0f13bf8ca 3 | timeCreated: 1472735453 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | spriteTessellationDetail: -1 50 | textureType: 8 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Resources/medicine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity3dAzure/AppServicesDemo/b2d9cd82b12826699758eac33d9385f7c27b7005/Assets/Resources/medicine.png -------------------------------------------------------------------------------- /Assets/Resources/medicine.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 610e5362ad5544457bea7367ca6224c8 3 | timeCreated: 1472721533 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | spriteTessellationDetail: -1 50 | textureType: 8 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Resources/melons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity3dAzure/AppServicesDemo/b2d9cd82b12826699758eac33d9385f7c27b7005/Assets/Resources/melons.png -------------------------------------------------------------------------------- /Assets/Resources/melons.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0a7cd9a1accd4fb6a76cf8191e713a3 3 | timeCreated: 1472735453 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | spriteTessellationDetail: -1 50 | textureType: 8 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Resources/strawberries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity3dAzure/AppServicesDemo/b2d9cd82b12826699758eac33d9385f7c27b7005/Assets/Resources/strawberries.png -------------------------------------------------------------------------------- /Assets/Resources/strawberries.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49b41181ba0714373ab4fa3729e49e30 3 | timeCreated: 1472735453 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | spriteTessellationDetail: -1 50 | textureType: 8 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Scenes/HighscoresDemo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e29fc0800b86549ceaf0cde27e4f2f7b 3 | timeCreated: 1472650440 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/InventoryDemo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcd99bf75e09a435686856c65d42ed70 3 | timeCreated: 1472650440 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/DataModels.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43e326c6826bc44f09176742511e0610 3 | folderAsset: yes 4 | timeCreated: 1472650436 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/DataModels/Highscore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Azure.AppServices; 3 | 4 | [Serializable] 5 | public class Highscore : DataModel 6 | { 7 | public string username; 8 | public uint score; 9 | } -------------------------------------------------------------------------------- /Assets/Scripts/DataModels/Highscore.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 383cd2a32ba4743e4a1eb91de86baf89 3 | timeCreated: 1472307969 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/DataModels/Inventory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Azure.AppServices; 3 | 4 | [Serializable] 5 | public class Inventory : DataModel 6 | { 7 | public uint strawberries; 8 | public uint melons; 9 | public uint lemons; 10 | public uint medicine; 11 | 12 | public Inventory() { 13 | this.strawberries = 0; 14 | this.melons = 0; 15 | this.lemons = 0; 16 | this.medicine = 0; 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/Scripts/DataModels/Inventory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5359ca64607cc4865a59185fa47fc08a 3 | timeCreated: 1472722879 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/DataModels/Message.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System; 4 | 5 | [Serializable] 6 | public class Message 7 | { 8 | public string message; 9 | public string title; 10 | 11 | // Factory method to create a new message 12 | public static Message Create(string message, string title="") { 13 | Message m = new Message (); 14 | m.message = message; 15 | m.title = title; 16 | return m; 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/Scripts/DataModels/Message.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d07af210a4ce458eb6feacefd4e9f53 3 | timeCreated: 1472307970 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/HighscoresDemo.cs: -------------------------------------------------------------------------------- 1 | using Azure.AppServices; 2 | using RESTClient; 3 | using UnityEngine; 4 | using System; 5 | using System.Net; 6 | using System.Collections.Generic; 7 | using UnityEngine.UI; 8 | using Tacticsoft; 9 | using Prefabs; 10 | using UnityEngine.SceneManagement; 11 | using System.Linq; 12 | 13 | public class HighscoresDemo : MonoBehaviour, ITableViewDataSource 14 | { 15 | /// 16 | /// Enter your Azure App Service url 17 | /// 18 | 19 | [Header ("Azure App Service")] 20 | // Azure Mobile App connection strings 21 | [SerializeField] 22 | private string _appUrl = "PASTE_YOUR_APP_URL"; 23 | 24 | [Header ("User Authentication")] 25 | // Client-side login requires auth token from identity provider. 26 | // NB: Remember to update Azure App Service authentication provider with your app key and secret and SAVE changes! 27 | 28 | // Facebook - go to https://developers.facebook.com/tools/accesstoken/ to generate a "User Token". 29 | [Header ("Facebook")] 30 | [SerializeField] 31 | private string _facebookUserToken = ""; 32 | 33 | // Twitter auth - go to https://apps.twitter.com/ and select "Keys and Access Tokens" to generate a access "Access Token" and "Access Token Secret". 34 | [Header ("Twitter")] 35 | [SerializeField] 36 | private string _twitterAccessToken = ""; 37 | [SerializeField] 38 | private string _twitterTokenSecret = ""; 39 | 40 | // App Service Rest Client 41 | private AppServiceClient _client; 42 | 43 | // App Service Table defined using a DataModel 44 | private AppServiceTable _table; 45 | 46 | // List of highscores (leaderboard) 47 | private List _scores = new List (); 48 | 49 | private Highscore _score; 50 | 51 | [Header ("UI")] 52 | // TSTableView for displaying list of results 53 | [SerializeField] 54 | private TableView _tableView; 55 | [SerializeField] 56 | private ScoreCell _cellPrefab; 57 | bool HasNewData = false; 58 | // to reload table view when data has changed 59 | 60 | // infinite scroll vars 61 | private bool _isPaginated = false; 62 | // only enable infinite scrolling for paginated results 63 | private const float _infiniteScrollSize = 0.2f; 64 | private bool _isLoadingNextPage = false; 65 | // load once when scroll buffer is hit 66 | private const uint _noPageResults = 50; 67 | private uint _skip = 0; 68 | // no of records to skip 69 | private uint _totalCount = 0; 70 | // count value should be > 0 to paginate 71 | 72 | [Space (10)] 73 | [SerializeField] 74 | private ModalAlert _modalAlert; 75 | private Message _message; 76 | 77 | // Use this for initialization 78 | void Start () 79 | { 80 | // Create App Service client 81 | _client = new AppServiceClient (_appUrl); 82 | 83 | // Get App Service 'Highscores' table 84 | _table = _client.GetTable ("Highscores"); 85 | 86 | // set TSTableView delegate 87 | _tableView.dataSource = this; 88 | 89 | UpdateUI (); 90 | } 91 | 92 | // Update is called once per frame 93 | void Update () 94 | { 95 | // Only update table when there is new data 96 | if (_tableView != null && HasNewData) { 97 | Debug.Log ("Refresh Table Data"); 98 | SetInteractableScrollbars (false); 99 | _tableView.ReloadData (); 100 | SetInteractableScrollbars (true); 101 | HasNewData = false; 102 | } 103 | // Display new score details 104 | if (_score != null) { 105 | Debug.Log ("Show score:" + _score.ToString ()); 106 | DisplayScore (_score); 107 | _score = null; 108 | } 109 | // Display modal where there is a new message 110 | if (_message != null) { 111 | Debug.Log ("Show message:" + _message.message); 112 | _modalAlert.Show (_message.message, _message.title); 113 | _message = null; 114 | } 115 | } 116 | 117 | public void Login () 118 | { 119 | if (!string.IsNullOrEmpty(_facebookUserToken)) 120 | { 121 | StartCoroutine (_client.LoginWithFacebook (_facebookUserToken, OnLoginCompleted)); 122 | return; 123 | } 124 | if (!string.IsNullOrEmpty(_twitterAccessToken) && !string.IsNullOrEmpty(_twitterTokenSecret)) 125 | { 126 | StartCoroutine (_client.LoginWithTwitter (_twitterAccessToken, _twitterTokenSecret, OnLoginCompleted)); 127 | return; 128 | } 129 | Debug.LogWarning("Login requires Facebook or Twitter access tokens"); 130 | } 131 | 132 | private void OnLoginCompleted (IRestResponse response) 133 | { 134 | Debug.Log ("OnLoginCompleted: " + response.Content + " Url:" + response.Url); 135 | 136 | if (!response.IsError && response.StatusCode == HttpStatusCode.OK) { 137 | Debug.Log ("Authorized UserId: " + _client.User.user.userId); 138 | } else { 139 | Debug.LogWarning ("Authorization Error: " + response.StatusCode); 140 | _message = Message.Create ("Login failed", "Error"); 141 | } 142 | } 143 | 144 | public void Insert () 145 | { 146 | Highscore score = GetScore (); 147 | if (Validate (score)) { 148 | StartCoroutine (_table.Insert (score, OnInsertCompleted)); 149 | } 150 | } 151 | 152 | private void OnInsertCompleted (IRestResponse response) 153 | { 154 | if (!response.IsError && response.StatusCode == HttpStatusCode.Created) { 155 | Debug.Log ("OnInsertItemCompleted: " + response.Content + " status code:" + response.StatusCode + " data:" + response.Data); 156 | Highscore item = response.Data; // if successful the item will have an 'id' property value 157 | _score = item; 158 | } else { 159 | Debug.LogWarning ("Insert Error Status:" + response.StatusCode + " Url: " + response.Url); 160 | } 161 | } 162 | 163 | public void UpdateScore () 164 | { 165 | Highscore score = GetScore (); 166 | if (Validate (score)) { 167 | StartCoroutine (_table.Update (score, OnUpdateScoreCompleted)); 168 | } 169 | } 170 | 171 | private void OnUpdateScoreCompleted (IRestResponse response) 172 | { 173 | if (!response.IsError) { 174 | Debug.Log ("OnUpdateItemCompleted: " + response.Content); 175 | } else { 176 | Debug.LogWarning ("Update Error Status:" + response.StatusCode + " " + response.ErrorMessage + " Url: " + response.Url); 177 | } 178 | } 179 | 180 | public void Delete () 181 | { 182 | Highscore score = GetScore (); 183 | StartCoroutine (_table.Delete (score.id, OnDeleteCompleted)); 184 | } 185 | 186 | private void OnDeleteCompleted (IRestResponse response) 187 | { 188 | if (!response.IsError) { 189 | Debug.Log ("OnDeleteItemCompleted"); 190 | } else { 191 | Debug.LogWarning ("Delete Error Status:" + response.StatusCode + " " + response.ErrorMessage + " Url: " + response.Url); 192 | } 193 | } 194 | 195 | public void Read () 196 | { 197 | StartCoroutine (_table.Read (OnReadCompleted)); 198 | } 199 | 200 | private void OnReadCompleted (IRestResponse response) 201 | { 202 | if (!response.IsError) { 203 | Debug.Log ("OnReadCompleted: " + response.Url + " data: " + response.Content); 204 | Highscore[] items = response.Data; 205 | _isPaginated = false; // default query has max. of 50 records and is not paginated so disable infinite scroll 206 | _scores = items.ToList (); 207 | HasNewData = true; 208 | } else { 209 | Debug.LogWarning ("Read Error Status:" + response.StatusCode + " Url: " + response.Url); 210 | } 211 | } 212 | 213 | private void OnReadNestedResultsCompleted (IRestResponse> response) 214 | { 215 | if (!response.IsError) { 216 | Debug.Log ("OnReadNestedResultsCompleted: " + response.Url + " data: " + response.Content); 217 | Highscore[] items = response.Data.results; 218 | _totalCount = response.Data.count; 219 | Debug.Log ("Read items count: " + items.Length + "/" + response.Data.count); 220 | _isPaginated = true; // nested query will support pagination 221 | if (_skip != 0) { 222 | _scores.AddRange (items.ToList ()); 223 | } else { 224 | _scores = items.ToList (); // set for first page of results 225 | } 226 | HasNewData = true; 227 | } else { 228 | Debug.LogWarning ("Read Nested Results Error Status:" + response.StatusCode.ToString () + " Url: " + response.Url); 229 | } 230 | _isLoadingNextPage = false; // allows next page to be loaded 231 | } 232 | 233 | public void GetAllHighscores () 234 | { 235 | ResetList (); 236 | GetPageHighscores (); 237 | } 238 | 239 | private void GetPageHighscores () 240 | { 241 | var orderBy = new OrderBy("score", SortDirection.desc); 242 | TableQuery query = new TableQuery ("", _noPageResults, _skip, "id,username,score", TableSystemProperty.nil, false, orderBy); 243 | StartCoroutine (_table.Query (query, OnReadNestedResultsCompleted)); 244 | } 245 | 246 | public void GetTopHighscores () 247 | { 248 | ResetList (); 249 | DateTime today = DateTime.Today; 250 | string day = today.ToString ("s"); 251 | string filterPredicate = string.Format ("createdAt gt '{0}Z'", day); 252 | Debug.Log ("filter:" + filterPredicate); 253 | var orderBy = new OrderBy("score", SortDirection.desc); 254 | //TableQuery query = new TableQuery (filterPredicate, 10, 0, null, TableSystemProperty.nil, false, orderBy); 255 | TableQuery query = TableQuery.CreateWithOrderBy(orderBy); 256 | query.Top = 10; 257 | query.Filter = filterPredicate; 258 | Query (query); 259 | } 260 | 261 | public void GetUsernameHighscore () 262 | { 263 | ResetList (); 264 | Highscore score = GetScore (); 265 | string filterPredicate = string.Format ("username eq '{0}'", score.username); 266 | var orderBy = new OrderBy("score", SortDirection.desc); 267 | TableQuery query = TableQuery.CreateWithOrderBy(orderBy); 268 | query.Filter = filterPredicate; 269 | Query (query); 270 | } 271 | 272 | private void Query (TableQuery query) 273 | { 274 | StartCoroutine (_table.Query (query, OnReadCompleted)); 275 | } 276 | 277 | private void ResetList () 278 | { 279 | _skip = 0; 280 | _scores = new List (); 281 | _tableView.ReloadData (); 282 | } 283 | 284 | /// 285 | /// This is an example showing how to get an item using it's id. For example if $select columns are specified and the returned data is limited then this can be used to get all the details by using the items's id. 286 | /// 287 | public void Lookup () 288 | { 289 | Highscore score = GetScore (); 290 | StartCoroutine (_table.Lookup (score.id, OnLookupCompleted)); 291 | } 292 | 293 | private void OnLookupCompleted (IRestResponse response) 294 | { 295 | if (!response.IsError) { 296 | Highscore item = response.Data; 297 | _score = item; 298 | // show message with some details 299 | string message = string.Format ("Scored {0} points on {1}", _score.score, _score.CreatedAt ()); 300 | _message = Message.Create (message, _score.username); 301 | } else { 302 | // TODO: Parse response error (response.Content); 303 | Debug.Log ("Lookup Error Status:" + response.StatusCode); 304 | } 305 | } 306 | 307 | #region Easy APIs 308 | 309 | /// 310 | /// This demo 'hello' custom api just gets a response message eg. '{"message":"Hello World!"}' 311 | /// 312 | public void Hello () 313 | { 314 | StartCoroutine (_client.InvokeApi ("hello", Method.GET, OnCustomApiCompleted)); 315 | } 316 | 317 | public void GenerateScores () 318 | { 319 | StartCoroutine (_client.InvokeApi ("GenerateScores", Method.POST, OnCustomApiCompleted)); 320 | } 321 | 322 | private void OnCustomApiCompleted (IRestResponse response) 323 | { 324 | if (!response.IsError) { 325 | Debug.Log ("OnCustomApiCompleted data: " + response.Content); 326 | Message message = response.Data; 327 | Debug.Log ("Result: " + message); 328 | _message = message; 329 | } else { 330 | Debug.Log ("Api Error Status:" + response.StatusCode + " Url: " + response.Url); 331 | } 332 | } 333 | 334 | #endregion 335 | 336 | #region UI 337 | 338 | /// 339 | /// Create data model from UI 340 | /// 341 | private Highscore GetScore () 342 | { 343 | string name = GameObject.Find ("InputName").GetComponent ().text; 344 | string score = GameObject.Find ("InputScore").GetComponent ().text; 345 | string id = GameObject.Find ("Id").GetComponent ().text; 346 | Highscore highscore = new Highscore (); 347 | highscore.username = name; 348 | if (!String.IsNullOrEmpty (score)) { 349 | highscore.score = Convert.ToUInt32 (score); 350 | } 351 | if (!String.IsNullOrEmpty (id)) { 352 | highscore.id = id; 353 | Debug.Log ("Existing Id:" + id); 354 | } 355 | return highscore; 356 | } 357 | 358 | /// 359 | /// Update UI with data model 360 | /// 361 | private void DisplayScore (Highscore highscore) 362 | { 363 | InputField name = GameObject.Find ("InputName").GetComponent (); 364 | InputField score = GameObject.Find ("InputScore").GetComponent (); 365 | Text id = GameObject.Find ("Id").GetComponent (); 366 | name.text = highscore.username; 367 | score.text = highscore.score.ToString (); 368 | id.text = highscore.id; 369 | UpdateUI (); 370 | } 371 | 372 | /// 373 | /// Reset UI to insert new score 374 | /// 375 | public void ClearScore () 376 | { 377 | InputField name = GameObject.Find ("InputName").GetComponent (); 378 | InputField score = GameObject.Find ("InputScore").GetComponent (); 379 | Text id = GameObject.Find ("Id").GetComponent (); 380 | name.text = ""; 381 | score.text = ""; 382 | id.text = ""; 383 | UpdateUI (); 384 | } 385 | 386 | /// 387 | /// Validate data before sending 388 | /// 389 | private bool Validate (Highscore highscore) 390 | { 391 | bool isUsernameValid = true, isScoreValid = true; 392 | // Validate username 393 | if (String.IsNullOrEmpty (highscore.username)) { 394 | isUsernameValid = false; 395 | Debug.LogWarning ("Error, player username required"); 396 | } 397 | // Validate score 398 | if (!(highscore.score > 0)) { 399 | isScoreValid = false; 400 | Debug.LogWarning ("Error, player score should be greater than 0"); 401 | } 402 | UpdateText ("Player", isUsernameValid); 403 | UpdateText ("Score", isScoreValid); 404 | return (isUsernameValid && isScoreValid); 405 | } 406 | 407 | /// 408 | /// Change text color to highlight errors 409 | /// 410 | private void UpdateText (string gameObjectName, bool isValid = true) 411 | { 412 | Text text = GameObject.Find (gameObjectName).GetComponent (); 413 | if (text) { 414 | text.color = isValid ? Color.white : Color.red; 415 | } 416 | } 417 | 418 | /// 419 | /// Handler for text changed event to update view state 420 | /// 421 | public void TextChanged () 422 | { 423 | UpdateUI (); 424 | } 425 | 426 | /// 427 | /// Method to manage UI view state 428 | /// 429 | private void UpdateUI () 430 | { 431 | // Insert or Update mode 432 | Text id = GameObject.Find ("Id").GetComponent (); 433 | GameObject insert = GameObject.Find ("GroupInsert"); 434 | GameObject update = GameObject.Find ("GroupUpdate"); 435 | CanvasGroup groupInsert = insert.GetComponent (); 436 | CanvasGroup groupUpdate = update.GetComponent (); 437 | if (String.IsNullOrEmpty (id.text)) { 438 | groupInsert.alpha = 1; 439 | groupUpdate.alpha = 0; 440 | groupInsert.interactable = true; 441 | groupUpdate.interactable = false; 442 | } else { 443 | groupInsert.alpha = 0; 444 | groupUpdate.alpha = 1; 445 | groupInsert.interactable = false; 446 | groupUpdate.interactable = true; 447 | } 448 | 449 | // Close dialog if no message 450 | if (_message == null) { 451 | _modalAlert.Close (); 452 | } 453 | } 454 | 455 | #endregion 456 | 457 | #region TSTableView ITableViewDataSource 458 | 459 | public int GetNumberOfRowsForTableView (TableView tableView) 460 | { 461 | return _scores.Count; 462 | } 463 | 464 | public float GetHeightForRowInTableView (TableView tableView, int row) 465 | { 466 | return (_cellPrefab.transform as RectTransform).rect.height; 467 | } 468 | 469 | public TableViewCell GetCellForRowInTableView (TableView tableView, int row) 470 | { 471 | ScoreCell cell = tableView.GetReusableCell (_cellPrefab.reuseIdentifier) as ScoreCell; 472 | if (cell == null) { 473 | cell = (ScoreCell)GameObject.Instantiate (_cellPrefab); 474 | } 475 | Highscore data = _scores [row]; 476 | cell.Name.text = data.username; 477 | cell.Score.text = data.score.ToString (); 478 | cell.Rank.text = (row + 1).ToString (); 479 | cell.Btn.name = row.ToString (); // save index to button name 480 | return cell; 481 | } 482 | 483 | #endregion 484 | 485 | /// 486 | /// Handler to get selected row item 487 | /// 488 | public void OnSelectedRow (Button button) 489 | { 490 | int index = Convert.ToInt32 (button.name); 491 | //Debug.Log("Selected index:" + index); //Count 492 | if (index >= _scores.Count) { 493 | return; 494 | } 495 | Highscore score = _scores [index]; 496 | Debug.Log ("Selected:" + score.ToString ()); 497 | _score = score; // update editor with selected item 498 | } 499 | 500 | #region Infinite Scroll private methods for Highscores 501 | 502 | void OnEnable () 503 | { 504 | _tableView.GetComponent ().onValueChanged.AddListener (OnScrollValueChanged); 505 | } 506 | 507 | void OnDisable () 508 | { 509 | if (_tableView != null) { 510 | _tableView.GetComponent ().onValueChanged.RemoveListener (OnScrollValueChanged); 511 | } 512 | } 513 | 514 | private void OnScrollValueChanged (Vector2 newScrollValue) 515 | { 516 | // skip if not paginated results, or if no items, or if busy already loading next page of results 517 | if (!_isPaginated || _totalCount == 0 || _isLoadingNextPage) { 518 | return; 519 | } 520 | //Debug.Log (string.Format("Scroll y:{0} table view scroll: {1}/{2}", newScrollValue.y, _tableView.scrollY, _tableView.scrollableHeight)); 521 | float scrollY = _tableView.scrollableHeight - _tableView.scrollY; 522 | float scrollBuffer = _infiniteScrollSize * _tableView.scrollableHeight; 523 | // scrollY is still at 'top' and so no need to load anything at this point 524 | if (scrollY > scrollBuffer) { 525 | return; 526 | } 527 | // scrollY has reached 'bottom' minus buffer size 528 | // only trigger request if there are more records to load 529 | if (_skip < _totalCount) { 530 | _isLoadingNextPage = true; 531 | _skip += _noPageResults; 532 | //Debug.Log (string.Format("Load next page @{0} scroll: {1}<{2}", _skip, scrollY, scrollBuffer)); 533 | GetPageHighscores (); 534 | } 535 | } 536 | 537 | // Tip: When infinite scrolling and using TSTableView's ReloadData() method I prefer to wrap "disable and enable scrollbar" calls around it to help prevent jumpy behaviour when continously dragging the scrollbar thumb. 538 | private void SetInteractableScrollbars (bool isInteractable) 539 | { 540 | Scrollbar[] scrollbars = _tableView.GetComponentsInChildren (); 541 | foreach (Scrollbar scrollbar in scrollbars) { 542 | //Debug.Log (string.Format("Scrollbar {0} is {1}",scrollbar.name, isInteractable)); 543 | scrollbar.interactable = isInteractable; 544 | } 545 | } 546 | 547 | #endregion 548 | 549 | /// 550 | /// Handler to go to next scene 551 | /// 552 | public void GoNextScene () 553 | { 554 | SceneManager.LoadScene ("InventoryDemo"); 555 | } 556 | } 557 | -------------------------------------------------------------------------------- /Assets/Scripts/HighscoresDemo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9dcdeb5277262475c858002ec725ae70 3 | timeCreated: 1472650440 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/InventoryDemo.cs: -------------------------------------------------------------------------------- 1 | using Azure.AppServices; 2 | using RESTClient; 3 | using UnityEngine; 4 | using System.Collections; 5 | using System; 6 | using UnityEngine.UI; 7 | using System.Collections.Generic; 8 | using System.Net; 9 | using Tacticsoft; 10 | using Prefabs; 11 | using UnityEngine.SceneManagement; 12 | 13 | /// 14 | /// Virtual inventory item used to populate table cell 15 | /// 16 | public class InventoryItem 17 | { 18 | public string name; 19 | public uint amount; 20 | } 21 | 22 | public class InventoryDemo : MonoBehaviour, ITableViewDataSource 23 | { 24 | 25 | /// 26 | /// Enter your Azure App Service url 27 | /// 28 | 29 | [Header ("Azure App Service")] 30 | // Azure Mobile App connection strings 31 | [SerializeField] 32 | private string _appUrl = "PASTE_YOUR_APP_URL"; 33 | 34 | [Header ("User Authentication")] 35 | // Client-side login requires auth token from identity provider. 36 | // NB: Remember to update Azure App Service authentication provider with your app key and secret and SAVE changes! 37 | 38 | // Facebook - go to https://developers.facebook.com/tools/accesstoken/ to generate a "User Token". 39 | [Header ("Facebook")] 40 | [SerializeField] 41 | private string _facebookUserToken = ""; 42 | 43 | // Twitter auth - go to https://apps.twitter.com/ and select "Keys and Access Tokens" to generate a access "Access Token" and "Access Token Secret". 44 | [Header ("Twitter")] 45 | [SerializeField] 46 | private string _twitterAccessToken = ""; 47 | [SerializeField] 48 | private string _twitterTokenSecret = ""; 49 | 50 | // App Service Rest Client 51 | private AppServiceClient _client; 52 | 53 | // App Service Table defined using a DataModel 54 | private AppServiceTable _table; 55 | 56 | // Data 57 | private Inventory _inventory; 58 | 59 | // List of virtual items (inventory) 60 | private List _items = new List (); 61 | 62 | [Header ("UI")] 63 | // TSTableView for displaying list of results 64 | [SerializeField] 65 | private TableView _tableView; 66 | [SerializeField] 67 | private InventoryCell _cellPrefab; 68 | bool HasNewData = false; 69 | // to reload table view when data has changed 70 | 71 | [Space (10)] 72 | [SerializeField] 73 | private ModalAlert _modalAlert; 74 | private Message _message; 75 | 76 | // to show user's inventory after successful login 77 | bool DidLogin = false; 78 | 79 | // Use this for initialization 80 | void Start () 81 | { 82 | // Create App Service client 83 | _client = new AppServiceClient (_appUrl); 84 | 85 | // Get App Service 'Highscores' table 86 | _table = _client.GetTable ("Inventory"); 87 | 88 | // set TSTableView delegate 89 | _tableView.dataSource = this; 90 | 91 | // hide controls until login 92 | CanvasGroup group = GameObject.Find ("UserDataGroup").GetComponent (); 93 | group.alpha = 0; 94 | group.interactable = false; 95 | 96 | UpdateUI (); 97 | } 98 | 99 | // Update is called once per frame 100 | void Update () 101 | { 102 | // show controls after login 103 | if (DidLogin) { 104 | CanvasGroup group = GameObject.Find ("UserDataGroup").GetComponent (); 105 | group.alpha = 1; 106 | group.interactable = true; 107 | DidLogin = false; 108 | } 109 | // update editor fields and reload table data 110 | if (HasNewData && _inventory != null) { 111 | InputField strawberries = GameObject.Find ("Input1").GetComponent (); 112 | InputField melons = GameObject.Find ("Input2").GetComponent (); 113 | InputField lemons = GameObject.Find ("Input3").GetComponent (); 114 | InputField medicine = GameObject.Find ("Input4").GetComponent (); 115 | //Debug.Log ("strawberries: " + _inventory.strawberries + " melons: " + _inventory.melons + " lemons: " + _inventory.lemons + " medicine: " + _inventory.medicine); 116 | strawberries.text = _inventory.strawberries.ToString (); 117 | melons.text = _inventory.melons.ToString (); 118 | lemons.text = _inventory.lemons.ToString (); 119 | medicine.text = _inventory.medicine.ToString (); 120 | ReloadTableData (); 121 | HasNewData = false; 122 | } 123 | // Display modal where there is a new message 124 | if (_message != null) { 125 | Debug.Log ("Show message:" + _message.message); 126 | _modalAlert.Show (_message.message, _message.title); 127 | _message = null; 128 | } 129 | } 130 | 131 | public void Login () 132 | { 133 | if (!string.IsNullOrEmpty(_facebookUserToken)) 134 | { 135 | StartCoroutine (_client.LoginWithFacebook (_facebookUserToken, OnLoginCompleted)); 136 | return; 137 | } 138 | if (!string.IsNullOrEmpty(_twitterAccessToken) && !string.IsNullOrEmpty(_twitterTokenSecret)) 139 | { 140 | StartCoroutine (_client.LoginWithTwitter (_twitterAccessToken, _twitterTokenSecret, OnLoginCompleted)); 141 | return; 142 | } 143 | Debug.LogWarning("Login requires Facebook or Twitter access tokens"); 144 | } 145 | 146 | private void OnLoginCompleted (IRestResponse response) 147 | { 148 | if (!response.IsError) { 149 | Debug.Log ("OnLoginCompleted: " + response.Content + " Status: " + response.StatusCode + " Url:" + response.Url); 150 | Debug.Log ("Authorized UserId: " + _client.User.user.userId); 151 | DidLogin = true; 152 | Load (); // auto load user data 153 | } else { 154 | Debug.LogWarning ("Authorization Error: " + response.StatusCode); 155 | _message = Message.Create ("Login failed", "Error"); 156 | } 157 | } 158 | 159 | public void Load () 160 | { 161 | string filterPredicate = string.Format ("userId eq '{0}'", _client.User.user.userId); 162 | TableQuery query = new TableQuery (filterPredicate); 163 | Debug.Log ("Load data for UserId: " + _client.User.user.userId + " query:" + query); 164 | 165 | StartCoroutine (_table.Query (query, OnLoadCompleted)); 166 | } 167 | 168 | private void OnLoadCompleted (IRestResponse response) 169 | { 170 | if (!response.IsError) { 171 | Debug.Log ("OnLoadItemsCompleted data: " + response.Content); 172 | Inventory[] results = response.Data; 173 | Debug.Log ("Load results count: " + results.Length); 174 | // no record 175 | if (results.Length == 0) { 176 | _inventory = new Inventory (); 177 | } 178 | if (results.Length >= 1) { 179 | Debug.Log ("inventory result: " + results [0]); 180 | _inventory = results [0]; 181 | } 182 | HasNewData = true; 183 | } else { 184 | Debug.LogWarning ("Read Error Status:" + response.StatusCode + " Url: " + response.Url); 185 | } 186 | } 187 | 188 | public void Save () 189 | { 190 | if (_inventory == null) { 191 | Debug.Log ("Error, no inventory"); 192 | return; 193 | } 194 | // If new Insert, else Update existing user inventory 195 | if (String.IsNullOrEmpty (_inventory.id)) { 196 | InsertInventory (); 197 | } else { 198 | UpdateInventory (); 199 | } 200 | } 201 | 202 | private void InsertInventory () 203 | { 204 | RecalculateInventoryItems (); 205 | Debug.Log ("Insert:" + _inventory.ToString ()); 206 | StartCoroutine (_table.Insert (_inventory, OnInsertCompleted)); 207 | } 208 | 209 | private void OnInsertCompleted (IRestResponse response) 210 | { 211 | if (!response.IsError && response.StatusCode == HttpStatusCode.Created) { 212 | Debug.Log ("OnInsertItemCompleted: " + response.Data); 213 | Inventory item = response.Data; // if successful the item will have an 'id' property value 214 | _inventory = item; 215 | _message = Message.Create ("Inventory saved", "Inserted"); // show confirmation message 216 | } else { 217 | Debug.LogWarning ("Insert Error Status:" + response.StatusCode + " " + response.ErrorMessage + " Url: " + response.Url); 218 | } 219 | } 220 | 221 | private void UpdateInventory () 222 | { 223 | RecalculateInventoryItems (); 224 | Debug.Log ("Update:" + _inventory.ToString ()); 225 | StartCoroutine (_table.Update (_inventory, OnUpdateCompleted)); 226 | } 227 | 228 | private void OnUpdateCompleted (IRestResponse response) 229 | { 230 | if (!response.IsError) { 231 | Debug.Log ("OnUpdateCompleted: " + response.Content); 232 | _message = Message.Create ("Inventory saved", "Updated"); // show confirmation message 233 | } else { 234 | Debug.LogWarning ("Update Error Status:" + response.StatusCode + " " + response.ErrorMessage + " Url: " + response.Url); 235 | } 236 | } 237 | 238 | #region UI 239 | 240 | /// 241 | /// Update inventory using input values 242 | /// 243 | private void RecalculateInventoryItems () 244 | { 245 | if (_inventory == null) { 246 | Debug.Log ("Error, no inventory"); 247 | } 248 | InputField strawberries = GameObject.Find ("Input1").GetComponent (); 249 | InputField melons = GameObject.Find ("Input2").GetComponent (); 250 | InputField lemons = GameObject.Find ("Input3").GetComponent (); 251 | InputField medicine = GameObject.Find ("Input4").GetComponent (); 252 | _inventory.strawberries = Convert.ToUInt32 (strawberries.text); 253 | _inventory.melons = Convert.ToUInt32 (melons.text); 254 | _inventory.lemons = Convert.ToUInt32 (lemons.text); 255 | _inventory.medicine = Convert.ToUInt32 (medicine.text); 256 | } 257 | 258 | /// 259 | /// Handler for text changed event to update view state 260 | /// 261 | public void TextChanged () 262 | { 263 | UpdateUI (); 264 | } 265 | 266 | /// 267 | /// Method to manage UI view state 268 | /// 269 | private void UpdateUI () 270 | { 271 | // Close dialog if no message 272 | if (_message == null) { 273 | _modalAlert.Close (); 274 | } 275 | } 276 | 277 | /// 278 | /// Reloads table data 279 | /// 280 | private void ReloadTableData () 281 | { 282 | // start with new list 283 | _items = new List (); 284 | 285 | if (_inventory == null) { 286 | return; 287 | } 288 | 289 | // Inventory data model properties 290 | string[] properties = { "strawberries", "melons", "lemons", "medicine" }; 291 | foreach (string property in properties) { 292 | // Check property exists in data model then check amount value 293 | if (ReflectionHelper.HasField (_inventory, property)) { 294 | var x = ReflectionHelper.GetField (_inventory, property); 295 | Nullable value = x.GetValue (_inventory) as Nullable; 296 | uint amount = value ?? 0; 297 | // Only display items with 1 or more 298 | if (amount > 0) { 299 | InventoryItem item = new InventoryItem (); 300 | item.name = property; 301 | item.amount = amount; 302 | // Add to table view list 303 | _items.Add (item); 304 | } 305 | } 306 | } 307 | 308 | // reload table data 309 | _tableView.ReloadData (); 310 | } 311 | 312 | #endregion 313 | 314 | #region ITableViewDataSource 315 | 316 | public int GetNumberOfRowsForTableView (TableView tableView) 317 | { 318 | return _items.Count; 319 | } 320 | 321 | public float GetHeightForRowInTableView (TableView tableView, int row) 322 | { 323 | return (_cellPrefab.transform as RectTransform).rect.height; //50.0f; 324 | } 325 | 326 | public TableViewCell GetCellForRowInTableView (TableView tableView, int row) 327 | { 328 | InventoryCell cell = tableView.GetReusableCell (_cellPrefab.reuseIdentifier) as InventoryCell; 329 | if (cell == null) { 330 | cell = (InventoryCell)GameObject.Instantiate (_cellPrefab); 331 | } 332 | InventoryItem data = _items [row]; 333 | cell.Name.text = data.name; 334 | cell.Amount.text = data.amount.ToString (); 335 | cell.Icon.sprite = LoadImage (data.name); 336 | cell.Btn.name = row.ToString (); // save index to button name 337 | return cell; 338 | } 339 | 340 | #endregion 341 | 342 | public Sprite LoadImage (string filename) 343 | { 344 | Texture2D texture = Resources.Load (filename) as Texture2D; 345 | if (texture == null) { 346 | return null; 347 | } 348 | Rect rect = new Rect (0, 0, texture.width, texture.height); 349 | Vector2 pivot = new Vector2 (0.0f, 0.0f); 350 | return Sprite.Create (texture, rect, pivot); 351 | } 352 | 353 | /// 354 | /// Handler to go to next scene 355 | /// 356 | public void GoNextScene () 357 | { 358 | SceneManager.LoadScene ("HighscoresDemo"); 359 | } 360 | } -------------------------------------------------------------------------------- /Assets/Scripts/InventoryDemo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cbf7b4bb150744d19a51e4387ac47fa 3 | timeCreated: 1472717991 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f020ae5b8d3a45698e80e859b453891 3 | folderAsset: yes 4 | timeCreated: 1472925732 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/ModalAlert.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | using System; 5 | 6 | namespace Prefabs 7 | { 8 | public class ModalAlert : MonoBehaviour 9 | { 10 | 11 | public Text titleBox; 12 | public Text messageBox; 13 | 14 | /// 15 | /// Modal alert 16 | /// 17 | public void Show (string message = "", string title = "Alert") 18 | { 19 | // set message 20 | titleBox.text = title; 21 | messageBox.text = message; 22 | // show alert 23 | ShowModalAlert (); 24 | } 25 | 26 | public void Close () 27 | { 28 | ShowModalAlert (false); 29 | } 30 | 31 | private void ShowModalAlert (bool show = true) 32 | { 33 | CanvasGroup modal = gameObject.GetComponent (); 34 | if (!show) { 35 | modal.alpha = 0; 36 | modal.interactable = false; 37 | modal.blocksRaycasts = false; 38 | return; 39 | } 40 | // show modal alert 41 | modal.alpha = 1; 42 | modal.interactable = true; 43 | modal.blocksRaycasts = true; // disable other buttons behind 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Assets/Scripts/UI/ModalAlert.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8c37c862afa141ec965ca1369e5eb2f 3 | timeCreated: 1472926207 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/TableViewCells.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fdf7621f53c84a5597a4c407f1b27b0 3 | folderAsset: yes 4 | timeCreated: 1472926060 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/TableViewCells/InventoryCell.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | using Tacticsoft; 5 | using System; 6 | 7 | namespace Prefabs 8 | { 9 | public class InventoryCell : TableViewCell 10 | { 11 | public Image Icon; 12 | public Text Name; 13 | public Text Amount; 14 | public Button Btn; 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/Scripts/UI/TableViewCells/InventoryCell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 177d64a8e263e4ca990b0b5b61fd989a 3 | timeCreated: 1472818375 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/TableViewCells/ScoreCell.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | using Tacticsoft; 5 | using System; 6 | 7 | namespace Prefabs 8 | { 9 | public class ScoreCell : TableViewCell 10 | { 11 | public Text Rank; 12 | public Text Score; 13 | public Text Name; 14 | public Button Btn; 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/Scripts/UI/TableViewCells/ScoreCell.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4156a15707484fa6b641b4692736092 3 | timeCreated: 1472818375 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Unity3dAzure 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_SolverIterationCount: 6 13 | m_QueriesHitTriggers: 1 14 | m_EnableAdaptiveForce: 0 15 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 16 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/HighscoresDemo.unity 10 | - enabled: 1 11 | path: Assets/Scenes/InventoryDemo.unity 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_WebSecurityEmulationEnabled: 0 10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d 11 | m_DefaultBehaviorMode: 1 12 | m_SpritePackerMode: 2 13 | m_SpritePackerPaddingPower: 1 14 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 15 | m_ProjectGenerationRootNamespace: 16 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_TierSettings_Tier1: 42 | renderingPath: 1 43 | useCascadedShadowMaps: 0 44 | m_TierSettings_Tier2: 45 | renderingPath: 1 46 | useCascadedShadowMaps: 0 47 | m_TierSettings_Tier3: 48 | renderingPath: 1 49 | useCascadedShadowMaps: 0 50 | m_DefaultRenderingPath: 1 51 | m_DefaultMobileRenderingPath: 1 52 | m_TierSettings: [] 53 | m_LightmapStripping: 0 54 | m_FogStripping: 0 55 | m_LightmapKeepPlain: 1 56 | m_LightmapKeepDirCombined: 1 57 | m_LightmapKeepDirSeparate: 1 58 | m_LightmapKeepDynamicPlain: 1 59 | m_LightmapKeepDynamicDirCombined: 1 60 | m_LightmapKeepDynamicDirSeparate: 1 61 | m_FogKeepLinear: 1 62 | m_FogKeepExp: 1 63 | m_FogKeepExp2: 1 64 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshAreas: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_MinPenetrationForPenalty: 0.01 17 | m_BaumgarteScale: 0.2 18 | m_BaumgarteTimeOfImpactScale: 0.75 19 | m_TimeToSleep: 0.5 20 | m_LinearSleepTolerance: 0.01 21 | m_AngularSleepTolerance: 2 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 26 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | productGUID: 2d980679b11fa446d9d20f5a821d2147 8 | AndroidProfiler: 0 9 | defaultScreenOrientation: 4 10 | targetDevice: 2 11 | useOnDemandResources: 0 12 | accelerometerFrequency: 60 13 | companyName: DefaultCompany 14 | productName: AppServicesDemo 15 | defaultCursor: {fileID: 0} 16 | cursorHotspot: {x: 0, y: 0} 17 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 18 | m_ShowUnitySplashScreen: 1 19 | m_ShowUnitySplashLogo: 1 20 | m_SplashScreenOverlayOpacity: 1 21 | m_SplashScreenAnimation: 1 22 | m_SplashScreenLogoStyle: 1 23 | m_SplashScreenDrawMode: 0 24 | m_SplashScreenBackgroundAnimationZoom: 1 25 | m_SplashScreenLogoAnimationZoom: 1 26 | m_SplashScreenBackgroundLandscapeAspect: 1 27 | m_SplashScreenBackgroundPortraitAspect: 1 28 | m_SplashScreenBackgroundLandscapeUvs: 29 | serializedVersion: 2 30 | x: 0 31 | y: 0 32 | width: 1 33 | height: 1 34 | m_SplashScreenBackgroundPortraitUvs: 35 | serializedVersion: 2 36 | x: 0 37 | y: 0 38 | width: 1 39 | height: 1 40 | m_SplashScreenLogos: [] 41 | m_SplashScreenBackgroundLandscape: {fileID: 0} 42 | m_SplashScreenBackgroundPortrait: {fileID: 0} 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_MobileMTRendering: 0 53 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 54 | iosShowActivityIndicatorOnLoading: -1 55 | androidShowActivityIndicatorOnLoading: -1 56 | tizenShowActivityIndicatorOnLoading: -1 57 | iosAppInBackgroundBehavior: 0 58 | displayResolutionDialog: 1 59 | iosAllowHTTPDownload: 1 60 | allowedAutorotateToPortrait: 1 61 | allowedAutorotateToPortraitUpsideDown: 1 62 | allowedAutorotateToLandscapeRight: 1 63 | allowedAutorotateToLandscapeLeft: 1 64 | useOSAutorotation: 1 65 | use32BitDisplayBuffer: 1 66 | disableDepthAndStencilBuffers: 0 67 | defaultIsFullScreen: 1 68 | defaultIsNativeResolution: 1 69 | runInBackground: 0 70 | captureSingleScreen: 0 71 | muteOtherAudioSources: 0 72 | Prepare IOS For Recording: 0 73 | Force IOS Speakers When Recording: 0 74 | submitAnalytics: 1 75 | usePlayerLog: 1 76 | bakeCollisionMeshes: 0 77 | forceSingleInstance: 0 78 | resizableWindow: 0 79 | useMacAppStoreValidation: 0 80 | macAppStoreCategory: public.app-category.games 81 | gpuSkinning: 0 82 | graphicsJobs: 0 83 | xboxPIXTextureCapture: 0 84 | xboxEnableAvatar: 0 85 | xboxEnableKinect: 0 86 | xboxEnableKinectAutoTracking: 0 87 | xboxEnableFitness: 0 88 | visibleInBackground: 0 89 | allowFullscreenSwitch: 1 90 | graphicsJobMode: 0 91 | macFullscreenMode: 2 92 | d3d9FullscreenMode: 1 93 | d3d11FullscreenMode: 1 94 | xboxSpeechDB: 0 95 | xboxEnableHeadOrientation: 0 96 | xboxEnableGuest: 0 97 | xboxEnablePIXSampling: 0 98 | n3dsDisableStereoscopicView: 0 99 | n3dsEnableSharedListOpt: 1 100 | n3dsEnableVSync: 0 101 | ignoreAlphaClear: 0 102 | xboxOneResolution: 0 103 | xboxOneMonoLoggingLevel: 0 104 | xboxOneLoggingLevel: 1 105 | xboxOneDisableEsram: 0 106 | videoMemoryForVertexBuffers: 0 107 | psp2PowerMode: 0 108 | psp2AcquireBGM: 1 109 | wiiUTVResolution: 0 110 | wiiUGamePadMSAA: 1 111 | wiiUSupportsNunchuk: 0 112 | wiiUSupportsClassicController: 0 113 | wiiUSupportsBalanceBoard: 0 114 | wiiUSupportsMotionPlus: 0 115 | wiiUSupportsProController: 0 116 | wiiUAllowScreenCapture: 1 117 | wiiUControllerCount: 0 118 | m_SupportedAspectRatios: 119 | 4:3: 1 120 | 5:4: 1 121 | 16:10: 1 122 | 16:9: 1 123 | Others: 1 124 | bundleVersion: 1.0 125 | preloadedAssets: [] 126 | metroInputSource: 0 127 | m_HolographicPauseOnTrackingLoss: 1 128 | xboxOneDisableKinectGpuReservation: 0 129 | xboxOneEnable7thCore: 0 130 | vrSettings: 131 | cardboard: 132 | depthFormat: 0 133 | enableTransitionView: 0 134 | daydream: 135 | depthFormat: 0 136 | useSustainedPerformanceMode: 0 137 | hololens: 138 | depthFormat: 1 139 | protectGraphicsMemory: 0 140 | useHDRDisplay: 0 141 | targetPixelDensity: 0 142 | resolutionScalingMode: 0 143 | applicationIdentifier: 144 | Android: net.deadlyfingers.Unity3DAzure 145 | Standalone: unity.DefaultCompany.AppServicesDemo 146 | Tizen: net.deadlyfingers.Unity3DAzure 147 | iOS: net.deadlyfingers.Unity3DAzure 148 | tvOS: net.deadlyfingers.Unity3DAzure 149 | buildNumber: 150 | iOS: 0 151 | AndroidBundleVersionCode: 1 152 | AndroidMinSdkVersion: 16 153 | AndroidTargetSdkVersion: 0 154 | AndroidPreferredInstallLocation: 1 155 | aotOptions: 156 | stripEngineCode: 1 157 | iPhoneStrippingLevel: 0 158 | iPhoneScriptCallOptimization: 0 159 | ForceInternetPermission: 1 160 | ForceSDCardPermission: 0 161 | CreateWallpaper: 0 162 | APKExpansionFiles: 0 163 | keepLoadedShadersAlive: 0 164 | StripUnusedMeshComponents: 0 165 | VertexChannelCompressionMask: 166 | serializedVersion: 2 167 | m_Bits: 238 168 | iPhoneSdkVersion: 988 169 | iOSTargetOSVersionString: 6.0 170 | tvOSSdkVersion: 0 171 | tvOSRequireExtendedGameController: 0 172 | tvOSTargetOSVersionString: 9.0 173 | uIPrerenderedIcon: 0 174 | uIRequiresPersistentWiFi: 0 175 | uIRequiresFullScreen: 1 176 | uIStatusBarHidden: 1 177 | uIExitOnSuspend: 0 178 | uIStatusBarStyle: 0 179 | iPhoneSplashScreen: {fileID: 0} 180 | iPhoneHighResSplashScreen: {fileID: 0} 181 | iPhoneTallHighResSplashScreen: {fileID: 0} 182 | iPhone47inSplashScreen: {fileID: 0} 183 | iPhone55inPortraitSplashScreen: {fileID: 0} 184 | iPhone55inLandscapeSplashScreen: {fileID: 0} 185 | iPadPortraitSplashScreen: {fileID: 0} 186 | iPadHighResPortraitSplashScreen: {fileID: 0} 187 | iPadLandscapeSplashScreen: {fileID: 0} 188 | iPadHighResLandscapeSplashScreen: {fileID: 0} 189 | appleTVSplashScreen: {fileID: 0} 190 | tvOSSmallIconLayers: [] 191 | tvOSLargeIconLayers: [] 192 | tvOSTopShelfImageLayers: [] 193 | tvOSTopShelfImageWideLayers: [] 194 | iOSLaunchScreenType: 0 195 | iOSLaunchScreenPortrait: {fileID: 0} 196 | iOSLaunchScreenLandscape: {fileID: 0} 197 | iOSLaunchScreenBackgroundColor: 198 | serializedVersion: 2 199 | rgba: 0 200 | iOSLaunchScreenFillPct: 100 201 | iOSLaunchScreenSize: 100 202 | iOSLaunchScreenCustomXibPath: 203 | iOSLaunchScreeniPadType: 0 204 | iOSLaunchScreeniPadImage: {fileID: 0} 205 | iOSLaunchScreeniPadBackgroundColor: 206 | serializedVersion: 2 207 | rgba: 0 208 | iOSLaunchScreeniPadFillPct: 100 209 | iOSLaunchScreeniPadSize: 100 210 | iOSLaunchScreeniPadCustomXibPath: 211 | iOSDeviceRequirements: [] 212 | iOSURLSchemes: [] 213 | iOSBackgroundModes: 0 214 | iOSMetalForceHardShadows: 0 215 | metalEditorSupport: 0 216 | metalAPIValidation: 1 217 | iOSRenderExtraFrameOnPause: 1 218 | appleDeveloperTeamID: 219 | iOSManualSigningProvisioningProfileID: 220 | tvOSManualSigningProvisioningProfileID: 221 | appleEnableAutomaticSigning: 0 222 | AndroidTargetDevice: 0 223 | AndroidSplashScreenScale: 0 224 | androidSplashScreen: {fileID: 0} 225 | AndroidKeystoreName: 226 | AndroidKeyaliasName: 227 | AndroidTVCompatibility: 1 228 | AndroidIsGame: 1 229 | androidEnableBanner: 1 230 | m_AndroidBanners: 231 | - width: 320 232 | height: 180 233 | banner: {fileID: 0} 234 | androidGamepadSupportLevel: 0 235 | resolutionDialogBanner: {fileID: 0} 236 | m_BuildTargetIcons: 237 | - m_BuildTarget: 238 | m_Icons: 239 | - serializedVersion: 2 240 | m_Icon: {fileID: 0} 241 | m_Width: 128 242 | m_Height: 128 243 | m_BuildTargetBatching: [] 244 | m_BuildTargetGraphicsAPIs: [] 245 | m_BuildTargetVRSettings: 246 | - m_BuildTarget: Android 247 | m_Enabled: 0 248 | m_Devices: 249 | - Oculus 250 | - m_BuildTarget: Metro 251 | m_Enabled: 0 252 | m_Devices: [] 253 | - m_BuildTarget: N3DS 254 | m_Enabled: 0 255 | m_Devices: [] 256 | - m_BuildTarget: PS3 257 | m_Enabled: 0 258 | m_Devices: [] 259 | - m_BuildTarget: PS4 260 | m_Enabled: 0 261 | m_Devices: 262 | - PlayStationVR 263 | - m_BuildTarget: PSM 264 | m_Enabled: 0 265 | m_Devices: [] 266 | - m_BuildTarget: PSP2 267 | m_Enabled: 0 268 | m_Devices: [] 269 | - m_BuildTarget: SamsungTV 270 | m_Enabled: 0 271 | m_Devices: [] 272 | - m_BuildTarget: Standalone 273 | m_Enabled: 0 274 | m_Devices: 275 | - Oculus 276 | - m_BuildTarget: Tizen 277 | m_Enabled: 0 278 | m_Devices: [] 279 | - m_BuildTarget: WebGL 280 | m_Enabled: 0 281 | m_Devices: [] 282 | - m_BuildTarget: WebPlayer 283 | m_Enabled: 0 284 | m_Devices: [] 285 | - m_BuildTarget: WiiU 286 | m_Enabled: 0 287 | m_Devices: [] 288 | - m_BuildTarget: Xbox360 289 | m_Enabled: 0 290 | m_Devices: [] 291 | - m_BuildTarget: XboxOne 292 | m_Enabled: 0 293 | m_Devices: [] 294 | - m_BuildTarget: iOS 295 | m_Enabled: 0 296 | m_Devices: [] 297 | - m_BuildTarget: tvOS 298 | m_Enabled: 0 299 | m_Devices: [] 300 | openGLRequireES31: 0 301 | openGLRequireES31AEP: 0 302 | webPlayerTemplate: APPLICATION:Default 303 | m_TemplateCustomTags: {} 304 | wiiUTitleID: 0005000011000000 305 | wiiUGroupID: 00010000 306 | wiiUCommonSaveSize: 4096 307 | wiiUAccountSaveSize: 2048 308 | wiiUOlvAccessKey: 0 309 | wiiUTinCode: 0 310 | wiiUJoinGameId: 0 311 | wiiUJoinGameModeMask: 0000000000000000 312 | wiiUCommonBossSize: 0 313 | wiiUAccountBossSize: 0 314 | wiiUAddOnUniqueIDs: [] 315 | wiiUMainThreadStackSize: 3072 316 | wiiULoaderThreadStackSize: 1024 317 | wiiUSystemHeapSize: 128 318 | wiiUTVStartupScreen: {fileID: 0} 319 | wiiUGamePadStartupScreen: {fileID: 0} 320 | wiiUDrcBufferDisabled: 0 321 | wiiUProfilerLibPath: 322 | playModeTestRunnerEnabled: 0 323 | actionOnDotNetUnhandledException: 1 324 | enableInternalProfiler: 0 325 | logObjCUncaughtExceptions: 1 326 | enableCrashReportAPI: 0 327 | cameraUsageDescription: 328 | locationUsageDescription: 329 | microphoneUsageDescription: 330 | switchNetLibKey: 331 | switchSocketMemoryPoolSize: 6144 332 | switchSocketAllocatorPoolSize: 128 333 | switchSocketConcurrencyLimit: 14 334 | switchScreenResolutionBehavior: 2 335 | switchUseCPUProfiler: 0 336 | switchApplicationID: 0x01004b9000490000 337 | switchNSODependencies: 338 | switchTitleNames_0: 339 | switchTitleNames_1: 340 | switchTitleNames_2: 341 | switchTitleNames_3: 342 | switchTitleNames_4: 343 | switchTitleNames_5: 344 | switchTitleNames_6: 345 | switchTitleNames_7: 346 | switchTitleNames_8: 347 | switchTitleNames_9: 348 | switchTitleNames_10: 349 | switchTitleNames_11: 350 | switchPublisherNames_0: 351 | switchPublisherNames_1: 352 | switchPublisherNames_2: 353 | switchPublisherNames_3: 354 | switchPublisherNames_4: 355 | switchPublisherNames_5: 356 | switchPublisherNames_6: 357 | switchPublisherNames_7: 358 | switchPublisherNames_8: 359 | switchPublisherNames_9: 360 | switchPublisherNames_10: 361 | switchPublisherNames_11: 362 | switchIcons_0: {fileID: 0} 363 | switchIcons_1: {fileID: 0} 364 | switchIcons_2: {fileID: 0} 365 | switchIcons_3: {fileID: 0} 366 | switchIcons_4: {fileID: 0} 367 | switchIcons_5: {fileID: 0} 368 | switchIcons_6: {fileID: 0} 369 | switchIcons_7: {fileID: 0} 370 | switchIcons_8: {fileID: 0} 371 | switchIcons_9: {fileID: 0} 372 | switchIcons_10: {fileID: 0} 373 | switchIcons_11: {fileID: 0} 374 | switchSmallIcons_0: {fileID: 0} 375 | switchSmallIcons_1: {fileID: 0} 376 | switchSmallIcons_2: {fileID: 0} 377 | switchSmallIcons_3: {fileID: 0} 378 | switchSmallIcons_4: {fileID: 0} 379 | switchSmallIcons_5: {fileID: 0} 380 | switchSmallIcons_6: {fileID: 0} 381 | switchSmallIcons_7: {fileID: 0} 382 | switchSmallIcons_8: {fileID: 0} 383 | switchSmallIcons_9: {fileID: 0} 384 | switchSmallIcons_10: {fileID: 0} 385 | switchSmallIcons_11: {fileID: 0} 386 | switchManualHTML: 387 | switchAccessibleURLs: 388 | switchLegalInformation: 389 | switchMainThreadStackSize: 1048576 390 | switchPresenceGroupId: 391 | switchLogoHandling: 0 392 | switchReleaseVersion: 0 393 | switchDisplayVersion: 1.0.0 394 | switchStartupUserAccount: 0 395 | switchTouchScreenUsage: 0 396 | switchSupportedLanguagesMask: 0 397 | switchLogoType: 0 398 | switchApplicationErrorCodeCategory: 399 | switchUserAccountSaveDataSize: 0 400 | switchUserAccountSaveDataJournalSize: 0 401 | switchApplicationAttribute: 0 402 | switchCardSpecSize: -1 403 | switchCardSpecClock: -1 404 | switchRatingsMask: 0 405 | switchRatingsInt_0: 0 406 | switchRatingsInt_1: 0 407 | switchRatingsInt_2: 0 408 | switchRatingsInt_3: 0 409 | switchRatingsInt_4: 0 410 | switchRatingsInt_5: 0 411 | switchRatingsInt_6: 0 412 | switchRatingsInt_7: 0 413 | switchRatingsInt_8: 0 414 | switchRatingsInt_9: 0 415 | switchRatingsInt_10: 0 416 | switchRatingsInt_11: 0 417 | switchLocalCommunicationIds_0: 418 | switchLocalCommunicationIds_1: 419 | switchLocalCommunicationIds_2: 420 | switchLocalCommunicationIds_3: 421 | switchLocalCommunicationIds_4: 422 | switchLocalCommunicationIds_5: 423 | switchLocalCommunicationIds_6: 424 | switchLocalCommunicationIds_7: 425 | switchParentalControl: 0 426 | switchAllowsScreenshot: 1 427 | switchDataLossConfirmation: 0 428 | switchSupportedNpadStyles: 3 429 | switchSocketConfigEnabled: 0 430 | switchTcpInitialSendBufferSize: 32 431 | switchTcpInitialReceiveBufferSize: 64 432 | switchTcpAutoSendBufferSizeMax: 256 433 | switchTcpAutoReceiveBufferSizeMax: 256 434 | switchUdpSendBufferSize: 9 435 | switchUdpReceiveBufferSize: 42 436 | switchSocketBufferEfficiency: 4 437 | switchSocketInitializeEnabled: 1 438 | switchNetworkInterfaceManagerInitializeEnabled: 1 439 | switchPlayerConnectionEnabled: 1 440 | ps4NPAgeRating: 12 441 | ps4NPTitleSecret: 442 | ps4NPTrophyPackPath: 443 | ps4ParentalLevel: 1 444 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 445 | ps4Category: 0 446 | ps4MasterVersion: 01.00 447 | ps4AppVersion: 01.00 448 | ps4AppType: 0 449 | ps4ParamSfxPath: 450 | ps4VideoOutPixelFormat: 0 451 | ps4VideoOutInitialWidth: 1920 452 | ps4VideoOutBaseModeInitialWidth: 1920 453 | ps4VideoOutReprojectionRate: 120 454 | ps4PronunciationXMLPath: 455 | ps4PronunciationSIGPath: 456 | ps4BackgroundImagePath: 457 | ps4StartupImagePath: 458 | ps4SaveDataImagePath: 459 | ps4SdkOverride: 460 | ps4BGMPath: 461 | ps4ShareFilePath: 462 | ps4ShareOverlayImagePath: 463 | ps4PrivacyGuardImagePath: 464 | ps4NPtitleDatPath: 465 | ps4RemotePlayKeyAssignment: -1 466 | ps4RemotePlayKeyMappingDir: 467 | ps4PlayTogetherPlayerCount: 0 468 | ps4EnterButtonAssignment: 1 469 | ps4ApplicationParam1: 0 470 | ps4ApplicationParam2: 0 471 | ps4ApplicationParam3: 0 472 | ps4ApplicationParam4: 0 473 | ps4DownloadDataSize: 0 474 | ps4GarlicHeapSize: 2048 475 | ps4ProGarlicHeapSize: 2560 476 | ps4Passcode: 5PN2qmWqBlQ9wQj99nsQzldVI5ZuGXbE 477 | ps4pnSessions: 1 478 | ps4pnPresence: 1 479 | ps4pnFriends: 1 480 | ps4pnGameCustomData: 1 481 | playerPrefsSupport: 0 482 | restrictedAudioUsageRights: 0 483 | ps4UseResolutionFallback: 0 484 | ps4ReprojectionSupport: 0 485 | ps4UseAudio3dBackend: 0 486 | ps4SocialScreenEnabled: 0 487 | ps4ScriptOptimizationLevel: 3 488 | ps4Audio3dVirtualSpeakerCount: 14 489 | ps4attribCpuUsage: 0 490 | ps4PatchPkgPath: 491 | ps4PatchLatestPkgPath: 492 | ps4PatchChangeinfoPath: 493 | ps4PatchDayOne: 0 494 | ps4attribUserManagement: 0 495 | ps4attribMoveSupport: 0 496 | ps4attrib3DSupport: 0 497 | ps4attribShareSupport: 0 498 | ps4attribExclusiveVR: 0 499 | ps4disableAutoHideSplash: 0 500 | ps4videoRecordingFeaturesUsed: 0 501 | ps4contentSearchFeaturesUsed: 0 502 | ps4attribEyeToEyeDistanceSettingVR: 0 503 | ps4IncludedModules: [] 504 | monoEnv: 505 | psp2Splashimage: {fileID: 0} 506 | psp2NPTrophyPackPath: 507 | psp2NPSupportGBMorGJP: 0 508 | psp2NPAgeRating: 12 509 | psp2NPTitleDatPath: 510 | psp2NPCommsID: 511 | psp2NPCommunicationsID: 512 | psp2NPCommsPassphrase: 513 | psp2NPCommsSig: 514 | psp2ParamSfxPath: 515 | psp2ManualPath: 516 | psp2LiveAreaGatePath: 517 | psp2LiveAreaBackroundPath: 518 | psp2LiveAreaPath: 519 | psp2LiveAreaTrialPath: 520 | psp2PatchChangeInfoPath: 521 | psp2PatchOriginalPackage: 522 | psp2PackagePassword: WRK5RhRXdCdG5nG5azdNMK66MuCV6GXi 523 | psp2KeystoneFile: 524 | psp2MemoryExpansionMode: 0 525 | psp2DRMType: 0 526 | psp2StorageType: 0 527 | psp2MediaCapacity: 0 528 | psp2DLCConfigPath: 529 | psp2ThumbnailPath: 530 | psp2BackgroundPath: 531 | psp2SoundPath: 532 | psp2TrophyCommId: 533 | psp2TrophyPackagePath: 534 | psp2PackagedResourcesPath: 535 | psp2SaveDataQuota: 10240 536 | psp2ParentalLevel: 1 537 | psp2ShortTitle: Not Set 538 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 539 | psp2Category: 0 540 | psp2MasterVersion: 01.00 541 | psp2AppVersion: 01.00 542 | psp2TVBootMode: 0 543 | psp2EnterButtonAssignment: 2 544 | psp2TVDisableEmu: 0 545 | psp2AllowTwitterDialog: 1 546 | psp2Upgradable: 0 547 | psp2HealthWarning: 0 548 | psp2UseLibLocation: 0 549 | psp2InfoBarOnStartup: 0 550 | psp2InfoBarColor: 0 551 | psp2ScriptOptimizationLevel: 0 552 | psmSplashimage: {fileID: 0} 553 | splashScreenBackgroundSourceLandscape: {fileID: 0} 554 | splashScreenBackgroundSourcePortrait: {fileID: 0} 555 | spritePackerPolicy: 556 | webGLMemorySize: 256 557 | webGLExceptionSupport: 1 558 | webGLNameFilesAsHashes: 0 559 | webGLDataCaching: 0 560 | webGLDebugSymbols: 0 561 | webGLEmscriptenArgs: 562 | webGLModulesDirectory: 563 | webGLTemplate: APPLICATION:Default 564 | webGLAnalyzeBuildSize: 0 565 | webGLUseEmbeddedResources: 0 566 | webGLUseWasm: 0 567 | webGLCompressionFormat: 1 568 | scriptingDefineSymbols: {} 569 | platformArchitecture: 570 | iOS: 2 571 | tvOS: 1 572 | scriptingBackend: 573 | Android: 0 574 | Metro: 2 575 | Standalone: 0 576 | WP8: 2 577 | WebGL: 1 578 | iOS: 1 579 | tvOS: 1 580 | incrementalIl2cppBuild: 581 | iOS: 1 582 | tvOS: 0 583 | additionalIl2CppArgs: 584 | scriptingRuntimeVersion: 0 585 | apiCompatibilityLevelPerPlatform: {} 586 | m_RenderingPath: 1 587 | m_MobileRenderingPath: 1 588 | metroPackageName: net.deadlyfingers.Unity3dAzureDemo 589 | metroPackageVersion: 1.0.0.0 590 | metroCertificatePath: Assets\WSATestCertificate.pfx 591 | metroCertificatePassword: 592 | metroCertificateSubject: DefaultCompany 593 | metroCertificateIssuer: DefaultCompany 594 | metroCertificateNotAfter: 005b50d72d25d301 595 | metroApplicationDescription: MobileServicesDemo 596 | wsaImages: {} 597 | metroTileShortName: 598 | metroCommandLineArgsFile: 599 | metroTileShowName: 0 600 | metroMediumTileShowName: 0 601 | metroLargeTileShowName: 0 602 | metroWideTileShowName: 0 603 | metroDefaultTileSize: 1 604 | metroTileForegroundText: 1 605 | metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 606 | metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 607 | metroSplashScreenUseBackgroundColor: 0 608 | platformCapabilities: 609 | WindowsStoreApps: 610 | AllJoyn: False 611 | BlockedChatMessages: False 612 | Bluetooth: False 613 | Chat: False 614 | CodeGeneration: False 615 | EnterpriseAuthentication: False 616 | HumanInterfaceDevice: False 617 | InternetClient: True 618 | InternetClientServer: False 619 | Location: False 620 | Microphone: False 621 | MusicLibrary: False 622 | Objects3D: False 623 | PhoneCall: False 624 | PicturesLibrary: False 625 | PrivateNetworkClientServer: False 626 | Proximity: False 627 | RemovableStorage: False 628 | SharedUserCertificates: False 629 | SpatialPerception: False 630 | UserAccountInformation: False 631 | VideosLibrary: False 632 | VoipCall: False 633 | WebCam: False 634 | metroFTAName: 635 | metroFTAFileTypes: [] 636 | metroProtocolName: 637 | metroCompilationOverrides: 1 638 | tizenProductDescription: 639 | tizenProductURL: 640 | tizenSigningProfileName: 641 | tizenGPSPermissions: 0 642 | tizenMicrophonePermissions: 0 643 | tizenDeploymentTarget: 644 | tizenDeploymentTargetType: 0 645 | tizenMinOSVersion: 1 646 | n3dsUseExtSaveData: 0 647 | n3dsCompressStaticMem: 1 648 | n3dsExtSaveDataNumber: 0x12345 649 | n3dsStackSize: 131072 650 | n3dsTargetPlatform: 2 651 | n3dsRegion: 7 652 | n3dsMediaSize: 0 653 | n3dsLogoStyle: 3 654 | n3dsTitle: GameName 655 | n3dsProductCode: 656 | n3dsApplicationId: 0xFF3FF 657 | stvDeviceAddress: 658 | stvProductDescription: 659 | stvProductAuthor: 660 | stvProductAuthorEmail: 661 | stvProductLink: 662 | stvProductCategory: 0 663 | XboxOneProductId: 664 | XboxOneUpdateKey: 665 | XboxOneSandboxId: 666 | XboxOneContentId: 667 | XboxOneTitleId: 668 | XboxOneSCId: 669 | XboxOneGameOsOverridePath: 670 | XboxOnePackagingOverridePath: 671 | XboxOneAppManifestOverridePath: 672 | XboxOnePackageEncryption: 0 673 | XboxOnePackageUpdateGranularity: 2 674 | XboxOneDescription: 675 | XboxOneLanguage: 676 | - enus 677 | XboxOneCapability: [] 678 | XboxOneGameRating: {} 679 | XboxOneIsContentPackage: 0 680 | XboxOneEnableGPUVariability: 0 681 | XboxOneSockets: {} 682 | XboxOneSplashScreen: {fileID: 0} 683 | XboxOneAllowedProductIds: [] 684 | XboxOnePersistentLocalStorageSize: 0 685 | xboxOneScriptCompiler: 0 686 | vrEditorSettings: 687 | daydream: 688 | daydreamIconForeground: {fileID: 0} 689 | daydreamIconBackground: {fileID: 0} 690 | cloudServicesEnabled: 691 | Analytics: 0 692 | Build: 0 693 | Collab: 0 694 | ErrorHub: 0 695 | Game_Performance: 0 696 | Hub: 0 697 | Purchasing: 0 698 | UNet: 0 699 | Unity_Ads: 0 700 | facebookSdkVersion: 7.9.4 701 | apiCompatibilityLevel: 2 702 | cloudProjectId: 703 | projectName: 704 | organizationId: 705 | cloudEnabled: 0 706 | enableNativePlatformBackendsForNewInputSystem: 0 707 | disableOldInputManagerSupport: 0 708 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2017.1.1f1 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 2 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | blendWeights: 1 21 | textureQuality: 1 22 | anisotropicTextures: 0 23 | antiAliasing: 0 24 | softParticles: 0 25 | softVegetation: 0 26 | realtimeReflectionProbes: 0 27 | billboardsFaceCameraPosition: 0 28 | vSyncCount: 0 29 | lodBias: 0.3 30 | maximumLODLevel: 0 31 | particleRaycastBudget: 4 32 | asyncUploadTimeSlice: 2 33 | asyncUploadBufferSize: 4 34 | excludedTargetPlatforms: [] 35 | - serializedVersion: 2 36 | name: Fast 37 | pixelLightCount: 0 38 | shadows: 0 39 | shadowResolution: 0 40 | shadowProjection: 1 41 | shadowCascades: 1 42 | shadowDistance: 20 43 | shadowNearPlaneOffset: 2 44 | shadowCascade2Split: 0.33333334 45 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 46 | blendWeights: 2 47 | textureQuality: 0 48 | anisotropicTextures: 0 49 | antiAliasing: 0 50 | softParticles: 0 51 | softVegetation: 0 52 | realtimeReflectionProbes: 0 53 | billboardsFaceCameraPosition: 0 54 | vSyncCount: 0 55 | lodBias: 0.4 56 | maximumLODLevel: 0 57 | particleRaycastBudget: 16 58 | asyncUploadTimeSlice: 2 59 | asyncUploadBufferSize: 4 60 | excludedTargetPlatforms: [] 61 | - serializedVersion: 2 62 | name: Simple 63 | pixelLightCount: 1 64 | shadows: 1 65 | shadowResolution: 0 66 | shadowProjection: 1 67 | shadowCascades: 1 68 | shadowDistance: 20 69 | shadowNearPlaneOffset: 2 70 | shadowCascade2Split: 0.33333334 71 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 72 | blendWeights: 2 73 | textureQuality: 0 74 | anisotropicTextures: 1 75 | antiAliasing: 0 76 | softParticles: 0 77 | softVegetation: 0 78 | realtimeReflectionProbes: 0 79 | billboardsFaceCameraPosition: 0 80 | vSyncCount: 0 81 | lodBias: 0.7 82 | maximumLODLevel: 0 83 | particleRaycastBudget: 64 84 | asyncUploadTimeSlice: 2 85 | asyncUploadBufferSize: 4 86 | excludedTargetPlatforms: [] 87 | - serializedVersion: 2 88 | name: Good 89 | pixelLightCount: 2 90 | shadows: 2 91 | shadowResolution: 1 92 | shadowProjection: 1 93 | shadowCascades: 2 94 | shadowDistance: 40 95 | shadowNearPlaneOffset: 2 96 | shadowCascade2Split: 0.33333334 97 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 98 | blendWeights: 2 99 | textureQuality: 0 100 | anisotropicTextures: 1 101 | antiAliasing: 0 102 | softParticles: 0 103 | softVegetation: 1 104 | realtimeReflectionProbes: 1 105 | billboardsFaceCameraPosition: 1 106 | vSyncCount: 1 107 | lodBias: 1 108 | maximumLODLevel: 0 109 | particleRaycastBudget: 256 110 | asyncUploadTimeSlice: 2 111 | asyncUploadBufferSize: 4 112 | excludedTargetPlatforms: [] 113 | - serializedVersion: 2 114 | name: Beautiful 115 | pixelLightCount: 3 116 | shadows: 2 117 | shadowResolution: 2 118 | shadowProjection: 1 119 | shadowCascades: 2 120 | shadowDistance: 70 121 | shadowNearPlaneOffset: 2 122 | shadowCascade2Split: 0.33333334 123 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 124 | blendWeights: 4 125 | textureQuality: 0 126 | anisotropicTextures: 2 127 | antiAliasing: 2 128 | softParticles: 1 129 | softVegetation: 1 130 | realtimeReflectionProbes: 1 131 | billboardsFaceCameraPosition: 1 132 | vSyncCount: 1 133 | lodBias: 1.5 134 | maximumLODLevel: 0 135 | particleRaycastBudget: 1024 136 | asyncUploadTimeSlice: 2 137 | asyncUploadBufferSize: 4 138 | excludedTargetPlatforms: [] 139 | - serializedVersion: 2 140 | name: Fantastic 141 | pixelLightCount: 4 142 | shadows: 2 143 | shadowResolution: 2 144 | shadowProjection: 1 145 | shadowCascades: 4 146 | shadowDistance: 150 147 | shadowNearPlaneOffset: 2 148 | shadowCascade2Split: 0.33333334 149 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 150 | blendWeights: 4 151 | textureQuality: 0 152 | anisotropicTextures: 2 153 | antiAliasing: 2 154 | softParticles: 1 155 | softVegetation: 1 156 | realtimeReflectionProbes: 1 157 | billboardsFaceCameraPosition: 1 158 | vSyncCount: 1 159 | lodBias: 2 160 | maximumLODLevel: 0 161 | particleRaycastBudget: 4096 162 | asyncUploadTimeSlice: 2 163 | asyncUploadBufferSize: 4 164 | excludedTargetPlatforms: [] 165 | m_PerPlatformDefaultQuality: {} 166 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | CrashReportingSettings: 11 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 12 | m_Enabled: 0 13 | m_CaptureEditorExceptions: 1 14 | UnityPurchasingSettings: 15 | m_Enabled: 0 16 | m_TestMode: 0 17 | UnityAnalyticsSettings: 18 | m_Enabled: 0 19 | m_InitializeOnStartup: 1 20 | m_TestMode: 0 21 | m_TestEventUrl: 22 | m_TestConfigUrl: 23 | UnityAdsSettings: 24 | m_Enabled: 0 25 | m_InitializeOnStartup: 1 26 | m_TestMode: 0 27 | m_EnabledPlatforms: 4294967295 28 | m_IosGameId: 29 | m_AndroidGameId: 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Azure App Services for Unity3d 2 | Contains a Unity 5 project featuring two demo scenes for Azure App Services (previously Mobile Services). 3 | 4 | 1. Highscores demo scene 5 | 2. Inventory demo scene 6 | 7 | ## :octocat: Download instructions 8 | This project contains git submodule dependencies so use: 9 | `git clone --recursive https://github.com/Unity3dAzure/AppServicesDemo.git` 10 | 11 | Or if you've already done a git clone then use: 12 | `git submodule update --init --recursive` 13 | 14 | ## Highscore demo features 15 | * Client-directed login with Facebook 16 | * Insert Highscore 17 | * Update Highscore 18 | * Read list of Highscores using infinite scrolling (hall of fame) 19 | * Query for today's top ten highscores (daily leaderboard) 20 | * Query for username (user's scores) 21 | 22 | [![App Services Highscores Unity demo video](https://j.gifs.com/Y6J0oK.gif)](https://youtu.be/R8adpelztJA) 23 | 24 | ## Inventory demo features 25 | * Client-directed login with Facebook 26 | * Load User's inventory. 27 | * Save User's inventory. (Inserts if new or Updates existing record) 28 | 29 | [![App Services Inventory Unity demo video](https://j.gifs.com/lOyLn6.gif)](https://youtu.be/R8adpelztJA) 30 | 31 | ## Developer blogs 32 | - [How to setup Azure App Services to create Unity highscores leaderboard](http://www.deadlyfingers.net/azure/azure-app-services-for-unity3d/). 33 | 34 | ## Setup Azure App Services for Unity 35 | 1. Create an [Azure Mobile App](https://portal.azure.com/) 36 | * Create 'Highscores' and 'Inventory' table for storing app data using **Easy Tables**. 37 | 2. In Unity open scene file(s) inside the *Scenes* folder: 38 | * *HighscoresDemo.unity* 39 | * *InventoryDemo.unity* 40 | 3. Then select the *AppServicesController gameobject* in the Unity Hierarchy window and paste your **Azure App Service URL** into the Editor Inspector field. 41 | ![alt Unity Editor Mobile Services config](https://cloud.githubusercontent.com/assets/1880480/18139855/0e5fe626-6fab-11e6-8de6-484e3b909cc8.png) 42 | 43 | ## Setup Azure App Services with Authentication 44 | This demo uses Facebook identity to save user's highscore or inventory items: 45 | 46 | 1. [Create Facebook app](https://developers.facebook.com/apps/) 47 | 2. Fill in the [Azure App Services](https://portal.azure.com/) Authentication settings with Facebook App Id & App Secret. 48 | 3. Paste [Facebook access user token](https://developers.facebook.com/tools/accesstoken/) into Unity access token field to enable Login button. 49 | 4. Modify 'Highscores' and 'Inventory' table script (using 'Insert' snippet below) to save `user.id` 50 | 51 | #### **Easy Table Insert** script (*tables/Highscores.js*, *tables/Inventory.js*) 52 | ```node 53 | var table = module.exports = require('azure-mobile-apps').table(); 54 | table.insert(function (context) { 55 | if (context.user) { 56 | context.item.userId = context.user.id; 57 | } 58 | return context.execute(); 59 | }); 60 | ``` 61 | 62 | ## Setup Azure App Services custom APIs with **Easy APIs** 63 | With [Azure App Services](https://portal.azure.com/) you can create custom APIs using **Easy APIs**. 64 | 65 | 1. Create a 'hello' api (using "get" method) to say hello! (Example Easy API message script below) 66 | 2. Create a 'GenerateScores' api (using "post" method) to generate 10 random scores. (Example Easy API query script below) 67 | 68 | #### Easy API 'hello' script (*api/hello.js*) 69 | ```node 70 | module.exports = { 71 | "get": function (req, res, next) { 72 | res.send(200, { message : "Hello Unity!" }); 73 | } 74 | } 75 | ``` 76 | 77 | #### Easy API 'GenerateScores' script (*api/GenerateScores.js*) 78 | ```node 79 | var util = require('util'); 80 | module.exports = { 81 | "post": function (req, res, next) { 82 | var insert = "INSERT INTO Highscores (username,score) VALUES "; 83 | var i = 10; 84 | while (i--) { 85 | var min = 1; 86 | var max = 1000; 87 | var rand = Math.floor(Math.random() * (max - min)) + min; 88 | var values = util.format("('%s',%d),", 'Zumo', rand); 89 | insert = insert + values; 90 | } 91 | insert = insert.slice(0, -1); // remove last ',' 92 | var query = { 93 | sql: insert 94 | }; 95 | req.azureMobile.data.execute(query).then(function(results){ 96 | res.send(200, { message : "Zumo set some highscores!" }); 97 | }); 98 | } 99 | } 100 | 101 | ``` 102 | ## Known issues 103 | * There is an issue with [PATCH on Android using UnityWebRequest with Azure App Services](http://answers.unity3d.com/questions/1230067/trying-to-use-patch-on-a-unitywebrequest-on-androi.html). 104 | Android doesn't support PATCH requests made with UnityWebRequest needed to perform Azure App Service updates. 105 | One workaround is to enable the `X-HTTP-Method-Override` header. Here's the quick fix for App Services running node backend: 106 | 1. Install the "method-override" package. 107 | ``` 108 | npm install method-override --save 109 | ``` 110 | 2. In 'app.js' file insert: 111 | ``` 112 | var methodOverride = require('method-override'); 113 | // after the line "var app = express();" add 114 | app.use(methodOverride('X-HTTP-Method-Override')); 115 | ``` 116 | 117 | This will enable PATCH requests to be sent on Android. 118 | 119 | ## Credits 120 | * Inventory uses [pixel art icons designed by Henrique Lazarini](http://7soul1.deviantart.com/art/420-Pixel-Art-Icons-for-RPG-129892453) 121 | 122 | ## Dependencies included 123 | * [TSTableView](https://bitbucket.org/tacticsoft/tstableview) is used to display recyclable list of results. 124 | 125 | ## Dependencies installed as git submodules 126 | * [AppServices](https://github.com/Unity3dAzure/AppServices) for Unity. 127 | * [RESTClient](https://github.com/Unity3dAzure/RESTClient) for Unity. 128 | 129 | Refer to the download instructions above to install these submodules. 130 | 131 | Questions or tweet #Azure #GameDev [@deadlyfingers](https://twitter.com/deadlyfingers) 132 | --------------------------------------------------------------------------------