using System;
using UnityEngine;

public abstract class WindowPartsEffectBase : MonoBehaviour
{
	public virtual void Awake()
	{
		this.EnabledCheckBox.onClick.Add(new Action<WFCheckBox>(this.OnClickBaseEnabledCheckBox));
	}

	public virtual void Start()
	{
	}

	public virtual void OnDestroy()
	{
	}

	public virtual void Update()
	{
	}

	public abstract void Init();

	public abstract void OnSerializeEvent();

	public abstract void OnDeserializeEvent();

	public virtual void OnMaidAddEvent(Maid maid, bool is_deserialize_load)
	{
	}

	public virtual void OnClickEnabledCheckBox(WFCheckBox check_box)
	{
		this.effect_enabled = check_box.check;
		this.OnChangeEffectEnabled(check_box.check);
	}

	public virtual void OnChangeEffectEnabled(bool enabled)
	{
	}

	public void SetEffectWindow(EffectWindow effect_window)
	{
		this.effect_window_ = effect_window;
	}

	public bool visible
	{
		get
		{
			return base.gameObject.activeSelf;
		}
		set
		{
			base.gameObject.SetActive(value);
		}
	}

	public bool effect_enabled
	{
		get
		{
			return !GameMain.Instance.VRMode && this.effect_object != null && this.effect_object.enabled;
		}
		set
		{
			if (!GameMain.Instance.VRMode && this.effect_object != null)
			{
				this.effect_object.enabled = value;
			}
		}
	}

	protected abstract MonoBehaviour effect_object { get; }

	private void OnClickBaseEnabledCheckBox(WFCheckBox check_box)
	{
		this.OnClickEnabledCheckBox(check_box);
	}

	public WFCheckBox EnabledCheckBox;

	protected EffectWindow effect_window_;
}