Example #1
0
        public void InitActorList()
        {
            this.PlayerItems = new List <NetPlayerItem>();
            List <ActorNet> rActors = Account.Instance.NetActors;

            if (rActors != null)
            {
                for (int i = 0; i < rActors.Count; i++)
                {
                    GameObject rPlayerItemObj = GameObject.Instantiate(this.NetPlayerItemTemplate.GameObject);
                    rPlayerItemObj.SetActive(true);
                    var rMBContainer   = rPlayerItemObj.GetComponent <HotfixMBContainer>();
                    var rNetPlayerItem = new NetPlayerItem(rMBContainer);

                    rNetPlayerItem.Parent = this;
                    rNetPlayerItem.Set(rActors[i]);

                    rNetPlayerItem.SetSelected(i == 0);
                    if (i == 0)
                    {
                        rNetPlayerItem.OnValueChanged();
                    }
                    rPlayerItemObj.transform.SetParent(this.PlayerListContainer.transform, false);
                    this.PlayerItems.Add(rNetPlayerItem);
                }
            }
        }
Example #2
0
        public override void OnInitialize()
        {
            this.PlayerListContainer = this.Objects[1].Object as GridLayoutGroup;
            this.StartGameBtn        = this.Objects[2].Object as Button;
            this.CreatePlayerBtn     = this.Objects[3].Object as Button;
            this.SelectedPlayerItem  = null;

            this.EventBinding(this.StartGameBtn, EventTriggerType.PointerClick, OnStartGameBtn_Clicked);
            this.EventBinding(this.CreatePlayerBtn, EventTriggerType.PointerClick, OnCreatePlayerBtn_Clicked);
        }
Example #3
0
 public override void OnOpening()
 {
     this.NetPlayerItemTemplate = new NetPlayerItem(this.Objects[0].Object as HotfixMBContainer);
     this.InitActorList();
 }
Example #4
0
 public override void OnInitialize()
 {
     this.PlayerListContainer = this.Objects[1].Object as GridLayoutGroup;
     this.SelectedPlayerItem  = null;
 }