Exemplo n.º 1
0
    public void CloseRank()
    {
        RankContent.GetInstance().RemoveRankCell();

        m_objMainMenu.SetActive(true);
        m_objRankContent.SetActive(false);

        m_objRankContent.transform.localPosition = new Vector3(-1500.0f, 0.0f, 0.0f);
    }
Exemplo n.º 2
0
        public void Initialize(string title)
        {
            RemoveAll();

            var value     = Agent.GetState(RankStateAddress);
            var rankState = (value is null ? new RankingState() : new RankingState((Bencodex.Types.Dictionary)value));

            var rankingInfos = rankState.GetRanking(title);
            var rank         = rankingInfos.Select(kv => kv.Value).OrderByDescending(info => info.score);

            _rankContent.gameObject.SetActive(true);

            var         i           = 1;
            var         bgImage     = true;
            RankContent prevContent = null;

            foreach (var info in rank)
            {
                if (!AgentMap.ContainsKey(info.address))
                {
                    AgentMap[info.address] = new AgentState((Bencodex.Types.Dictionary)Agent.GetState(info.address));
                }


                var content = Instantiate(_rankContent, _rankList.content);
                if (prevContent != null && prevContent.Score == info.score)
                {
                    content.Initialize(prevContent.Rank, AgentMap[info.address].Name, AgentMap[info.address].address.ToHex(), info.score, bgImage);
                }
                else
                {
                    content.Initialize(i, AgentMap[info.address].Name, AgentMap[info.address].address.ToHex(), info.score, bgImage);
                }

                i++;
                bgImage     = !bgImage;
                prevContent = content;
            }
            _rankContent.gameObject.SetActive(false);
        }
Exemplo n.º 3
0
 private void Awake()
 {
     m_refInstance = this;
 }