diff --git a/wrappers/csharp/Documentation/cookbook.md b/wrappers/csharp/Documentation/cookbook.md index d4e4d407d7..1d58f56e91 100644 --- a/wrappers/csharp/Documentation/cookbook.md +++ b/wrappers/csharp/Documentation/cookbook.md @@ -182,12 +182,12 @@ PipelineProfile selection = pipe.Start(); var selected_device = selection.Device; var depth_sensor = selected_device.Sensors[0]; -if (depth_sensor.Options[Option.EmitterEnabled].Supported) +if (depth_sensor.Options.Supports(Option.EmitterEnabled)) { depth_sensor.Options[Option.EmitterEnabled].Value = 1f; // Enable emitter depth_sensor.Options[Option.EmitterEnabled].Value = 0f; // Disable emitter } -if (depth_sensor.Options[Option.LaserPower].Supported) +if (depth_sensor.Options.Supports(Option.LaserPower)) { var laserPower = depth_sensor.Options[Option.LaserPower]; laserPower.Value = laserPower.Max; // Set max power diff --git a/wrappers/csharp/Intel.RealSense/Base/DeleterHandle.cs b/wrappers/csharp/Intel.RealSense/Base/DeleterHandle.cs index c3445fe897..4d76472a2c 100644 --- a/wrappers/csharp/Intel.RealSense/Base/DeleterHandle.cs +++ b/wrappers/csharp/Intel.RealSense/Base/DeleterHandle.cs @@ -4,6 +4,7 @@ namespace Intel.RealSense.Base { using System; + using System.Diagnostics; using System.Runtime.InteropServices; using System.Security; @@ -15,6 +16,7 @@ namespace Intel.RealSense.Base /// Native handle with deleter delegate to release unmanaged resources /// // TODO: CriticalFinalizerObject & CER + //[DebuggerDisplay("{deleter?.Method.Name,nq}", Name = nameof(Deleter))] internal sealed class DeleterHandle : IDisposable { private IntPtr handle; @@ -64,8 +66,9 @@ internal void Reset(IntPtr ptr) internal void Reset(IntPtr ptr, Deleter deleter) { + this.handle = ptr; this.deleter = deleter; - Reset(ptr); + //GC.ReRegisterForFinalize(this); } ~DeleterHandle() diff --git a/wrappers/csharp/Intel.RealSense/Base/Object.cs b/wrappers/csharp/Intel.RealSense/Base/Object.cs index a25f9aef2f..b1cc94b62c 100644 --- a/wrappers/csharp/Intel.RealSense/Base/Object.cs +++ b/wrappers/csharp/Intel.RealSense/Base/Object.cs @@ -4,6 +4,7 @@ namespace Intel.RealSense.Base { using System; + using System.Diagnostics; /// /// Base class for disposable objects with native resources @@ -11,6 +12,7 @@ namespace Intel.RealSense.Base public abstract class Object : IDisposable { // TODO: rename, kept for backwards compatiblity + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal readonly DeleterHandle m_instance; /// diff --git a/wrappers/csharp/Intel.RealSense/CMakeLists.txt b/wrappers/csharp/Intel.RealSense/CMakeLists.txt index 1583854d80..c9a56254e9 100644 --- a/wrappers/csharp/Intel.RealSense/CMakeLists.txt +++ b/wrappers/csharp/Intel.RealSense/CMakeLists.txt @@ -23,6 +23,7 @@ include(StreamProfiles/CMakeLists.txt) include(Sensors/CMakeLists.txt) include(Types/CMakeLists.txt) include(Helpers/CMakeLists.txt) +include(Options/CMakeLists.txt) csharp_set_designer_cs_properties( .nuget/Intel.RealSense.targets diff --git a/wrappers/csharp/Intel.RealSense/Devices/AdvancedDevice.cs b/wrappers/csharp/Intel.RealSense/Devices/AdvancedDevice.cs index 6e86f674dd..48e799e4f9 100644 --- a/wrappers/csharp/Intel.RealSense/Devices/AdvancedDevice.cs +++ b/wrappers/csharp/Intel.RealSense/Devices/AdvancedDevice.cs @@ -35,7 +35,7 @@ public static AdvancedDevice FromDevice(Device dev) /// /// Gets or sets a value indicating whether Advanced-Mode is enabled /// - /// true when Advanced-Mode is enabled + /// when Advanced-Mode is enabled public bool AdvancedModeEnabled { get diff --git a/wrappers/csharp/Intel.RealSense/Devices/Device.cs b/wrappers/csharp/Intel.RealSense/Devices/Device.cs index b8c481198e..8e8452cc9c 100644 --- a/wrappers/csharp/Intel.RealSense/Devices/Device.cs +++ b/wrappers/csharp/Intel.RealSense/Devices/Device.cs @@ -6,6 +6,7 @@ namespace Intel.RealSense using System; using System.Collections; using System.Collections.Generic; + using System.Collections.ObjectModel; using System.Runtime.InteropServices; /// @@ -15,7 +16,7 @@ public class Device : Base.PooledObject { internal override void Initialize() { - Info = new CameraInfos(this); + Info = new InfoCollection(NativeMethods.rs2_supports_device_info, NativeMethods.rs2_get_device_info, Handle); } internal Device(IntPtr ptr) @@ -40,87 +41,36 @@ internal static T Create(IntPtr ptr, Base.Deleter deleter) where T : Device { var dev = ObjectPool.Get(ptr); - dev.m_instance.Reset(ptr, deleter); + dev.Reset(ptr, deleter); return dev; } - public class CameraInfos : IEnumerable> - { - private readonly Device device; - - internal CameraInfos(Device device) - { - this.device = device; - } - - /// - /// Retrieve camera specific information, like versions of various internal components. - /// - /// Camera info type to retrieve - /// The requested camera info string, in a format specific to the device model - public string this[CameraInfo info] - { - get - { - object err; - if (NativeMethods.rs2_supports_device_info(device.Handle, info, out err) > 0) - { - return Marshal.PtrToStringAnsi(NativeMethods.rs2_get_device_info(device.Handle, info, out err)); - } - - return null; - } - } - - private static readonly CameraInfo[] CameraInfoValues = Enum.GetValues(typeof(CameraInfo)) as CameraInfo[]; - - /// - public IEnumerator> GetEnumerator() - { - object error; - foreach (var key in CameraInfoValues) { - if (NativeMethods.rs2_supports_device_info(device.Handle, key, out error) > 0) - { - var value = Marshal.PtrToStringAnsi(NativeMethods.rs2_get_device_info(device.Handle, key, out error)); - yield return new KeyValuePair(key, value); - } - } - } - - /// - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } - /// /// Gets camera specific information, like versions of various internal components /// - public CameraInfos Info { get; private set; } + public InfoCollection Info { get; private set; } /// /// create a static snapshot of all connected devices at the time of the call /// /// The list of sensors - public SensorList QuerySensors() + public ReadOnlyCollection QuerySensors() { object error; var ptr = NativeMethods.rs2_query_sensors(Handle, out error); - return new SensorList(ptr); + using (var sl = new SensorList(ptr)) + { + var a = new Sensor[sl.Count]; + sl.CopyTo(a, 0); + return Array.AsReadOnly(a); + } } /// /// Gets a static snapshot of all connected devices at the time of the call /// /// The list of sensors - public SensorList Sensors - { - get - { - return QuerySensors(); - } - } + public ReadOnlyCollection Sensors => QuerySensors(); /// /// Send hardware reset request to the device. The actual reset is asynchronous. diff --git a/wrappers/csharp/Intel.RealSense/Devices/DeviceList.cs b/wrappers/csharp/Intel.RealSense/Devices/DeviceList.cs index c044dce4a1..b33510fd06 100644 --- a/wrappers/csharp/Intel.RealSense/Devices/DeviceList.cs +++ b/wrappers/csharp/Intel.RealSense/Devices/DeviceList.cs @@ -6,12 +6,45 @@ namespace Intel.RealSense using System; using System.Collections; using System.Collections.Generic; + using System.Diagnostics; using System.Runtime.InteropServices; + [DebuggerTypeProxy(typeof(DeviceListDebugView))] + [DebuggerDisplay("Count = {Count}")] public class DeviceList : Base.Object, IEnumerable { internal static readonly Base.Deleter DeviceDeleter = NativeMethods.rs2_delete_device; + internal sealed class DeviceListDebugView + { + private readonly DeviceList dl; + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public Device[] Items + { + get + { + Device[] array = new Device[dl.Count]; + for (int i = 0; i < dl.Count; i++) + { + array.SetValue(dl[i], i); + } + + return array; + } + } + + public DeviceListDebugView(DeviceList optionList) + { + if (optionList == null) + { + throw new ArgumentNullException(nameof(optionList)); + } + + dl = optionList; + } + } + /// /// Initializes a new instance of the class. /// @@ -33,7 +66,7 @@ public IEnumerator GetEnumerator() for (int i = 0; i < deviceCount; i++) { var ptr = NativeMethods.rs2_create_device(Handle, i, out error); - yield return Device.Create(ptr, DeviceDeleter); + yield return Device.Create(ptr, NativeMethods.rs2_delete_device); } } @@ -64,7 +97,7 @@ public Device this[int index] { object error; var ptr = NativeMethods.rs2_create_device(Handle, index, out error); - return Device.Create(ptr, DeviceDeleter); + return Device.Create(ptr, NativeMethods.rs2_delete_device); } } diff --git a/wrappers/csharp/Intel.RealSense/Frames/Frame.cs b/wrappers/csharp/Intel.RealSense/Frames/Frame.cs index 3c97d2d7c9..00acdf26cd 100644 --- a/wrappers/csharp/Intel.RealSense/Frames/Frame.cs +++ b/wrappers/csharp/Intel.RealSense/Frames/Frame.cs @@ -5,6 +5,8 @@ namespace Intel.RealSense { using System; using System.Collections.Generic; + using System.Diagnostics; + using System.Linq; using System.Runtime.InteropServices; /// @@ -12,12 +14,15 @@ namespace Intel.RealSense /// public class Frame : Base.PooledObject { + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private static readonly Base.Deleter FrameReleaser = NativeMethods.rs2_release_frame; + internal override void Initialize() { } internal Frame(IntPtr ptr) - : base(ptr, NativeMethods.rs2_release_frame) + : base(ptr, FrameReleaser) { } @@ -57,7 +62,7 @@ public static T Create(Frame other) /// Test if the given frame can be extended to the requested extension /// The extension to which the frame should be tested if it is extendable - /// true iff the frame can be extended to the given extension + /// iff the frame can be extended to the given extension public bool Is(Extension extension) { object error; @@ -73,7 +78,7 @@ public T As() return Create(this); } - /// Returns a strongly-typed clone, this is disposed + /// Returns a strongly-typed clone, is disposed /// type or subclass /// an instance of public T Cast() @@ -111,9 +116,11 @@ public void Keep() /// /// Gets a value indicating whether frame is a composite frame - /// Shorthand for Is(Extension.CompositeFrame) + /// Shorthand for Is() /// - /// true if frame is a composite frame and false otherwise + /// + /// if frame is a composite frame and false otherwise + [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsComposite { get @@ -149,6 +156,7 @@ public T GetProfile() /// /// Gets the stream profile that was used to start the stream of this frame /// + /// public StreamProfile Profile => GetProfile(); /// Gets the frame number of the frame @@ -213,5 +221,19 @@ public bool SupportsFrameMetaData(FrameMetadataValue frame_metadata) object error; return NativeMethods.rs2_supports_frame_metadata(Handle, frame_metadata, out error) != 0; } + +#if DEBUGGER_METADATA + private static readonly FrameMetadataValue[] MetadataValues = Enum.GetValues(typeof(FrameMetadataValue)) as FrameMetadataValue[]; + public ICollection> MetaData + { + get + { + return MetadataValues + .Where(m => SupportsFrameMetaData(m)) + .Select(m => new KeyValuePair(m, GetFrameMetadata(m))) + .ToArray(); + } + } +#endif } } diff --git a/wrappers/csharp/Intel.RealSense/Frames/FrameSet.cs b/wrappers/csharp/Intel.RealSense/Frames/FrameSet.cs index 49ba2a4059..24a07bfb5a 100644 --- a/wrappers/csharp/Intel.RealSense/Frames/FrameSet.cs +++ b/wrappers/csharp/Intel.RealSense/Frames/FrameSet.cs @@ -6,12 +6,17 @@ namespace Intel.RealSense using System; using System.Collections; using System.Collections.Generic; + using System.Diagnostics; using System.Runtime.InteropServices; public class FrameSet : Frame, ICompositeDisposable, IEnumerable { private readonly List disposables = new List(); + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly Enumerator enumerator; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private int count; /// @@ -54,6 +59,9 @@ internal FrameSet(IntPtr ptr) enumerator = new Enumerator(this); } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + public new bool IsComposite => true; + /// /// Cast this to a /// @@ -83,7 +91,7 @@ public void ForEach(Action action) public T FirstOrDefault(Stream stream, Format format = Format.Any) where T : Frame { - return FirstOrDefault(stream, format).Cast(); + return FirstOrDefault(stream, format)?.Cast(); } public Frame FirstOrDefault(Stream stream, Format format = Format.Any) @@ -142,57 +150,39 @@ public T First(Stream stream, Format format = Format.Any) return f; } - public Frame First(Stream stream, Format format = Format.Any) - { - return First(stream, format); - } + /// + /// Retrieve back the first frame of specific stream type, if no frame found, error will be thrown + /// + /// stream type of frame to be retrieved + /// format type of frame to be retrieved, defaults to + /// first found frame with type and type + /// Thrown when requested type not found + /// + public Frame First(Stream stream, Format format = Format.Any) => First(stream, format); - public DepthFrame DepthFrame - { - get - { - return FirstOrDefault(Stream.Depth, Format.Z16); - } - } + /// Gets the first depth frame + public DepthFrame DepthFrame => FirstOrDefault(Stream.Depth, Format.Z16); - public VideoFrame ColorFrame - { - get - { - return FirstOrDefault(Stream.Color); - } - } + /// Gets the first color frame + public VideoFrame ColorFrame => FirstOrDefault(Stream.Color); - public VideoFrame InfraredFrame - { - get - { - return FirstOrDefault(Stream.Infrared); - } - } + /// Gets the first infrared frame + public VideoFrame InfraredFrame => FirstOrDefault(Stream.Infrared); - public VideoFrame FishEyeFrame - { - get - { - return FirstOrDefault(Stream.Fisheye)?.As(); - } - } + /// Gets the first fisheye frame + public VideoFrame FishEyeFrame => FirstOrDefault(Stream.Fisheye); - public PoseFrame PoseFrame - { - get - { - return FirstOrDefault(Stream.Pose)?.As(); - } - } + /// Gets the first pose frame + public PoseFrame PoseFrame => FirstOrDefault(Stream.Pose); + /// public IEnumerator GetEnumerator() { enumerator.Reset(); return enumerator; } + /// IEnumerator IEnumerable.GetEnumerator() { enumerator.Reset(); @@ -201,13 +191,7 @@ IEnumerator IEnumerable.GetEnumerator() /// Gets the number of frames embedded within a composite frame /// Number of embedded frames - public int Count - { - get - { - return count; - } - } + public int Count => count; /// Extract frame from within a composite frame /// Index of the frame to extract within the composite frame @@ -268,6 +252,7 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } + /// public void AddDisposable(IDisposable disposable) { if (disposable == this) diff --git a/wrappers/csharp/Intel.RealSense/Frames/Points.cs b/wrappers/csharp/Intel.RealSense/Frames/Points.cs index 36778c6f20..30603a789e 100644 --- a/wrappers/csharp/Intel.RealSense/Frames/Points.cs +++ b/wrappers/csharp/Intel.RealSense/Frames/Points.cs @@ -112,5 +112,11 @@ public void CopyTextureCoords(T[] textureArray) handle.Free(); } } + + public void ExportToPLY(string fname, Frame texture) + { + object error; + NativeMethods.rs2_export_to_ply(Handle, fname, texture.Handle, out error); + } } } diff --git a/wrappers/csharp/Intel.RealSense/Helpers/ICompositeDisposable.cs b/wrappers/csharp/Intel.RealSense/Helpers/ICompositeDisposable.cs index 95b574bf02..614a46d3ab 100644 --- a/wrappers/csharp/Intel.RealSense/Helpers/ICompositeDisposable.cs +++ b/wrappers/csharp/Intel.RealSense/Helpers/ICompositeDisposable.cs @@ -10,6 +10,10 @@ namespace Intel.RealSense /// public interface ICompositeDisposable : IDisposable { + /// + /// Add an object to to be disposed along with this instance + /// + /// an to to be disposed along with this instance void AddDisposable(IDisposable disposable); } diff --git a/wrappers/csharp/Intel.RealSense/Helpers/ObjectPool.cs b/wrappers/csharp/Intel.RealSense/Helpers/ObjectPool.cs index 9b341a1636..3ca525b117 100644 --- a/wrappers/csharp/Intel.RealSense/Helpers/ObjectPool.cs +++ b/wrappers/csharp/Intel.RealSense/Helpers/ObjectPool.cs @@ -57,7 +57,7 @@ private static object CreateInstance(Type t, IntPtr ptr) } var ctorinfo = t.GetConstructor( - BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, + BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, new Type[] { typeof(IntPtr) }, null); @@ -96,6 +96,12 @@ private static object Get(Type t, IntPtr ptr) return CreateInstance(t, ptr); } + /// + /// Get an object from the pool, should be released back + /// + /// type of object + /// native handle + /// an object of type public static T Get(IntPtr ptr) where T : Base.PooledObject { @@ -107,6 +113,11 @@ public static T Get(IntPtr ptr) return Get(typeof(T), ptr) as T; } + /// + /// Return an object to the pool + /// + /// type of object + /// object to return to pool public static void Release(T obj) where T : Base.PooledObject { diff --git a/wrappers/csharp/Intel.RealSense/NativeMethods.cs b/wrappers/csharp/Intel.RealSense/NativeMethods.cs index d1c3fadd68..7c2ef72a8b 100644 --- a/wrappers/csharp/Intel.RealSense/NativeMethods.cs +++ b/wrappers/csharp/Intel.RealSense/NativeMethods.cs @@ -119,6 +119,12 @@ internal static MemCpyDelegate GetMethod() [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern int rs2_processing_block_register_simple_option(IntPtr block, Option option_id, float min, float max, float step, float def, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] + internal static extern IntPtr rs2_get_processing_block_info(IntPtr block, CameraInfo info, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] + internal static extern int rs2_supports_processing_block_info(IntPtr block, CameraInfo info, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern void rs2_start_processing_queue(IntPtr block, IntPtr queue, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); @@ -181,6 +187,18 @@ internal static MemCpyDelegate GetMethod() [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern void rs2_set_option(IntPtr options, Option option, float value, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] + internal static extern IntPtr rs2_get_options_list(IntPtr options, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] + internal static extern int rs2_get_options_list_size(IntPtr options, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] + internal static extern Option rs2_get_option_from_list(IntPtr options_list, int i, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] + internal static extern void rs2_delete_options_list(IntPtr options_list); + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern int rs2_supports_option(IntPtr options, Option option, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); @@ -243,6 +261,9 @@ internal static MemCpyDelegate GetMethod() [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern int rs2_get_frame_points_count(IntPtr frame, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] + internal static extern void rs2_export_to_ply(IntPtr frame, string fname, IntPtr texture, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr rs2_get_frame_stream_profile(IntPtr frame, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); @@ -344,18 +365,15 @@ internal static MemCpyDelegate GetMethod() [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr rs2_get_recommended_processing_blocks(IntPtr device, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); - [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr rs2_get_processing_block(IntPtr device, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); - [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr rs2_get_stream_profile(IntPtr list, int index, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr rs2_get_processing_block(IntPtr list, int index, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); - [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern void rs2_get_stream_profile_data(IntPtr mode, out Stream stream, out Format format, out int index, out int unique_id, out int framerate, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); @@ -374,7 +392,6 @@ internal static MemCpyDelegate GetMethod() [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern int rs2_is_processing_block_extendable_to(IntPtr mode, Extension type, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); - [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern void rs2_get_video_stream_resolution(IntPtr from, out int width, out int height, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); @@ -409,19 +426,16 @@ internal static MemCpyDelegate GetMethod() internal static extern int rs2_import_localization_map(IntPtr sensor, IntPtr raw_data_to_send, uint size_of_raw_data_to_send, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] - internal static extern int rs2_set_static_node(IntPtr sensor, [MarshalAs(UnmanagedType.LPStr)] string guid, Math.Vector pos, Math.Quaternion orient, - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + internal static extern int rs2_set_static_node(IntPtr sensor, [MarshalAs(UnmanagedType.LPStr)] string guid, Math.Vector pos, Math.Quaternion orient, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] - internal static extern int rs2_get_static_node(IntPtr sensor, [MarshalAs(UnmanagedType.LPStr)] string guid, out Math.Vector pos, out Math.Quaternion orient, - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + internal static extern int rs2_get_static_node(IntPtr sensor, [MarshalAs(UnmanagedType.LPStr)] string guid, out Math.Vector pos, out Math.Quaternion orient, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern int rs2_load_wheel_odometry_config(IntPtr sensor, IntPtr wheel_odometry_cfg_buf, uint size_of_buf, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] - internal static extern int rs2_send_wheel_odometry(IntPtr sensor, byte wo_sensor_id, uint frame_num, Math.Vector translational_velocity, - [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + internal static extern int rs2_send_wheel_odometry(IntPtr sensor, byte wo_sensor_id, uint frame_num, Math.Vector translational_velocity, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] internal static extern void rs2_get_motion_intrinsics(IntPtr profile, out MotionDeviceIntrinsics intrinsics, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); diff --git a/wrappers/csharp/Intel.RealSense/Options/CMakeLists.txt b/wrappers/csharp/Intel.RealSense/Options/CMakeLists.txt new file mode 100644 index 0000000000..1d6babc036 --- /dev/null +++ b/wrappers/csharp/Intel.RealSense/Options/CMakeLists.txt @@ -0,0 +1,8 @@ +target_sources(${LRS_DOTNET_TARGET} + PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/IOption.cs" + "${CMAKE_CURRENT_LIST_DIR}/IOptions.cs" + "${CMAKE_CURRENT_LIST_DIR}/IOptionsContainer.cs" + "${CMAKE_CURRENT_LIST_DIR}/OptionsList.cs" + "${CMAKE_CURRENT_LIST_DIR}/OptionInternal.cs" +) diff --git a/wrappers/csharp/Intel.RealSense/Options/IOption.cs b/wrappers/csharp/Intel.RealSense/Options/IOption.cs new file mode 100644 index 0000000000..e6b2aeb6a7 --- /dev/null +++ b/wrappers/csharp/Intel.RealSense/Options/IOption.cs @@ -0,0 +1,43 @@ +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2017 Intel Corporation. All Rights Reserved. + +namespace Intel.RealSense +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + + public interface IOption + { + Option Key { get; } + + /// Gets or sets option value + /// value of the option + float Value { get; set; } + + /// Gets the minimum value which will be accepted for this option + float Min { get; } + + /// Gets the maximum value which will be accepted for this option + float Max { get; } + + /// Gets the granularity of options which accept discrete values, or zero if the option accepts continuous values + float Step { get; } + + /// Gets the default value of the option + float Default { get; } + + /// Gets a value indicating whether an option is read-only + /// if option is read-only + bool ReadOnly { get; } + + /// Gets the option description + /// human-readable option description + string Description { get; } + + /// Gets the option value description (in case specific option value hold special meaning) + /// human-readable description of a specific value of an option or null if no special meaning + string ValueDescription { get; } + } +} diff --git a/wrappers/csharp/Intel.RealSense/Types/IOptions.cs b/wrappers/csharp/Intel.RealSense/Options/IOptions.cs similarity index 88% rename from wrappers/csharp/Intel.RealSense/Types/IOptions.cs rename to wrappers/csharp/Intel.RealSense/Options/IOptions.cs index 9897c60da7..2196a08d9c 100644 --- a/wrappers/csharp/Intel.RealSense/Types/IOptions.cs +++ b/wrappers/csharp/Intel.RealSense/Options/IOptions.cs @@ -4,8 +4,10 @@ namespace Intel.RealSense { using System; + using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; + using Base; public interface IOptions { diff --git a/wrappers/csharp/Intel.RealSense/Types/IOptionsContainer.cs b/wrappers/csharp/Intel.RealSense/Options/IOptionsContainer.cs similarity index 86% rename from wrappers/csharp/Intel.RealSense/Types/IOptionsContainer.cs rename to wrappers/csharp/Intel.RealSense/Options/IOptionsContainer.cs index 55cfd006d9..6b532d22b8 100644 --- a/wrappers/csharp/Intel.RealSense/Types/IOptionsContainer.cs +++ b/wrappers/csharp/Intel.RealSense/Options/IOptionsContainer.cs @@ -3,14 +3,14 @@ namespace Intel.RealSense { - using System; using System.Collections.Generic; - using System.Runtime.InteropServices; public interface IOptionsContainer : IEnumerable { IOption this[Option option] { get; } + bool Supports(Option option); + string OptionValueDescription(Option option, float value); } } diff --git a/wrappers/csharp/Intel.RealSense/Options/OptionInternal.cs b/wrappers/csharp/Intel.RealSense/Options/OptionInternal.cs new file mode 100644 index 0000000000..d8ddf57d81 --- /dev/null +++ b/wrappers/csharp/Intel.RealSense/Options/OptionInternal.cs @@ -0,0 +1,112 @@ +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2017 Intel Corporation. All Rights Reserved. + +namespace Intel.RealSense +{ + using System; + using System.Diagnostics; + using System.Runtime.InteropServices; + + [DebuggerDisplay("{Value}", Name = "{Key}")] + internal sealed class OptionInternal : IOption + { + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly IntPtr m_options; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly Option option; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly float min; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly float max; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly float step; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly float @default; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private string description; + + internal OptionInternal(IntPtr options, Option option) + { + m_options = options; + this.option = option; + + object error; + NativeMethods.rs2_get_option_range(m_options, option, out min, out max, out step, out @default, out error); + } + + /// Gets the option description + /// human-readable option description + public string Description + { + get + { + if (description == null) + { + object error; + var str = NativeMethods.rs2_get_option_description(m_options, option, out error); + description = Marshal.PtrToStringAnsi(str); + } + + return description; + } + } + + /// Gets or sets option value + /// value of the option + public float Value + { + get + { + object error; + return NativeMethods.rs2_get_option(m_options, option, out error); + } + + set + { + object error; + NativeMethods.rs2_set_option(m_options, option, value, out error); + } + } + + /// get option value description (in case specific option value hold special meaning) + /// value of the option + /// human-readable description of a specific value of an option or null if no special meaning + public string GetValueDescription(float value) + { + object error; + var str = NativeMethods.rs2_get_option_value_description(m_options, option, value, out error); + return Marshal.PtrToStringAnsi(str); + } + + public Option Key => option; + + public float Min => min; + + public float Max => max; + + public float Step => step; + + public float Default => @default; + + /// Gets the option value description (in case specific option value hold special meaning) + /// human-readable description of a specific value of an option or null if no special meaning + public string ValueDescription => GetValueDescription(Value); + + /// Gets a value indicating whether an option is read-only + /// if option is read-only + public bool ReadOnly + { + get + { + object error; + return NativeMethods.rs2_is_option_read_only(m_options, option, out error) != 0; + } + } + } +} diff --git a/wrappers/csharp/Intel.RealSense/Options/OptionsList.cs b/wrappers/csharp/Intel.RealSense/Options/OptionsList.cs new file mode 100644 index 0000000000..c5d9d245af --- /dev/null +++ b/wrappers/csharp/Intel.RealSense/Options/OptionsList.cs @@ -0,0 +1,142 @@ +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2017 Intel Corporation. All Rights Reserved. + +namespace Intel.RealSense +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Diagnostics; + using System.Runtime.InteropServices; + + [DebuggerTypeProxy(typeof(OptionsListDebugView))] + [DebuggerDisplay("Count = {Count}")] + internal sealed class OptionsList : Base.Object, IOptionsContainer, ICollection + { + internal sealed class OptionsListDebugView + { + private readonly OptionsList ol; + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public IOption[] Items + { + get + { + IOption[] array = new IOption[ol.Count]; + ol.CopyTo(array, 0); + return array; + } + } + + public OptionsListDebugView(OptionsList optionList) + { + if (optionList == null) + { + throw new ArgumentNullException(nameof(optionList)); + } + + ol = optionList; + } + } + + private readonly IntPtr options; + + /// + public int Count + { + get + { + object error; + return NativeMethods.rs2_get_options_list_size(Handle, out error); + } + } + + /// + public object SyncRoot => this; + + /// + public bool IsSynchronized => false; + + internal static IntPtr Create(IntPtr options) + { + object error; + return NativeMethods.rs2_get_options_list(options, out error); + } + + internal OptionsList(IntPtr options) + : base(Create(options), NativeMethods.rs2_delete_options_list) + { + this.options = options; + } + + public IOption this[Option option] + { + get + { + return new OptionInternal(options, option); + } + } + + /// + /// check if particular option is supported by a subdevice + /// + /// option id to be checked + /// true if option is supported + public bool Supports(Option option) + { + object error; + return NativeMethods.rs2_supports_option(options, option, out error) > 0; + } + + /// get option value description (in case specific option value hold special meaning) + /// option id to be checked + /// value of the option + /// human-readable description of a specific value of an option or null if no special meaning + public string OptionValueDescription(Option option, float value) + { + object error; + var desc = NativeMethods.rs2_get_option_value_description(options, option, value, out error); + if (desc != IntPtr.Zero) + { + return Marshal.PtrToStringAnsi(desc); + } + + return null; + } + + /// + public IEnumerator GetEnumerator() + { + object error; + int size = NativeMethods.rs2_get_options_list_size(Handle, out error); + for (int i = 0; i < size; i++) + { + var option = NativeMethods.rs2_get_option_from_list(Handle, i, out error); + yield return new OptionInternal(options, option); + } + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + public void CopyTo(Array array, int index) + { + if (array == null) + { + throw new ArgumentNullException("array"); + } + + object error; + for (int i = 0; i < Count; i++) + { + var option = NativeMethods.rs2_get_option_from_list(Handle, i, out error); + array.SetValue(this[option], i + index); + } + } + } +} diff --git a/wrappers/csharp/Intel.RealSense/Pipeline/Pipeline.cs b/wrappers/csharp/Intel.RealSense/Pipeline/Pipeline.cs index 3588ed0e8a..74b5702a72 100644 --- a/wrappers/csharp/Intel.RealSense/Pipeline/Pipeline.cs +++ b/wrappers/csharp/Intel.RealSense/Pipeline/Pipeline.cs @@ -6,6 +6,7 @@ namespace Intel.RealSense using System; using System.Collections; using System.Collections.Generic; + using System.Diagnostics; using System.Runtime.InteropServices; /// @@ -20,6 +21,7 @@ namespace Intel.RealSense /// public class Pipeline : Base.Object { + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private frame_callback m_callback; internal static IntPtr Create(Context ctx) @@ -28,6 +30,14 @@ internal static IntPtr Create(Context ctx) return NativeMethods.rs2_create_pipeline(ctx.Handle, out error); } + internal static IntPtr Create() + { + using (var ctx = new Context()) + { + return Create(ctx); + } + } + /// /// Initializes a new instance of the class. /// @@ -41,7 +51,7 @@ public Pipeline(Context ctx) /// Initializes a new instance of the class. /// public Pipeline() - : base(Create(new Context()), NativeMethods.rs2_delete_pipeline) + : base(Create(), NativeMethods.rs2_delete_pipeline) { } @@ -83,6 +93,7 @@ public PipelineProfile Start(Config cfg) /// /// Delegate to register as per-frame callback /// The actual pipeline device and streams profile, which was successfully configured to the streaming device. + // TODO: overload with state object and Action callback to avoid allocations public PipelineProfile Start(FrameCallback cb) { object error; @@ -99,6 +110,7 @@ public PipelineProfile Start(FrameCallback cb) return prof; } + // TODO: overload with state object and Action callback to avoid allocations public PipelineProfile Start(Config cfg, FrameCallback cb) { object error; diff --git a/wrappers/csharp/Intel.RealSense/Pipeline/PipelineProfile.cs b/wrappers/csharp/Intel.RealSense/Pipeline/PipelineProfile.cs index 81c8671fdd..0d6e6fc15c 100644 --- a/wrappers/csharp/Intel.RealSense/Pipeline/PipelineProfile.cs +++ b/wrappers/csharp/Intel.RealSense/Pipeline/PipelineProfile.cs @@ -6,6 +6,7 @@ namespace Intel.RealSense using System; using System.Collections; using System.Collections.Generic; + using System.Collections.ObjectModel; using System.Runtime.InteropServices; /// @@ -38,13 +39,17 @@ public Device Device /// /// Gets the selected streams profiles, which are enabled in this profile. /// - public StreamProfileList Streams + public ReadOnlyCollection Streams { get { object error; - var ptr = NativeMethods.rs2_pipeline_profile_get_streams(Handle, out error); - return new StreamProfileList(ptr); + using (var pl = new StreamProfileList(NativeMethods.rs2_pipeline_profile_get_streams(Handle, out error))) + { + var profiles = new StreamProfile[pl.Count]; + pl.CopyTo(profiles, 0); + return Array.AsReadOnly(profiles); + } } } @@ -64,9 +69,9 @@ public StreamProfile GetStream(Stream s, int index = -1) public T GetStream(Stream s, int index = -1) where T : StreamProfile { - using (var streams = Streams) + object error; + using (var streams = new StreamProfileList(NativeMethods.rs2_pipeline_profile_get_streams(Handle, out error))) { - object error; int count = streams.Count; for (int i = 0; i < count; i++) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/CMakeLists.txt b/wrappers/csharp/Intel.RealSense/Processing/CMakeLists.txt index ba02b19b1f..9d72eeaac0 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/CMakeLists.txt +++ b/wrappers/csharp/Intel.RealSense/Processing/CMakeLists.txt @@ -12,7 +12,7 @@ target_sources(${LRS_DOTNET_TARGET} "${CMAKE_CURRENT_LIST_DIR}/SpatialFilter.cs" "${CMAKE_CURRENT_LIST_DIR}/Syncer.cs" "${CMAKE_CURRENT_LIST_DIR}/TemporalFilter.cs" - "${CMAKE_CURRENT_LIST_DIR}/ZeroOrderFix.cs" + "${CMAKE_CURRENT_LIST_DIR}/ZeroOrderInvalidationFilter.cs" "${CMAKE_CURRENT_LIST_DIR}/ProcessingBlockList.cs" "${CMAKE_CURRENT_LIST_DIR}/ThresholdFilter.cs" ) diff --git a/wrappers/csharp/Intel.RealSense/Processing/Colorizer.cs b/wrappers/csharp/Intel.RealSense/Processing/Colorizer.cs index 5fc5ab465f..ac55703d04 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/Colorizer.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/Colorizer.cs @@ -16,6 +16,11 @@ private static IntPtr Create() return NativeMethods.rs2_create_colorizer(out error); } + internal Colorizer(IntPtr ptr) + : base(ptr) + { + } + public Colorizer() : base(Create()) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/CustomProcessingBlock.cs b/wrappers/csharp/Intel.RealSense/Processing/CustomProcessingBlock.cs index 1d8ed7a099..7e587690ea 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/CustomProcessingBlock.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/CustomProcessingBlock.cs @@ -16,10 +16,10 @@ public class CustomProcessingBlock : IOptions, IDisposable { internal Base.DeleterHandle m_instance; + private static readonly frame_processor_callback fpc = new frame_processor_callback(ProcessingBlockCallback); + private static readonly frame_callback frameCallback = new frame_callback(ProcessingBlockFrameCallback); private readonly FrameQueue queue = new FrameQueue(1); private readonly GCHandle frameProcessorCallbackHandle; - private readonly frame_processor_callback fpc = new frame_processor_callback(ProcessingBlockCallback); - private GCHandle frameCallbackHandle; /// @@ -33,7 +33,7 @@ public CustomProcessingBlock(FrameProcessorCallback cb) object error; var pb = NativeMethods.rs2_create_processing_block_fptr(fpc, cbPtr, out error); m_instance = new Base.DeleterHandle(pb, NativeMethods.rs2_delete_processing_block); - Options = new Sensor.SensorOptions(m_instance.Handle); + Options = new OptionsList(m_instance.Handle); } ~CustomProcessingBlock() @@ -105,6 +105,7 @@ public void Start() /// Start the processing block, delivering frames to a callback /// /// callback to receive frames + // TODO: overload with state object and Action callback to avoid allocations public void Start(FrameCallback cb) { frameCallbackHandle = GCHandle.Alloc(cb, GCHandleType.Normal); @@ -129,8 +130,6 @@ public bool RegisterOption(Option option_id, float min, float max, float step, f return NativeMethods.rs2_processing_block_register_simple_option(m_instance.Handle, option_id, min, max, step, def, out error) > 0; } - private readonly frame_callback frameCallback = new frame_callback(ProcessingBlockFrameCallback); - private static void ProcessingBlockFrameCallback(IntPtr f, IntPtr u) { try @@ -163,6 +162,7 @@ protected virtual void Dispose(bool disposing) m_instance.Dispose(); } + /// public void Dispose() { Dispose(true); diff --git a/wrappers/csharp/Intel.RealSense/Processing/DecimationFilter.cs b/wrappers/csharp/Intel.RealSense/Processing/DecimationFilter.cs index 10ee4b85e6..a2f7635980 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/DecimationFilter.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/DecimationFilter.cs @@ -16,6 +16,11 @@ private static IntPtr Create() return NativeMethods.rs2_create_decimation_filter_block(out error); } + internal DecimationFilter(IntPtr ptr) + : base(ptr) + { + } + public DecimationFilter() : base(Create()) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/DisparityTransform.cs b/wrappers/csharp/Intel.RealSense/Processing/DisparityTransform.cs index 19391bb842..9585da3796 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/DisparityTransform.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/DisparityTransform.cs @@ -17,6 +17,11 @@ private static IntPtr Create(bool transform_to_disparity) return NativeMethods.rs2_create_disparity_transform_block(transform_direction, out error); } + internal DisparityTransform(IntPtr ptr) + : base(ptr) + { + } + public DisparityTransform(bool transform_to_disparity = true) : base(Create(transform_to_disparity)) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/HoleFillingFilter.cs b/wrappers/csharp/Intel.RealSense/Processing/HoleFillingFilter.cs index 24652e6c7f..a71b720e18 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/HoleFillingFilter.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/HoleFillingFilter.cs @@ -16,6 +16,11 @@ private static IntPtr Create() return NativeMethods.rs2_create_hole_filling_filter_block(out error); } + internal HoleFillingFilter(IntPtr ptr) + : base(ptr) + { + } + public HoleFillingFilter() : base(Create()) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/PointCloud.cs b/wrappers/csharp/Intel.RealSense/Processing/PointCloud.cs index 154d3010a4..00877fd803 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/PointCloud.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/PointCloud.cs @@ -20,6 +20,11 @@ private static IntPtr Create() return NativeMethods.rs2_create_pointcloud(out error); } + internal PointCloud(IntPtr ptr) + : base(ptr) + { + } + public PointCloud() : base(Create()) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/ProcessingBlock.cs b/wrappers/csharp/Intel.RealSense/Processing/ProcessingBlock.cs index 2875058f40..60981f285e 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/ProcessingBlock.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/ProcessingBlock.cs @@ -4,10 +4,13 @@ namespace Intel.RealSense { using System; + using System.Collections; using System.Collections.Generic; + using System.Diagnostics; using System.Linq; using System.Runtime.InteropServices; using Intel.RealSense.Base; + using System.Reflection; public interface IProcessingBlock : IOptions { @@ -17,13 +20,16 @@ public interface IProcessingBlock : IOptions /// /// Base class for processing blocks /// - public abstract class ProcessingBlock : Base.Object, IProcessingBlock + public class ProcessingBlock : Base.Object, IProcessingBlock { + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly FrameQueue queue = new FrameQueue(1); /// public IOptionsContainer Options { get; private set; } + public InfoCollection Info { get; private set; } + /// /// Gets the internal queue /// @@ -38,16 +44,17 @@ public FrameQueue Queue /// /// Initializes a new instance of the class. /// - /// Starts the processing block directing it's output to the + /// Starts the processing block directing it's output to the /// /// - /// native pointer - protected ProcessingBlock(IntPtr ptr) + /// native rs2_processing_block* pointer + public ProcessingBlock(IntPtr ptr) : base(ptr, NativeMethods.rs2_delete_processing_block) { - Options = new Sensor.SensorOptions(Handle); - object error; + Options = new OptionsList(Handle); + Info = new InfoCollection(NativeMethods.rs2_supports_processing_block_info, NativeMethods.rs2_get_processing_block_info, Handle); + NativeMethods.rs2_start_processing_queue(Handle, queue.Handle, out error); } @@ -89,8 +96,32 @@ public T Process(Frame original) protected override void Dispose(bool disposing) { queue.Dispose(); + (Options as OptionsList).Dispose(); base.Dispose(disposing); } + + /// Test if the given processing block can be extended to the requested extension + /// The extension to which the processing block should be tested if it is extendable + /// iff the processing block can be extended to the given extension + public bool Is(Extension extension) + { + object error; + return NativeMethods.rs2_is_processing_block_extendable_to(Handle, extension, out error) > 0; + } + + /// Cast to a strongly-typed subclass + /// type or subclass + /// an instance of + public T As() + where T : ProcessingBlock + { + return (T)Activator.CreateInstance( + typeof(T), + BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, + null, + new object[] { Handle }, + null); + } } public static class IProcessingBlockExtensions diff --git a/wrappers/csharp/Intel.RealSense/Processing/ProcessingBlockList.cs b/wrappers/csharp/Intel.RealSense/Processing/ProcessingBlockList.cs index 884c41d21b..fdb4eb8afb 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/ProcessingBlockList.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/ProcessingBlockList.cs @@ -1,27 +1,28 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.InteropServices; +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2017 Intel Corporation. All Rights Reserved. namespace Intel.RealSense { - public class ProcessingBlockList : IDisposable, IEnumerable - { - internal IntPtr m_instance; + using System; + using System.Collections; + using System.Collections.Generic; + using System.Runtime.InteropServices; + internal sealed class ProcessingBlockList : Base.Object, IEnumerable, ICollection + { public ProcessingBlockList(IntPtr ptr) + : base(ptr, NativeMethods.rs2_delete_recommended_processing_blocks) { - m_instance = ptr; } public IEnumerator GetEnumerator() { object error; - int deviceCount = NativeMethods.rs2_get_recommended_processing_blocks_count(m_instance, out error); + int deviceCount = NativeMethods.rs2_get_recommended_processing_blocks_count(Handle, out error); for (int i = 0; i < deviceCount; i++) { - var ptr = NativeMethods.rs2_get_processing_block(m_instance, i, out error); + var ptr = NativeMethods.rs2_get_processing_block(Handle, i, out error); yield return new ProcessingBlock(ptr); } } @@ -36,61 +37,41 @@ public int Count get { object error; - int deviceCount = NativeMethods.rs2_get_recommended_processing_blocks_count(m_instance, out error); + int deviceCount = NativeMethods.rs2_get_recommended_processing_blocks_count(Handle, out error); return deviceCount; } } - public T GetProcessingBlock(int index) where T : ProcessingBlock + public object SyncRoot => this; + + public bool IsSynchronized => false; + + public T GetProcessingBlock(int index) + where T : ProcessingBlock { object error; - return new ProcessingBlock(NativeMethods.rs2_get_processing_block(m_instance, index, out error)) as T; + return new ProcessingBlock(NativeMethods.rs2_get_processing_block(Handle, index, out error)) as T; } - public ProcessingBlock this[int index] + public void CopyTo(Array array, int index) { - get + if (array == null) { - return GetProcessingBlock(index); + throw new ArgumentNullException("array"); } - } - #region IDisposable Support - private bool disposedValue = false; // To detect redundant calls - - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) + for (int i = 0; i < Count; i++) { - if (disposing) - { - // TODO: dispose managed state (managed objects). - } - - // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. - // TODO: set large fields to null. - NativeMethods.rs2_delete_recommended_processing_blocks(m_instance); - m_instance = IntPtr.Zero; - - disposedValue = true; + array.SetValue(this[i], i + index); } } - //TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. - ~ProcessingBlockList() - { - // Do not change this code. Put cleanup code in Dispose(bool disposing) above. - Dispose(false); - } - - // This code added to correctly implement the disposable pattern. - public void Dispose() + public ProcessingBlock this[int index] { - // Do not change this code. Put cleanup code in Dispose(bool disposing) above. - Dispose(true); - // TODO: uncomment the following line if the finalizer is overridden above. - GC.SuppressFinalize(this); + get + { + return GetProcessingBlock(index); + } } - #endregion } } diff --git a/wrappers/csharp/Intel.RealSense/Processing/SpatialFilter.cs b/wrappers/csharp/Intel.RealSense/Processing/SpatialFilter.cs index 7039f62782..c2983ef172 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/SpatialFilter.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/SpatialFilter.cs @@ -16,6 +16,11 @@ private static IntPtr Create() return NativeMethods.rs2_create_spatial_filter_block(out error); } + internal SpatialFilter(IntPtr ptr) + : base(ptr) + { + } + public SpatialFilter() : base(Create()) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/Syncer.cs b/wrappers/csharp/Intel.RealSense/Processing/Syncer.cs index fb092dae78..67525f8c9f 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/Syncer.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/Syncer.cs @@ -16,6 +16,11 @@ private static IntPtr Create() return NativeMethods.rs2_create_sync_processing_block(out error); } + internal Syncer(IntPtr ptr) + : base(ptr) + { + } + /// /// Initializes a new instance of the class. /// diff --git a/wrappers/csharp/Intel.RealSense/Processing/TemporalFilter.cs b/wrappers/csharp/Intel.RealSense/Processing/TemporalFilter.cs index d15adf2c24..f08ac72307 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/TemporalFilter.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/TemporalFilter.cs @@ -16,6 +16,11 @@ private static IntPtr Create() return NativeMethods.rs2_create_temporal_filter_block(out error); } + internal TemporalFilter(IntPtr ptr) + : base(ptr) + { + } + public TemporalFilter() : base(Create()) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/ThresholdFilter.cs b/wrappers/csharp/Intel.RealSense/Processing/ThresholdFilter.cs index 7f949ee801..a0d64e0790 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/ThresholdFilter.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/ThresholdFilter.cs @@ -16,6 +16,11 @@ private static IntPtr Create() return NativeMethods.rs2_create_threshold(out error); } + internal ThresholdFilter(IntPtr ptr) + : base(ptr) + { + } + public ThresholdFilter() : base(Create()) { diff --git a/wrappers/csharp/Intel.RealSense/Processing/ZeroOrderFix.cs b/wrappers/csharp/Intel.RealSense/Processing/ZeroOrderInvalidationFilter.cs similarity index 51% rename from wrappers/csharp/Intel.RealSense/Processing/ZeroOrderFix.cs rename to wrappers/csharp/Intel.RealSense/Processing/ZeroOrderInvalidationFilter.cs index 329f95cc5e..c87f4f2c3c 100644 --- a/wrappers/csharp/Intel.RealSense/Processing/ZeroOrderFix.cs +++ b/wrappers/csharp/Intel.RealSense/Processing/ZeroOrderInvalidationFilter.cs @@ -1,17 +1,26 @@ -using System; -using System.Runtime.InteropServices; -using System.Collections.Generic; -using System.Linq; +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2017 Intel Corporation. All Rights Reserved. namespace Intel.RealSense { + using System; + public class ZeroOrderInvalidationFilter : ProcessingBlock { - public ZeroOrderInvalidationFilter() + private static IntPtr Create() { object error; - m_instance = new HandleRef(this, NativeMethods.rs2_create_zero_order_invalidation_block(out error)); - NativeMethods.rs2_start_processing_queue(m_instance.Handle, queue.m_instance.Handle, out error); + return NativeMethods.rs2_create_zero_order_invalidation_block(out error); + } + + internal ZeroOrderInvalidationFilter(IntPtr ptr) + : base(ptr) + { + } + + public ZeroOrderInvalidationFilter() + : base(Create()) + { } [Obsolete("This method is obsolete. Use Process method instead")] diff --git a/wrappers/csharp/Intel.RealSense/Sensors/Sensor.cs b/wrappers/csharp/Intel.RealSense/Sensors/Sensor.cs index 3a712b4832..56288b82b8 100644 --- a/wrappers/csharp/Intel.RealSense/Sensors/Sensor.cs +++ b/wrappers/csharp/Intel.RealSense/Sensors/Sensor.cs @@ -6,18 +6,24 @@ namespace Intel.RealSense using System; using System.Collections; using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Diagnostics; using System.Linq; using System.Runtime.InteropServices; + // TODO: subclasses - DepthSensor, DepthStereoSensor, PoseSensor... public class Sensor : Base.PooledObject, IOptions { internal override void Initialize() { - Info = new CameraInfos(Handle); - Options = new SensorOptions(Handle); + Info = new InfoCollection(NativeMethods.rs2_supports_sensor_info, NativeMethods.rs2_get_sensor_info, Handle); + Options = new OptionsList(Handle); } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private frame_callback m_callback; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private FrameQueue m_queue; internal static T Create(IntPtr ptr) @@ -29,11 +35,18 @@ internal static T Create(IntPtr ptr) internal Sensor(IntPtr sensor) : base(sensor, NativeMethods.rs2_delete_sensor) { - Info = new CameraInfos(Handle); - Options = new SensorOptions(Handle); + Info = new InfoCollection(NativeMethods.rs2_supports_sensor_info, NativeMethods.rs2_get_sensor_info, Handle); + Options = new OptionsList(Handle); } - public class CameraInfos + protected override void Dispose(bool disposing) + { + //m_queue.Dispose(); + (Options as OptionsList).Dispose(); + base.Dispose(disposing); + } + + public class CameraInfos : IEnumerable> { private readonly IntPtr m_sensor; @@ -58,203 +71,19 @@ public string this[CameraInfo info] return null; } } - } - - public CameraInfos Info { get; private set; } - - internal class CameraOption : IOption - { - private readonly IntPtr m_sensor; - private readonly Option option; - - private readonly float min; - private readonly float max; - private readonly float step; - private readonly float @default; - private string description; - - public CameraOption(IntPtr sensor, Option option) - { - m_sensor = sensor; - this.option = option; - - if (Supported) - { - object error; - NativeMethods.rs2_get_option_range(m_sensor, option, out min, out max, out step, out @default, out error); - } - } - - /// Gets a value indicating whether a particular option is supported by a subdevice - /// true if option is supported - public bool Supported - { - get - { - try - { - object error; - return NativeMethods.rs2_supports_option(m_sensor, option, out error) > 0; - } - catch (Exception) - { - return false; - } - } - } - - public Option Key - { - get - { - return option; - } - } - - /// Gets the option description - /// human-readable option description - public string Description - { - get - { - if (description == null) - { - object error; - var str = NativeMethods.rs2_get_option_description(m_sensor, option, out error); - description = Marshal.PtrToStringAnsi(str); - } - - return description; - } - } - - /// Gets or sets option value - /// value of the option - public float Value - { - get - { - object error; - return NativeMethods.rs2_get_option(m_sensor, option, out error); - } - - set - { - object error; - NativeMethods.rs2_set_option(m_sensor, option, value, out error); - } - } - - /// Gets the option value description (in case specific option value hold special meaning) - /// human-readable description of a specific value of an option or null if no special meaning - public string ValueDescription - { - get - { - return GetValueDescription(Value); - } - } - - /// get option value description (in case specific option value hold special meaning) - /// value of the option - /// human-readable description of a specific value of an option or null if no special meaning - public string GetValueDescription(float value) - { - object error; - var str = NativeMethods.rs2_get_option_value_description(m_sensor, option, value, out error); - return Marshal.PtrToStringAnsi(str); - } - - public float Min - { - get - { - return min; - } - } - public float Max - { - get - { - return max; - } - } - - public float Step - { - get - { - return step; - } - } - - public float Default - { - get - { - return @default; - } - } - - /// Gets a value indicating whether an option is read-only - /// true if option is read-only - public bool ReadOnly - { - get - { - object error; - return NativeMethods.rs2_is_option_read_only(m_sensor, option, out error) != 0; - } - } - } - - public class SensorOptions : IOptionsContainer - { - private readonly IntPtr m_sensor; - - /// read option value from the sensor - /// option id to be queried - /// value of the option - public IOption this[Option option] - { - get - { - return new CameraOption(m_sensor, option); - } - } + private static readonly CameraInfo[] CameraInfoValues = Enum.GetValues(typeof(CameraInfo)) as CameraInfo[]; - /// - /// Get option value description (in case specific option value hold special meaning) - /// - /// option id to be checked - /// value of the option - /// human-readable description of a specific value of an option or null if no special meaning - public string OptionValueDescription(Option option, float value) + /// + public IEnumerator> GetEnumerator() { object error; - var desc = NativeMethods.rs2_get_option_value_description(m_sensor, option, value, out error); - if (desc != IntPtr.Zero) + foreach (var key in CameraInfoValues) { - return Marshal.PtrToStringAnsi(desc); - } - - return null; - } - - private static readonly Option[] OptionValues = Enum.GetValues(typeof(Option)) as Option[]; - - /// - /// Returns an enumerator that iterates over supported options - /// - /// an enumerator that iterates over supported options - public IEnumerator GetEnumerator() - { - foreach (var v in OptionValues) - { - if (this[v].Supported) + if (NativeMethods.rs2_supports_sensor_info(m_sensor, key, out error) > 0) { - yield return this[v]; + var value = Marshal.PtrToStringAnsi(NativeMethods.rs2_get_sensor_info(m_sensor, key, out error)); + yield return new KeyValuePair(key, value); } } } @@ -264,13 +93,11 @@ IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } - - internal SensorOptions(IntPtr sensor) - { - m_sensor = sensor; - } } + public InfoCollection Info { get; private set; } + + /// public IOptionsContainer Options { get; private set; } @@ -303,6 +130,7 @@ public void Open(params StreamProfile[] profiles) /// start streaming from specified configured sensor of specific stream to frame queue /// /// frame-queue to store new frames into + // TODO: overload with state object and Action callback to avoid allocations public void Start(FrameQueue queue) { object error; @@ -313,6 +141,7 @@ public void Start(FrameQueue queue) /// start streaming from specified configured sensor /// delegate to register as per-frame callback + // TODO: overload with state object and Action callback to avoid allocations public void Start(FrameCallback cb) { object error; @@ -348,6 +177,12 @@ public void Close() NativeMethods.rs2_close(Handle, out error); } + public bool Is(Extension ext) + { + object error; + return NativeMethods.rs2_is_sensor_extendable_to(Handle, ext, out error) != 0; + } + /// /// Gets the mapping between the units of the depth image and meters /// @@ -369,7 +204,7 @@ public AutoExposureROI AutoExposureSettings get { object error; - if (NativeMethods.rs2_is_sensor_extendable_to(Handle, Extension.Roi, out error) == 0) + if (NativeMethods.rs2_is_sensor_extendable_to(Handle, Extension.Roi, out error) != 0) { return new AutoExposureROI { m_instance = Handle }; } @@ -381,12 +216,36 @@ public AutoExposureROI AutoExposureSettings /// Gets the list of supported stream profiles /// list of stream profiles that given subdevice can provide - public StreamProfileList StreamProfiles + public ReadOnlyCollection StreamProfiles + { + get + { + object error; + using (var pl = new StreamProfileList(NativeMethods.rs2_get_stream_profiles(Handle, out error))) + { + var profiles = new StreamProfile[pl.Count]; + pl.CopyTo(profiles, 0); + return Array.AsReadOnly(profiles); + } + } + } + + /// Gets the list of recommended processing blocks for a specific sensor. + /// + /// Order and configuration of the blocks are decided by the sensor + /// + /// list of supported sensor recommended processing blocks + public ReadOnlyCollection ProcessingBlocks { get { object error; - return new StreamProfileList(NativeMethods.rs2_get_stream_profiles(Handle, out error)); + using (var pl = new ProcessingBlockList(NativeMethods.rs2_get_recommended_processing_blocks(Handle, out error))) + { + var blocks = new ProcessingBlock[pl.Count]; + pl.CopyTo(blocks, 0); + return Array.AsReadOnly(blocks); + } } } } diff --git a/wrappers/csharp/Intel.RealSense/Sensors/SensorList.cs b/wrappers/csharp/Intel.RealSense/Sensors/SensorList.cs index 4d9e51c4fb..80b614812c 100644 --- a/wrappers/csharp/Intel.RealSense/Sensors/SensorList.cs +++ b/wrappers/csharp/Intel.RealSense/Sensors/SensorList.cs @@ -6,19 +6,21 @@ namespace Intel.RealSense using System; using System.Collections; using System.Collections.Generic; + using System.Collections.ObjectModel; using System.Linq; using System.Runtime.InteropServices; /// /// List of adjacent devices, sharing the same physical parent composite device /// - public class SensorList : Base.Object, IEnumerable + internal sealed class SensorList : Base.Object, IEnumerable, ICollection { internal SensorList(IntPtr ptr) : base(ptr, NativeMethods.rs2_delete_sensor_list) { } + /// public IEnumerator GetEnumerator() { object error; @@ -31,11 +33,26 @@ public IEnumerator GetEnumerator() } } + /// IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } + /// + public void CopyTo(Array array, int index) + { + if (array == null) + { + throw new ArgumentNullException("array"); + } + + for (int i = 0; i < Count; i++) + { + array.SetValue(this[i], i + index); + } + } + /// /// Gets the number of sensors in the list /// @@ -44,11 +61,14 @@ public int Count get { object error; - int deviceCount = NativeMethods.rs2_get_sensors_count(Handle, out error); - return deviceCount; + return NativeMethods.rs2_get_sensors_count(Handle, out error); } } + public object SyncRoot => this; + + public bool IsSynchronized => false; + /// /// Creates sensor by index /// diff --git a/wrappers/csharp/Intel.RealSense/StreamProfiles/StreamProfile.cs b/wrappers/csharp/Intel.RealSense/StreamProfiles/StreamProfile.cs index d1aa939f65..a4e52a1e75 100644 --- a/wrappers/csharp/Intel.RealSense/StreamProfiles/StreamProfile.cs +++ b/wrappers/csharp/Intel.RealSense/StreamProfiles/StreamProfile.cs @@ -6,6 +6,7 @@ namespace Intel.RealSense using System; using System.Collections; using System.Collections.Generic; + using System.Diagnostics; using System.Runtime.InteropServices; /// @@ -26,10 +27,19 @@ internal StreamProfile(IntPtr ptr) this.Initialize(); } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Stream stream; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Format format; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private int framerate; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private int index; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private int uniqueId; /// diff --git a/wrappers/csharp/Intel.RealSense/StreamProfiles/StreamProfileList.cs b/wrappers/csharp/Intel.RealSense/StreamProfiles/StreamProfileList.cs index 53724faa07..3b6f75b10a 100644 --- a/wrappers/csharp/Intel.RealSense/StreamProfiles/StreamProfileList.cs +++ b/wrappers/csharp/Intel.RealSense/StreamProfiles/StreamProfileList.cs @@ -8,25 +8,27 @@ namespace Intel.RealSense using System.Collections.Generic; using System.Runtime.InteropServices; - public class StreamProfileList : Base.Object, IEnumerable + internal sealed class StreamProfileList : Base.Object, IEnumerable, ICollection { public StreamProfileList(IntPtr ptr) : base(ptr, NativeMethods.rs2_delete_stream_profiles_list) { } + /// public IEnumerator GetEnumerator() { object error; - int deviceCount = NativeMethods.rs2_get_stream_profiles_count(Handle, out error); - for (int i = 0; i < deviceCount; i++) + int size = NativeMethods.rs2_get_stream_profiles_count(Handle, out error); + for (int i = 0; i < size; i++) { var ptr = NativeMethods.rs2_get_stream_profile(Handle, i, out error); yield return StreamProfile.Create(ptr); } } + /// IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); @@ -39,11 +41,16 @@ public int Count get { object error; - int deviceCount = NativeMethods.rs2_get_stream_profiles_count(Handle, out error); - return deviceCount; + return NativeMethods.rs2_get_stream_profiles_count(Handle, out error); } } + /// + public object SyncRoot => this; + + /// + public bool IsSynchronized => false; + /// /// Gets a specific stream profile /// @@ -69,5 +76,19 @@ public T GetProfile(int index) object error; return StreamProfile.Create(NativeMethods.rs2_get_stream_profile(Handle, index, out error)); } + + /// + public void CopyTo(Array array, int index) + { + if (array == null) + { + throw new ArgumentNullException("array"); + } + + for (int i = 0; i < Count; i++) + { + array.SetValue(this[i], i + index); + } + } } } diff --git a/wrappers/csharp/Intel.RealSense/Types/CMakeLists.txt b/wrappers/csharp/Intel.RealSense/Types/CMakeLists.txt index f52db36aac..09ffc6a072 100644 --- a/wrappers/csharp/Intel.RealSense/Types/CMakeLists.txt +++ b/wrappers/csharp/Intel.RealSense/Types/CMakeLists.txt @@ -8,9 +8,6 @@ target_sources(${LRS_DOTNET_TARGET} "${CMAKE_CURRENT_LIST_DIR}/Extrinsics.cs" "${CMAKE_CURRENT_LIST_DIR}/Intrinsics.cs" "${CMAKE_CURRENT_LIST_DIR}/MotionDeviceIntrinsics.cs" - "${CMAKE_CURRENT_LIST_DIR}/IOption.cs" - "${CMAKE_CURRENT_LIST_DIR}/IOptions.cs" - "${CMAKE_CURRENT_LIST_DIR}/IOptionsContainer.cs" "${CMAKE_CURRENT_LIST_DIR}/ROI.cs" "${CMAKE_CURRENT_LIST_DIR}/SoftwareVideoFrame.cs" "${CMAKE_CURRENT_LIST_DIR}/SoftwareVideoStream.cs" @@ -19,4 +16,5 @@ target_sources(${LRS_DOTNET_TARGET} "${CMAKE_CURRENT_LIST_DIR}/SoftwareMotionStream.cs" "${CMAKE_CURRENT_LIST_DIR}/SoftwareMotionFrame.cs" "${CMAKE_CURRENT_LIST_DIR}/Pose.cs" + "${CMAKE_CURRENT_LIST_DIR}/InfoCollection.cs" ) diff --git a/wrappers/csharp/Intel.RealSense/Types/Enums/Extension.cs b/wrappers/csharp/Intel.RealSense/Types/Enums/Extension.cs index 4ca176cf5c..5916c20edc 100644 --- a/wrappers/csharp/Intel.RealSense/Types/Enums/Extension.cs +++ b/wrappers/csharp/Intel.RealSense/Types/Enums/Extension.cs @@ -39,6 +39,10 @@ public enum Extension SpatialFilter = 28, TemporalFilter = 29, HoleFillingFilter = 30, - ZeroOrderFilter = 31 + ZeroOrderFilter = 31, + RecommendedFilters = 32, + Pose = 33, + PoseSensor = 34, + WheelOdometer = 35, } } diff --git a/wrappers/csharp/Intel.RealSense/Types/Enums/Option.cs b/wrappers/csharp/Intel.RealSense/Types/Enums/Option.cs index e986e59d6b..9eda4f21b8 100644 --- a/wrappers/csharp/Intel.RealSense/Types/Enums/Option.cs +++ b/wrappers/csharp/Intel.RealSense/Types/Enums/Option.cs @@ -152,19 +152,19 @@ public enum Option /// When supported, this option make the camera to switch the emitter state every frame. 0 for disabled, 1 for enabled EmitterOnOff = 46, - ///Zero order point x - zeroOrderPointX = 47, + /// Zero order point x + ZeroOrderPointX = 47, - ///Zero order point y - zeroOrderPointY = 48, + /// Zero order point y + ZeroOrderPointY = 48, - ///LLD temperature + /// LLD temperature LLDTemperature = 49, - ///MC temperature + /// MC temperature MCTemperature = 50, - ///MA temperature + /// MA temperature MATemperature = 51 } } diff --git a/wrappers/csharp/Intel.RealSense/Types/IOption.cs b/wrappers/csharp/Intel.RealSense/Types/IOption.cs deleted file mode 100644 index ad4d7fc6b3..0000000000 --- a/wrappers/csharp/Intel.RealSense/Types/IOption.cs +++ /dev/null @@ -1,33 +0,0 @@ -// License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2017 Intel Corporation. All Rights Reserved. - -namespace Intel.RealSense -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - - public interface IOption - { - Option Key { get; } - - bool Supported { get; } - - float Value { get; set; } - - float Min { get; } - - float Max { get; } - - float Step { get; } - - float Default { get; } - - bool ReadOnly { get; } - - string Description { get; } - - string ValueDescription { get; } - } -} diff --git a/wrappers/csharp/Intel.RealSense/Types/InfoCollection.cs b/wrappers/csharp/Intel.RealSense/Types/InfoCollection.cs new file mode 100644 index 0000000000..47f04238ac --- /dev/null +++ b/wrappers/csharp/Intel.RealSense/Types/InfoCollection.cs @@ -0,0 +1,118 @@ +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2017 Intel Corporation. All Rights Reserved. + +using System.Collections.Generic; +using System.Diagnostics; +using Intel.RealSense; + +[assembly: DebuggerDisplay("{Value,nq}", Name = "{Key}", Target = typeof(KeyValuePair))] + +namespace Intel.RealSense +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Diagnostics; + using System.Linq; + using System.Runtime.InteropServices; + using System.Security; + + [DebuggerTypeProxy(typeof(InfoCollectionDebugView))] + [DebuggerDisplay("Count = {Count}")] + public class InfoCollection : IEnumerable> + { + internal sealed class InfoCollectionDebugView + { + private readonly InfoCollection ic; + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public KeyValuePair[] Items => ic.ToArray(); + + public InfoCollectionDebugView(InfoCollection optionList) + { + if (optionList == null) + { + throw new ArgumentNullException(nameof(optionList)); + } + + ic = optionList; + } + } + + public int Count => Enumerable.Count(this); + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly SupportsDelegate supports; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly GetInfoDelegate get; + + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private readonly IntPtr handle; + + [SuppressUnmanagedCodeSecurity] + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate IntPtr GetInfoDelegate(IntPtr obj, CameraInfo info, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + + [SuppressUnmanagedCodeSecurity] + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate int SupportsDelegate(IntPtr obj, CameraInfo info, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); + + internal InfoCollection(SupportsDelegate supports, GetInfoDelegate get, IntPtr handle) + { + this.supports = supports; + this.get = get; + this.handle = handle; + } + + /// + /// retrieve camera specific information, like versions of various internal components + /// + /// camera info type to retrieve + /// the requested camera info string, in a format specific to the device model + public string GetInfo(CameraInfo info) + { + object error; + return Marshal.PtrToStringAnsi(get(handle, info, out error)); + } + + /// + /// check if specific camera info is supported + /// + /// the parameter to check for support + /// true if the parameter both exist and well-defined for the specific device + public bool Supports(CameraInfo info) + { + object error; + return supports(handle, info, out error) > 0; + } + + /// + /// retrieve camera specific information, like versions of various internal components + /// + /// camera info type to retrieve + /// the requested camera info string, in a format specific to the device model + public string this[CameraInfo info] => Supports(info) ? GetInfo(info) : null; + + private static readonly CameraInfo[] CameraInfoValues = Enum.GetValues(typeof(CameraInfo)) as CameraInfo[]; + + /// + public IEnumerator> GetEnumerator() + { + foreach (var info in CameraInfoValues) + { + if (Supports(info)) + { + yield return new KeyValuePair(info, GetInfo(info)); + } + } + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/wrappers/csharp/cs-tutorial-1-depth/Program.cs b/wrappers/csharp/cs-tutorial-1-depth/Program.cs index 820b4e32a7..0a9bd87706 100644 --- a/wrappers/csharp/cs-tutorial-1-depth/Program.cs +++ b/wrappers/csharp/cs-tutorial-1-depth/Program.cs @@ -36,9 +36,10 @@ static void Main(string[] args) char[] buffer = new char[(640 / 10 + 1) * (480 / 20)]; int[] coverage = new int[64]; - depthSensor.Start(f => + depthSensor.Start(f => { - f.CopyTo(depth); + using (var vf = f.As()) + vf.CopyTo(depth); int b = 0; for (int y = 0; y < 480; ++y) diff --git a/wrappers/csharp/cs-tutorial-2-capture/Window.xaml.cs b/wrappers/csharp/cs-tutorial-2-capture/Window.xaml.cs index 6672d1d341..d2b2f31d6f 100644 --- a/wrappers/csharp/cs-tutorial-2-capture/Window.xaml.cs +++ b/wrappers/csharp/cs-tutorial-2-capture/Window.xaml.cs @@ -31,11 +31,8 @@ static Action UpdateImage(Image img) var wbmp = img.Source as WriteableBitmap; return new Action(frame => { - using (frame) - { - var rect = new Int32Rect(0, 0, frame.Width, frame.Height); - wbmp.WritePixels(rect, frame.Data, frame.Stride * frame.Height, frame.Stride); - } + var rect = new Int32Rect(0, 0, frame.Width, frame.Height); + wbmp.WritePixels(rect, frame.Data, frame.Stride * frame.Height, frame.Stride); }); } @@ -74,8 +71,8 @@ public CaptureWindow() var colorFrame = frames.ColorFrame.DisposeWith(frames); var depthFrame = frames.DepthFrame.DisposeWith(frames); - // We colorize the depth frame for visualization purposes, . - var colorizedDepth = colorizer.Process(depthFrame).As().DisposeWith(frames); + // We colorize the depth frame for visualization purposes + var colorizedDepth = colorizer.Process(depthFrame).DisposeWith(frames); // Render the frames. Dispatcher.Invoke(DispatcherPriority.Render, updateDepth, colorizedDepth); diff --git a/wrappers/csharp/cs-tutorial-3-processing/Window.xaml.cs b/wrappers/csharp/cs-tutorial-3-processing/Window.xaml.cs index eeb80f6170..592becaea0 100644 --- a/wrappers/csharp/cs-tutorial-3-processing/Window.xaml.cs +++ b/wrappers/csharp/cs-tutorial-3-processing/Window.xaml.cs @@ -38,11 +38,8 @@ static Action UpdateImage(Image img) var wbmp = img.Source as WriteableBitmap; return new Action(frame => { - using (frame) - { - var rect = new Int32Rect(0, 0, frame.Width, frame.Height); - wbmp.WritePixels(rect, frame.Data, frame.Stride * frame.Height, frame.Stride); - } + var rect = new Int32Rect(0, 0, frame.Width, frame.Height); + wbmp.WritePixels(rect, frame.Data, frame.Stride * frame.Height, frame.Stride); }); } @@ -56,18 +53,10 @@ public ProcessingWindow() cfg.EnableStream(Stream.Depth, 640, 480); cfg.EnableStream(Stream.Color, Format.Rgb8); var pp = pipeline.Start(cfg); - var s = pp.Device.Sensors; - var blocks = new List(); - - foreach (var sensor in pp.Device.Sensors) - { - var list = sensor.ProcessingBlocks; - foreach (var block in list) - { - blocks.Add(block); - } - } + // Get the recommended processing blocks for the depth sensor + var sensor = pp.Device.Sensors.First(s => s.Is(Extension.DepthSensor)); + var blocks = sensor.ProcessingBlocks.ToList(); // Allocate bitmaps for rendring. // Since the sample aligns the depth frames to the color frames, both of the images will have the color resolution @@ -87,7 +76,7 @@ public ProcessingWindow() // Processing blocks are inherently thread-safe and play well with // other API primitives such as frame-queues, // and can be used to encapsulate advanced operations. - // All invokations are, however, synchronious so the high-level threading model + // All invocations are, however, synchronious so the high-level threading model // is up to the developer block = new CustomProcessingBlock((f, src) => { @@ -96,31 +85,31 @@ public ProcessingWindow() // at the end of scope. using (var releaser = new FramesReleaser()) { - var frames = FrameSet.FromFrame(f).DisposeWith(releaser); - foreach (ProcessingBlock p in blocks) - frames = p.Process(frames).DisposeWith(releaser); + f = p.Process(f).DisposeWith(releaser); - frames = frames.ApplyFilter(align).DisposeWith(releaser); - frames = frames.ApplyFilter(colorizer).DisposeWith(releaser); + f = f.ApplyFilter(align).DisposeWith(releaser); + f = f.ApplyFilter(colorizer).DisposeWith(releaser); + var frames = f.As().DisposeWith(releaser); + var colorFrame = frames[Stream.Color, Format.Rgb8].DisposeWith(releaser); var colorizedDepth = frames[Stream.Depth, Format.Rgb8].DisposeWith(releaser); // Combine the frames into a single result var res = src.AllocateCompositeFrame(colorizedDepth, colorFrame).DisposeWith(releaser); // Send it to the next processing stage - src.FramesReady(res); + src.FrameReady(res); } }); // Register to results of processing via a callback: block.Start(f => { - using (var frames = FrameSet.FromFrame(f)) + using (var frames = f.As()) { var colorFrame = frames.ColorFrame.DisposeWith(frames); - var colorizedDepth = frames[Stream.Depth, Format.Rgb8].As().DisposeWith(frames); + var colorizedDepth = frames.First(Stream.Depth, Format.Rgb8).DisposeWith(frames); Dispatcher.Invoke(DispatcherPriority.Render, updateDepth, colorizedDepth); Dispatcher.Invoke(DispatcherPriority.Render, updateColor, colorFrame); @@ -136,7 +125,7 @@ public ProcessingWindow() using (var frames = pipeline.WaitForFrames()) { // Invoke custom processing block - block.ProcessFrames(frames); + block.Process(frames); } } }, token); diff --git a/wrappers/csharp/cs-tutorial-4-software-dev/Window.xaml.cs b/wrappers/csharp/cs-tutorial-4-software-dev/Window.xaml.cs index 6510e9d190..543fce8a1f 100644 --- a/wrappers/csharp/cs-tutorial-4-software-dev/Window.xaml.cs +++ b/wrappers/csharp/cs-tutorial-4-software-dev/Window.xaml.cs @@ -32,11 +32,8 @@ static Action UpdateImage(Image img) var wbmp = img.Source as WriteableBitmap; return new Action(frame => { - using (frame) - { - var rect = new Int32Rect(0, 0, frame.Width, frame.Height); - wbmp.WritePixels(rect, frame.Data, frame.Stride * frame.Height, frame.Stride); - } + var rect = new Int32Rect(0, 0, frame.Width, frame.Height); + wbmp.WritePixels(rect, frame.Data, frame.Stride * frame.Height, frame.Stride); }); } @@ -136,7 +133,7 @@ public CaptureWindow() var depthFrame = new_frames.DepthFrame.DisposeWith(new_frames); var colorFrame = new_frames.ColorFrame.DisposeWith(new_frames); - VideoFrame colorizedDepth = colorizer.Process(depthFrame).As().DisposeWith(new_frames); + var colorizedDepth = colorizer.Process(depthFrame).DisposeWith(new_frames); // Render the frames. Dispatcher.Invoke(DispatcherPriority.Render, updateDepth, colorizedDepth); diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Editor/RsDeviceInspectorEditor.cs b/wrappers/unity/Assets/RealSenseSDK2.0/Editor/RsDeviceInspectorEditor.cs index 8305fc7b88..45187567a9 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Editor/RsDeviceInspectorEditor.cs +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Editor/RsDeviceInspectorEditor.cs @@ -75,7 +75,7 @@ public override void OnInspectorGUI() DrawHorizontal("Device S/N", devSerial); EditorGUILayout.Space(); - if (dev.Info[CameraInfo.AdvancedMode] != null) + if (dev.Info.Supports(CameraInfo.AdvancedMode)) { var adv = dev.As(); if (adv.AdvancedModeEnabled) diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Misc/SampleSceneUI.unity b/wrappers/unity/Assets/RealSenseSDK2.0/Misc/SampleSceneUI.unity index e131853c45..d11b8336ea 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Misc/SampleSceneUI.unity +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Misc/SampleSceneUI.unity @@ -161,7 +161,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -312,6 +312,7 @@ GameObject: - component: {fileID: 564758688} - component: {fileID: 564758690} - component: {fileID: 564758689} + - component: {fileID: 564758691} m_Layer: 5 m_Name: Errors m_TagString: Untagged @@ -334,9 +335,9 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: 0, y: 60} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} + m_Pivot: {x: 0.5, y: 0} --- !u!114 &564758689 MonoBehaviour: m_ObjectHideFlags: 0 @@ -372,6 +373,19 @@ MonoBehaviour: m_ChildForceExpandHeight: 0 m_ChildControlWidth: 1 m_ChildControlHeight: 0 +--- !u!114 &564758691 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 564758687} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 1 --- !u!1 &1195535093 GameObject: m_ObjectHideFlags: 0 diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Misc/Utils/RsDeviceListener.cs b/wrappers/unity/Assets/RealSenseSDK2.0/Misc/Utils/RsDeviceListener.cs index a7864c7e79..c32542e49e 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Misc/Utils/RsDeviceListener.cs +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Misc/Utils/RsDeviceListener.cs @@ -22,23 +22,16 @@ void Awake() Instance = this; } - // void Start() IEnumerator Start() { ctx = new Context(); - // pipeline = new Pipeline(ctx); - pipeline = new Pipeline(); + pipeline = new Pipeline(ctx); + ctx.OnDevicesChanged += OnDevicesChanged; yield return null; e.Set(); - - ctx.QueryDevices(); - yield return new WaitForSeconds(1f); - ctx.QueryDevices(); - - e.Set(); } void Update() @@ -106,6 +99,11 @@ private void OnDevicesChanged(DeviceList removed, DeviceList added) void OnDestroy() { + foreach (var d in m_added) + d.Dispose(); + m_added.Clear(); + m_removed.Clear(); + if (pipeline != null) { pipeline.Dispose(); @@ -114,6 +112,7 @@ void OnDestroy() if (ctx != null) { + ctx.OnDevicesChanged -= OnDevicesChanged; ctx.Dispose(); ctx = null; } diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/ProcessingPipe/PointCloudProcessingBlocks.asset b/wrappers/unity/Assets/RealSenseSDK2.0/ProcessingPipe/PointCloudProcessingBlocks.asset index 64b5b01a81..c28970e927 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/ProcessingPipe/PointCloudProcessingBlocks.asset +++ b/wrappers/unity/Assets/RealSenseSDK2.0/ProcessingPipe/PointCloudProcessingBlocks.asset @@ -13,6 +13,7 @@ MonoBehaviour: m_EditorClassIdentifier: _processingBlocks: - {fileID: 114476060953143426} + - {fileID: 114613456056826128} - {fileID: 114544001719900210} - {fileID: 114401103692956310} - {fileID: 114093195037715096} @@ -109,6 +110,20 @@ MonoBehaviour: m_EditorClassIdentifier: enabled: 1 Mode: 1 +--- !u!114 &114613456056826128 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7dffddaeb99d79644b99b1d8d18bad86, type: 3} + m_Name: RsThresholdFilter + m_EditorClassIdentifier: + enabled: 0 + MinDistance: 0 + MaxDistance: 4 --- !u!114 &114894276943703578 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/Samples/PointCloudProcessingBlocks.unity b/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/Samples/PointCloudProcessingBlocks.unity index 2d2ded86b5..3ddd5ecba5 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/Samples/PointCloudProcessingBlocks.unity +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/Samples/PointCloudProcessingBlocks.unity @@ -584,9 +584,68 @@ Prefab: propertyPath: DeviceConfiguration.Profiles.Array.data[1].Height value: 480 objectReference: {fileID: 0} + - target: {fileID: 114866818567473902, guid: d2790e271f1a64347bb2ede5601b1e23, + type: 2} + propertyPath: processMode + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114866818567473902, guid: d2790e271f1a64347bb2ede5601b1e23, + type: 2} + propertyPath: DeviceConfiguration.Profiles.Array.data[0].Framerate + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 114866818567473902, guid: d2790e271f1a64347bb2ede5601b1e23, + type: 2} + propertyPath: DeviceConfiguration.mode + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114866818567473902, guid: d2790e271f1a64347bb2ede5601b1e23, + type: 2} + propertyPath: DeviceConfiguration.Profiles.Array.data[0].Width + value: 640 + objectReference: {fileID: 0} + - target: {fileID: 114866818567473902, guid: d2790e271f1a64347bb2ede5601b1e23, + type: 2} + propertyPath: DeviceConfiguration.Profiles.Array.data[0].Height + value: 480 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: d2790e271f1a64347bb2ede5601b1e23, type: 2} m_IsPrefabParent: 0 +--- !u!1 &192592016 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 192592017} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &192592017 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 192592016} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1123990037} + m_Father: {fileID: 326283690} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &194549602 GameObject: m_ObjectHideFlags: 0 @@ -669,6 +728,114 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_ShowMaskGraphic: 0 +--- !u!1 &222447825 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 222447826} + - component: {fileID: 222447828} + - component: {fileID: 222447827} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &222447826 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 222447825} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 801409137} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -12} + m_SizeDelta: {x: 0, y: 12} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &222447827 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 222447825} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.69411767, g: 0.7294118, b: 0.7490196, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 12 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Minimum Distance +--- !u!222 &222447828 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 222447825} +--- !u!1 &237119362 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 237119363} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &237119363 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 237119362} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1953058697} + m_Father: {fileID: 1626679069} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &238020932 GameObject: m_ObjectHideFlags: 0 @@ -978,6 +1145,74 @@ MonoBehaviour: m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_IsOn: 0 +--- !u!1 &276471210 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 276471211} + - component: {fileID: 276471213} + - component: {fileID: 276471212} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &276471211 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 276471210} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1105138668} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0.25, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &276471212 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 276471210} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.18946669, g: 0.7544285, b: 0.9333334, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &276471213 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 276471210} --- !u!114 &283937341 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 114866818567473902, guid: d2790e271f1a64347bb2ede5601b1e23, @@ -1149,7 +1384,7 @@ RectTransform: - {fileID: 468983679} - {fileID: 400371667} m_Father: {fileID: 1382451895} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1178,6 +1413,103 @@ MonoBehaviour: m_ChildForceExpandHeight: 0 m_ChildControlWidth: 0 m_ChildControlHeight: 1 +--- !u!1 &326283689 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 326283690} + - component: {fileID: 326283691} + m_Layer: 5 + m_Name: Slider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &326283690 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 326283689} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1293041316} + - {fileID: 2055935485} + - {fileID: 192592017} + m_Father: {fileID: 801409137} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -30} + m_SizeDelta: {x: 10, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &326283691 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 326283689} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -113659843, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.18946669, g: 0.7544285, b: 0.9333334, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1123990038} + m_FillRect: {fileID: 482368980} + m_HandleRect: {fileID: 1123990037} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 16 + m_WholeNumbers: 0 + m_Value: 0.1 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114613456056826128, guid: 6f1f4d0a8f3f052419ca9059315d7fe0, + type: 2} + m_MethodName: SetMinDistance + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null --- !u!1 &336264789 GameObject: m_ObjectHideFlags: 0 @@ -1595,7 +1927,7 @@ RectTransform: - {fileID: 250891961} - {fileID: 1704065513} m_Father: {fileID: 1382451895} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2200,6 +2532,109 @@ MonoBehaviour: m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_IsOn: 0 +--- !u!1 &482368979 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 482368980} + - component: {fileID: 482368982} + - component: {fileID: 482368981} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &482368980 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 482368979} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2055935485} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0.00625, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &482368981 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 482368979} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.18946669, g: 0.7544285, b: 0.9333334, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &482368982 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 482368979} +--- !u!1 &501182033 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 501182034} + m_Layer: 5 + m_Name: MaxDist + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &501182034 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 501182033} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 614883686} + - {fileID: 1626679069} + m_Father: {fileID: 1946110990} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 99, y: -95} + m_SizeDelta: {x: 198, y: 50} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &542911489 GameObject: m_ObjectHideFlags: 0 @@ -2410,45 +2845,119 @@ MonoBehaviour: m_GameObject: {fileID: 591346080} m_Enabled: 0 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.18946669, g: 0.7544285, b: 0.9333334, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &591346083 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 591346080} +--- !u!114 &591346084 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 591346080} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0.07058824, g: 0.4862745, b: 0.75686276, a: 1} + m_EffectDistance: {x: 0, y: -1} + m_UseGraphicAlpha: 1 +--- !u!1 &614883685 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 614883686} + - component: {fileID: 614883688} + - component: {fileID: 614883687} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &614883686 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 614883685} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 501182034} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -12} + m_SizeDelta: {x: 0, y: 12} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &614883687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 614883685} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.18946669, g: 0.7544285, b: 0.9333334, a: 1} + m_Color: {r: 0.69411767, g: 0.7294118, b: 0.7490196, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &591346083 + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 12 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Maximum Distance +--- !u!222 &614883688 CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 591346080} ---- !u!114 &591346084 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 591346080} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_EffectColor: {r: 0.07058824, g: 0.4862745, b: 0.75686276, a: 1} - m_EffectDistance: {x: 0, y: -1} - m_UseGraphicAlpha: 1 + m_GameObject: {fileID: 614883685} --- !u!1 &617886965 GameObject: m_ObjectHideFlags: 0 @@ -3348,7 +3857,7 @@ RectTransform: - {fileID: 356647754} - {fileID: 1779824891} m_Father: {fileID: 1382451895} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -3664,6 +4173,106 @@ RectTransform: m_AnchoredPosition: {x: -5.0000305, y: 0} m_SizeDelta: {x: -20, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &801409136 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 801409137} + m_Layer: 5 + m_Name: MinDist + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &801409137 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 801409136} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 222447826} + - {fileID: 326283690} + m_Father: {fileID: 1946110990} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 99, y: -45} + m_SizeDelta: {x: 198, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &803689925 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 803689926} + - component: {fileID: 803689928} + - component: {fileID: 803689927} + m_Layer: 5 + m_Name: Threshold + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &803689926 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 803689925} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1753725876} + - {fileID: 1946110990} + m_Father: {fileID: 1382451895} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 220, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!222 &803689927 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 803689925} +--- !u!114 &803689928 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 803689925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 1 --- !u!1 &829626622 GameObject: m_ObjectHideFlags: 0 @@ -4862,6 +5471,40 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -20, y: -20} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1105138667 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1105138668} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1105138668 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1105138667} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 276471211} + m_Father: {fileID: 1626679069} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: -5.0000305, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1121707013 GameObject: m_ObjectHideFlags: 0 @@ -5004,6 +5647,74 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1122411032} +--- !u!1 &1123990036 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1123990037} + - component: {fileID: 1123990039} + - component: {fileID: 1123990038} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1123990037 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1123990036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 192592017} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.00625, y: 0} + m_AnchorMax: {x: 0.00625, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1123990038 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1123990036} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1123990039 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1123990036} --- !u!1 &1163591405 GameObject: m_ObjectHideFlags: 0 @@ -5517,75 +6228,143 @@ CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1243116569} ---- !u!1 &1263468406 + m_GameObject: {fileID: 1243116569} +--- !u!1 &1263468406 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1263468407} + - component: {fileID: 1263468409} + - component: {fileID: 1263468408} + m_Layer: 5 + m_Name: Arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1263468407 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1263468406} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1947886534} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -15, y: 0} + m_SizeDelta: {x: 18, y: 18} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1263468408 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1263468406} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.003584008, g: 0.6487098, b: 0.853, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 03e1bc5ce8b14394fba02264a82105fe, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1263468409 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1263468406} +--- !u!1 &1293041315 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} serializedVersion: 5 m_Component: - - component: {fileID: 1263468407} - - component: {fileID: 1263468409} - - component: {fileID: 1263468408} + - component: {fileID: 1293041316} + - component: {fileID: 1293041318} + - component: {fileID: 1293041317} m_Layer: 5 - m_Name: Arrow + m_Name: Background m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1263468407 +--- !u!224 &1293041316 RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1263468406} + m_GameObject: {fileID: 1293041315} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 1947886534} - m_RootOrder: 2 + m_Father: {fileID: 326283690} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 0.5} - m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: -15, y: 0} - m_SizeDelta: {x: 18, y: 18} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -10, y: -6} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1263468408 +--- !u!114 &1293041317 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1263468406} + m_GameObject: {fileID: 1293041315} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.003584008, g: 0.6487098, b: 0.853, a: 1} + m_Color: {r: 0.69411767, g: 0.7294118, b: 0.7490196, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 03e1bc5ce8b14394fba02264a82105fe, type: 3} - m_Type: 0 + m_Sprite: {fileID: 0} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!222 &1263468409 +--- !u!222 &1293041318 CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1263468406} + m_GameObject: {fileID: 1293041315} --- !u!1 &1327947015 GameObject: m_ObjectHideFlags: 0 @@ -5859,6 +6638,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1195358375} + - {fileID: 803689926} - {fileID: 399358487} - {fileID: 764214006} - {fileID: 306514086} @@ -6366,7 +7146,7 @@ MonoBehaviour: m_Elasticity: 0.1 m_Inertia: 1 m_DecelerationRate: 0.135 - m_ScrollSensitivity: 1 + m_ScrollSensitivity: 10 m_Viewport: {fileID: 1929505078} m_HorizontalScrollbar: {fileID: 0} m_VerticalScrollbar: {fileID: 792903468} @@ -6454,40 +7234,280 @@ GameObject: m_PrefabInternal: {fileID: 0} serializedVersion: 5 m_Component: - - component: {fileID: 1622842339} - - component: {fileID: 1622842341} - - component: {fileID: 1622842340} + - component: {fileID: 1622842339} + - component: {fileID: 1622842341} + - component: {fileID: 1622842340} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1622842339 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1622842338} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1163591406} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.25, y: 0} + m_AnchorMax: {x: 0.25, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1622842340 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1622842338} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1622842341 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1622842338} +--- !u!1 &1622991365 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1622991366} + - component: {fileID: 1622991368} + - component: {fileID: 1622991367} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1622991366 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1622991365} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 780031670} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -12} + m_SizeDelta: {x: 0, y: 12} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1622991367 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1622991365} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.69411767, g: 0.7294118, b: 0.7490196, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 12 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Smooth Delta +--- !u!222 &1622991368 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1622991365} +--- !u!1 &1626679068 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1626679069} + - component: {fileID: 1626679070} + m_Layer: 5 + m_Name: Slider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1626679069 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1626679068} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2146701656} + - {fileID: 1105138668} + - {fileID: 237119363} + m_Father: {fileID: 501182034} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -30} + m_SizeDelta: {x: 10, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1626679070 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1626679068} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -113659843, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.18946669, g: 0.7544285, b: 0.9333334, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1953058698} + m_FillRect: {fileID: 276471211} + m_HandleRect: {fileID: 1953058697} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 16 + m_WholeNumbers: 0 + m_Value: 4 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114613456056826128, guid: 6f1f4d0a8f3f052419ca9059315d7fe0, + type: 2} + m_MethodName: SetMaxDistance + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!1 &1628507320 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1628507321} + - component: {fileID: 1628507323} + - component: {fileID: 1628507322} m_Layer: 5 - m_Name: Handle + m_Name: Background m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1622842339 +--- !u!224 &1628507321 RectTransform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1622842338} + m_GameObject: {fileID: 1628507320} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1163591406} + m_Children: + - {fileID: 1788710548} + m_Father: {fileID: 1753725876} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.25, y: 0} - m_AnchorMax: {x: 0.25, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 194, y: -10} + m_SizeDelta: {x: 36, y: 18} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1622842340 +--- !u!114 &1628507322 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1622842338} + m_GameObject: {fileID: 1628507320} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} @@ -6501,7 +7521,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Sprite: {fileID: 21300002, guid: e6d27f5726b0f084fa72f50379d1f588, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -6509,86 +7529,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!222 &1622842341 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1622842338} ---- !u!1 &1622991365 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1622991366} - - component: {fileID: 1622991368} - - component: {fileID: 1622991367} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1622991366 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1622991365} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 780031670} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -12} - m_SizeDelta: {x: 0, y: 12} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1622991367 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1622991365} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.69411767, g: 0.7294118, b: 0.7490196, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 12 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 1 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 1 - m_VerticalOverflow: 1 - m_LineSpacing: 1 - m_Text: Smooth Delta ---- !u!222 &1622991368 +--- !u!222 &1628507323 CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1622991365} + m_GameObject: {fileID: 1628507320} --- !u!1 &1628558566 GameObject: m_ObjectHideFlags: 0 @@ -7392,6 +8338,110 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1748578272} +--- !u!1 &1753725875 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1753725876} + - component: {fileID: 1753725877} + m_Layer: 5 + m_Name: Toggle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1753725876 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753725875} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1628507321} + - {fileID: 1963349027} + m_Father: {fileID: 803689926} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1753725877 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753725875} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 2109663825, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1628507322} + toggleTransition: 1 + graphic: {fileID: 1788710549} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114613456056826128, guid: 6f1f4d0a8f3f052419ca9059315d7fe0, + type: 2} + m_MethodName: set_Enabled + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 1946110989} + m_MethodName: SetActive + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_IsOn: 0 --- !u!1 &1771568473 GameObject: m_ObjectHideFlags: 0 @@ -7595,7 +8645,75 @@ CanvasRenderer: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1784300953} + m_GameObject: {fileID: 1784300953} +--- !u!1 &1788710547 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1788710548} + - component: {fileID: 1788710550} + - component: {fileID: 1788710549} + m_Layer: 5 + m_Name: Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1788710548 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1788710547} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1628507321} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 36, y: 18} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1788710549 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1788710547} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: e6d27f5726b0f084fa72f50379d1f588, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1788710550 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1788710547} --- !u!1 &1816744330 GameObject: m_ObjectHideFlags: 0 @@ -7958,6 +9076,64 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -20, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1946110989 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1946110990} + - component: {fileID: 1946110991} + m_Layer: 5 + m_Name: Sliders + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1946110990 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1946110989} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 801409137} + - {fileID: 501182034} + m_Father: {fileID: 803689926} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 10, y: -60} + m_SizeDelta: {x: 20, y: 120} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1946110991 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1946110989} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 20 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 --- !u!1 &1947886533 GameObject: m_ObjectHideFlags: 0 @@ -8113,6 +9289,148 @@ MonoBehaviour: m_EffectColor: {r: 0.69411767, g: 0.7294118, b: 0.7490196, a: 1} m_EffectDistance: {x: 1, y: -1} m_UseGraphicAlpha: 1 +--- !u!1 &1953058696 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1953058697} + - component: {fileID: 1953058699} + - component: {fileID: 1953058698} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1953058697 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1953058696} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 237119363} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.25, y: 0} + m_AnchorMax: {x: 0.25, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1953058698 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1953058696} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1953058699 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1953058696} +--- !u!1 &1963349026 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1963349027} + - component: {fileID: 1963349029} + - component: {fileID: 1963349028} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1963349027 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1963349026} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1753725876} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 76.8, y: -9.999993} + m_SizeDelta: {x: 153.6, y: 20.7} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1963349028 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1963349026} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.3254902, g: 0.3372549, b: 0.3529412, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Threshold +--- !u!222 &1963349029 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1963349026} --- !u!1 &1968801748 GameObject: m_ObjectHideFlags: 0 @@ -8290,6 +9608,40 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2009228148} +--- !u!1 &2055935484 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2055935485} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2055935485 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2055935484} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 482368980} + m_Father: {fileID: 326283690} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: -5.0000305, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2065575180 GameObject: m_ObjectHideFlags: 0 @@ -8699,3 +10051,71 @@ MonoBehaviour: OrbitCursor: {fileID: 2800000, guid: 060e148624d6bb145942cb272dcb589b, type: 3} PanCursor: {fileID: 2800000, guid: ad8b7b54f38a87441a12f9d70126b777, type: 3} ZoomCursor: {fileID: 2800000, guid: 32a0faa869d56b94f839dcba748fdce3, type: 3} +--- !u!1 &2146701655 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2146701656} + - component: {fileID: 2146701658} + - component: {fileID: 2146701657} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2146701656 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2146701655} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1626679069} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -10, y: -6} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2146701657 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2146701655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.69411767, g: 0.7294118, b: 0.7490196, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &2146701658 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2146701655} diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/Samples/SLAM.unity b/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/Samples/SLAM.unity index 399f377a7c..205f138e9f 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/Samples/SLAM.unity +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/Samples/SLAM.unity @@ -246,7 +246,7 @@ MonoBehaviour: Width: 0 Height: 0 RequestedSerialNumber: - PlaybackFile: d:/odo1.bag + PlaybackFile: RecordPath: --- !u!1 &341674281 GameObject: diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/StartHere.unity b/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/StartHere.unity index e638c8c281..906b312482 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/StartHere.unity +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scenes/StartHere.unity @@ -1596,7 +1596,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0.000015258789} + m_AnchoredPosition: {x: 0, y: -0.000015258789} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 1} --- !u!114 &522935575 @@ -5151,7 +5151,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 986175406} m_HandleRect: {fileID: 986175405} m_Direction: 2 - m_Value: 0 + m_Value: 1 m_Size: 0.99999994 m_NumberOfSteps: 0 m_OnValueChanged: diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsDevice.cs b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsDevice.cs index b50cc7ee7c..6e5fb29a3c 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsDevice.cs +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsDevice.cs @@ -70,8 +70,7 @@ void OnEnable() using (var cfg = DeviceConfiguration.ToPipelineConfig()) ActiveProfile = m_pipeline.Start(cfg); - using (var activeStreams = ActiveProfile.Streams) - DeviceConfiguration.Profiles = activeStreams.Select(RsVideoStreamRequest.FromProfile).ToArray(); + DeviceConfiguration.Profiles = ActiveProfile.Streams.Select(RsVideoStreamRequest.FromProfile).ToArray(); if (processMode == ProcessMode.Multithread) { @@ -106,6 +105,12 @@ void OnDisable() if (Streaming && OnStop != null) OnStop(); + if (ActiveProfile != null) + { + ActiveProfile.Dispose(); + ActiveProfile = null; + } + if (m_pipeline != null) { // if (Streaming) @@ -115,12 +120,6 @@ void OnDisable() } Streaming = false; - - if (ActiveProfile != null) - { - ActiveProfile.Dispose(); - ActiveProfile = null; - } } void OnDestroy() @@ -128,11 +127,17 @@ void OnDestroy() // OnStart = null; OnStop = null; + if (ActiveProfile != null) + { + ActiveProfile.Dispose(); + ActiveProfile = null; + } + if (m_pipeline != null) + { m_pipeline.Dispose(); - m_pipeline = null; - - // Instance = null; + m_pipeline = null; + } } private void RaiseSampleEvent(Frame frame) diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsDeviceInspector.cs b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsDeviceInspector.cs index 9dd4745709..e2f8e21af0 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsDeviceInspector.cs +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsDeviceInspector.cs @@ -11,7 +11,6 @@ public class RsDeviceInspector : MonoBehaviour public bool streaming; public Device device; - public StreamProfileList streams; public readonly Dictionary sensors = new Dictionary(); public readonly Dictionary> sensorOptions = new Dictionary>(); @@ -44,12 +43,6 @@ private void onStopStreaming() device = null; } - if (streams != null) - { - streams.Dispose(); - streams = null; - } - foreach (var s in sensors) { var sensor = s.Value; @@ -63,15 +56,11 @@ private void onStopStreaming() private void onStartStreaming(PipelineProfile profile) { device = profile.Device; - streams = profile.Streams; - using (var sensorList = device.Sensors) + foreach (var s in device.Sensors) { - foreach (var s in sensorList) - { - var sensorName = s.Info[CameraInfo.Name]; - sensors.Add(sensorName, s); - sensorOptions.Add(sensorName, s.Options.ToList()); - } + var sensorName = s.Info[CameraInfo.Name]; + sensors.Add(sensorName, s); + sensorOptions.Add(sensorName, s.Options.ToList()); } streaming = true; } diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsPointCloudRenderer.cs b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsPointCloudRenderer.cs index 72d9768fbe..3763ced87c 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsPointCloudRenderer.cs +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsPointCloudRenderer.cs @@ -113,7 +113,7 @@ private void OnNewSample(Frame frame) { if (frame.IsComposite) { - using (var fs = FrameSet.FromFrame(frame)) + using (var fs = frame.As()) using (var points = fs.FirstOrDefault(Stream.Depth, Format.Xyz32f)) { if (points != null) diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsPoseStreamTransformer.cs b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsPoseStreamTransformer.cs index ddccd4565e..a927006016 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsPoseStreamTransformer.cs +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsPoseStreamTransformer.cs @@ -55,7 +55,7 @@ private void OnNewSample(Frame f) { if (f.IsComposite) { - using (var fs = FrameSet.FromFrame(f)) + using (var fs = f.As()) using (var poseFrame = fs.FirstOrDefault(Stream.Pose, Format.SixDOF)) if (poseFrame != null) q.Enqueue(poseFrame); diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsStreamTextureRenderer.cs b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsStreamTextureRenderer.cs index febd92420c..68205efaa7 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsStreamTextureRenderer.cs +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsStreamTextureRenderer.cs @@ -126,7 +126,7 @@ void OnNewSample(Frame frame) { if (frame.IsComposite) { - using (var fs = FrameSet.FromFrame(frame)) + using (var fs = frame.As()) using (var f = fs.FirstOrDefault(matcher)) { if (f != null) diff --git a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsVideoStreamRequest.cs b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsVideoStreamRequest.cs index 91118ed45d..4219cff297 100644 --- a/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsVideoStreamRequest.cs +++ b/wrappers/unity/Assets/RealSenseSDK2.0/Scripts/RsVideoStreamRequest.cs @@ -39,7 +39,7 @@ public static RsVideoStreamRequest FromProfile(StreamProfile p) { var isVideo = p.Is(Extension.VideoProfile); using (p) - using (var v = p.As()) + using (var v = isVideo ? p.As() : null) return new RsVideoStreamRequest( p.Stream, p.Format, diff --git a/wrappers/unity/Assets/StreamingAssets/StreamingAssets b/wrappers/unity/Assets/StreamingAssets/StreamingAssets index 3f67a2b121..211b5c161e 100644 Binary files a/wrappers/unity/Assets/StreamingAssets/StreamingAssets and b/wrappers/unity/Assets/StreamingAssets/StreamingAssets differ diff --git a/wrappers/unity/Assets/StreamingAssets/StreamingAssets.manifest b/wrappers/unity/Assets/StreamingAssets/StreamingAssets.manifest index aaaa367295..f92eebcc2b 100644 --- a/wrappers/unity/Assets/StreamingAssets/StreamingAssets.manifest +++ b/wrappers/unity/Assets/StreamingAssets/StreamingAssets.manifest @@ -1,5 +1,5 @@ ManifestFileVersion: 0 -CRC: 3826169903 +CRC: 2877810330 AssetBundleManifest: AssetBundleInfos: Info_0: diff --git a/wrappers/unity/Assets/StreamingAssets/sample_assets b/wrappers/unity/Assets/StreamingAssets/sample_assets index c00af1dece..83d56059f1 100644 Binary files a/wrappers/unity/Assets/StreamingAssets/sample_assets and b/wrappers/unity/Assets/StreamingAssets/sample_assets differ diff --git a/wrappers/unity/Assets/StreamingAssets/sample_assets.manifest b/wrappers/unity/Assets/StreamingAssets/sample_assets.manifest index ced438fafd..f9def0040d 100644 --- a/wrappers/unity/Assets/StreamingAssets/sample_assets.manifest +++ b/wrappers/unity/Assets/StreamingAssets/sample_assets.manifest @@ -1,12 +1,12 @@ ManifestFileVersion: 0 -CRC: 2364766343 +CRC: 2778896699 Hashes: AssetFileHash: serializedVersion: 2 - Hash: 3730d325bf98a6fb40e0db1d4675a299 + Hash: 740a499bf82751d5b474a321772343b6 TypeTreeHash: serializedVersion: 2 - Hash: 19e7ac1c6152188ade5a6c5cc5f09672 + Hash: 5ed1980f8c6aeb070f1246e488ad86c4 HashAppended: 0 ClassTypes: - Class: 1 @@ -77,6 +77,8 @@ ClassTypes: Script: {fileID: 11500000, guid: 48f1a4dc738fa514aa5e5d4cc3665aae, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 2a81fc1e64edf3540a7f9ba78a879104, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 7dffddaeb99d79644b99b1d8d18bad86, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 46ef920fe825d5c4996039f57cad2ffa, type: 3} - Class: 115 diff --git a/wrappers/unity/Assets/StreamingAssets/sample_scenes b/wrappers/unity/Assets/StreamingAssets/sample_scenes index 4c7f4e5c98..d14292a116 100644 Binary files a/wrappers/unity/Assets/StreamingAssets/sample_scenes and b/wrappers/unity/Assets/StreamingAssets/sample_scenes differ diff --git a/wrappers/unity/Assets/StreamingAssets/sample_scenes.manifest b/wrappers/unity/Assets/StreamingAssets/sample_scenes.manifest index 27064bb705..8b0cb1e765 100644 --- a/wrappers/unity/Assets/StreamingAssets/sample_scenes.manifest +++ b/wrappers/unity/Assets/StreamingAssets/sample_scenes.manifest @@ -1,9 +1,9 @@ ManifestFileVersion: 0 -CRC: 2154260734 +CRC: 1094038802 Hashes: AssetFileHash: serializedVersion: 2 - Hash: f846e0e113f66865066c3bfc9ead6947 + Hash: 957cd2b0628106c71537793848a8c38b TypeTreeHash: serializedVersion: 2 Hash: 31d6cfe0d16ae931b73c59d7e0c089c0