using System.Collections; using System.Collections.Generic; using UnityEngine; public class CourseBarView : MonoBehaviour { [SerializeField] private Tab3DButtonList MTabBtnList; [SerializeField] private TextMesh TitileText; [SerializeField] private TextMesh RoomNameText; [SerializeField] private TextMesh ChatRoomNameText; [SerializeField] private TextMesh UserNameText; void Start() { MTabBtnList.ClickAction = TabClick; } private string title_str = "{0}-{1}"; private string user_name_str = "用户名: {0}"; private string room_str = "房间名字: {0}"; public void Show() { CourseConfigData course_config = GameConfigData.Instance.course_data.GetCourseConfigById(GamePlayerData.Instance.room_data.CurOnlineData.course_id); TitileText.text = string.Format(title_str, GameConfigData.Instance.course_data.GetSubjectNameById(short.Parse(course_config.subject_id)), course_config.course_name, GamePlayerData.Instance.room_data.CurOnlineData.course_name); RoomNameText.text = string.Format(room_str, GamePlayerData.Instance.room_data.CurOnlineData.course_name); UserNameText.text = string.Format(user_name_str, GamePlayerData.Instance.user_name); this.gameObject.SetActive(true); MTabBtnList.Show(); MTabBtnList.ResetBtns(); MTabBtnList.SetBtnVisiable(4, GamePlayerData.Instance.room_data.CurOnlineData.course_id == 12 || GamePlayerData.Instance.room_data.CurOnlineData.course_id == 78); } public void Hide() { this.gameObject.SetActive(false); } private void TabClick() { //屏蔽掉非房主的操作 if (!GamePlayerData.Instance.IsFangzhu()) { return; } PannelType pType = PannelType.Default; switch (MTabBtnList.Index) { case 0: pType = PannelType.Goal; break; case 1: pType = PannelType.Procedure; break; case 2: pType = PannelType.Question; break; case 3: pType = PannelType.Conclusion; break; case 4: pType = PannelType.MR; break; } MessageCenterController.Instance.Broadcast(GameEnum.MESSAGE_SHOW_PANNEL_BY_TYPE, pType); } private void OnDestroy() { } }