public void Awake(A0008_GetUserInfo_G2C message) { //保存帐号信息 messageUser = message; //获取父级"包" FUI SelectCharacter = this.GetParent <FUI>(); Controller = SelectCharacter.Get("Controller"); //Get有先后顺序 SeatSelect = Controller.GObject.asCom.GetController("c1"); NoneorExist1 = Controller.GObject.asCom.GetController("c2"); NoneorExist2 = Controller.GObject.asCom.GetController("c3"); NoneorExist3 = Controller.GObject.asCom.GetController("c4"); Holder1 = Controller.Get("Holder1"); Holder2 = Controller.Get("Holder2"); Holder3 = Controller.Get("Holder3"); Money1 = Controller.Get("Money1"); Money2 = Controller.Get("Money2"); Money3 = Controller.Get("Money3"); Mail1 = Controller.Get("Mail1"); Mail2 = Controller.Get("Mail2"); Mail3 = Controller.Get("Mail3"); Level1 = Controller.Get("Level1"); Level2 = Controller.Get("Level2"); Level3 = Controller.Get("Level3"); Location1 = Controller.Get("Location1"); Location2 = Controller.Get("Location2"); Location3 = Controller.Get("Location3"); //设置当前激活序列 由上次登陆游戏/注册的角色决定 SeatSelect.SetSelectedIndex(messageUser.LastPlay - 1); //加载帐号设置 形象/金钱/邮件/等级/位置 OnLoadCharacters(messageUser.Characters[0], Holder1, NoneorExist1, Money1, Mail1, Level1, Location1); OnLoadCharacters(messageUser.Characters[1], Holder2, NoneorExist2, Money2, Mail2, Level2, Location2); OnLoadCharacters(messageUser.Characters[2], Holder3, NoneorExist3, Money3, Mail3, Level3, Location3); //添加事件 Controller.Get("Select1").GObject.asButton.onClick.Add(OnSelect1); //选择一个角色位置 进入游戏或创建角色 Controller.Get("Select2").GObject.asButton.onClick.Add(OnSelect2); Controller.Get("Select3").GObject.asButton.onClick.Add(OnSelect3); Log.Debug("加载完选择角色界面"); }
//加载3个角色空位中的人物形象 public void OnLoadCharacters(CharacterInfo message, FUI holder, Controller controller, FUI money, FUI mail, FUI level, FUI location) { if (message.Level == 0) { controller.SetSelectedIndex(0); } else { controller.SetSelectedIndex(1); //获得资源设置 string skeleton = SekiaHelper.GetSkeletonName(message.Skeleton); string weapon = SekiaHelper.GetWeaponName(message.Weapon); string head = SekiaHelper.GetHeadName(message.Head); string chest = SekiaHelper.GetChestName(message.Chest); string hand = SekiaHelper.GetHandName(message.Hand); string feet = SekiaHelper.GetFeetName(message.Feet); //设置模型到指定位置 GameObject demo = SekiaHelper.CreateCharacter(skeleton, weapon, head, chest, hand, feet); demo.transform.localPosition = new Vector3(30, -125, 1000); //模型的原点在脚下 向下位移半个身高 向右位移1/4身宽 //Log.Debug($"Holder位置 X:{holder.GObject.x} Y:{holder.GObject.y}"); //编辑器中的坐标 以左上角为原点 Y为正值 demo.transform.localScale = new Vector3(125, 125, 125); //大小 demo.transform.localEulerAngles = new Vector3(0, 180, 0); //角度 GoWrapper wrapper = new GoWrapper(demo); holder.GObject.asGraph.SetNativeObject(wrapper); //设置各项参数 money.GObject.asTextField.text = message.Money.ToString(); mail.GObject.asTextField.text = message.Mail.ToString(); level.GObject.asTextField.text = $"Lv.{message.Level} {message.Name}"; location.GObject.asTextField.text = $"{Enum.GetName(message.Career.GetType(), message.Career)}·{Enum.GetName(message.Region.GetType(), message.Region)}"; } }
public void Add(FUI ui) { Root.Add(ui); }
public void Push(FUI fui) { this.uis.Peek().Visible = false; this.uis.Push(fui); }
public FUI Get(string name) { FUI ui = this.Root.Get(name); return(ui); }
public void Add(FUI ui) { this.Root.Add(ui); }