protected override void Run(ETModel.Session session, LoginResult message) { DiskComponet diskComponet = Game.Scene.GetComponent <DiskComponet>(); Log.Debug($" playerId = {message.PlayerId}"); SessionComponent.Instance.Session.Pid = message.PlayerId; diskComponet.Clear(); for (int i = 0; i < message.Bigs.count; i++) { diskComponet.AddBigIcon(message.Bigs[i]); } for (int i = 0; i < message.Middles.count; i++) { diskComponet.AddMiddleIcon(message.Middles[i]); } for (int i = 0; i < message.Smalls.count; i++) { diskComponet.AddSmallIcon(message.Smalls[i]); } Game.Scene.GetComponent <UIComponent>().OpenPanelAsync(UIEnum.Disk); Game.Scene.GetComponent <UIComponent>().Close(UIEnum.Begin); }
public void Awake() { ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); this.big = rc.Get <GameObject>("big"); this.middle = rc.Get <GameObject>("middle"); this.small = rc.Get <GameObject>("small"); this.begin = rc.Get <GameObject>("begin"); begin.GetComponent <Button>().onClick.Add(OnBegin); DiskComponet diskComponet = Game.Scene.GetComponent <DiskComponet>(); List <string> bigIcons = diskComponet.GetBigIcons(); for (int i = 0; i < bigIcons.Count; i++) { addIcon(this.big, 395, i, bigIcons[i]); } List <string> middleIcons = diskComponet.GetMiddleIcons(); for (int i = 0; i < middleIcons.Count; i++) { addIcon(this.middle, 280, i, middleIcons[i]); } List <string> smallIcons = diskComponet.GetSmallIcons(); for (int i = 0; i < smallIcons.Count; i++) { addIcon(this.small, 140, i, smallIcons[i]); } this.tbBig = ComponentFactory.Create <Turntable, GameObject>(this.big); //this.tbBig.Parent = this; this.tbMiddle = ComponentFactory.Create <Turntable, GameObject>(this.middle); //this.tbMiddle.Parent = this; this.tbSmall = ComponentFactory.Create <Turntable, GameObject>(this.small); //this.tbSmall.Parent = this; }