dfPanel control = gameObject.GetComponent<dfPanel>(); dfLabel avatarName = control.Find<dfLabel>("AvatarName"); dfLabel avatarLvl = control.Find<dfLabel>("AvatarLvl"); avatarName.Text = Screen.width.ToString(); avatarLvl.Text = Screen.height.ToString(); control是avatarName 和avatarLvl 的父级 脚本绑在control上