上海虹口龙之梦项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

65 lines
2.0 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UniRx;
public class AttributePanelControl : MonoBehaviour
{
public bool isImagePanel=true;
public GameObject InfosPanel;
public GameObject InputsPanel;
public GameObject DefaultPanel;
public GameObject EditorPanel;
public GameObject ImageControlPanel;
// Start is called before the first frame update
void Start()
{
transform.Find("Bottom/DefaultPanel/EditorButton").GetComponent<Button>().OnClickAsObservable()
.Subscribe(_ =>
{
InfosPanel.SetActive(false);
InputsPanel.SetActive(true);
DefaultPanel.SetActive(false);
EditorPanel.SetActive(true);
if (isImagePanel)
ImageControlPanel.SetActive(true);
}).AddTo(gameObject);
transform.Find("Bottom/EditorPanel/CancelButton").GetComponent<Button>().OnClickAsObservable()
.Subscribe(_ =>
{
InfosPanel.SetActive(true);
InputsPanel.SetActive(false);
DefaultPanel.SetActive(true);
EditorPanel.SetActive(false);
if (isImagePanel)
ImageControlPanel.SetActive(false);
}).AddTo(gameObject);
transform.Find("Bottom/EditorPanel/SaveButton").GetComponent<Button>().OnClickAsObservable()
.Subscribe(_ =>
{
InfosPanel.SetActive(true);
InputsPanel.SetActive(false);
DefaultPanel.SetActive(true);
EditorPanel.SetActive(false);
if (isImagePanel)
ImageControlPanel.SetActive(false);
}).AddTo(gameObject);
}
public void ResetPanel()
{
InfosPanel.SetActive(true);
InputsPanel.SetActive(false);
DefaultPanel.SetActive(true);
EditorPanel.SetActive(false);
if (isImagePanel)
ImageControlPanel.SetActive(false);
}
}