mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 12:35:41 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
415acf27cd |
@@ -27,7 +27,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Temp\Bin\Debug\Assembly-CSharp-firstpass\</OutputPath>
|
||||
<DefineConstants>UNITY_6000_4_10;UNITY_6000_4;UNITY_6000;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;UNITY_2022_1_OR_NEWER;UNITY_2022_2_OR_NEWER;UNITY_2022_3_OR_NEWER;UNITY_2023_1_OR_NEWER;UNITY_2023_2_OR_NEWER;UNITY_2023_3_OR_NEWER;UNITY_6000_0_OR_NEWER;UNITY_6000_1_OR_NEWER;UNITY_6000_2_OR_NEWER;UNITY_6000_3_OR_NEWER;UNITY_6000_4_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;UNITY_ANALYTICS;ENABLE_AR;ENABLE_AUDIO;ENABLE_AUDIO_SCRIPTABLE_PIPELINE;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_UNITY_CONSENT;ENABLE_UNITY_CLOUD_IDENTIFIERS;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_NATIVE_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_EDITOR_GAME_SERVICES;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_MARSHALLING_TESTS;ENABLE_VIDEO;ENABLE_NAVIGATION_OFFMESHLINK_TO_NAVMESHLINK;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;ENABLE_ACCESSIBILITY_SCREEN_READER;TEXTCORE_1_0_OR_NEWER;EDITOR_ONLY_NAVMESH_BUILDER_DEPRECATED;PLATFORM_STANDALONE_OSX;PLATFORM_STANDALONE;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_GAMECENTER;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_CLOUD_SERVICES_ENGINE_DIAGNOSTICS;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;ENABLE_SPATIALTRACKING;PLATFORM_HAS_CUSTOM_MUTEX;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;PLATFORM_SUPPORTS_SPLIT_GRAPHICS_JOBS;PLATFORM_REQUIRES_PATH_NORMALIZATION;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;ENABLE_PROFILER_ASSISTANT_INTEGRATION;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_INPUT_SYSTEM;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;TEXTCORE_TEXT_ENGINE_1_5_OR_NEWER;TEXTCORE_FONT_ENGINE_1_6_OR_NEWER;UNITY_POST_PROCESSING_STACK_V2;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER</DefineConstants>
|
||||
<DefineConstants>UNITY_6000_4_10;UNITY_6000_4;UNITY_6000;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;UNITY_2022_1_OR_NEWER;UNITY_2022_2_OR_NEWER;UNITY_2022_3_OR_NEWER;UNITY_2023_1_OR_NEWER;UNITY_2023_2_OR_NEWER;UNITY_2023_3_OR_NEWER;UNITY_6000_0_OR_NEWER;UNITY_6000_1_OR_NEWER;UNITY_6000_2_OR_NEWER;UNITY_6000_3_OR_NEWER;UNITY_6000_4_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;UNITY_ANALYTICS;ENABLE_AR;ENABLE_AUDIO;ENABLE_AUDIO_SCRIPTABLE_PIPELINE;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_UNITY_CONSENT;ENABLE_UNITY_CLOUD_IDENTIFIERS;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_NATIVE_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_EDITOR_GAME_SERVICES;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_MARSHALLING_TESTS;ENABLE_VIDEO;ENABLE_NAVIGATION_OFFMESHLINK_TO_NAVMESHLINK;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;ENABLE_ACCESSIBILITY_SCREEN_READER;TEXTCORE_1_0_OR_NEWER;EDITOR_ONLY_NAVMESH_BUILDER_DEPRECATED;PLATFORM_STANDALONE_OSX;PLATFORM_STANDALONE;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_GAMECENTER;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_CLOUD_SERVICES_ENGINE_DIAGNOSTICS;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;ENABLE_SPATIALTRACKING;PLATFORM_HAS_CUSTOM_MUTEX;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;PLATFORM_SUPPORTS_SPLIT_GRAPHICS_JOBS;PLATFORM_REQUIRES_PATH_NORMALIZATION;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;ENABLE_PROFILER_ASSISTANT_INTEGRATION;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_INPUT_SYSTEM;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;TEXTCORE_TEXT_ENGINE_1_5_OR_NEWER;TEXTCORE_FONT_ENGINE_1_6_OR_NEWER;UNITY_POST_PROCESSING_STACK_V2;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169,0649</NoWarn>
|
||||
|
||||
@@ -12110,17 +12110,39 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 1004000001}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_SendPointerHoverToParent: 1
|
||||
m_HorizontalAxis: Horizontal
|
||||
m_VerticalAxis: Vertical
|
||||
m_SubmitButton: Submit
|
||||
m_CancelButton: Cancel
|
||||
m_InputActionsPerSecond: 10
|
||||
m_RepeatDelay: 0.5
|
||||
m_ForceModuleActive: 0
|
||||
m_MoveRepeatDelay: 0.5
|
||||
m_MoveRepeatRate: 0.1
|
||||
m_XRTrackingOrigin: {fileID: 0}
|
||||
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_PointAction: {fileID: 1054132383583890850, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_MoveAction: {fileID: 3710738434707379630, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_SubmitAction: {fileID: 2064916234097673511, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_CancelAction: {fileID: -1967631576421560919, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_LeftClickAction: {fileID: 8056856818456041789, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_MiddleClickAction: {fileID: 3279352641294131588, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_RightClickAction: {fileID: 3837173908680883260, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_ScrollWheelAction: {fileID: 4502412055082496612, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_TrackedDevicePositionAction: {fileID: 4754684134866288074, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_TrackedDeviceOrientationAction: {fileID: 1025543830046995696, guid: ca9f5fa95ffab41fb9a615ab714db018,
|
||||
type: 3}
|
||||
m_DeselectOnBackgroundClick: 1
|
||||
m_PointerBehavior: 0
|
||||
m_CursorLockBehavior: 0
|
||||
m_ScrollDeltaPerTick: 6
|
||||
--- !u!81 &1004000005
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public static class UIInputSystemModuleDefaultActions {
|
||||
private static int configurationLogCount;
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
||||
private static void Initialize() {
|
||||
ConfigureEditorInputBehavior();
|
||||
InputSystem.onDeviceChange -= LogDeviceChange;
|
||||
InputSystem.onDeviceChange += LogDeviceChange;
|
||||
SceneManager.sceneLoaded -= AssignDefaultActionsToLoadedModules;
|
||||
SceneManager.sceneLoaded += AssignDefaultActionsToLoadedModules;
|
||||
AssignDefaultActionsToLoadedModules();
|
||||
EnsureDiagnosticsRunner();
|
||||
}
|
||||
|
||||
private static void ConfigureEditorInputBehavior() {
|
||||
#if UNITY_EDITOR
|
||||
InputSystem.settings.editorInputBehaviorInPlayMode =
|
||||
InputSettings.EditorInputBehaviorInPlayMode.AllDeviceInputAlwaysGoesToGameView;
|
||||
InputSystem.settings.backgroundBehavior = InputSettings.BackgroundBehavior.IgnoreFocus;
|
||||
if (InputSystem.devices.Count == 0) {
|
||||
InputSystem.AddDevice<Mouse>();
|
||||
InputSystem.AddDevice<Keyboard>();
|
||||
Debug.Log("[UIInputSystem] Added editor fallback Mouse and Keyboard devices.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void LogDeviceChange(InputDevice device, InputDeviceChange change) {
|
||||
Debug.Log(
|
||||
"[UIInputSystem] Device change. " + $"change={change}, " +
|
||||
$"device={device.displayName}, " + $"devices={DescribeDevices()}");
|
||||
}
|
||||
|
||||
private static void AssignDefaultActionsToLoadedModules(Scene scene, LoadSceneMode mode) {
|
||||
AssignDefaultActionsToLoadedModules();
|
||||
}
|
||||
|
||||
private static void AssignDefaultActionsToLoadedModules() {
|
||||
var modules = Object.FindObjectsByType<InputSystemUIInputModule>(FindObjectsSortMode.None);
|
||||
foreach (InputSystemUIInputModule module in modules) {
|
||||
if (!HasRequiredActions(module)) {
|
||||
module.AssignDefaultActions();
|
||||
module.enabled = false;
|
||||
module.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (EventSystem.current != null && EventSystem.current.currentInputModule == null) {
|
||||
EventSystem.current.UpdateModules();
|
||||
}
|
||||
|
||||
if (configurationLogCount < 8) {
|
||||
configurationLogCount++;
|
||||
Debug.Log(
|
||||
"[UIInputSystem] Configured UI input modules. " +
|
||||
$"moduleCount={modules.Length}, " +
|
||||
$"eventSystem={(EventSystem.current == null ? "<none>" : EventSystem.current.name)}, " +
|
||||
$"currentModule={DescribeCurrentModule()}, " +
|
||||
$"devices={DescribeDevices()}, " +
|
||||
$"moduleActions={string.Join(" | ", modules.Select(DescribeModuleActions))}");
|
||||
}
|
||||
}
|
||||
|
||||
private static bool HasRequiredActions(InputSystemUIInputModule module) {
|
||||
return module.point?.action != null && module.leftClick?.action != null &&
|
||||
module.submit?.action != null && module.cancel?.action != null;
|
||||
}
|
||||
|
||||
private static void EnsureDiagnosticsRunner() {
|
||||
if (Object.FindFirstObjectByType<UIInputSystemDiagnostics>() != null) { return; }
|
||||
|
||||
var gameObject = new GameObject("UI Input System Diagnostics");
|
||||
Object.DontDestroyOnLoad(gameObject);
|
||||
gameObject.AddComponent<UIInputSystemDiagnostics>();
|
||||
}
|
||||
|
||||
private static string DescribeCurrentModule() {
|
||||
if (EventSystem.current?.currentInputModule == null) { return "<none>"; }
|
||||
|
||||
var module = EventSystem.current.currentInputModule;
|
||||
return $"{module.GetType().Name}({module.name}, active={module.isActiveAndEnabled})";
|
||||
}
|
||||
|
||||
private static string DescribeDevices() {
|
||||
return $"mouse={(Mouse.current == null ? "<none>" : Mouse.current.displayName)}, " +
|
||||
$"touchscreen={(Touchscreen.current == null ? "<none>" : Touchscreen.current.displayName)}, " +
|
||||
$"keyboard={(Keyboard.current == null ? "<none>" : Keyboard.current.displayName)}, " +
|
||||
$"deviceCount={InputSystem.devices.Count}, " +
|
||||
$"allDevices={string.Join(", ", InputSystem.devices.Select(device => device.displayName))}";
|
||||
}
|
||||
|
||||
private static string DescribeModuleActions(InputSystemUIInputModule module) {
|
||||
return $"{module.name}: " + $"active={module.isActiveAndEnabled}, " +
|
||||
$"point={DescribeAction(module.point)}, " +
|
||||
$"leftClick={DescribeAction(module.leftClick)}, " +
|
||||
$"submit={DescribeAction(module.submit)}, " +
|
||||
$"cancel={DescribeAction(module.cancel)}";
|
||||
}
|
||||
|
||||
private static string DescribeAction(UnityEngine.InputSystem.InputActionReference reference) {
|
||||
if (reference?.action == null) { return "<null>"; }
|
||||
|
||||
return $"{reference.action.name}(enabled={reference.action.enabled}, " +
|
||||
$"phase={reference.action.phase})";
|
||||
}
|
||||
|
||||
private class UIInputSystemDiagnostics : MonoBehaviour {
|
||||
private void Update() {
|
||||
if (!PointerPressedThisFrame()) { return; }
|
||||
|
||||
Vector2 pointerPosition = PointerPosition();
|
||||
var raycastResults = RaycastPointer(pointerPosition);
|
||||
var modules =
|
||||
Object.FindObjectsByType<InputSystemUIInputModule>(FindObjectsSortMode.None);
|
||||
string topHit =
|
||||
raycastResults.Count == 0
|
||||
? "<none>"
|
||||
: $"{raycastResults[0].gameObject.name} " +
|
||||
$"(module={raycastResults[0].module?.GetType().Name})";
|
||||
|
||||
Debug.Log(
|
||||
"[UIInputSystem] Pointer click diagnostic. " + $"position={pointerPosition}, " +
|
||||
$"eventSystem={(EventSystem.current == null ? "<none>" : EventSystem.current.name)}, " +
|
||||
$"currentModule={DescribeCurrentModule()}, " +
|
||||
$"moduleCount={modules.Length}, " + $"topRaycastHit={topHit}, " +
|
||||
$"allRaycastHits={string.Join(", ", raycastResults.Select(r => r.gameObject.name).Take(8))}, " +
|
||||
$"moduleActions={string.Join(" | ", modules.Select(DescribeModuleActions))}");
|
||||
}
|
||||
|
||||
private static bool PointerPressedThisFrame() {
|
||||
if (Mouse.current != null && Mouse.current.leftButton.wasPressedThisFrame) {
|
||||
return true;
|
||||
}
|
||||
if (Touchscreen.current != null &&
|
||||
Touchscreen.current.primaryTouch.press.wasPressedThisFrame) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return GameInput.PrimaryPointerPressedThisFrame();
|
||||
}
|
||||
|
||||
private static Vector2 PointerPosition() {
|
||||
if (Mouse.current != null) { return Mouse.current.position.ReadValue(); }
|
||||
if (Touchscreen.current != null) {
|
||||
return Touchscreen.current.primaryTouch.position.ReadValue();
|
||||
}
|
||||
|
||||
return GameInput.PointerPosition();
|
||||
}
|
||||
|
||||
private static List<RaycastResult> RaycastPointer(Vector2 position) {
|
||||
if (EventSystem.current == null) { return new List<RaycastResult>(); }
|
||||
|
||||
var pointerData = new PointerEventData(EventSystem.current) {
|
||||
pointerId = -1,
|
||||
position = position,
|
||||
};
|
||||
var results = new List<RaycastResult>();
|
||||
EventSystem.current.RaycastAll(pointerData, results);
|
||||
return results;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a7d6c2c7e3b4cc29875996ad7ba5952
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user