//----------------------------------------------------------------------- // // // Copyright 2018 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // //----------------------------------------------------------------------- // Modifications copyright © 2020 Unity Technologies ApS #if AR_FOUNDATION_PRESENT || PACKAGE_DOCS_GENERATION using System; using System.Collections.Generic; using UnityEngine.XR.ARFoundation; namespace UnityEngine.XR.Interaction.Toolkit.AR { public abstract partial class GestureRecognizer where T : Gesture { /// /// The ARSessionOrigin /// that will be used by gestures (such as to get the [Camera](xref:UnityEngine.Camera) /// or to transform from Session space). /// [Obsolete("arSessionOrigin has been deprecated. Use xrOrigin instead for similar functionality.")] public ARSessionOrigin arSessionOrigin { get; set; } #pragma warning disable IDE1006 // Naming Styles /// /// (Deprecated) List of current active gestures. /// /// /// m_Gestures has been deprecated. Use instead. /// [Obsolete("m_Gestures has been deprecated. Use gestures instead.", true)] protected List m_Gestures = new List(); #pragma warning restore IDE1006 // Naming Styles #if !XRI_LEGACY_INPUT_DISABLED /// /// (Deprecated) Helper function for creating one-finger gestures when a touch begins. /// /// Function to be executed to create the gesture. /// /// TryCreateOneFingerGestureOnTouchBegan(Func<Touch, T>) has been deprecated. Use /// instead. /// [Obsolete("TryCreateOneFingerGestureOnTouchBegan(Func) is no longer functional. Use TryCreateOneFingerGestureOnTouchBegan(Func, Action) instead.", true)] protected void TryCreateOneFingerGestureOnTouchBegan(Func createGestureFunction) { } /// /// (Deprecated) Helper function for creating two-finger gestures when a touch begins. /// /// Function to be executed to create the gesture. /// /// TryCreateTwoFingerGestureOnTouchBegan(Func<Touch, Touch, T>) has been deprecated. Use /// instead. /// [Obsolete("TryCreateTwoFingerGestureOnTouchBegan(Func) is no longer functional. Use TryCreateTwoFingerGestureOnTouchBegan(Func, Action) instead.", true)] protected void TryCreateTwoFingerGestureOnTouchBegan( Func createGestureFunction) { } /// /// (Deprecated) Helper function for creating or re-initializing one-finger gestures when a touch begins. /// /// Function to be executed to create the gesture if no dead gesture was available to re-initialize. /// Function to be executed to re-initialize the gesture if a dead gesture was available to re-initialize. /// /// This is deprecated for its reference to Input Manager Touch. Set active input handling to New Input System, and use InputSystem.EnhancedTouch.Touch instead. /// [Obsolete("TryCreateOneFingerGestureOnTouchBegan(Func, Action) is marked for deprecation in XRI 3.2.0 and will be removed in a future version. Use TryCreateOneFingerGestureOnTouchBegan(Func, Action) instead.")] protected void TryCreateOneFingerGestureOnTouchBegan( Func createGestureFunction, Action reinitializeGestureFunction) { TryCreateOneFingerGestureOnTouchBegan( TouchConverterClosureHelper.GetFunc(createGestureFunction), TouchActionConverterClosureHelper.GetAction(reinitializeGestureFunction)); } /// /// (Deprecated) Helper function for creating or re-initializing two-finger gestures when a touch begins. /// /// Function to be executed to create the gesture if no dead gesture was available to re-initialize. /// Function to be executed to re-initialize the gesture if a dead gesture was available to re-initialize. /// /// This is deprecated for its reference to Input Manager Touch. Set active input handling to New Input System, and use InputSystem.EnhancedTouch.Touch instead. /// [Obsolete("TryCreateTwoFingerGestureOnTouchBegan(Func, Action) is marked for deprecation in XRI 3.2.0 and will be removed in a future version. Use TryCreateTwoFingerGestureOnTouchBegan(Func, Action, InputSystem.EnhancedTouch.Touch) instead.")] protected void TryCreateTwoFingerGestureOnTouchBegan( Func createGestureFunction, Action reinitializeGestureFunction) { TryCreateTwoFingerGestureOnTouchBegan( TouchConverterClosureHelper.GetFunc(createGestureFunction), TouchActionConverterClosureHelper.GetAction(reinitializeGestureFunction)); } #endif /// /// (Deprecated) Helper function for creating one-finger gestures when a touch begins. /// /// Function to be executed to create the gesture. /// /// TryCreateOneFingerGestureOnTouchBegan(Func<InputSystem.EnhancedTouch.Touch, T>) has been deprecated. Use /// instead. /// [Obsolete("TryCreateOneFingerGestureOnTouchBegan(Func) is no longer functional. Use TryCreateOneFingerGestureOnTouchBegan(Func, Action) instead.", true)] protected void TryCreateOneFingerGestureOnTouchBegan(Func createGestureFunction) { } /// /// (Deprecated) Helper function for creating two-finger gestures when a touch begins. /// /// Function to be executed to create the gesture. /// /// TryCreateTwoFingerGestureOnTouchBegan(Func<Touch, Touch, T>) has been deprecated. Use /// instead. /// [Obsolete("TryCreateTwoFingerGestureOnTouchBegan(Func) is no longer functional. Use TryCreateTwoFingerGestureOnTouchBegan(Func, Action) instead.", true)] protected void TryCreateTwoFingerGestureOnTouchBegan( Func createGestureFunction) { } static partial class TouchActionConverterClosureHelper { #if !XRI_LEGACY_INPUT_DISABLED [Obsolete("GetAction is marked for deprecation in XRI 3.2.0 and will be removed in a future version. Use GetAction(Action) instead.", true)] public static Action GetAction(Action reinitializeGestureFunction) { s_ReinitializeGestureFromOneTouchFunction = reinitializeGestureFunction; return s_ConvertUsingOneTouch; } [Obsolete("GetAction is marked for deprecation in XRI 3.2.0 and will be removed in a future version. Use GetAction(Action) instead.", true)] public static Action GetAction(Action reinitializeGestureFunction) { s_ReinitializeGestureFromTwoTouchFunction = reinitializeGestureFunction; return s_ConvertUsingTwoTouch; } #endif } } } #endif