// -------------------------------------------------------------------------------
        protected override void ThrottledUpdate()
        {
            if (manager == null)
            {
                manager = localPlayer.GetComponent <AchievementManager>();
            }

            for (int i = 0; i < contentGroup.childCount; i++)
            {
                GameObject.Destroy(contentGroup.GetChild(i).gameObject);
            }

            foreach (AchievementSyncStruct _entry in manager.GetEntries(SortOrder.None, category))
            {
                AchievementSyncStruct entry  = _entry;
                GameObject            prefab = null;

                if (displayType == DisplayType.Horizontal)
                {
                    prefab = horizontalSlotPrefab.gameObject;
                }
                else if (displayType == DisplayType.Vertical)
                {
                    prefab = verticalSlotPrefab.gameObject;
                }
                else if (displayType == DisplayType.Grid)
                {
                    prefab = gridSlotPrefab.gameObject;
                }

                GameObject go = GameObject.Instantiate(prefab);
                go.transform.SetParent(contentGroup, false);
                go.GetComponent <UIPlayerListAchievementSlot>().Init(localPlayer, ref entry);
            }
        }
コード例 #2
0
        // -------------------------------------------------------------------------------
        public void Init(GameObject localPlayer, AchievementSyncStruct _entry)
        {
            entry = _entry;

            manager           = localPlayer.GetComponent <AchievementManager>();
            permissionManager = localPlayer.GetComponent <PermissionManager>();


            Setup();
        }
コード例 #3
0
        public void AddEntry(int _slot, AchievementTemplate _template, long _value)
        {
            AchievementSyncStruct syncStruct = new AchievementSyncStruct(_slot, _template, _value);

            syncAchievements.Add(syncStruct);
        }