12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using System;
- using UnityEngine;
- public class WindowPartsWindowVisible : WFCheckBox
- {
- public bool windowVisible
- {
- get
- {
- return this.TargetWindow.visible;
- }
- set
- {
- this.TargetWindow.visible = value;
- if (this.TargetWindow.visible && !base.check)
- {
- base.check = true;
- }
- else if (!this.TargetWindow.visible && base.check)
- {
- base.check = false;
- }
- }
- }
- public override void Awake()
- {
- base.Awake();
- }
- public void Start()
- {
- if (this.TargetWindow != null)
- {
- this.TargetWindow.SetButtonEnabled(BasePhotoWindow.BtnType.Min, true, false);
- this.TargetWindow.GetButtonOnClickEventList(BasePhotoWindow.BtnType.Min).Add(delegate
- {
- if (this.TargetWindow.visible)
- {
- this.OnClockEvent();
- }
- });
- }
- }
- protected override void OnClockEvent()
- {
- this.TargetWindow.visible = !base.check;
- if (this.TargetWindow.visible)
- {
- this.TargetWindow.ActiveWindow();
- }
- base.OnClockEvent();
- }
- public virtual void Update()
- {
- if (this.overRideStartVisible != WindowPartsWindowVisible.OverRideStartVisible.Non)
- {
- bool flag = this.overRideStartVisible == WindowPartsWindowVisible.OverRideStartVisible.Visible;
- this.TargetWindow.visible = flag;
- base.check = flag;
- if (this.TargetWindow.visible)
- {
- this.TargetWindow.ActiveWindow();
- }
- }
- this.overRideStartVisible = WindowPartsWindowVisible.OverRideStartVisible.Non;
- if (this.TargetWindow.visible && !base.check)
- {
- base.check = true;
- }
- else if (!this.TargetWindow.visible && base.check)
- {
- base.check = false;
- }
- }
- [SerializeField]
- public BasePhotoWindow TargetWindow;
- [SerializeField]
- public WindowPartsWindowVisible.OverRideStartVisible overRideStartVisible;
- public enum OverRideStartVisible
- {
- Non,
- Visible,
- Invisible
- }
- }
|