开始开发
This commit is contained in:
69
Assets/Script/TabChangeController.cs
Normal file
69
Assets/Script/TabChangeController.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using RenderStreaming;
|
||||
using Stary.Evo;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TabChangeController : MonoBehaviour, IController
|
||||
{
|
||||
private Toggle _meetingTog;
|
||||
private Toggle _chatTog;
|
||||
private Toggle _contactTog;
|
||||
|
||||
private GameObject _meetingInfoList;
|
||||
private GameObject _meetingChat;
|
||||
private GameObject _meetingContacts;
|
||||
void Start()
|
||||
{
|
||||
_meetingTog = transform.Find("MeetingOrganizers").GetComponent<Toggle>();
|
||||
_chatTog = transform.Find("Chat").GetComponent<Toggle>();
|
||||
_contactTog = transform.Find("Contacts").GetComponent<Toggle>();
|
||||
_meetingInfoList = transform.parent.Find("MeetingInfoList").gameObject;
|
||||
_meetingChat = transform.parent.Find("MeetingChat").gameObject;
|
||||
_meetingContacts = transform.parent.Find("MeetingContacts").gameObject;
|
||||
_meetingTog.onValueChanged.AddListener(OnMeetingOrganizers);
|
||||
_chatTog.onValueChanged.AddListener(OnChat);
|
||||
_contactTog.onValueChanged.AddListener(OnContacts);
|
||||
|
||||
|
||||
|
||||
_meetingTog.isOn = true;
|
||||
}
|
||||
private void OnMeetingOrganizers(bool value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
_meetingInfoList.SetActive(true);
|
||||
_meetingChat.SetActive(false);
|
||||
_meetingContacts.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnChat(bool value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
_meetingInfoList.SetActive(false);
|
||||
_meetingChat.SetActive(true);
|
||||
_meetingContacts.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnContacts(bool value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
_meetingInfoList.SetActive(false);
|
||||
_meetingChat.SetActive(false);
|
||||
_meetingContacts.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public IArchitecture GetArchitecture()
|
||||
{
|
||||
return MainArchitecture.Interface;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user