12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using System;
- using UnityEngine;
- public class PhotoWindowDragMove : UIDragDropItem
- {
- public void Awake()
- {
- this.uiCamera = GameObject.Find("UI Root/Camera").GetComponent<Camera>();
- this.uiPanel = base.GetComponent<UIPanel>();
- }
- protected override void Update()
- {
- base.Update();
- if (this.mDragging && !NInput.GetMouseButton(0))
- {
- base.StopDragging(null);
- }
- if (0 < this.updateDraw)
- {
- this.updateDraw--;
- if (this.uiPanel != null && this.updateDraw % 2 == 0)
- {
- this.uiPanel.SetDirty();
- }
- }
- }
- protected override void StartDragging()
- {
- if (UICamera.currentKey != KeyCode.Mouse0)
- {
- return;
- }
- base.StartDragging();
- }
- protected override void OnDragDropMove(Vector2 delta)
- {
- base.OnDragDropMove(delta);
- }
- protected override void OnDragDropStart()
- {
- base.OnDragDropStart();
- this.updateDraw = 1;
- }
- protected override void OnDragDropRelease(GameObject surface)
- {
- base.OnDragDropRelease(surface);
- this.updateDraw = 6;
- }
- protected override Transform TaregetTrans
- {
- get
- {
- return this.WindowTransform;
- }
- }
- public Transform WindowTransform;
- private UIPanel uiPanel;
- private int updateDraw;
- private Camera uiCamera;
- }
|