Initial Commit
This commit is contained in:
parent
53eb92e9af
commit
270ab7d11f
15341 changed files with 700234 additions and 0 deletions
|
@ -0,0 +1,40 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class DragCallbackCheck : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IDropHandler, IPointerDownHandler
|
||||
{
|
||||
private bool loggedOnDrag = false;
|
||||
public bool onBeginDragCalled = false;
|
||||
public bool onDragCalled = false;
|
||||
public bool onEndDragCalled = false;
|
||||
public bool onDropCalled = false;
|
||||
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
onBeginDragCalled = true;
|
||||
}
|
||||
|
||||
public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
if (loggedOnDrag)
|
||||
return;
|
||||
|
||||
loggedOnDrag = true;
|
||||
onDragCalled = true;
|
||||
}
|
||||
|
||||
public void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
onEndDragCalled = true;
|
||||
}
|
||||
|
||||
public void OnDrop(PointerEventData eventData)
|
||||
{
|
||||
onDropCalled = true;
|
||||
}
|
||||
|
||||
public void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
// Empty to ensure we get the drop if we have a pointer handle as well.
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 76c82729ad712f14bae1a8a279c52ac3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,117 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class FakeBaseInput : BaseInput
|
||||
{
|
||||
[NonSerialized]
|
||||
public String CompositionString = "";
|
||||
|
||||
private IMECompositionMode m_ImeCompositionMode = IMECompositionMode.Auto;
|
||||
private Vector2 m_CompositionCursorPos = Vector2.zero;
|
||||
|
||||
[NonSerialized]
|
||||
public bool MousePresent = false;
|
||||
|
||||
[NonSerialized]
|
||||
public bool[] MouseButtonDown = new bool[3];
|
||||
|
||||
[NonSerialized]
|
||||
public bool[] MouseButtonUp = new bool[3];
|
||||
|
||||
[NonSerialized]
|
||||
public bool[] MouseButton = new bool[3];
|
||||
|
||||
[NonSerialized]
|
||||
public Vector2 MousePosition = Vector2.zero;
|
||||
|
||||
[NonSerialized]
|
||||
public Vector2 MouseScrollDelta = Vector2.zero;
|
||||
|
||||
[NonSerialized]
|
||||
public bool TouchSupported = false;
|
||||
|
||||
[NonSerialized]
|
||||
public int TouchCount = 0;
|
||||
|
||||
[NonSerialized]
|
||||
public Touch TouchData;
|
||||
|
||||
[NonSerialized]
|
||||
public float AxisRaw = 0f;
|
||||
|
||||
[NonSerialized]
|
||||
public bool ButtonDown = false;
|
||||
|
||||
public override string compositionString
|
||||
{
|
||||
get { return CompositionString; }
|
||||
}
|
||||
|
||||
public override IMECompositionMode imeCompositionMode
|
||||
{
|
||||
get { return m_ImeCompositionMode; }
|
||||
set { m_ImeCompositionMode = value; }
|
||||
}
|
||||
|
||||
public override Vector2 compositionCursorPos
|
||||
{
|
||||
get { return m_CompositionCursorPos; }
|
||||
set { m_CompositionCursorPos = value; }
|
||||
}
|
||||
|
||||
public override bool mousePresent
|
||||
{
|
||||
get { return MousePresent; }
|
||||
}
|
||||
|
||||
public override bool GetMouseButtonDown(int button)
|
||||
{
|
||||
return MouseButtonDown[button];
|
||||
}
|
||||
|
||||
public override bool GetMouseButtonUp(int button)
|
||||
{
|
||||
return MouseButtonUp[button];
|
||||
}
|
||||
|
||||
public override bool GetMouseButton(int button)
|
||||
{
|
||||
return MouseButton[button];
|
||||
}
|
||||
|
||||
public override Vector2 mousePosition
|
||||
{
|
||||
get { return MousePosition; }
|
||||
}
|
||||
|
||||
public override Vector2 mouseScrollDelta
|
||||
{
|
||||
get { return MouseScrollDelta; }
|
||||
}
|
||||
|
||||
public override bool touchSupported
|
||||
{
|
||||
get { return TouchSupported; }
|
||||
}
|
||||
|
||||
public override int touchCount
|
||||
{
|
||||
get { return TouchCount; }
|
||||
}
|
||||
|
||||
public override Touch GetTouch(int index)
|
||||
{
|
||||
return TouchData;
|
||||
}
|
||||
|
||||
public override float GetAxisRaw(string axisName)
|
||||
{
|
||||
return AxisRaw;
|
||||
}
|
||||
|
||||
public override bool GetButtonDown(string buttonName)
|
||||
{
|
||||
return ButtonDown;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 138dbec4f8742654fbceb0a19d68b9c5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,20 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class MouseUpdate : MonoBehaviour
|
||||
{
|
||||
FakeBaseInput m_FakeBaseInput;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
m_FakeBaseInput = GetComponent<FakeBaseInput>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
Debug.Assert(m_FakeBaseInput, "FakeBaseInput component has not been added to the EventSystem");
|
||||
|
||||
// Update mouse position
|
||||
m_FakeBaseInput.MousePosition.x += 10f;
|
||||
m_FakeBaseInput.MousePosition.y += 10f;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 19c6f364c1e81cb4f829a057824639ad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,13 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
public class PointerClickCallbackCheck : MonoBehaviour, IPointerDownHandler
|
||||
{
|
||||
public bool pointerDown = false;
|
||||
|
||||
public void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
pointerDown = true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0573713975c6b8246b7544ed524ef1dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue