using System;
using UnityEngine;

public class EditViewReset : MonoBehaviour
{
	private void Awake()
	{
		this.m_goViewReset = UTY.GetChildObject(base.gameObject, "ViewReset", false);
		this.m_uiViewReset = this.m_goViewReset.GetComponent<UIButton>();
		this.m_goAutoCam = UTY.GetChildObject(base.gameObject, "AutoCam", false);
		this.m_uiAutoCam = this.m_goAutoCam.GetComponent<UIButton>();
		this.m_goEyeToCam = UTY.GetChildObject(base.gameObject, "EyeToCam", false);
		this.m_uiEyeToCam = this.m_goEyeToCam.GetComponent<UIButton>();
		EventDelegate.Add(this.m_uiViewReset.onClick, new EventDelegate.Callback(this.OnClickViewReset));
		EventDelegate.Add(this.m_uiAutoCam.onClick, new EventDelegate.Callback(this.OnClickAutoCam));
		EventDelegate.Add(this.m_uiEyeToCam.onClick, new EventDelegate.Callback(this.OnClickEyeToCam));
		this.UpdateAutoEyeCam();
	}

	private void Start()
	{
		if (SceneEdit.Instance.IsVRComMode)
		{
			this.m_uiAutoCam.disabledColor.a = 0.5f;
			this.m_uiViewReset.disabledColor = this.m_uiAutoCam.disabledColor;
			this.m_uiViewReset.SetState(UIButtonColor.State.Disabled, true);
			this.m_uiViewReset.isEnabled = false;
			this.m_uiAutoCam.SetState(UIButtonColor.State.Disabled, true);
			this.m_uiAutoCam.isEnabled = false;
		}
	}

	public void SetOnClickCallBack(EditViewReset.OnClick f_dgViewReset, EditViewReset.OnClick f_dgAutoCam, EditViewReset.OnClick f_dgEyeToCam)
	{
		this.m_dgOnViewReset = f_dgViewReset;
		this.m_dgOnAutoCam = f_dgAutoCam;
		this.m_dgOnEyeToCam = f_dgEyeToCam;
	}

	public void Show()
	{
		this.m_goViewReset.SetActive(true);
		this.m_goAutoCam.SetActive(true);
		this.m_goEyeToCam.SetActive(true);
	}

	public void Close()
	{
		this.m_goViewReset.SetActive(false);
		this.m_goAutoCam.SetActive(false);
		this.m_goEyeToCam.SetActive(false);
	}

	public void SetVisibleAutoCam(bool f_bVisible)
	{
		this.m_bVisibleAutoCam = f_bVisible;
		this.UpdateAutoEyeCam();
	}

	public bool GetVisibleAutoCam()
	{
		return this.m_bVisibleAutoCam;
	}

	public void SetVisibleEyeToCam(bool f_bVisible)
	{
		this.m_bVisibleEyeToCam = f_bVisible;
		this.UpdateAutoEyeCam();
	}

	public bool GetVisibleEyeToCam()
	{
		return this.m_bVisibleEyeToCam;
	}

	private void UpdateAutoEyeCam()
	{
		this.m_uiAutoCam.defaultColor = new Color(1f, 1f, 1f, (!this.m_bVisibleAutoCam) ? 0.2f : 1f);
		this.m_uiEyeToCam.defaultColor = new Color(1f, 1f, 1f, (!this.m_bVisibleEyeToCam) ? 0.2f : 1f);
	}

	private void OnClickViewReset()
	{
		if (this.m_dgOnViewReset != null)
		{
			this.m_dgOnViewReset();
		}
	}

	private void OnClickAutoCam()
	{
		if (this.m_dgOnAutoCam != null)
		{
			this.m_dgOnAutoCam();
		}
	}

	private void OnClickEyeToCam()
	{
		if (this.m_dgOnEyeToCam != null)
		{
			this.m_dgOnEyeToCam();
		}
	}

	private void Update()
	{
	}

	private GameObject m_goViewReset;

	private UIButton m_uiViewReset;

	private GameObject m_goAutoCam;

	private UIButton m_uiAutoCam;

	private GameObject m_goEyeToCam;

	private UIButton m_uiEyeToCam;

	private EditViewReset.OnClick m_dgOnViewReset;

	private EditViewReset.OnClick m_dgOnAutoCam;

	private EditViewReset.OnClick m_dgOnEyeToCam;

	private bool m_bVisibleAutoCam;

	private bool m_bVisibleEyeToCam;

	public delegate void OnClick();
}
