diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..eb89864a --- /dev/null +++ b/.gitignore @@ -0,0 +1,92 @@ +# Created by https://www.gitignore.io/api/unity +# Edit at https://www.gitignore.io/?templates=unity + +### Unity ### +# This .gitignore file should be placed at the root of your Unity project directory +# +# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore +*/[Ll]ibrary/ +*/[Tt]emp/ +*/[Oo]bj/ +*/[Bb]uild/ +*/[Bb]uilds/ +*/[Ll]ogs/ +*/[Mm]emoryCaptures/ + +# Never ignore Asset meta data +!*/[Aa]ssets/**/*.meta + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# TextMesh Pro files +*/[Aa]ssets/TextMesh*Pro/ +*/[Aa]ssets/TextMesh*Pro.meta + +# Autogenerated Jetbrains Rider plugin +*/[Aa]ssets/Plugins/Editor/JetBrains* + +# Visual Studio cache directory +.vs/ + +# Visual Studio Code user settings +.vscode/ + +# Gradle cache directory +.gradle/ + +# Autogenerated VS/MD/Consulo solution and project files +*/ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.mdb +*.opendb +*.VC.db + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + +# Unity3D generated file on crash reports +sysinfo.txt + +# Builds +*.apk +*.unitypackage +*.symbols.zip + +# Crashlytics generated file +crashlytics-build.properties + +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# End of https://www.gitignore.io/api/unity diff --git a/Assets/Plugins.meta b/Assets/Plugins.meta new file mode 100644 index 00000000..7b83b753 --- /dev/null +++ b/Assets/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e5a0853f2888cb42a988db112bb7a48 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AsyncIO.0.1.69.meta b/Assets/Plugins/AsyncIO.0.1.69.meta new file mode 100644 index 00000000..a332939e --- /dev/null +++ b/Assets/Plugins/AsyncIO.0.1.69.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8392e7f9d4152a422b4a58b4a7ffd515 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AsyncIO.0.1.69/.signature.p7s b/Assets/Plugins/AsyncIO.0.1.69/.signature.p7s new file mode 100755 index 00000000..e195ad1c Binary files /dev/null and b/Assets/Plugins/AsyncIO.0.1.69/.signature.p7s differ diff --git a/Assets/Plugins/AsyncIO.0.1.69/lib.meta b/Assets/Plugins/AsyncIO.0.1.69/lib.meta new file mode 100644 index 00000000..08e6490f --- /dev/null +++ b/Assets/Plugins/AsyncIO.0.1.69/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c85428fc5f338a711988bbd9debefed6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AsyncIO.0.1.69/lib/net40.meta b/Assets/Plugins/AsyncIO.0.1.69/lib/net40.meta new file mode 100644 index 00000000..efb76fe3 --- /dev/null +++ b/Assets/Plugins/AsyncIO.0.1.69/lib/net40.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0f2098483d3355d0d845d51b1c32a227 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AsyncIO.0.1.69/lib/net40/AsyncIO.dll b/Assets/Plugins/AsyncIO.0.1.69/lib/net40/AsyncIO.dll new file mode 100755 index 00000000..7889466d Binary files /dev/null and b/Assets/Plugins/AsyncIO.0.1.69/lib/net40/AsyncIO.dll differ diff --git a/Assets/Plugins/AsyncIO.0.1.69/lib/net40/AsyncIO.dll.meta b/Assets/Plugins/AsyncIO.0.1.69/lib/net40/AsyncIO.dll.meta new file mode 100644 index 00000000..08801d74 --- /dev/null +++ b/Assets/Plugins/AsyncIO.0.1.69/lib/net40/AsyncIO.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 6f1387eb146471a12b683b14ea194a26 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/NetMQ.4.0.0.207.meta b/Assets/Plugins/NetMQ.4.0.0.207.meta new file mode 100644 index 00000000..f6ecad90 --- /dev/null +++ b/Assets/Plugins/NetMQ.4.0.0.207.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 15237b32625f1a23b93c00cfe181dbdd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/NetMQ.4.0.0.207/.signature.p7s b/Assets/Plugins/NetMQ.4.0.0.207/.signature.p7s new file mode 100755 index 00000000..065dc551 Binary files /dev/null and b/Assets/Plugins/NetMQ.4.0.0.207/.signature.p7s differ diff --git a/Assets/Plugins/NetMQ.4.0.0.207/lib.meta b/Assets/Plugins/NetMQ.4.0.0.207/lib.meta new file mode 100644 index 00000000..3326cbe3 --- /dev/null +++ b/Assets/Plugins/NetMQ.4.0.0.207/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 61eaa26e3ce17162fae204c208d91075 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/NetMQ.4.0.0.207/lib/net40.meta b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40.meta new file mode 100644 index 00000000..71903266 --- /dev/null +++ b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e6f3e18dbf0177fe88d6162afc1bcea6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.dll b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.dll new file mode 100755 index 00000000..c6a425e0 Binary files /dev/null and b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.dll differ diff --git a/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.dll.meta b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.dll.meta new file mode 100644 index 00000000..7ce50295 --- /dev/null +++ b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 3b6102344e627841190072db3fcba42b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.xml b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.xml new file mode 100755 index 00000000..2c3204a8 --- /dev/null +++ b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.xml @@ -0,0 +1,9220 @@ + + + + NetMQ + + + + + The IBufferPool interface specifies two methods: Take, and Return. + These provide for taking byte-array data from a common pool, and returning it. + + + + + Take byte-array storage from the buffer-pool. + + the number of bytes to take + a byte-array that comes from the buffer-pool + + + + Return the given byte-array buffer to the common buffer-pool. + + the byte-array to return to the buffer-pool + + + + This implementation of uses WCF's + class to manage a pool of buffers. + + + + + Create a new BufferManagerBufferPool with the specified maximum buffer pool size + and a maximum size for each individual buffer in the pool. + + the maximum size to allow for the buffer pool + the maximum size to allow for each individual buffer in the pool + There was insufficient memory to create the requested buffer pool. + Either maxBufferPoolSize or maxBufferSize was less than zero. + + + + Return a byte-array buffer of at least the specified size from the pool. + + the size in bytes of the requested buffer + a byte-array that is the requested size + size cannot be less than zero + + + + Return the given buffer to this manager pool. + + a reference to the buffer being returned + the Length of buffer does not match the pool's buffer length property + the buffer reference cannot be null + + + + Release the buffers currently cached in this manager. + + + + + Release the buffers currently cached in this manager. + + true if managed resources are to be disposed + + + + This simple implementation of does no buffer pooling. Instead, it uses regular + .NET memory management to allocate a buffer each time is called. Unused buffers + passed to are simply left for the .NET garbage collector to deal with. + + + + + Return a newly-allocated byte-array buffer of at least the specified size from the pool. + + the size in bytes of the requested buffer + a byte-array that is the requested size + there is not sufficient memory to allocate the requested memory + + + + The expectation of an actual buffer-manager is that this method returns the given buffer to the manager pool. + This particular implementation does nothing. + + a reference to the buffer being returned + + + + The expectation of an actual buffer-manager is that the Dispose method will release the buffers currently cached in this manager. + This particular implementation does nothing. + + + + + Release the buffers currently cached in this manager (however in this case, this does nothing). + + true if managed resources are to be disposed + + + + Contains a singleton instance of used for allocating byte arrays + for instances with type . + + + Sending and receiving message frames requires the use of buffers (byte arrays), which are expensive to create and destroy. + You can use the BufferPool class to pool buffers for reuse, reducing allocation, deallocation and garbage collection. + + The default implementation is . + + Call to replace it with a . + Call to reinstate the default . + Call to substitute a custom implementation for the allocation and + deallocation of message buffers. + + + + + + Set BufferPool to use the (which it does by default). + + + + + Set BufferPool to use the to manage the buffer-pool. + + the maximum size to allow for the buffer pool + the maximum size to allow for each individual buffer in the pool + There was insufficient memory to create the requested buffer pool. + Either maxBufferPoolSize or maxBufferSize was less than zero. + + + + Set BufferPool to use the specified IBufferPool implementation to manage the buffer-pool. + + the implementation of to use + + + + Allocate a buffer of at least bytes from the current . + + The minimum size required, in bytes. + A byte array having at least bytes. + + + + Returns to the . + + The byte array to be returned to the pool. + + + + Class Address contains a specification of a protocol and an MqEndPoint. + + + + + The string-literal "inproc" + - this denotes in-process, or inter-thread, communication. + + + + + The string-literal "tcp" + - this denotes TCP communication over the network. + + + + + The string-literal "ipc" + - this denotes inter-process communication, which on NetMQ is exactly the same as TCP. + + + + + The string-literal "pgm" + - this denotes the Pragmatic General Multicast (PGM) reliable multicast protocol. + + + + + The string-literal "epgm" + - this denotes the Encapsulated PGM protocol. + + + + + Interface IZAddress specifies that Resolve and property Address must be implemented. + + + + + Create a new Address instance with the given protocol and text expression of an address. + + the protocol of this Address - as in tcp, ipc, pgm + a text representation of the address + + + + Create a new Address instance based upon the given endpoint, assuming a protocol of tcp. + + the subclass of EndPoint to base this Address upon + + + + Defines a command sent between threads. + + + + + Create a new Command object for the given destination, type, and optional argument. + + a ZObject that denotes the destination for this command + the CommandType of the new command + an Object to comprise the argument for the command (optional) + + + The destination to which the command should be applied. + + + The type of this command. + + + + Get the argument to this command. + + + + + Override of ToString, which returns a string in the form [ command-type, destination ]. + + a string that denotes the command-type and destination + + + + Enumeration of possible types. + + + The value of denotes what action + the command will perform. + + + + + Sent to I/O thread to let it know that it should + terminate itself. + + + + + Sent to I/O object to make it register with its I/O thread + + + + + Sent to socket to let it know about the newly created object. + + + + + Attach the engine to the session. If engine is NULL, it informs + session that the connection has failed. + + + + + Sent from session to socket to establish pipe(s) between them. + Caller must have used inc_seqnum before sending the command. + + + + + Sent by pipe writer to inform dormant pipe reader that there + are messages in the pipe. + + + + + Sent by pipe reader to inform pipe writer how many + messages it has read so far. + + + + + Sent by pipe reader to writer after creating a new inpipe. + The parameter is actually of type pipe_t::upipe_t, however, + its definition is private so we'll have to do with void*. + + + + + Sent by pipe reader to pipe writer to ask it to terminate + its end of the pipe. + + + + + Pipe writer acknowledges pipe_term command. + + + + + Sent by I/O object to the socket to request the shutdown of + the I/O object. + + + + + Sent by socket to I/O object to start its shutdown. + + + + + Sent by I/O object to the socket to acknowledge it has + shut down. + + + + + Transfers the ownership of the closed socket + to the reaper thread. + + + + + Closed socket notifies the reaper that it's already deallocated. + + + + + Sent by reaper thread to the term thread when all the sockets + have successfully been deallocated. + + + + + Send to reaper to stop the reaper immediatly + + + + + This class exists to hold constant values that comprise the internal configuration of the messaging system. + + + + + Number of new messages in message pipe needed to trigger new memory + allocation. Setting this parameter to 256 decreases the impact of + memory allocation by approximately 99.6% + + + + + Commands in pipe per allocation event. + + + + + Determines how often does socket poll for new commands when it + still has unprocessed messages to handle. Thus, if it is set to 100, + socket will process 100 inbound messages before doing the poll. + If there are no unprocessed messages available, poll is done + immediately. Decreasing the value trades overall latency for more + real-time behaviour (less latency peaks). + + + + + Maximal batching size for engines with receiving functionality. + So, if there are 10 messages that fit into the batch size, all of + them may be read by a single 'recv' system call, thus avoiding + unnecessary network stack traversals. + + + + + Maximal batching size for engines with sending functionality. + So, if there are 10 messages that fit into the batch size, all of + them may be written by a single 'send' system call, thus avoiding + unnecessary network stack traversals. + + + + + Maximal delta between high and low watermark. + + + + + Maximum number of events the I/O thread can process in one go. + + + + + Maximal delay to process command in API thread (in CPU ticks). + 3,000,000 ticks equals to 1 - 2 milliseconds on current CPUs. + Note that delay is only applied when there is continuous stream of + messages to process. If not so, commands are processed immediately. + + + + + Low-precision clock precision in CPU ticks. 1ms. Value of 1000000 + should be OK for CPU frequencies above 1GHz. If should work + reasonably well for CPU frequencies above 500MHz. For lower CPU + frequencies you may consider lowering this value to get best + possible latencies. + + + + + Maximum transport data unit size for PGM (TPDU). + + + + + On some OSes the signaler has to be emulated using a TCP + connection. In such cases following port is used. + + + + + Objects of class Ctx are intended to encapsulate all of the global state + associated with the NetMQ library. This contains the sockets, and manages interaction + between them. + + + + + Information associated with inproc endpoint. Note that endpoint options + are registered as well so that the peer can access them without a need + for synchronisation, handshaking or similar. + + + + + Create a new Endpoint with the given socket. + + the socket for this new Endpoint + the Options to assign to this new Endpoint + + + + Get the socket associated with this Endpoint. + + + + + Get the Options of this Endpoint. + + + + + Sockets belonging to this context. We need the list so that + we can notify the sockets when zmq_term() is called. The sockets + will return ETERM then. + + + + + List of unused thread slots. + + + + + If true, zmq_init has been called but no socket has been created + yet. Launching of I/O threads is delayed. + + + + + If true, zmq_term was already called. + + + + + This object is for synchronisation of accesses to global slot-related data: + sockets, empty_slots, terminating. It also synchronises + access to zombie sockets as such (as opposed to slots) and provides + a memory barrier to ensure that all CPU cores see the same data. + + + + + The reaper thread. + + + + + List of I/O threads. + + + + + Length of the mailbox-array. + + + + + Array of pointers to mailboxes for both application and I/O threads. + + + + + Mailbox for zmq_term thread. + + + + + Dictionary containing the inproc endpoints within this context. + + + + + This object provides synchronisation of access to the list of inproc endpoints. + + + + + The highest socket-id that has been assigned thus far. + + + + + The maximum number of sockets that can be opened at the same time. + + + + + The number of I/O threads to launch. + + + + + This object is used to synchronize access to context options. + + + + + The thread-id for the termination (the equivalent of the zmq_term) thread. + + + + + This is the thread-id to assign to the Reaper (value is 1). + + + + + This function is called when user invokes zmq_term. If there are + no more sockets open it'll cause all the infrastructure to be shut + down. If there are open sockets still, the deallocation happens + after the last one is closed. + + + + + Create and return a new socket of the given type, and initialize this Ctx if this is the first one. + + the type of socket to create + the newly-created socket + Cannot create new socket while terminating. + Maximum number of sockets reached. + The context (Ctx) must not be already terminating. + + + + Destroy the given socket - which means to remove it from the list of active sockets, + and add it to the list of unused sockets to be terminated. + + the socket to destroy + + If this was the last socket, then stop the reaper. + + + + + Returns reaper thread object. + + + + + Send a command to the given destination thread. + + + + + Returns the that is the least busy at the moment. + + Which threads are eligible (0 = all). + The least busy thread, or null if none is available. + + + + Save the given address and Endpoint within our internal list. + This is used for management of inproc endpoints. + + the textual name to give this endpoint + the Endpoint to remember + true if the given address was NOT already registered + + + + Un-register the given address/socket, by removing it from the contained list of endpoints. + + the (string) address denoting the endpoint to unregister + the socket associated with that endpoint + true if the endpoint having this address and socket is found, false otherwise + + + + Remove from the list of endpoints, all endpoints that reference the given socket. + + the socket to remove all references to + + + + Return the EndPoint that has the given address, and increments the seqnum of the associated socket. + + the (string) address to match against the endpoints + the Endpoint that was found + The given address was not found in the list of endpoints. + + By calling this method, the socket associated with that returned EndPoint has it's Seqnum incremented, + in order to prevent it from being de-allocated before a command can be sent to it. + + + + + Class ErrorHelper provides one static method - ToErrorCode, for converting a SocketError to the equivalent ErrorCode. + + + + + Return the ErrorCode that is the closest equivalent to the given SocketError. + + the SocketError to convert from + an ErrorCode that corresponds to the given SocketError + + + + Interface IMsgSink mandates a PushMsg( Msg ) method. + + + + + Deliver a message. Return true if successful; false otherwise. + This function takes ownership of the passed message. + + the message (of type Msg) to deliver + + + + Classes that implement IMsgSource are able to fetch a message, with the method: PullMsg. + + + + + Fetch a message. + If successful - returns true and writes the message instance to the msg argument. + If not successful - return false and write null to the msg argument. + + the Msg to write the fetched message into + true if successful - and writes the message to the msg argument + + + + Simple base class for objects that live in I/O threads. + It makes communication with the poller object easier and + makes defining unneeded event handlers unnecessary. + + + + + Create a new IOObject object and plug it into the given IOThread. + + the IOThread to plug this new IOObject into. + + + + "Plug in" this IOObject to the given IOThread, - ie associate this with the specified IOThread. + + the IOThread for this object to live in + + When migrating an object from one I/O thread to another, first + unplug it, then migrate it, then plug it to the new thread. + + + + + "Un-Plug" this IOObject from its current IOThread, and set its handler to null. + + + When migrating an object from one I/O thread to another, first + unplug it, then migrate it, then plug it to the new thread. + + + + + Add the given socket to the Proactor. + + the AsyncSocket to add + + + + Remove the given socket from the Proactor. + + the AsyncSocket to remove + + + + This method is called when a message receive operation has been completed. This forwards it on to the handler's InCompleted method. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + + + + This method is called when a message Send operation has been completed. This forwards it on to the handler's OutCompleted method. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + + + + This is called when the timer expires. + + an integer used to identify the timer + + + + I/O thread accesses incoming commands via this mailbox. + + + + + I/O multiplexing is performed using a poller object. + + + + + Create a new IOThread object within the given context (Ctx) and thread. + + the Ctx (context) for this thread to live within + the integer thread-id for this new IOThread + + + + Classes that implement IPollEvents provide two methods (InEvent and OutEvent) that are invoked when ready for reading or writing. + + + + + Called by the I/O thread when the file descriptor is ready for reading. + + + + + Called by the I/O thread when the file descriptor is ready for writing. + + + + + This is an ITimerEvent, with InCompleted and OutCompleted callback-methods, + used for implementing a Proactor pattern. + + + + + This is the "Input-Completed" method - called by the I/O-thread when the file descriptor is ready for reading. + + this is set to any socket-error that has occurred + the number of bytes that are now ready to be read + + + + This is the "Output-Completed" method - called by the I/O thread when the file descriptor is ready for writing. + + this is set to any socket-error that has occurred + the number of bytes that are now ready to be written + + + + The ITimerEvent interface mandates a TimerEvent( int id ) method, + that is called with an id-value when the timer expires. + + + + + This is called when the timer expires. + + an integer used to identify the timer + + + + There's only one thread receiving from the mailbox, but there + is arbitrary number of threads sending. Given that ypipe requires + synchronised access on both of its endpoints, we have to synchronize + the sending side. + + + + + The pipe to store actual commands. + + + + + Signaler to pass signals from writer thread to reader thread. + + + + + There's only one thread receiving from the mailbox, but there + is an arbitrary number of threads sending. Given that requires + synchronised access on both of its endpoints, we have to synchronize + the sending side. + + + + + True if the underlying pipe is active, ie. when we are allowed to + read commands from it. + + + + + Create a new Mailbox with the given name. + + the name to give this new Mailbox + + + + Get the socket-handle contained by the Signaler. + + + + + Send the given Command out across the command-pipe. + + the Command to send + + + + Receive and return a Command from the command-pipe. + + how long to wait for a command (in milliseconds) before returning + + + + + Close the contained Signaler. + + + + + Class Options is essentially a container for socket-related option-settings. + + + + + Create a new Options object with all default values. + + + + + Get or set the I/O-thread affinity. + The default value is 0. + + + + + Maximum backlog for pending connections. + The default value is 100. + + + + + Get or set whether connecting pipes are not attached immediately, meaning a send() + on a socket with only connecting pipes would block. + The default value is false. + + + + + If true, session reads all the pending messages from the pipe and + sends them to the network when socket is closed. + The default value is true. + + + + + If true, socket reads all the messages from the pipe and delivers + them to the user when the peer terminates. + The default value is true. + + + + + Get or set the Endian-ness, which indicates whether the most-significant bits are placed higher or lower in memory. + The default value is Endianness.Big. + + + + + If true, (X)SUB socket should filter the messages. If false (which is the default), it should not. + + + + + Get or set the byte-array that represents the Identity. + The initial value is null. + + + + + Get or set the size of the socket-identity byte-array. + The initial value is 0, until the Identity property is set. + + + + + Get or set whether this allows the use of IPv4 sockets only. + If true (the default), it will not be possible to communicate with IPv6-only hosts. + If false, the socket can connect to and accept connections from both IPv4 and IPv6 hosts. + + + + + Get or set the last socket endpoint resolved URI + The initial value is null. + + + + + Get or set the Linger time, in milliseconds. + The default value is -1; The XSub ctor sets this to 0. + + + + + Get or set the maximum size of message to handle. + The default value is -1, which indicates no limit. + + + + + Sets the time-to-live field in every multicast packet sent. + The default value is 1. + + + + + Get or set the maximum transfer rate [Kb/s]. The default is 100 Kb/s. + + + + + If true, router socket accepts non-zmq tcp connections + The default value is false, except the Stream ctor initialises this to true. + Setting this to true changes RecvIdentity to false. + + + + + If true, the identity message is forwarded to the socket. + The default value is false. + + + + + Get or set the minimum interval between attempts to reconnect, in milliseconds. + The default is 100 ms + + + + + Get or set the maximum interval between attempts to reconnect, in milliseconds. + The default is 0 (unused). + + + + + Get or set the recovery time interval [ms]. The default is 10 seconds. + + + + + SO_SNDBUF and SO_RCVBUF to be passed to underlying transport sockets. + The initial value is 0. + + + + + Get or set the size of the receive-buffer. + The initial value is 0. + + + + + Get or set the high-water marks for message pipes. + The default value is 1000. + + + + + Get or set the high-water mark for message reception. + The default value is 1000. + + + + + The low-water mark for message transmission. + + + + + The low-water mark for message reception. + + + + + Get or set the timeout for send operations for this socket. + The default value is -1, which means no timeout. + + + + + Get or set the ID of the socket. + The default value is 0. + + + + + Get or set the type of socket (ZmqSocketType). + The default value is ZmqSocketType.None. + + + + + TCP keep-alive settings. + Defaults to -1 = do not change socket options + + + + + Get or set the TCP Keep-Alive Count. + The default value is -1. + + + + + Get or set the TCP Keep-Alive interval to use when at idle. + The default value is -1. + + + + + Get or set the TCP Keep-Alive Interval + The default value is -1. + + + + + Disable TIME_WAIT tcp state when client disconnect. + The default value is false. + + + + + Controls the maximum datagram size for PGM. + + + + + Assign the given optionValue to the specified option. + + a ZmqSocketOption that specifies what to set + an Object that is the value to set that option to + The option and optionValue must be valid. + + + + Get the value of the specified option. + + a ZmqSocketOption that specifies what to get + an Object that is the value of that option + A valid option must be specified. + + + + Base class for objects forming a part of ownership hierarchy. + It handles initialisation and destruction of such objects. + + + + + The Options of this Own. + + + + + True if termination was already initiated. If so, we can destroy + the object if there are no more child objects or pending term acks. + + + + + Sequence number of the last command sent to this object. + + + + + Sequence number of the last command processed by this object. + + + + + Socket owning this object. It's responsible for shutting down + this object. + + + + + List of all objects owned by this socket. We are responsible + for deallocating them before we quit. + + + + + Number of events we have to get before we can destroy the object. + + + + + Initializes a new instance of the class that is running on a thread outside of 0MQ infrastructure. + + The parent context. + The thread id. + + Note that the owner is unspecified in the constructor. It'll be assigned later on using + when the object is plugged in. + + + + + Initializes a new instance of the class that is running within I/O thread. + + The I/O thread. + The options. + + Note that the owner is unspecified in the constructor. It'll be assigned later on using + when the object is plugged in. + + + + + Eliminate any contained resources that need to have this explicitly done. + + + + + A place to hook in when physical destruction of the object is to be delayed. + Unless overridden, this simply calls Destroy. + + + + + Set the owner of *this* Own object, to be the given owner. + + the Own object to be our new owner + + + + When another owned object wants to send a command to this object it calls this function + to let it know it should not shut down before the command is delivered. + + + This function may be called from a different thread! + + + + + Launch the supplied object and become its owner. + + The object to be launched. + + + + Terminate owned object. + + + + + Process a termination-request for the given Own obj, + removing it from the listed of owned things. + + the Own object to remove and terminate + + + + Add the given Own object to the list of owned things. + + the Own object to add to our list + + If *this* Own is already terminating, then send a request to the given Own obj + to terminate itself. + + + + + Ask owner object to terminate this object. It may take a while actual termination is started. + + + This function should not be called more than once. + + + + + Returns true if the object is in process of termination. + + + + + Send termination requests to all of the owned objects, and then runs the termination process. + + the linger time, in milliseconds + + Termination handler is protected rather than private so that it can be intercepted by the derived class. + This is useful to add custom steps to the beginning of the termination process. + + + + + Add the given number to the termination-acknowledgement count. + + + The methods RegisterTermAcks and are used to wait for arbitrary events before + terminating. Just add the number of events to wait for, and when the event occurs - call . + When the number of pending termination-acknowledgements reaches zero, this object will be deallocated. + + + + + Decrement the termination-acknowledgement count, and if it reaches zero + then send a termination-ack to the owner. + + + The methods and UnregisterTermAck are used to wait for arbitrary events before + terminating. Just add the number of events to wait for, and when the event occurs - call UnregisterTermAck. + When the number of pending termination-acknowledgements reaches zero, this object will be deallocated. + + + + + Process the first termination-acknowledgement. + Unless this is overridden, it simply calls . + + + + + If terminating, and we've already worked through the Seq-nums that were sent, + then send a termination-ack to the owner (if there is one) and destroy itself. + + + + + A Dealer socket is a SocketBase that is used as the parent-class of the Req socket. + It provides for a pre-fetched Msg, and skips identity-messages. + + + + + A DealerSession is a SessionBase subclass that is contained within the Dealer class. + + + + + Create a new DealerSession (which is just a SessionBase). + + the I/O-thread to associate this with + + + + + + + + Messages are fair-queued from inbound pipes. And load-balanced to + the outbound pipes. + + + + + Have we prefetched a message. + + + + + The Msg that we have pre-fetched. + + + + + Create a new Dealer socket that holds the prefetched message. + + + + + Destroy this Dealer-socket and close out any pre-fetched Msg. + + + + + Register the pipe with this socket. + + the Pipe to attach + not used + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + + + + For a Dealer socket: If there's a pre-fetched message, snatch that. + Otherwise, dump any identity messages and get the first non-identity message, + or return false if there are no messages available. + + a Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + If there's a pre-fetched message, snatch that. + Otherwise, dump any identity messages and get the first non-identity message, + or return false if there are no messages available. + + a Msg to receive the message into + false if there were no messages to receive + + + + If there is a message available and one has not been pre-fetched yet, + preserve that message as our pre-fetched one. + + + + + + Indicate the given pipe as being ready for reading by this socket. + + the Pipe that is now becoming available for reading + + + + Indicate the given pipe as being ready for writing to by this socket. + This gets called by the WriteActivated method + and gets overridden by the different sockets + to provide their own concrete implementation. + + the Pipe that is now becoming available for writing + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Register the pipe with this socket. + + the Pipe to attach + not used + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Indicate the given pipe as being ready for reading by this socket + - however in the case of Pair, this does nothing. + + the Pipe that is now becoming available for reading + + + + Indicate the given pipe as being ready for writing to by this socket, + however in the case of this Pair socket - this does nothing. + This method gets called by the WriteActivated method. + + the Pipe that is now becoming available for writing + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + A Router is a subclass of SocketBase + + + + + An instance of class Outpipe contains a Pipe and a boolean property Active. + + + + + Fair queueing object for inbound pipes. + + + + + Holds the prefetched message. + + + + + Outbound pipes indexed by the peer IDs. + + + + + The pipe we are currently writing to. + + + + + State of the recv operation + + + + + State of the sending operation + + + + + Peer ID are generated. It's a simple increment and wrap-over + algorithm. This value is the next ID to use (if not used already). + + + + + Create a new Router instance with the given parent-Ctx, thread-id, and socket-id. + + the Ctx that will contain this Router + the integer thread-id value + the integer socket-id value + + + + Register the pipe with this socket. + + the Pipe to attach + not used + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Indicate the given pipe as being ready for reading by this socket. + + the Pipe that is now becoming available for reading + + + + Indicate the given pipe as being ready for writing to by this socket. + This gets called by the WriteActivated method. + + the Pipe that is now becoming available for writing + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + The receiving host must be identifiable. + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + This override of the abstract XRecv method, simply throws a NotSupportedException because XRecv is not supported on a Pub socket. + + the Msg to receive the message into + Messages cannot be received from PUB socket + + + + Fair queueing object for inbound pipes. + + + + + Register the pipe with this socket. + + the Pipe to attach + not used + + + + Indicate the given pipe as being ready for reading by this socket. + + the Pipe that is now becoming available for reading + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + Load balancer managing the outbound pipes. + + + + + Register the pipe with this socket. + + the Pipe to attach + not used + + + + Indicate the given pipe as being ready for writing to by this socket. + This gets called by the WriteActivated method. + + the Pipe that is now becoming available for writing + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + + + + If true, we are in process of sending the reply. If false we are + in process of receiving a request. + + + + + If true, we are starting to receive a request. The beginning + of the request is the backtrace stack. + + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + XSend must only be called on Rep when in the state of sending a reply. + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + XRecv must not be called on Rep while in the state of sending a reply. + + + + A Req is a Dealer socket that serves as the Request in a Request/Response pattern. + + + + + If true, request was already sent and reply wasn't received yet or + was received partially. + + + + + If true, we are starting to send/receive a message. The first part + of the message must be empty message part (backtrace stack bottom). + + + + + Create a new Req (Request) socket with the given parent Ctx, thread and socket id. + + the Ctx to contain this socket + an integer thread-id for this socket to execute on + the socket-id for this socket + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + Cannot XSend on a Req while awaiting reply. + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + Req.XRecv expecting send, not receive. + + + ReqSession must be in a valid state when PushMsg is called. + + + + A Router is a subclass of SocketBase + + + + + An instance of class Outpipe contains a Pipe and a boolean property Active. + + + + + Fair queueing object for inbound pipes. + + + + + True if there is a message held in the pre-fetch buffer. + + + + + If true, the receiver got the message part with + the peer's identity. + + + + + Holds the prefetched identity. + + + + + Holds the prefetched message. + + + + + If true, more incoming message parts are expected. + + + + + We keep a set of pipes that have not been identified yet. + + + + + Outbound pipes indexed by the peer IDs. + + + + + The pipe we are currently writing to. + + + + + The pipe we are currently reading from. + + + + + If true, more outgoing message parts are expected. + + + + + Peer ID are generated. It's a simple increment and wrap-over + algorithm. This value is the next ID to use (if not used already). + + + + + If true, report EHOSTUNREACH to the caller instead of silently dropping + the message targeting an unknown peer. + + + + + If true, router socket accepts non-zmq tcp connections + + + + + When enabled new router connections with same identity take over old ones + + + + + Create a new Router instance with the given parent-Ctx, thread-id, and socket-id. + + the Ctx that will contain this Router + the integer thread-id value + the integer socket-id value + + + + Register the pipe with this socket. + + the Pipe to attach + not used + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Indicate the given pipe as being ready for reading by this socket. + + the Pipe that is now becoming available for reading + + + + Indicate the given pipe as being ready for writing to by this socket. + This gets called by the WriteActivated method. + + the Pipe that is now becoming available for writing + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + The receiving host must be identifiable. + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + Fair queueing object for inbound pipes. + + + + + True if there is a message held in the pre-fetch buffer. + + + + + If true, the receiver got the message part with + the peer's identity. + + + + + Holds the prefetched identity. + + + + + Holds the prefetched message. + + + + + Outbound pipes indexed by the peer IDs. + + + + + The pipe we are currently writing to. + + + + + If true, more outgoing message parts are expected. + + + + + Peer ID are generated. It's a simple increment and wrap-over + algorithm. This value is the next ID to use (if not used already). + + + + + Register the pipe with this socket. + + the Pipe to attach + not used + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Indicate the given pipe as being ready for reading by this socket. + + the Pipe that is now becoming available for reading + + + + Indicate the given pipe as being ready for writing to by this socket. + This gets called by the WriteActivated method. + + the Pipe that is now becoming available for writing + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + In Stream.XSend + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + Set the specified option on this socket - which must be either a SubScribe or an Unsubscribe. + + which option to set + the value to set the option to + true if successful + optionValue must be a String or a byte-array. + + + + XSend transmits a given message. The Send method calls this to do the actual sending. + This override of that abstract method simply throws NotSupportedException because XSend is not supported on a Sub socket. + + the message to transmit + XSend not supported on Sub socket + + + + Return false to indicate that XHasOut is not applicable on a Sub socket. + + + + + + Make resize operation on array. + + Type of containing data. + Source array. + New size of array. + If grow/shrink operation should be applied to the end of array. + Resized array. + + + + List of outbound pipes. + + + + + Number of all the pipes to send the next message to. + + + + + Number of active pipes. All the active pipes are located at the + beginning of the pipes array. These are the pipes the messages + can be sent to at the moment. + + + + + Number of pipes eligible for sending messages to. This includes all + the active pipes plus all the pipes that we can in theory send + messages to (the HWM is not yet reached), but sending a message + to them would result in partial message being delivered, ie. message + with initial parts missing. + + + + + True if last we are in the middle of a multipart message. + + + + + Create a new, empty Distribution object. + + + + + Adds the pipe to the distributor object. + + + + + + Mark the pipe as matching. Subsequent call to send_to_matching + will send message also to this pipe. + + + + + + Mark all pipes as non-matching. + + + + + This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe from the distributor. + + the pipe that was terminated + + + + Activates pipe that have previously reached high watermark. + + + + + + Send the message to all the outbound pipes. + + + + + + Send the message to the matching outbound pipes. + + + + + + Put the message to all active pipes. + + + + + Write the message to the pipe. Make the pipe inactive if writing + fails. In such a case false is returned. + + + + + This class manages a set of inbound pipes. On receive it performs fair + queueing so that senders gone berserk won't cause denial of + service for decent senders. + + + + + Inbound pipes. + + + + + Number of active pipes. All the active pipes are located at the + beginning of the pipes array. + + + + + Index of the next bound pipe to read a message from. + + + + + If true, part of a multipart message was already received, but + there are following parts still waiting in the current pipe. + + + + + This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe. + + the pipe that was terminated + + + + List of outbound pipes. + + + + + Number of active pipes. All the active pipes are located at the + beginning of the pipes array. + + + + + Points to the last pipe that the most recent message was sent to. + + + + + True if last we are in the middle of a multipart message. + + + + + True if we are dropping current message. + + + + + This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe. + + the pipe that was terminated + + + + Multi-trie. Each node in the trie is a set of pointers to pipes. + + + + + Add key to the trie. Returns true if it's a new subscription + rather than a duplicate. + + + + + Remove all subscriptions for a specific peer from the trie. + If there are no subscriptions left on some topics, invoke the + supplied callback function. + + + + + + + + + Remove specific subscription from the trie. Return true is it was + actually removed rather than de-duplicated. + + + + + + + + + + Signal all the matching pipes. + + + + + Add key to the trie. Returns true if this is a new item in the trie + rather than a duplicate. + + + + + + + + + Remove key from the trie. Returns true if the item is actually + removed from the trie. + + + + + + + + + Check whether particular key is in the trie. + + + + + + + + + List of all subscriptions mapped to corresponding pipes. + + + + + Distributor of messages holding the list of outbound pipes. + + + + + If true, send all subscription messages upstream, not just + unique ones. The default is false. + + + + + + The default value is false. + + + + + True if we are in the middle of sending a multipart message. + + + + + True if we are in the middle of receiving a multipart message. + + + + + List of pending (un)subscriptions, ie. those that were already + applied to the trie, but not yet received by the user. + + + + + Register the pipe with this socket. + + the Pipe to attach + if true - subscribe to all data on the pipe + + + + Indicate the given pipe as being ready for reading by this socket. + + the Pipe that is now becoming available for reading + + + + Indicate the given pipe as being ready for writing to by this socket. + This gets called by the WriteActivated method. + + the Pipe that is now becoming available for writing + + + + Set the specified option on this socket. + + which option to set + the value to set the option to + true if successful + optionValue must be a byte-array. + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + An XSubSession is a subclass of SessionBase that provides nothing more. + + + + + Fair queueing object for inbound pipes. + + + + + Object for distributing the subscriptions upstream. + + + + + The repository of subscriptions. + + + + + If true, 'message' contains a matching message to return on the + next recv call. + + + + + If true, part of a multipart message was already received, but + there are following parts still waiting. + + + + + Register the pipe with this socket. + + the Pipe to attach + not used + + + + Indicate the given pipe as being ready for reading by this socket. + + the Pipe that is now becoming available for reading + + + + Indicate the given pipe as being ready for writing to by this socket. + This gets called by the WriteActivated method. + + the Pipe that is now becoming available for writing + + + + This is an override of the abstract method that gets called to signal that the given pipe is to be removed from this socket. + + the Pipe that is being removed + + + + Transmit the given message. The Send method calls this to do the actual sending. + + the message to transmit + true if the message was sent successfully + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + A pipe is a ZObject with .. + + + Note that pipe can be stored in three different arrays. + The array of inbound pipes (1), the array of outbound pipes (2) and + the generic array of pipes to deallocate (3). + + + + + Indicate that the given pipe is now ready for reading. + Pipe calls this on it's sink in response to ProcessActivateRead. + When called upon an instance of SocketBase, this simply calls XReadActivated. + + the pipe to indicate is ready for reading + + + + This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe. + + the pipe that was terminated + + + + The underlying pipe for reading from. + + + + + The underlying pipe for writing to. + + + + + This indicates whether this pipe can be read from. + + + + + This indicates whether this pipe be written to. + + + + + High watermark for the outbound pipe. + + + + + Low watermark for the inbound pipe. + + + + + Number of messages read so far. + + + + + Number of messages written so far. + + + + + Last received peer's msgs_read. The actual number in the peer + can be higher at the moment. + + + + + The pipe object on the other side of the pipe-pair. + + + + + Sink to send events to. + + + + + Specifies the state of the pipe endpoint. + + + + Active is common state before any termination begins. + + + Delimited means that delimiter was read from pipe before term command was received. + + + Pending means that term command was already received from the peer but there are still pending messages to read. + + + Terminating means that all pending messages were already read and all we are waiting for is ack from the peer. + + + Terminated means that 'terminate' was explicitly called by the user. + + + Double_terminated means that user called 'terminate' and then we've got term command from the peer as well. + + + + If true, we receive all the pending inbound messages before terminating. + If false, we terminate immediately when the peer asks us to. + + + + + Identity of the writer. Used uniquely by the reader side. + + + + + Create a new Pipe object with the given parent, and inbound and outbound YPipes. + + + Constructor is private as pipe can only be created using method. + + + + + Create a pipe pair for bi-directional transfer of messages. + + The parents. + First HWM is for messages passed from first pipe to the second pipe. + Second HWM is for messages passed from second pipe to the first pipe. + First LWM is for messages passed from first pipe to the second pipe. + Second LWM is for messages passed from second pipe to the first pipe. + Delay specifies how the pipe behaves when the peer terminates. If true + pipe receives all the pending messages before terminating, otherwise it + terminates straight away. + A pipe pair for bi-directional transfer of messages. + + + + uses this function to let us know about the peer pipe object. + + The peer to be assigned. + + + + Specifies the object to send events to. + + The receiver of the events. + + + + Get or set the byte-array that comprises the identity of this Pipe. + + + + + Get or set the byte-array that comprises the routing id of this Pipe. + + + + + Checks if there is at least one message to read in the pipe. + + Returns true if there is at least one message to read in the pipe; false otherwise. + + + + Read a message from the underlying inbound pipe, and write it to the provided Msg argument. + + true if a message is read from the pipe, false if pipe is terminated or no messages are available + + + + Check whether messages can be written to the pipe. If writing + the message would cause high watermark the function returns false. + + true if message can be written to the pipe; false otherwise. + + + + Write a message to the underlying pipe. + + The message to write. + false if the message cannot be written because high watermark was reached. + + + + Remove unfinished parts of the outbound message from the pipe. + + + + + Flush the messages downstream. + + + + + This method is called to assign the specified pipe as a replacement for the outbound pipe that was being used. + + the pipe to use for writing + + A "Hiccup" occurs when an outbound pipe experiences something like a transient disconnect or for whatever other reason + is no longer available for writing to. + + + + + Process the pipe-termination ack. + + + + + Ask pipe to terminate. The termination will happen asynchronously + and user will be notified about actual deallocation by 'terminated' + event. + + if set to true, the pending messages will be processed + before actual shutdown. + + + + Compute an appropriate low watermark from the given high-watermark. + + the given high-watermark value to compute it from + predefined low watermark value coming from configuration + the computed low-watermark + + + + Handles the delimiter read from the pipe. + + + + + Temporarily disconnects the inbound message stream and drops + all the messages on the fly. Causes 'hiccuped' event to be generated in the peer. + + + + + Override the ToString method to return a string denoting the type and the parent. + + a string containing this type and also the value of the parent-property + + + + Class Reaper is a ZObject and implements IPollEvents. + The Reaper is dedicated toward handling socket shutdown asynchronously and cleanly. + By passing this task off to the Reaper, the message-queueing subsystem can terminate immediately. + + + + + Reaper thread accesses incoming commands via this mailbox. + + + + + This is a Socket, used as the handle associated with the mailbox's file descriptor. + + + + + I/O multiplexing is performed using a poller object. + + + + + Number of sockets being reaped at the moment. + These are the reason for having a reaper: to take over the task of terminating these sockets. + + + + + If true, we were already asked to terminate. + + + + + Create a new Reaper with the given thread-id. + This will have a new Poller with the name "reaper-" + thread-id, and a Mailbox of that same name. + + the Ctx for this to be in + an integer id to give to the thread this will live on + + + + Release any contained resources - by destroying the poller and closing the mailbox. + + + + + Get the Mailbox that this Reaper uses for communication with the rest of the message-queueing subsystem. + + + + + Start the contained Poller to begin polling. + + + + + Issue the Stop command to this Reaper object. + + + + + Handle input-ready events, by receiving and processing any commands + that are waiting in the mailbox. + + + + + This method normally is for handling output-ready events, which don't apply here. + + You must not call OutEvent on a Reaper. + + + + This would be called when a timer expires - however in this event NotSupportedException would be thrown. + + an integer used to identify the timer + You must not call TimerEvent on a Reaper. + + + + Respond to the Stop command by signaling the polling-loop to terminate, + and if there're no sockets left to reap - stop the poller. + + + + + Add the given socket to the list to be reaped (terminated). + + the socket to add to the list for termination + + + + Respond to having one of the sockets that are marked for reaping, - finished being reaped, + and if there are none left - send the Done command and stop the poller. + + + + + If true, this session (re)connects to the peer. Otherwise, it's + a transient session created by the listener. + + + + + Pipe connecting the session to its socket. + + + + + This set is added to with pipes we are disconnecting, but haven't yet completed + + + + + This flag is true if the remainder of the message being processed + is still in the pipe. + + + + + True if termination have been suspended to push the pending + messages to the network. + + + + + The protocol I/O engine connected to the session. + + + + + The socket the session belongs to. + + + + + I/O thread the session is living in. It will be used to plug in + the engines into the same thread. + + + + + ID of the linger timer (0x20) + + + + + True is linger timer is running. + + + + + If true, identity has been sent to the network. + + + + + If true, identity has been received from the network. + + + + + Protocol and address to use when connecting. + + + + + Create a return a new session. + The specific subclass of SessionBase that is created is dictated by the SocketType specified by the options argument. + + the IOThread for this session to run in + whether to immediately connect + the socket to connect + an Options that provides the SocketType that dictates which type of session to create + an Address object that specifies the protocol and address to connect to + the newly-created instance of whichever subclass of SessionBase is specified by the options + The socket must be of the correct type. + + + + Create a new SessionBase object from the given IOThread, socket, and Address. + + the IOThread for this session to run on + this flag dictates whether to connect + the socket to contain + Options that dictate the settings of this session + an Address that dictates the protocol and IP-address to use when connecting + + + + Terminate and release any contained resources. + This cancels the linger-timer if that exists, and terminates the protocol-engine if that exists. + + + + + Attach the given pipe to this session. + + + This is to be used once only, when creating the session. + + + + + Read a message from the pipe. + + a reference to a Msg to put the message into + true if the Msg is successfully sent + + + + Write the given Msg to the pipe. + + the Msg to push to the pipe + true if the Msg was successfully sent + + + + Set the identity-sent and identity-received flags to false. + + + + + Flush any messages that are in the pipe downstream. + + + + + Remove any half processed messages. Flush unflushed messages. + Call this function when engine disconnect to get rid of leftovers. + + + + + This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe. + + the pipe that was terminated + + + + Indicate that the given pipe is now ready for reading. + Pipe calls this on it's sink in response to ProcessActivateRead. + + the pipe to indicate is ready for reading + + + + Get the contained socket. + + + + + Process the Plug-request by setting this SessionBase as the handler for the io-object + and starting connecting (without waiting). + + + + + Process the Attach-request by hooking up the pipes + and plugging in the given engine. + + the IEngine to plug in + + + + Flush out any leftover messages and call Detached. + + + + + Process a termination request. + + a time (in milliseconds) for this to linger before actually going away. -1 means infinite. + + + + Call this function to move on with the delayed process-termination request. + + + + + This is called when the timer expires. + + an integer used to identify the timer + + + + The parent SessionBase class calls this when the Detach method finishes detaching. + + + + + Begin connecting. + + Whether to wait a bit before actually attempting to connect + + + + Override the ToString method to also show the socket-id. + + the type of this object and [ socket-id ] + + + + This method would be called when a message receive operation has been completed, although here it only throws a NotSupportedException. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + This operation is not supported on the SessionBase class. + + + + This method would be called when a message Send operation has been completed, although here it only throws a NotSupportedException. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + This operation is not supported on the SessionBase class. + + + If true, associated context was already terminated. + + + + If true, object should have been already destroyed. However, + destruction is delayed while we unwind the stack to the point + where it doesn't intersect the object being destroyed. + + + + Socket's mailbox object. + + + List of attached pipes. + + + Reaper's poller. + + + The handle of this socket within the reaper's poller. + + + Timestamp of when commands were processed the last time. + + + Number of messages received since last command processing. + + + True if the last message received had MORE flag set. + + + Monitor socket. + + + Bitmask of events being monitored. + + + The tcp port that was bound to, if any. + + + + Create a new SocketBase within the given Ctx, with the specified thread-id and socket-id. + + the Ctx context that this socket will live within + the id of the thread upon which this socket will execute + the integer id for the new socket + + + + Abstract method for attaching a given pipe to this socket. + The concrete implementations are defined by the individual socket types. + + the Pipe to attach + if true - subscribe to all data on the pipe + + + + Abstract method that gets called to signal that the given pipe is to be removed from this socket. + The concrete implementations of SocketBase override this to provide their own implementation + of how to terminate the pipe. + + the Pipe that is being removed + + + Throw if this socket is already disposed. + This object is already disposed. + + + + Throw if the message-queueing system has started terminating. + + The socket has been stopped. + + + + Create a socket of a specified type. + + a ZmqSocketType specifying the type of socket to create + the parent context + the thread for this new socket to run on + an integer id for this socket + The socket type must be valid. + + + + Destroy this socket - which means to stop monitoring the queue for messages. + This simply calls StopMonitor, and then verifies that the destroyed-flag is set. + + + + + Return the Mailbox associated with this socket. + + + + + Interrupt a blocking call if the socket is stuck in one. + This function can be called from a different thread! + + + + + Check whether the transport protocol, as specified in connect or + bind, is available and compatible with the socket type. + + the specified protocol is not supported + the socket type and protocol do not match + + The supported protocols are "inproc", "ipc", "tcp", "pgm", and "epgm". + If the protocol is either "pgm" or "epgm", then this socket must be of type Pub, Sub, XPub, or XSub. + + + + + Register the given pipe with this socket. + + the Pipe to attach + if true - subscribe to all data on the pipe (optional - default is false) + + + + Set the specified socket option. + + which option to set + the value to set the option to + The socket has been stopped. + + + + Return the integer-value of the specified option. + + which option to get + the value of the specified option, or -1 if error + The socket has been stopped. + + If the ReceiveMore option is specified, then 1 is returned if it is true, 0 if it is false. + If the Events option is specified, then process any outstanding commands, and return -1 if that throws a TerminatingException. + then return an integer that is the bitwise-OR of the PollEvents.PollOut and PollEvents.PollIn flags. + Otherwise, cast the specified option value to an integer and return it. + + + + + Return the value of the specified option as an Object. + + which option to get + the value of the option + The socket has already been stopped. + + If the Handle option is specified, then return the handle of the contained mailbox. + If the Events option is specified, then process any outstanding commands, and return -1 if that throws a TerminatingException. + then return a PollEvents that is the bitwise-OR of the PollEvents.PollOut and PollEvents.PollIn flags. + + + + + Bind this socket to the given address. + + a string denoting the endpoint-address to bind to + the address specified to bind to must not be already in use + The requested protocol is not supported. + the socket bind failed + No IO thread was found, or the protocol's listener encountered an + error during initialisation. + the specified protocol is not supported + the socket type and protocol do not match + The socket has been stopped. + + The supported protocols are "inproc", "ipc", "tcp", "pgm", and "epgm". + If the protocol is either "pgm" or "epgm", then this socket must be of type Pub, Sub, XPub, or XSub. + If the protocol is "inproc", you cannot bind to the same address more than once. + + + + Bind the specified TCP address to an available port, assigned by the operating system. + a string denoting the endpoint to bind to + the port-number that was bound to + uses a protocol other than TCP. + The socket has been stopped. + The specified address is already in use. + No IO thread was found, or the protocol's listener errored during + initialisation. + the socket bind failed + + + + Connect this socket to the given address. + + a string denoting the endpoint to connect to + The specified address is already in use. + No IO thread was found. + the specified protocol is not supported + the socket type and protocol do not match + The socket has been stopped. + + The supported protocols are "inproc", "ipc", "tcp", "pgm", and "epgm". + If the protocol is either "pgm" or "epgm", then this socket must be of type Pub, Sub, XPub, or XSub. + + The given address was not found in the list of endpoints. + + + + Given a string containing an endpoint address like "tcp://127.0.0.1:5555, + break-it-down into the address part ("127.0.0.1:5555") and the protocol part ("tcp"). + + a string denoting the endpoint, to take the parts from + the IP-address portion of the end-point address + the protocol portion of the end-point address (such as "tcp") + + + + Take ownership of the given and register it against the given . + + + + + Disconnect from the given endpoint. + + the endpoint to disconnect from + is null. + Endpoint was not found and cannot be disconnected. + The specified protocol must be valid. + The socket has been stopped. + + + + Transmit the given Msg across the message-queueing system. + + The to send. + The timeout to wait before returning false. Pass to disable timeout. + Whether this message will contain another frame after this one. + The socket has been stopped. + is not initialised. + + + + Receive a frame into the given and return true if successful, false if it timed out. + + the Msg to read the received message into + this controls whether the call blocks, and for how long. + true if successful, false if it timed out + + For , there are three categories of value: + + - return false immediately if no message is available + (or a negative value) - wait indefinitely, always returning true + Any positive value - return false after the corresponding duration if no message has become available + + + the Msg must already have been uninitialised + The socket must not already be stopped. + + + + Close this socket. Mark it as disposed, and send ownership of it to the reaper thread to + attend to the rest of it's shutdown process. + + + + + These functions are used by the polling mechanism to determine + which events are to be reported from this socket. + + + + + These functions are used by the polling mechanism to determine + which events are to be reported from this socket. + + + + + Using this function reaper thread ask the socket to register with + its poller. + + + + + Processes commands sent to this socket (if any). + If is -1, the call blocks until at least one command was processed. + If is true, commands are processed at most once in a predefined time period. + + how much time to allow to wait for a command, before returning (in milliseconds) + if true - throttle the rate of command-execution by doing only one per call + The Ctx context must not already be terminating. + + + + Process a termination command on this socket, by stopping monitoring and marking this as terminated. + + + + + Process a Bind command by attaching the given Pipe. + + the Pipe to attach + + + + Process a termination request. + + a time (in milliseconds) for this to linger before actually going away. -1 means infinite. + + + + Mark this socket as having been destroyed. Delay actual destruction of the socket. + + + + + The default implementation assumes there are no specific socket + options for the particular socket type. If not so, overload this + method. + + a ZmqSocketOption specifying which option to set + an Object that is the value to set the option to + + + + This gets called when outgoing messages are ready to be sent out. + On SocketBase, this does nothing and simply returns false. + + this method on SocketBase only returns false + + + + Transmit the given message. The method calls this to do the actual sending. + This abstract method gets overridden by the different socket types + to provide their concrete implementation of sending messages. + + the message to transmit + true if the message was sent successfully + + + + This gets called when incoming messages are ready to be received. + On SocketBase, this does nothing and simply returns false. + + this method on SocketBase only returns false + + + + Receive a message. The Recv method calls this lower-level method to do the actual receiving. + This abstract method gets overridden by the different socket types + to provide their concrete implementation of receiving messages. + + the Msg to receive the message into + true if the message was received successfully, false if there were no messages to receive + + + + Indicate the given pipe as being ready for reading by this socket. + This abstract method gets overridden by the different sockets + to provide their own concrete implementation. + + the Pipe that is now becoming available for reading + + + + Indicate the given pipe as being ready for writing to by this socket. + This abstract method gets called by the WriteActivated method + and gets overridden by the different sockets + to provide their own concrete implementation. + + the Pipe that is now becoming available for writing + + + + Handle input-ready events by receiving and processing any incoming commands. + + + + + Handle output-ready events. + + This is not supported on instances of the parent class SocketBase. + + + + In subclasses of SocketBase this is overridden, to handle the expiration of a timer. + + an integer used to identify the timer + You must not call TimerEvent on an instance of class SocketBase. + + + + To be called after processing commands or invoking any command + handlers explicitly. If required, it will deallocate the socket. + + + + + Indicate that the given pipe is now ready for reading. + Pipe calls this on it's sink in response to ProcessActivateRead. + When called upon an instance of SocketBase, this simply calls XReadActivated. + + the pipe to indicate is ready for reading + + + + When called upon an instance of SocketBase, this simply calls XWriteActivated. + + the pipe to indicate is ready for writing + + + + This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe. + + the pipe that was terminated + + + + Moves the flags from the message to local variables, + to be later retrieved by getsockopt. + + + + + Register the given events to monitor on the given endpoint. + + a string denoting the endpoint to monitor. If this is null - monitoring is stopped. + the SocketEvent to monitor for + Maximum number of sockets reached. + The protocol of is not supported. + The socket has been stopped. + + + + If there is a monitor-socket, close it and set monitor-events to 0. + + + + + Override the ToString method in order to also show the socket-id. + + A string that denotes this object type followed by [ socket-id ] + + + + Get the Socket (Handle) - which is actually the Handle of the contained mailbox. + + + + + Return a short bit of text that denotes the SocketType of this socket. + + a short type-string such as PAIR, PUB, OR UNKNOWN + + + + The class ByteArraySegment provides for containing a simple byte-array, an Offset property, + and a variety of operations that may be performed upon it. + + + + + Create a new ByteArraySegment containing the given byte-array buffer. + + the byte-array for the new ByteArraySegment to contain + + + + Create a new ByteArraySegment containing the given byte-array buffer with the given offset. + + the byte-array for the new ByteArraySegment to contain + the value for the Offset property + + + + Create a new ByteArraySegment that is a shallow-copy of the given ByteArraySegment (with a reference to the same buffer). + + the source-ByteArraySegment to make a copy of + + + + Create a new ByteArraySegment that is a shallow-copy of the given ByteArraySegment (with a reference to the same buffer) + but with a different offset. + + the source-ByteArraySegment to make a copy of + a value for the Offset property that is distinct from that of the source ByteArraySegment + + + + Get the number of bytes within the buffer that is past the Offset (ie, buffer-length minus offset). + + + + + Add the given value to the offset. + + the delta value to add to the offset. + + + + Get the offset into the buffer. + + + + + Write the given 64-bit value into the buffer, at the position marked by the offset plus the given index i. + + an Endianness to specify in which order to write the bytes + the 64-bit value to write into the byte-array buffer + the index position beyond the offset to start writing the bytes + + + + Write the given 16-bit value into the buffer, at the position marked by the offset plus the given index i. + + an Endianness to specify in which order to write the bytes + the 16-bit value to write into the byte-array buffer + the index position beyond the offset to start writing the bytes + + + + Write the given 32-bit value into the buffer, at the position marked by the offset plus the given index i. + + an Endianness to specify in which order to write the bytes + the 32-bit value to write into the byte-array buffer + the index position beyond the offset to start writing the bytes + + + + Encode the given String into a byte-array using the ASCII encoding + and write that into the buffer. + + the String to write to the buffer + the number of encoded bytes to copy into the buffer + an index-offset, in addition to the Offset property, that marks where in the buffer to start writing bytes to + + + + Encode the given String into a byte-array using the ASCII encoding + and write that into the buffer. + + the String to write to the buffer + an index-offset, in addition to the Offset property, that marks where in the buffer to start writing bytes to + + + + Return a 64-bit numeric value that is read from the buffer, starting at the position marked by the offset plus the given index i, + based upon the given byte-ordering. + + an Endianness to specify which byte-ordering to use to interpret the source bytes + the index position beyond the offset to start reading the bytes + a long that is read from the bytes of the buffer + + + + Return a 64-bit unsigned numeric value (ulong) that is read from the buffer, starting at the position marked by the offset plus the given index i, + based upon the given byte-ordering. + + an Endianness to specify which byte-ordering to use to interpret the source bytes + the index position beyond the offset to start reading the bytes + an unsigned long that is read from the bytes of the buffer + + + + Return a 32-bit integer that is read from the buffer, starting at the position marked by the offset plus the given index i, + based upon the given byte-ordering. + + an Endianness to specify which byte-ordering to use to interpret the source bytes + the index position beyond the offset to start reading the bytes + an integer that is read from the bytes of the buffer + + + + Return a 16-bit unsigned integer (ushort) value that is read from the buffer, starting at the position marked by the offset plus the given index i, + based upon the given byte-ordering. + + an Endianness to specify which byte-ordering to use to interpret the source bytes + the index position beyond the offset to start reading the bytes + a ushort that is read from the bytes of the buffer + + + + Return a String that is read from the byte-array buffer, decoded using the ASCII encoding, + starting at the position marked by the offset plus the given index i. + + the length of the part of the buffer to read + the index position beyond the offset to start reading the bytes + a String decoded from the bytes of the buffer + + + + Write the bytes of this ByteArraySegment to the specified destination-ByteArraySegment. + + the destination-ByteArraySegment + the number of bytes to copy + + + + Write the bytes of this ByteArraySegment to the specified destination-ByteArraySegment. + + an offset within this source buffer to start copying from + the destination-ByteArraySegment + an offset within the destination buffer to start copying to + the number of bytes to copy + + + + Return a shallow-copy of this ByteArraySegment. + + a new ByteArraySegment that is a shallow-copy of this one + + + + Get or set the byte of the buffer at the i-th index position (zero-based). + + the index of the byte to access + + + + Set the offset to zero. + + + + + Return a new ByteArraySegment that has the data of this one, but with the given offset. + + the source-ByteArraySegment + the offset-value to give the new ByteArraySegment + + + + + Return a new ByteArraySegment that contains the given byte-array buffer. + + the source byte-array buffer + a new ByteArraySegment that contains the given buffer + + + + Return the byte-array buffer of this ByteArraySegment. + + the source-ByteArraySegment + the byte-array that is the buffer of this ByteArraySegment + + + + Return true if the given Object is a ByteArraySegment and has the same buffer and offset. + + an Object to compare for equality to this one + true only if the otherObject has the same buffer and offset + + The given Object is considered to be Equal if it also is a ByteArraySegment, + and has the same Offset property value + and it's buffer points to the SAME byte-array as the otherObject does. + + + + + Helper base class for decoders that know the amount of data to read + in advance at any moment. + This class is the state machine that parses the incoming buffer. + Derived classes should implement individual state machine actions. + + + Knowing the amount in advance is a property + of the protocol used. 0MQ framing protocol is based size-prefixed + paradigm, which qualifies it to be parsed by this class. + + On the other hand, XML-based transports (like XMPP or SOAP) don't allow + for knowing the size of data to read in advance and should use different + decoding algorithms. + + + + + Where to store the read data. + + + + + How much data to read before taking next step. + + + + + The buffer for data to decode. + + + + + Returns true if the decoder has been fed all required data + but cannot proceed with the next decoding step. + False is returned if the decoder has encountered an error. + + + + + Returns a buffer to be filled with binary data. + + + + + Processes the data in the buffer previously allocated using + get_buffer function. size argument specifies the number of bytes + actually filled into the buffer. Function returns number of + bytes actually processed. + + + + + Where to get the data to write from. + + + + + If true, first byte of the message is being written. + + + + + How much data to write before the next step should be executed. + + + + + The buffer for encoded data. + + + + + The size of the encoded-data buffer + + + + + This flag indicates whether there has been an encoder error. + + + + + Create a new EncoderBase with a buffer of the given size. + + how big of an internal buffer to allocate (in bytes) + the to set this EncoderBase to + + + + Get the Endianness (Big or Little) that this EncoderBase uses. + + + + + This returns a batch of binary data. The data + are filled to a supplied buffer. If no buffer is supplied (data_ + points to NULL) decoder object will provide buffer of its own. + + + + + Set a flag that indicates that there has been an encoding-error. + + + + + Return true if there has been an encoding error. + + the state of the error-flag + + + + Interface IEncoder mandates SetMsgSource and GetData methods. + + + + + Set message producer. + + + + + Get a ByteArraySegment of binary data. The data + are filled to a supplied buffer. If no buffer is supplied (data is null) + encoder will provide buffer of its own. + + + + + Abstract interface to be implemented by various engines. + + + + + Plug the engine to the session. + + + + + Terminate and deallocate the engine. Note that 'detached' + events are not fired on termination. + + + + + This method is called by the session to signal that more + messages can be written to the pipe. + + + + + This method is called by the session to signal that there + are messages to send available. + + + + + IpcConnecter is a subclass of TcpConnector, which provides absolutely nothing beyond what TcpConnector does. + + + + + An IpcListener is a TcpListener that also has an Address property and a SetAddress method. + + + + + Create a new IpcListener with the given IOThread, socket, and Options. + + + the SocketBase to listen to + an Options value that dictates the settings for this IpcListener + + + + Get the bound address for use with wildcards + + + + + Set address to listen on. + + a string denoting the address to listen to + + + Unable to parse the address's port number, or the IP address could not be parsed. + + + Unable to parse the address's port number, or the IP address could not be parsed. + + + Unable to parse the address's port number, or the IP address could not be parsed. + Error establishing underlying socket. + + + + Process a termination request. + + a time (in milliseconds) for this to linger before actually going away. -1 means infinite. + + + + This method is called when a message receive operation has been completed. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + + + + This method would be called when a message Send operation has been completed, although here it only throws a NotSupportedException. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + This operation is not supported on the PgmListener class. + + + + This would be called when the a expires, although here it only throws a NotSupportedException. + + an integer used to identify the timer (not used here) + This operation is not supported on the PgmListener class. + + + + ID of the timer used to delay the reconnection. Value is 1. + + + + + This would be called when a timer expires, although here it only throws a NotSupportedException. + + an integer used to identify the timer (not used here) + This method must not be called on instances of PgmSender. + + + + This method is called when a message Send operation has been completed. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + A non-recoverable socket error occurred. + + + + Internal function to return a reconnect back-off delay. + Will modify the current_reconnect_ivl used for next call + Returns the currently used interval + + + + + This method would be called when a message receive operation has been completed, although here it only throws a NotSupportedException. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + This method must not be called on instances of PgmSender. + + + + This enum-type is Idle, Receiving, Stuck, or Error. + + + + + This method is be called when a message receive operation has been completed. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + + + + This method would be called when a message Send operation has been completed, except in this case this method does nothing. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + + + + This would be called when a timer expires, although here it does nothing. + + an integer used to identify the timer (not used here) + + + + This enum-type denotes the type of Pragmatic General Multicast (PGM) socket. + Publisher, Receiver, or Listener. + + + + + A PgmSocket utilizes the Pragmatic General Multicast (PGM) multicast protocol, which is also referred to as "reliable multicast". + This is only supported on Windows when Microsoft Message Queueing (MSMQ) is installed. + See RFC 3208. + + + + + Set/Query rate (Kb/Sec) + window size (Kb and/or MSec) -- described by RM_SEND_WINDOW below + + + + + set IP multicast outgoing interface + + + + + add IP multicast incoming interface + + + + + Set the Time-To-Live (TTL) of the MCast packets -- (ULONG) + + + + + Perform initialization of this PgmSocket, including creating the socket handle. + + + + + Override the ToString method to produce a more descriptive, useful description. + + a useful description of this object's state + + + + This enum-type denotes the operational state of this StreamEngine - whether Closed, doing Handshaking, Active, or Stalled. + + + + + This method is be called when a message receive operation has been completed. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + + + + This method is called when a message Send operation has been completed. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + + + the SocketError that resulted from the write - which could be Success (no error at all) + this indicates the number of bytes that were transferred in the write + the number of bytes transferred if successful, -1 otherwise + If the socketError is not Success then it must be a valid recoverable error or the number of bytes transferred must be zero. + + If socketError is SocketError.Success and bytesTransferred is > 0, then this returns bytesTransferred. + If bytes is zero, or the socketError is one of NetworkDown, NetworkReset, HostUn, Connection Aborted, TimedOut, or ConnectionReset, - then -1 is returned. + Otherwise, a NetMQException is thrown. + + + + the SocketError that resulted from the read - which could be Success (no error at all) + this indicates the number of bytes that were transferred in the read + the number of bytes transferred if successful, -1 otherwise + If the socketError is not Success then it must be a valid recoverable error or the number of bytes transferred must be zero. + + If socketError is SocketError.Success and bytesTransferred is > 0, then this returns bytesTransferred. + If bytes is zero, or the socketError is one of NetworkDown, NetworkReset, HostUn, Connection Aborted, TimedOut, or ConnectionReset, - then -1 is returned. + Otherwise, a NetMQException is thrown. + + + + + This would be called when a timer expires, although here it only throws NotSupportedException. + + an integer used to identify the timer (not used here) + TimerEvent is not supported on StreamEngine. + + + + A TcpAddress implements IZAddress, and contains an IPEndPoint (the Address property) + and a Protocol property. + + + + + Override ToString to provide a detailed description of this object's state + in the form: Protocol://[AddressFamily]:Port + + a string in the form Protocol://[AddressFamily]:Port + + + + Given a string that should identify an endpoint-address, resolve it to an actual IP address + and set the Address property to a valid corresponding value. + + the endpoint-address to resolve + whether the address must be only-IPv4 + The name must contain the colon delimiter. + The specified port must be a valid nonzero integer. + Must be able to find the IP-address. + + + + Get the Address implementation - which here is an IPEndPoint, + which contains Address, AddressFamily, and Port properties. + + + + + Get the textual-representation of the communication protocol implied by this TcpAddress, + which here is simply "tcp". + + + + + If 'delay' is true connector first waits for a while, then starts connection process. + + + + + ID of the timer used to delay the reconnection. Value is 1. + + + + + Address to connect to. Owned by session_base_t. + + + + + The underlying AsyncSocket. + + + + + If true file descriptor is registered with the poller and 'handle' + contains valid value. + + + + + If true, connector is waiting a while before trying to connect. + + + + + True if a timer has been started. + + + + + Reference to the session we belong to. + + + + + Current reconnect-interval. This gets updated for back-off strategy. + + + + + String representation of endpoint to connect to + + + + + Socket + + + + + Create a new TcpConnector object. + + the I/O-thread for this TcpConnector to live on. + the session that will contain this + Options that define this new TcpC + the Address for this Tcp to connect to + this boolean flag dictates whether to wait before trying to connect + + + + This does nothing. + + + + + Begin connecting. If a delayed-start was specified - then the reconnect-timer is set, otherwise this starts immediately. + + + + + Process a termination request. + This cancels the reconnect-timer, closes the AsyncSocket, and marks the socket-handle as invalid. + + a time (in milliseconds) for this to linger before actually going away. -1 means infinite. + + + + This method would be called when a message receive operation has been completed, although here it only throws a NotImplementedException. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + InCompleted must not be called on a TcpConnector. + + + + Internal function to start the actual connection establishment. + + + + + This method is called when a message Send operation has been completed. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + A non-recoverable socket error occurred. + If the socketError is not Success then it must be a valid recoverable error. + + + + This is called when the timer expires - to start trying to connect. + + The timer-id. This is not used. + + + + Internal function to add a reconnect timer + + + + + Internal function to return a reconnect back-off delay. + Will modify the current_reconnect_ivl used for next call + Returns the currently used interval + + + + + Close the connecting socket. + + + + + Address to listen on. + + + + + Underlying socket. + + + + + Socket the listener belongs to. + + + + + String representation of endpoint to bind to + + + + + The port that was bound on + + + + + Create a new TcpListener on the given IOThread and socket. + + the IOThread for this to live within + a SocketBase to listen on + socket-related Options + + + + Release any contained resources (here - does nothing). + + + + + Process a termination request. + + a time (in milliseconds) for this to linger before actually going away. -1 means infinite. + + + + Set address to listen on. + + a string denoting the address to set this to + + + + This is called when socket input has been completed. + + This indicates the status of the input operation - whether Success or some error. + the number of bytes that were transferred + A non-recoverable socket-error occurred. + + + + Close the listening socket. + + + + + Get the bound address for use with wildcards + + + + + Get the port-number to listen on. + + + + + This method would be called when a message Send operation has been completed - except in this case it simply throws a NotImplementedException. + + a SocketError value that indicates whether Success or an error occurred + the number of bytes that were transferred + OutCompleted is not implemented on TcpListener. + + + + This would be called when a timer expires, although here it only throws a NotSupportedException. + + an integer used to identify the timer (not used here) + TimerEvent is not supported on TcpListener. + + + + The maximum message-size. If this is -1 then there is no maximum. + + + + + Create a new V1Decoder with the given buffer-size, maximum-message-size and Endian-ness. + + the buffer-size to give the contained buffer + the maximum message size. -1 indicates no limit. + the Endianness to specify for it - either Big or Little + + + + Set the receiver of decoded messages. + + + + + Set the receiver of decoded messages. + + + + + Encoder for 0MQ framing protocol. Converts messages into data stream. + + + + + V2Protocol is a class that contains two integer constants: MoreFlag and LargeFlag. + + + + + This is a constant-integer with the value 1. + + + + + This is a constant-integer with the value 2. + + + + + This class simply provides a counter-value, which may be set, increased, and decremented. + Increase and Decrement are both thread-safe operations. + + + + + Create a new AtomicCounter object with an initial counter-value of zero. + + + + + Assign the given amount to the counter-value. + + the integer value to set the counter to + + + + Add the given amount to the counter-value, in an atomic thread-safe manner. + + the integer amount to add to the counter-value + + + + Subtract the given amount from the counter-value, in an atomic thread-safe manner. + + the integer amount to subtract from to the counter-value (default value is 1) + the new value of the counter + + + + Class ByteArrayEqualityComparer is an IEqualityComparer for byte-arrays, + and provides an Equals methods to compare two byte-arrays for equality in value + and GetHashCode. + + + + + Return true only if the two byte-arrays are equal in length and contain the same values. + + one of the two byte-arrays to compare + the other byte-array to compare against + + + + + Return a numeric hashcode of the given byte-array. + + the given byte-array to compute the hashcode of + an integer that contains a hashcode computed over the byte-array + + + + The Clock class provides properties for getting timer-counts in either milliseconds or microseconds, + and the CPU's timestamp-counter if available. + + + + + TSC timestamp of when last time measurement was made. + + + + + Physical time corresponding to the TSC above (in milliseconds). + + + + + This flag indicates whether the rdtsc instruction is supported on this platform. + + + + + Return the High-Precision timestamp, as a 64-bit integer that denotes microseconds. + + + + + Return the Low-Precision timestamp, as a 64-bit integer denoting milliseconds. + In tight loops generating it can be 10 to 100 times faster than the High-Precision timestamp. + + + + + Return the CPU's timestamp counter, or 0 if it's not available. + + + + + A PollSet contains a single Socket and an IPollEvents Handler + that provides methods that signal when that socket is ready for reading or writing. + + + + + Get the Socket that this PollSet contains. + + + + + Get the IPollEvents object that has methods to signal when ready for reading or writing. + + + + + Get or set whether this PollSet is cancelled. + + + + + Create a new PollSet object to hold the given Socket and IPollEvents handler. + + the Socket to contain + the IPollEvents to signal when ready for reading or writing + + + + This is the list of registered descriptors (PollSets). + + + + + List of sockets to add at the start of the next loop + + + + + If true, there's at least one retired event source. + + + + + This flag is used to tell the polling-loop thread to shut down, + wherein it will stop at the end of it's current loop iteration. + + + + + This indicates whether the polling-thread is not presently running. Default is true. + + + + + This is the background-thread that performs the polling-loop. + + + + + This is the name associated with this Poller. + + + + + The set of Sockets to check for read-readiness. + + + + + The set of Sockets to check for any errors. + + + + + Create a new Poller object with the given name. + + a name to assign to this Poller + + + + Unless the polling-loop is already stopped, + tell it to stop at the end of the current polling iteration, and wait for that thread to finish. + + + + + Add a new PollSet containing the given Socket and IPollEvents at the next iteration through the loop, + and also add the Socket to the list of those to check for errors. + + the Socket to add + the IPollEvents to include in the new PollSet to add + + + + Remove the given Socket from this Poller. + + the System.Net.Sockets.Socket to remove + + + + Add the given Socket to the list to be checked for read-readiness at each poll-iteration. + + the Socket to add + + + + Begin running the polling-loop, on a background thread. + + + The name of that background-thread is the same as the name of this Poller object. + + + + + Signal that we want to stop the polling-loop. + This method returns immediately - it does not wait for the polling thread to stop. + + + + + This method is the polling-loop that is invoked on a background thread when Start is called. + As long as Stop hasn't been called: execute the timers, and invoke the handler-methods on each of the saved PollSets. + + + + + This serves as the parent-class for Poller and Proactor. + It provides for managing a list of timers (ITimerEvents) - adding, cancelling, and executing them, + and a Load property. + + + + + Load of the poller. Currently the number of file descriptors registered. + + + + + Instances of this class contain a ITimerEvent sink and an integer Id. + + + + + Create a new TimerInfo object from the given sink and id. + + an ITimerEvent that acts as a sink for when the timer expires + an integer id that identifies this timer + + + + Get the ITimerEvent that serves as the event-sink. + + + + + Get the integer Id of this TimerInfo. + + + + + This is a list of key/value pairs, with the keys being timeout numbers and the corresponding values being a list of TimerInfo objects. + It is sorted by the keys - which are timeout values. Thus, by walking down the list, you encounter the soonest timeouts first. + + + + + Create a new PollerBase object - which simply creates an empty m_timers collection. + + + + + Get the load of this poller. Note that this function can be + invoked from a different thread! + + + + + Add the given amount to the load. + This is called by individual poller implementations to manage the load. + + + This is thread-safe. + + + + + Add a to the internal list, created from the given sink and id - to expire in the given number of milliseconds. + Afterward the expiration method TimerEvent on the sink object will be called with argument set to id. + + the timeout-period in milliseconds of the new timer + the IProactorEvents to add for the sink of the new timer + the Id to assign to the new TimerInfo + + + + Cancel the timer that was created with the given sink object with the given Id. + + the ITimerEvent that the timer was created with + the Id of the timer to cancel + + The complexity of this operation is O(n). We assume it is rarely used. + + + + + Execute any timers that are due. Return the number of milliseconds + to wait to match the next timer or 0 meaning "no timers". + + the time to wait for the next timer, in milliseconds, or zero if there are no more timers + + + The completionStatuses item must have a valid OperationType. + + + + Close the read and write sockets. + + + + + This class exists only to provide a wrapper for the Socket.Select method, + such that the call may be handled slightly differently on .NET 3.5 as opposed to later versions. + + + + + Determine the status of one or more sockets. + After returning, the lists will be filled with only those sockets that satisfy the conditions. + + a list of Sockets to check for readability + a list of Sockets to check for writability + a list of Sockets to check for errors + a timeout value, in microseconds. A value of -1 indicates an infinite timeout. + + If you are in a listening state, readability means that a call to Accept will succeed without blocking. + If you have already accepted the connection, readability means that data is available for reading. In these cases, + all receive operations will succeed without blocking. Readability can also indicate whether the remote Socket + has shut down the connection - in which case a call to Receive will return immediately, with zero bytes returned. + + Select returns when at least one of the sockets of interest (ie any of the sockets in the checkRead, checkWrite, or checkError + lists) meets its specified criteria, or the microSeconds parameter is exceeded - whichever comes first. + Setting microSeconds to -1 specifies an infinite timeout. + + If you make a non-blocking call to Connect, writability means that you have connected successfully. If you already + have a connection established, writability means that all send operations will succeed without blocking. + If you have made a non-blocking call to Connect, the checkError parameter identifies sockets that have not connected successfully. + + See this reference for further details of the operation of the Socket.Select method: + https://msdn.microsoft.com/en-us/library/system.net.sockets.socket.select(v=vs.110).aspx + + This may possibly throw an ArgumentNullException, if all three lists are null or empty, + and a SocketException if an error occurred when attempting to access a socket. + + Use the Poll method if you only want to determine the status of a single Socket. + + This method cannot detect certain kinds of connection problems, + such as a broken network cable, or that the remote host was shut down ungracefully. + You must attempt to send or receive data to detect these kinds of errors. + + none of the three lists of sockets may be null. + an error occurred when attempting to access the socket. + + + + StringLib is a static class whose purpose is to provide miscellaneous string-related utility methods + and extension properties. + + + + + Return a string that gives detailed information of the state of the given List of Sockets, + for debugging purposes. + + the List of Sockets to describe + a string detailing the list contents, including the state of each Socket + + This is intended just for debugging purposes, as when adding detailed information to the Message of an + exception when an error occurs. In DEBUG mode more detail is provided. + + + + + Return a detailed textual description of the state of this Socket (if DEBUG is defined). + + the System.Net.Sockets.Socket to describe + a string containing a detailed listing of the properties of the Socket + + This is intended just for debugging purposes, as when adding detailed information to the Message of an + exception when an error occurs. In DEBUG mode more detail is provided. + + + + A FIFO queue. + + The class supports: + + Push-front via . + Pop-back via . + Pop-front via . + + As such it is only one operation short of being a double-ended queue (dequeue or deque). + + The internal implementation consists of a doubly-linked list of fixed-size arrays. + + + + + Individual memory chunk to hold N elements. + + + Contains global index positions of elements in the chunk. + + + Optional link to the previous . + + + Optional link to the next . + + + the size to give the new YQueue + should be no less than 2 + + + Gets the index of the front element of the queue. + The index of the front element of the queue. + If the queue is empty, it should be equal to . + + + Gets the front element of the queue. If the queue is empty, behaviour is undefined. + The front element of the queue. + + + Gets the index of the back element of the queue. + The index of the back element of the queue. + If the queue is empty, it should be equal to . + + + Retrieves the element at the front of the queue. + The element taken from queue. + + + Adds an element to the back end of the queue. + The value to be pushed. + + + Removes element from the back end of the queue, rolling back the last call to . + The caller must guarantee that the queue isn't empty when calling this method. + It cannot be done automatically as the read side of the queue can be managed by different, + completely unsynchronized threads. + The last item passed to . + + + + Allocation-efficient queue to store pipe items. + Front of the queue points to the first prefetched item, back of + the pipe points to last un-flushed item. Front is used only by + reader thread, while back is used only by writer thread. + + + + + Points to the first un-flushed item. This variable is used + exclusively by writer thread. + + + + + Points to the first un-prefetched item. This variable is used + exclusively by reader thread. + + + + + Points to the first item to be flushed in the future. + + + + + The single point of contention between writer and reader thread. + Points past the last flushed item. If it is NULL, + reader is asleep. This pointer should be always accessed using + atomic operations. + + + + + Write an item to the pipe. Don't flush it yet. If incomplete is + set to true the item is assumed to be continued by items + subsequently written to the pipe. Incomplete items are never + flushed down the stream. + + + + + Pop an incomplete item from the pipe. + + the element revoked if such item exists, null otherwise. + + + + Flush all the completed items into the pipe. + + Returns false if the reader thread is sleeping. In that case, caller is obliged to + wake the reader up before using the pipe again. + + + + + Check whether item is available for reading. + + + + + Attempts to read an item from the pipe. + + true if the read succeeded, otherwise false. + + + + Applies the function fn to the first element in the pipe + and returns the value returned by the fn. + The pipe mustn't be empty or the function crashes. + + + + + This enum-type serves to identity a particular socket-option. + + + + + The I/O-thread affinity. + 0 means no affinity, meaning that work shall be distributed fairly among all I/O threads. + For non-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2, and so on. + + + The I/O-thread Affinity is a 64-bit value used to specify which threads from the I/O thread-pool + associated with the socket's context shall handle newly-created connections. + 0 means no affinity, meaning that work shall be distributed fairly among all I/O threads. + For non-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2, and so on. + + + + + The unique identity of the socket, from a message-queueing router's perspective. + + + This is at most 255 bytes long. + + + + + Setting this option subscribes a socket to messages that have the given topic. This is valid only for Subscriber and XSubscriber sockets. + + + You subscribe a socket to a given topic when you want that socket to receive messages of that topic. + A topic is simply a specific prefix (in the form of a byte-array or the equivalent text). + This is valid only for Subscriber and XSubscriber sockets. + + + + + Set this option to un-subscribe a socket from a given topic. Only for Subscriber and XSubscriber sockets. + + + You un-subscribe a socket from the given topic when you no longer want that socket to receive + messages of that topic. A topic is simply a specific prefix (in the form of a byte-array or the equivalent text). + This is valid only for Subscriber and XSubscriber sockets. + + + + + The maximum send or receive data rate for multicast transports on the specified socket. + + + + + The recovery-interval, in milliseconds, for multicast transports using the specified socket. + Default is 10,000 ms (10 seconds). + + + This option determines the maximum time that a receiver can be absent from a multicast group + before unrecoverable data loss will occur. Default is 10,000 ms (10 seconds). + + + + + The size of the transmit buffer for the specified socket. + + + + + The size of the receive buffer for the specified socket. + + + + + This indicates more messages are to be received. + + + + + The file descriptor associated with the specified socket. + + + + + The event state for the specified socket. + This is a combination of: + PollIn - at least one message may be received without blocking + PollOut - at least one messsage may be sent without blocking + + + + + This option specifies the linger period for the specified socket, + which determines how long pending messages which have yet to be sent to a peer + shall linger in memory after a socket is closed. + + + + + The initial reconnection interval for the specified socket. + -1 means no reconnection. + + + This is the period to wait between attempts to reconnect disconnected peers + when using connection-oriented transports. + A value of -1 means no reconnection. + + + + + This is the maximum length of the queue of outstanding peer connections + for the specified socket. This only applies to connection-oriented transports. + Default is 100. + + + + + The maximum reconnection interval for the specified socket. + The default value of zero means no exponential backoff is performed. + + + This option value denotes the maximum reconnection interval for a socket. + It is used when a connection drops and NetMQ attempts to reconnect. + On each attempt to reconnect, the previous interval is doubled + until this maximum period is reached. + The default value of zero means no exponential backoff is performed. + + + + + The upper limit to the size for inbound messages. + -1 (the default value) means no limit. + + + If a peer sends a message larger than this it is disconnected. + + + + + The high-water mark for message transmission, which is the number of messages that are allowed to queue up + before mitigative action is taken. The default value is 1000. + + + + + The high-water mark for message reception, which is the number of messages that are allowed to queue up + before mitigative action is taken. The default value is 1000. + + + + + The time-to-live (maximum number of hops) that outbound multicast packets + are allowed to propagate. + The default value of 1 means that the multicast packets don't leave the local network. + + + + + Specifies the amount of time after which a synchronous send call will time out. + A value of 0 means Send will return immediately, with a EAGAIN error if the message cannot be sent. + -1 means to block until the message is sent. + + + + + This indicates the underlying native socket type. + + + An IPv4 socket will only use IPv4, while an IPv6 socket lets applications + connect to and accept connections from both IPv4 and IPv6 hosts. + + + + + The last endpoint bound for TCP and IPC transports. + The returned value will be a string in the form of a ZMQ DSN. + + + If the TCP host is ANY, indicated by a *, then the returned address + will be 0.0.0.0 (for IPv4). + + + + + Sets the RouterSocket behavior when an unroutable message is encountered. + A value of 0 is the default and discards the message silently when it cannot be routed. + A value of 1 returns an EHOSTUNREACH error code if the message cannot be routed. + + + + + Whether to use TCP keep-alive on this socket. + 0 = no, 1 = yes, + -1 (the default value) means to skip any overrides and leave it to the OS default. + + + + + The keep-alive time - the duration between two keepalive transmissions in idle condition. + + + The TCP keepalive period is required by socket implementers to be configurable and by default is + set to no less than 2 hours. + In 0MQ, -1 (the default value) means to just leave it to the OS default. + + + + + The TCP keep-alive interval - the duration between two keepalive transmission if no response was received to a previous keepalive probe. + + + By default a keepalive packet is sent every 2 hours or 7,200,000 milliseconds + if no other data have been carried over the TCP connection. + If there is no response to a keepalive, it is repeated once every KeepAliveInterval seconds. + The default is one second. + + + + + The list of accept-filters, which denote the addresses that a socket may accept. + Setting this to null clears the filter. + + + This applies to IPv4 addresses only. + + + + + This applies only to XPub sockets. + If true, send all subscription messages upstream, not just unique ones. + The default is false. + + + + + If true, router socket accepts non-zmq tcp connections + + + + + This is an XPublisher-socket welcome-message. + + + + + This applies only to XPub sockets. + If true, enable broadcast option on XPublishers + + + + + The low-water mark for message transmission. This is the number of messages that should be processed + before transmission is unblocked (in case it was blocked by reaching high-watermark). The default value is + calculated using relevant high-watermark (HWM): HWM > 2048 ? HWM - 1024 : (HWM + 1) / 2 + + + + + The low-water mark for message reception. This is the number of messages that should be processed + before reception is unblocked (in case it was blocked by reaching high-watermark). The default value is + calculated using relevant high-watermark (HWM): HWM > 2048 ? HWM - 1024 : (HWM + 1) / 2 + + + + + When enabled new router connections with same identity take over old ones + + + + + Returns the last peer routing id connect to the PEER socket + + + + + Specifies the byte-order: big-endian, vs little-endian. + + + + + Specifies the max datagram size for PGM. + + + + + This is the base-class for all objects that participate in inter-thread communication. + + + + + This Ctx is the context that provides access to the global state. + + + + + This is the thread-ID of the thread that this object belongs to. + + + + + Create a new ZObject with the given context and thread-id. + + the context for the new ZObject to live within + the integer thread-id for the new ZObject to be associated with + + + + Create a new ZObject that has the same context and thread-id as the given parent-ZObject. + + another ZObject that provides the context and thread-id for this one + + + + Get the id of the thread that this object belongs to. + + + + + Get the context that provides access to the global state. + + + + The given address was not found in the list of endpoints. + + + + Returns the that is the least busy at the moment. + + Which threads are eligible (0 = all). + The least busy thread, or null if none is available. + + + + Send the Stop command. + + + + + Send the Plug command, incrementing the destinations sequence-number if incSeqnum is true. + + the Own to send the command to + a flag that dictates whether to increment the sequence-number on the destination (optional - defaults to false) + + + + Send the Own command, and increment the sequence-number of the destination + + the Own to send the command to + the object to Own + + + + Send the Attach command + + the Own to send the command to + + + + + + Send the Bind command + + + + + + + + For owned objects, asks the owner () to terminate . + + + + + + + Send a Done command to the Ctx itself (null destination). + + + + + Send the given Command, on that commands Destination thread. + + the Command to send + + + Not supported on the ZObject class. + + + Not supported on the ZObject class. + + + Not supported on the ZObject class. + + + Not supported on the ZObject class. + + + Not supported on the ZObject class. + + + + Process the bind command with the given pipe. + + + Not supported on the ZObject class. + + + Not supported on the ZObject class. + + + Not supported on the ZObject class. + + + + This method would be called to assign the specified pipe as a replacement for the outbound pipe that was being used. + This, is an abstract method that is to be overridden by subclasses to provide their own concrete implementation. + + the pipe to use for writing + + A "Hiccup" occurs when an outbound pipe experiences something like a transient disconnect or for whatever other reason + is no longer available for writing to. + + No supported on the ZObject class. + + + + Process the terminate-pipe command. + + Not supported on the ZObject class. + + + + Process the terminate-pipe acknowledgement command. + + Not supported on the ZObject class. + + + + Process a termination-request command on the Own object. + + + Not supported on the ZObject class. + + + + Process a termination request. + + a time (in milliseconds) for this to linger before actually going away. -1 means infinite. + Not supported on the ZObject class. + + + + Process the termination-acknowledgement command. + + Not supported on the ZObject class. + + + Not supported on the ZObject class. + + + + Special handler called after a command that requires a seqnum + was processed. The implementation should catch up with its counter + of processed commands here. + + Not supported on the ZObject class. + + + + This enum-type specifies either big-endian (Big) or little-endian (Little), + which indicate whether the most-significant bits are placed first or last in memory. + + + + + Most-significant bits are placed first in memory. + + + + + Most-significant bits are placed last in memory. + + + + + This enum-type represents the various numeric socket-related error codes. + + + + + The provided endpoint is not connected. + + + + + The requested address is already in use. + + + + + Non-blocking mode was requested and the message cannot be sent at the moment. + + + + + Permission denied + + + + + The endpoint supplied is invalid. + + + + + The connection is still in progress. + + + + + The requested transport protocol is not supported. + + + + + The provided context is invalid. + + + + + The requested address was not available. + For Bind operations, that can mean the address was not local. + + + + + The network appears to be down. + + + + + There is not enough buffer space for the requested operation. + + + + + The socket is not connected. + + + + + The connection was refused. + + + + + The host is not reachable. + + + + + This is the value chosen for beginning the range of 0MQ error codes. + + + + + The message is too long. + + + + + The address family is not supported by this protocol. + + + + + The network is apparently not reachable. + + + + + The connection-attempt has apparently been aborted. + + + + + The connection has apparently been reset. + + + + + The operation timed-out. + + + + + The connection has apparently been reset. + + + + + The operation cannot be performed on this socket at the moment due + to the socket not being in the appropriate state. + + + + + The context associated with the specified socket has already been terminated. + + + + + No I/O thread is available to accomplish this task. + + + + + Too many sockets for this process. + + + + + Facilitates a pattern whereby an event may be decorated with logic that transforms its arguments. + + + Use of this class requires providing actions that register and unregister a handler of the source + event that calls with updated arguments in response. + + Argument type of the decorated event. + + + + Initialises a new instance. + + an Action to perform when the first handler is registered for the event + an Action to perform when the last handler is unregistered from the event + + + + Raise, or "Fire", the Event. + + the sender that the event-handler that gets notified of this event will receive + the subclass of EventArgs that the event-handler will receive + + + + class InterfaceItem provides the properties Address and BroadcastAddress (both are an IPAddress). + This serves to convey information for each of the network interfaces present on a host. + + + + + Create a new InterfaceItem from the given address and broadcast-address. + + an IPAddress that will comprise the 'Address' of the new InterfaceItem + an IPAddress that will comprise the 'BroadcastAddress' of the new InterfaceItem + + + + Get the 'address' of this network interface, as an IPAddress. + + + + + Get the 'broadcast-address' of this network interface, as an IPAddress. + + + + + This is a list of InterfaceItems, each of which has an Address and BroadcastAddress, + which is derived from all of the Network Interfaces present on this host at the time an instance of this class is created. + + + + + Create a new InterfaceCollection that contains a list of InterfaceItems derived from all of the Network Interfaces present on this host. + + + + + Return an IEnumerator over the InterfaceItems that this InterfaceCollection contains, + which are all of the network interfaces that were not running, nor loopback nor PPP interfaces. + + an IEnumerator over the InterfaceItems that this contains + + + + Interface IOutgoingSocket mandates a Send( Msg, SendReceiveOptions ) method. + + + + + Send a message if one is available within . + + An object with message's data to send. + The maximum length of time to try and send a message. If , no + wait occurs. + Indicate if another frame is expected after this frame + true if a message was sent, otherwise false. + + + + Defines a socket from which message data may be read. + + + + + Receive a message if one is available within . + + An object to receive the message's data into. + The maximum length of time to wait for a message. If , no + wait occurs. + true if a message was received, otherwise false. + + + + Implementations provide a via the property. + + + + + Gets a instance. + + + + + Gets whether the object has been disposed. + + + + + + + + This interface provides an abstraction over the legacy Poller and newer classes for use in . + + + + + Monitors a for events, raising them via events. + + + To run a monitor instance, either: + + Call (blocking) and , or + Call and . + + + + + + Initialises a monitor on for a specified . + + + This constructor matches the signature used by clrzmq. + + The socket to monitor. + a string denoting the endpoint which will be the monitoring address + + A flag indicating whether ownership of is transferred to the monitor. + If true, disposing the monitor will also dispose . + + + + + The monitoring address. + + + + + Get whether this monitor is currently running. + + + Start the monitor running via either or . + Stop the monitor via either or . + + + + + Gets and sets the timeout interval for poll iterations when using and . + + + The higher the number the longer it may take the to stop the monitor. + This value has no effect when the monitor is run via . + + + + + Raised whenever any monitored event fires. + + + + + Occurs when a connection is made to a socket. + + + + + Occurs when a synchronous connection attempt failed, and its completion is being polled for. + + + + + Occurs when an asynchronous connect / reconnection attempt is being handled by a reconnect timer. + + + + + Occurs when a socket is bound to an address and is ready to accept connections. + + + + + Occurs when a socket could not bind to an address. + + + + + Occurs when a connection from a remote peer has been established with a socket's listen address. + + + + + Occurs when a connection attempt to a socket's bound address fails. + + + + + Occurs when a connection was closed. + + + + + Occurs when a connection couldn't be closed. + + + + + Occurs when the stream engine (TCP and IPC specific) detects a corrupted / broken session. + + + + + Start monitor the socket, the method doesn't start a new thread and will block until the monitor poll is stopped + + The Monitor must not have already started nor attached to a poller. + + + + Start a background task for the monitoring operation. + + + + + + Stop monitoring. Blocks until monitoring completed. + + If this monitor is attached to a poller you must detach it first and not use the stop method. + + + + Release and dispose of any contained resources. + + + + + Release and dispose of any contained resources. + + true if releasing managed resources + + + + Base class for all event arguments raised by . + + + + + Create a new NetMQMonitorEventArgs that contains the given monitor and address. + + The that raised this event. + The address of the event. + The type of socket event that occurred. + + + + Gets the that raised this event. + + + + + Gets the address of the event. + + + + + Gets the type of socket event that occurred. + + + + + A subclass of that also holds a socket. + + + + + Create a new NetMQMonitorSocketEventArgs that contains the given monitor, address, and socket. + + The that raised this event. + The address of the event. + The type of socket event that occurred. + The socket upon which this event occurred. + + + + Gets the socket upon which this event occurred. + + + + + A subclass of that also holds an error code. + + + + + Create a new NetMQMonitorErrorEventArgs that contains the given monitor, address, and error-code. + + The that raised this event. + The address of the event. + The type of socket event that occurred. + The error code associated with this event. + + + + Gets the error code associated with this event. + + + + + A subclass of that also holds an interval. + + + + + Create a new NetMQMonitorIntervalEventArgs containing the given NetMQMonitor, address, and interval. + + the NetMQMonitor + The a string denoting the address + The interval, in milliseconds. + The type of socket event that occurred. + + + + Gets the interval, in milliseconds. + + + + Defines a set of flags applicable to a instance: None (default), More, Identity, Shared + + + Indicates no flags are set (the default). + + + Indicates that more frames of the same message follow. + + + Indicates that this frame conveys the identity of a connected peer. + + + Indicates that this frame's internal data is shared with other objects. + + + Enumeration of possible types: Uninitialised, GC, Pool, Delimiter. + + + The has not yet been initialised (default value). + + + The is empty. + + + The data will be garbage collected when no longer needed. + + + + The data was allocated by , and must be released back + to this pool when no longer needed. This happens when is called. + + + + The is a delimiter frame and doesn't contain any data. + Delimiters are commonly used to mark a boundary between groups frames. + + + + A Msg struct is the lowest-level interpretation of a ZeroMQ message, and simply contains byte-array data + and MsgType and MsgFlags properties. + It supports message buffer pooling. + + + Many users will not use this class directly. However in high-performance situations it + may be useful. When used correctly it's possible to have zero-copy and zero-allocation + behaviour. + + + + An atomic reference count for knowing when to release a pooled data buffer back to the . + Will be null unless equals . + + + + Get the number of bytes within the Data property. + + + + + Gets the position of the first element in the Data property delimited by the message, + relative to the start of the original array. + + + + Get the type of this message, from the MsgType enum. + + + + Get whether the Delimiter bit is set on the Flags property, + which would indicate that this message is intended for use simply to mark a boundary + between other parts of some unit of communication. + + + + Get whether this is initialised and ready for use. + A newly constructed is uninitialised, and can be initialised via one + of , , , , or . + Calling will cause the to become uninitialised again. + true if the is initialised, otherwise false. + + + + Get the flags-enum MsgFlags value, which indicates which of the More, Identity, or Shared bits are set. + + + + + Get the "Has-More" flag, which when set on a message-queue frame indicates that there are more frames to follow. + + + + + Get whether the buffer of this is shared with another instance. + Only applies to pooled message types. + + + + + Get whether the Identity bit is set on the Flags property. + + + + + Set the indicated Flags bits. + + which Flags bits to set (More, Identity, or Shared) + + + + Clear the indicated Flags bits. + + which Flags bits to clear (More, Identity, or Shared) + + + + Get the byte-array that represents the data payload of this . + + + This value will be null if is , + or . + + + + + Clear this Msg to empty - ie, set MsgFlags to None, MsgType to Empty, and clear the Data. + + + + + Initialise this Msg to be of MsgType.Pool, with a data-buffer of the given number of bytes. + + the number of bytes to allocate in the data-buffer + + + + Initialise this Msg to be of MsgType.GC with the given data-buffer value. + + the byte-array of data to assign to the Msg's Data property + the number of bytes that are in the data byte-array + + + + Initialise this Msg to be of MsgType.GC with the given data-buffer value. + + the byte-array of data to assign to the Msg's Data property + first byte in the data array + the number of bytes that are in the data byte-array + + + + Set this Msg to be of type MsgType.Delimiter with no bits set within MsgFlags. + + + + + Clear the and set the MsgType to Invalid. + If this is not a shared-data Msg (MsgFlags.Shared is not set), or it is shared but the reference-counter has dropped to zero, + then return the data back to the BufferPool. + + The object is not initialised. + + + + If this Msg is of MsgType.Pool, then - add the given amount number to the reference-counter + and set the shared-data Flags bit. + If this is not a Pool Msg, this does nothing. + + the number to add to the internal reference-counter + + + + If this Msg is of MsgType.Pool and is marked as Shared, then - subtract the given amount number from the reference-counter + and, if that reaches zero - return the data to the shared-data pool. + If this is not both a Pool Msg and also marked as Shared, this simply Closes this Msg. + + the number to subtract from the internal reference-counter + + + + Override the Object ToString method to show the object-type, and values of the MsgType, Size, and Flags properties. + + a string that provides some detail about this Msg's state + + + + Copy the given byte-array data to this Msg's Data buffer. + + the source byte-array to copy from + index within the internal Data array to copy that byte to + the number of bytes to copy + + + + Copy the given byte-array data to this Msg's Data buffer. + + the source byte-array to copy from + first byte in the source byte-array + index within the internal Data array to copy that byte to + the number of bytes to copy + + + + Copy the given single byte to this Msg's Data buffer. + + the source byte to copy from + + + + Copy the given single byte to this Msg's Data buffer at the given array-index. + + the source byte to copy from + index within the internal Data array to copy that byte to + + + + Get and set the byte value in the buffer at a specific index. + + The index to access + + + + + Close this Msg, and effectively make this Msg a copy of the given source Msg + by simply setting it to point to the given source Msg. + If this is a Pool Msg, then this also increases the reference-counter and sets the Shared bit. + + the source Msg to copy from + The object is not initialised. + + + + Increase Offset and decrease Size by the given count. + + Number of bytes to remove from a message + + + + Close this Msg and make it reference the given source Msg, and then clear the Msg to empty. + + the source-Msg to become + The object is not initialised. + + + Returns a new array containing the first bytes of . + + + + An IShimHandler provides a Run(PairSocket) method. + + + + + Execute whatever action this IShimHandler represents against the given shim. + + + + + + This is an EventArgs that provides an Actor property. + + + + + Create a new NetMQActorEventArgs with the given NetMQActor. + + the NetMQActor for this exception to reference + + + + Get the NetMQActor that this exception references. + + + + + This delegate represents the action for this actor to execute. + + the that is the shim to execute this action + + + + This delegate represents the action for this actor to execute - along with a state-information object. + + the type to use for the state-information object + the that is the shim to execute this action + the state-information that the action will use + + + + The Actor represents one end of a two-way pipe between 2 PairSocket(s). Where + the actor may be passed messages, that are sent to the other end of the pipe + which is called the "shim" + + + + + The terminate-shim command. + This is just the literal string "endPipe". + + + + + Create a new ActionShimHandler with the given type T to serve as the state-information, + and the given action to operate upon that type. + + a ShimAction of type T that comprises the action to perform + the state-information + + + + Perform the action upon the given shim, using our state-information. + + a that is the shim to perform the action upon + + + + Create a new ActionShimHandler with a given action to operate upon that type. + + a ShimAction that comprises the action to perform + + + + Perform the action upon the given shim, using our state-information. + + a that is the shim to perform the action upon + + + + Create a new with the given shimHandler. + + an IShimHandler that provides the Run method + the newly-created NetMQActor + + + + Create a new with the action, and state-information. + + a ShimAction - delegate for the action to perform + the state-information - of the generic type T + the newly-created NetMQActor + + + + Create a new with the given . + + a ShimAction - delegate for the action to perform + the newly-created NetMQActor + + + + Execute the shim handler's Run method, signal ok and then dispose of the shim. + + + + + Transmit the given Msg over this actor's own socket. + + the Msg to transmit + The maximum length of time to try and send a message. If , no + wait occurs. + Indicate if another frame is expected after this frame + true if a message was sent, otherwise false. + The socket has been stopped. + is not initialised. + + + + Attempt to receive a message for the specified period of time, returning true if successful or false if it times-out. + + a Msg to write the received message into + a TimeSpan specifying how long to block, waiting for a message, before timing out + true only if a message was indeed received + + + + This event occurs when at least one message may be received from the socket without blocking. + + + + + This event occurs when a message is ready to be transmitted from the socket. + + + + + + + + Release any contained resources. + + true if managed resources are to be released + + + + + + + A NetMQBeaconEventArgs is an EventArgs that provides a property that holds a NetMQBeacon. + + + + + Create a new NetMQBeaconEventArgs object containing the given NetMQBeacon. + + the NetMQBeacon object to hold a reference to + + + + Get the NetMQBeacon object that this holds. + + + + + Create a new NetMQBeacon. + + + + + Get the host name this beacon is bound to. + + + This may involve a reverse DNS lookup which can take a second or two. + + An empty string is returned if: + + the beacon is not bound, + the beacon is bound to all interfaces, + an error occurred during reverse DNS lookup. + + + + + + Get the IP address this beacon is bound to. + + + + + Get the socket of the contained actor. + + + + + This event occurs when at least one message may be received from the socket without blocking. + + + + + Configure beacon for the specified port on all interfaces. + + Blocks until the bind operation completes. + The UDP port to bind to. + + + + Configure beacon for the specified port and, optionally, to a specific interface. + + Blocks until the bind operation completes. + The UDP port to bind to. + IP address of the interface to bind to. Pass empty string (the default value) to use the default interface. + + + + Publish beacon immediately and continue to publish when interval elapsed + + Beacon to transmit. + Interval to transmit beacon + Encoding for . Defaults to . + + + + Publish beacon immediately and continue to publish when interval elapsed + + Beacon to transmit + Interval to transmit beacon + + + + Publish beacon immediately and continue to publish every second + + Beacon to transmit + Encoding for . Defaults to . + + + + Publish beacon immediately and continue to publish every second + + Beacon to transmit + + + + Stop publishing beacons. + + + + + Subscribe to beacon messages that match the specified filter. + + + Beacons must prefix-match with . + Any previous subscription is replaced by this one. + + Beacon will be filtered by this + + + + Unsubscribe to beacon messages + + + + + Receives the next beacon message, blocking until it arrives. + + + + + Receives the next beacon message if one is available before expires. + + The maximum amount of time to wait for the next beacon message. + The received beacon message. + true if a beacon message was received, otherwise false. + + + + + + + + + + Contents of a message received from a beacon. + + + + + THe beacon content as a byte array. + + + + + The address of the peer that sent this message. Includes host name and port number. + + + + + The beacon content as a string. + + Decoded using . Other encodings may be used with directly. + + + + The host name of the peer that sent this message. + + This is simply the value of without the port number. + + + + Cleanup library resources, call this method when your process is shutting-down. + + Set to true when you want to make sure sockets send all pending messages + + + + Get or set the default linger period for the all sockets, + which determines how long pending messages which have yet to be sent to a peer + shall linger in memory after a socket is closed. + + + This also affects the termination of the socket's context. + + -1: Specifies infinite linger period. Pending messages shall not be discarded after the socket is closed; + attempting to terminate the socket's context shall block until all pending messages have been sent to a peer. + + 0: The default value of specifies no linger period. Pending messages shall be discarded immediately when the socket is closed. + Positive values specify an upper bound for the linger period. Pending messages shall not be discarded after the socket is closed; + attempting to terminate the socket's context shall block until either all pending messages have been sent to a peer, + or the linger period expires, after which any pending messages shall be discarded. + + + + + Get or set the number of IO Threads NetMQ will create, default is 1. + 1 is good for most cases. + + + + + Get or set the maximum number of sockets. + + + + + Method is obsolete, call Cleanup instead + + + + + Method is obsolete, call Cleanup instead + + + + + Method is obsolete, call Cleanup instead + + Should the context block the thread while terminating. + + + + Method is obsolete, context created automatically + + + + + Base class for custom exceptions within the NetMQ library. + + + + Constructor for serialisation. + + + + Create a new NetMQException containing the given Exception, Message and ErrorCode. + + an Exception that this exception will expose via it's InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + an ErrorCode that this exception will expose via its ErrorCode property + + + + Create and return a new NetMQException with no Message containing only the given SocketException. + + a SocketException that this exception will expose via its InnerException property + a new NetMQException + + + + Create and return a new NetMQException with no Message containing the given SocketError and Exception. + + a SocketError that this exception will carry and expose via its ErrorCode property + an Exception that this exception will expose via its InnerException property + a new NetMQException + + + + Create and return a new NetMQException with no Message containing the given ErrorCode and Exception. + + an ErrorCode for this exception to contain and expose via its ErrorCode property + an Exception for this exception to contain and expose via its InnerException property + a new NetMQException + + + + Create and return a new NetMQException with no Message containing only the given ErrorCode. + + an ErrorCode that this exception will carry and expose via its ErrorCode property + a new NetMQException + + + + Create and return a new NetMQException with the given Message and ErrorCode. + + the textual description of what gave rise to this exception, to expose via the Message property + an ErrorCode that this exception will carry and expose via its ErrorCode property + a new NetMQException + + + + Create and return a new NetMQException with the given ErrorCode, Message, and Exception. + + an ErrorCode that this exception will contain and expose via its ErrorCode property + the textual description of what gave rise to this exception, to expose via the Message property + an Exception that this exception will expose via its InnerException property + a new NetMQException, or subclass of NetMQException that corresponds to the given ErrorCode + + + + AddressAlreadyInUseException is a NetMQException that is used within SocketBase.Bind to signal an address-conflict. + + + + + Create a new AddressAlreadyInUseException with a given inner-exception and message. + + an Exception for this new exception to contain and expose via its InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new AddressAlreadyInUseException with a given message. + + the textual description of what gave rise to this exception, to expose via the Message property + + + Constructor for serialisation. + + + + EndpointNotFoundException is a NetMQException that is used within Ctx.FindEndpoint to signal a failure to find a specified address. + + + + + Create a new EndpointNotFoundException with a given inner-exception and message. + + an Exception for this new exception to contain and expose via its InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new EndpointNotFoundException with a given message. + + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new EndpointNotFoundException with no message nor inner-exception. + + + + Constructor for serialisation. + + + + TerminatingException is a NetMQException that is used within SocketBase and Ctx to signal + that you're making the mistake of trying to do further work after terminating the message-queueing system. + + + + + Create a new TerminatingException with a given inner-exception and message. + + an Exception for this new exception to contain and expose via its InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new TerminatingException with no message nor inner-exception. + + + + Constructor for serialisation. + + + + InvalidException is a NetMQException that is used within the message-queueing system to signal invalid value errors. + + + + + Create a new InvalidException with a given inner-exception and message. + + an Exception for this new exception to contain and expose via its InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new InvalidException with the given message. + + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new InvalidException with no message nor inner-exception. + + + + Constructor for serialisation. + + + + FaultException is a NetMQException that is used within the message-queueing system to signal general fault conditions. + + + + + Create a new FaultException with a given inner-exception and message. + + an Exception for this new exception to contain and expose via its InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new FaultException with the given message. + + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new FaultException with no message nor inner-exception. + + + + Constructor for serialisation. + + + + ProtocolNotSupportedException is a NetMQException that is used within the message-queueing system to signal + mistakes in properly utilizing the communications protocols. + + + + + Create a new ProtocolNotSupportedException with a given inner-exception and message. + + an Exception for this new exception to contain and expose via its InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new ProtocolNotSupportedException with the given message. + + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new ProtocolNotSupportedException with no message nor inner-exception. + + + + Constructor for serialisation. + + + + HostUnreachableException is an Exception that is used within the message-queueing system + to signal failures to communicate with a host. + + + + + Create a new HostUnreachableException with a given inner-exception and message. + + an Exception for this new exception to contain and expose via its InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new HostUnreachableException with the given message. + + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new HostUnreachableException with no message nor inner-exception. + + + + Constructor for serialisation. + + + + FiniteStateMachineException is an Exception that is used within the message-queueing system + to signal errors in the send/receive order with request/response sockets. + + + + + Create a new FiniteStateMachineException with a given inner-exception and message. + + an Exception for this new exception to contain and expose via its InnerException property + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new FiniteStateMachineException with the given message. + + the textual description of what gave rise to this exception, to expose via the Message property + + + + Create a new FiniteStateMachineException with no message nor inner-exception. + + + + Constructor for serialisation. + + + + Objects of class NetMQFrame serve to hold a Buffer (that consists of a byte-array containing a unit of a message-queue message) + and provide methods to construct it given a string and an encoding. + + + + + This is the length of the byte-array data buffer. + + + + + This holds the computed hash-code for this object. + + + + + Create a new NetMQFrame containing the given byte-array data. + + a byte-array to hold as the frame's data + + + + Instantiates a frame from the provided byte array, considering only the specified number of bytes. + + This constructor may be useful to avoid copying data into a smaller array when a buffer is oversized. + The content of the frame. + The number bytes from to consider as part of the frame. + + + + Create a new NetMQFrame containing the given string-message, + using the default ASCII encoding. + + a string containing the message-data of the frame + + + + Create a new NetMQFrame containing the given string-message, + using the given encoding to convert it into a byte-array. + + a string containing the message-data of the frame + the Encoding to use to convert the given string-message into the internal byte-array + + + + Create a new NetMQFrame with a data-buffer pre-sized to the given length. + + the number of bytes to allocate for the data-buffer + length must be non-negative (zero or positive). + + + + Get or set the size of the message data contained in the frame, which here represents the number of bytes. + + The value must be between zero and BufferSize. + + + + Get the underlying frame-data buffer, which is an array of bytes. + + + + + Get the maximum size of the frame-data buffer (ie, the number of bytes of the array). + + + + + Get a new empty that may be used as message separators. + + + + + Get whether this NetMQFrame is empty - that is, has a Buffer of zero-length. + + + + + Create and return a new NetMQFrame with a copy of the supplied byte-array buffer. + + the byte-array to copy into the new NetMQFrame + a new containing a copy of the supplied byte-array + is null. + + + + Return this frame's data-buffer converted into a string, using the default ASCII encoding. + + the data buffer converted to a string + + + + Return this frame's data-buffer converted into a string using the given encoding. + + the Encoding to use to convert the internal byte-array buffer into a string + the data buffer converted to a string + + + + Convert the buffer to integer in network byte order (big-endian) + + + + + + Convert the buffer to long in network byte order (big-endian) + + + + + + Create a deep-copy of the supplied . + + the to copy + a containing a copy of + is null. + + + + Create a deep-copy of this NetMQFrame and return it. + + a new NetMQFrame containing a copy of this one's buffer data + + + + Return true if the buffer of this NetMQFrame is equal to the given byte-array. + + a byte-array buffer to compare this frame against + + + + + Determine whether the specified is equal to the current . + + the to compare with the current . + true if the specified NetMQFrame is equal to this one; otherwise, false + + + + Return true if the given Object is a NetMQFrame which has a Buffer that is identical to that of this one. + + the Object to compare this to + true only if the given Object is a NetMQFrame equal to this one + + + + Return true if this one and the other NetMQFrame are equal, or both are null. + + one frame to compare against the other + the other frame to compare + true if both frames are equal + + + + Return true if this one and the other NetMQFrame NOT are equal. + + one frame to compare against the other + the other frame to compare + false if both frames are equal + + + + Override the Object.GetHashCode method to return a hash-code derived from the content of the Buffer. + That is only computed the first time this method is called. + + an integer that represents the computed hash-code + + + + Return an array of bytes that carries the content of this NetMQFrames Buffer. + + if this argument is true - a new copy is made if BufferSize is equal to MessageSize + the Buffer as a byte-array, either newly-allocated or else (if copy is false) simply a reference to the actual Buffer + + + + This namespace encompasses the NetMQ message-queueing library + and attendant utility software. + + + + + A NetMQMessage is basically a collection of NetMQFrames, and is the basic message-unit that is sent and received + across this message-queueing subsystem. + + + + + This is the frame-stack that comprises the message-content of this message. + + + + + The default-constructor for NetMQMessage: create a new instance of NetMQMessage + with an empty frame-stack. + + + + + Create a new instance of a NetMQMessage that contains the given collection of NetMQFrames as its frame-stack. + + a collection of NetMQFrames, to form the frame-stack + The value of 'frames' cannot be null. + + + + Create a new instance of a NetMQMessage that contains the given collection of byte-arrays as its frame-stack. + + a collection of byte-array buffers, to form the frame-stack + The value of 'buffers' cannot be null. + + + + Gets the first frame in the current message. + + + + + Gets the last frame in the current message. + + + + + Gets a value indicating whether the current message is empty. + + + + + Gets the number of objects contained by this message. + + + + + Gets the at the specified index. + + The zero-based index of the to get. + The at the specified index. + + is less than 0 -or- is equal to or greater than . + + + + + Add the given NetMQFrame to this NetMQMessage, at the highest-indexed position of the frame-stack. + + a NetMQFrame object comprising the frame to be appended onto the frame-stack + + + + Add the given data (in this case a byte-array) to this NetMQMessage, at the highest-indexed position of the frame-stack. + Data is not copied. + + a byte-array containing the message to append onto the frame-stack of this NetMQMessage + + + + Add the given string - which gets converted into a NetMQFrame - onto + the highest-indexed position of the frame-stack of this NetMQMessage. + + a string containing the message to append onto the frame-stack of this NetMQMessage + + + + Add the given string - which gets converted into a NetMQFrame - onto + the highest-indexed position of the frame-stack of this NetMQMessage. + + a string containing the message to append onto the frame-stack of this NetMQMessage + an Encoding that specifies how to convert the string into bytes + + + + Convert the given integer value into an array of bytes and add it as a new frame onto this NetMQMessage. + + a 32-bit integer value that is to be converted into bytes and added to this message + + + + Convert the given long value into an array of bytes and add it as a new frame onto this NetMQMessage. + + a 64-bit number that is to be converted into bytes and added to this message + + + + Add an empty frame to this NetMQMessage. + + + + + Push the given NetMQFrame into the frame-stack of this NetMQMessage. + + the NetMQFrame to be inserted into the frame-stack + + The concept is the same as pushing an element onto a stack. + This inserts the given NetMQFrame into the lowest-indexed position of this NetMQMessage, + pushing all of the other frames upward in index-position. + + + + + Push a new frame containing the given byte-array into the frame-stack of this NetMQMessage. + + the byte-array to create a new frame from + + The concept is the same as pushing an element onto a stack. + This creates a new frame from the given data (in this case a byte-array) and inserts it into the lowest-indexed position of + the collection of frames of this NetMQMessage, + pushing all of the other frames upward in index-position. + + + + + Push a new frame containing the given string (converted into a byte-array) into the frame-stack of this NetMQMessage. + + the string to create a new frame from + + The concept is the same as pushing an element onto a stack. + This creates a new frame from the given data (in this case a string which gets converted into a byte-array using the default ASCII encoding) and inserts it into the lowest-indexed position of + the collection of frames of this NetMQMessage, + pushing all of the other frames upward in index-position. + + + + + Push a new frame containing the given string (converted into a byte-array) into the frame-stack of this NetMQMessage. + + the string to create a new frame from + the Encoding that dictates how to encode the string into bytes + + The concept is the same as pushing an element onto a stack. + This creates a new frame from the given data (in this case a string which gets converted into a byte-array using the given Encoding) and inserts it into the lowest-indexed position of + the collection of frames of this NetMQMessage, + pushing all of the other frames upward in index-position. + + + + + Push a new frame containing the given integer (converted into a byte-array) into the frame-stack of this NetMQMessage. + + the integer to create a new frame from + + The concept is the same as pushing an element onto a stack. + This creates a new frame from the given data (in this case a 32-bit integer which gets converted into a byte-array in big-endian order) and inserts it into the lowest-indexed position of + the collection of frames of this NetMQMessage, + pushing all of the other frames upward in index-position. + + + + + Push a new frame containing the given long (converted into a byte-array) into the frame-stack of this NetMQMessage. + + the 64-bit number to create a new frame from + + The concept is the same as pushing an element onto a stack. + This creates a new frame from the given data (in this case a 64-bit long which gets converted into a byte-array in big-endian order) and inserts it into the lowest-indexed position of + the collection of frames of this NetMQMessage, + pushing all of the other frames upward in index-position. + + + + + Push an empty frame (a NetMQFrame.Empty) onto the frame-stack. + + + + + Remove and return the first frame. + + the first frame, which was popped - which is the frame from the lowest-indexed position + + + + Delete the given frame from the frame-stack. + + the frame to remove + true if removed, otherwise false. + + + + Clear (empty) the frame-stack, so that it no longer contains any frames. + + + + + Return an enumerator over the frames contained within this message. + + an IEnumerator over the frames in this message + + + + Return an enumerator over the frames contained within this message. + + an IEnumerator over the frames in this message + + + + Returns a string showing the frame contents. + + + + + + Get whether the caller is running on the scheduler's thread. + If true, the caller can execute tasks directly (inline). + If false, the caller must start a on this scheduler. + + + This property enables avoiding the creation of a object and + potential delays to its execution due to queueing. In most cases this is just + an optimisation. + + + + if (scheduler.CanExecuteTaskInline) + { + socket.Send(...); + } + else + { + var task = new Task(() => socket.Send(...)); + task.Start(scheduler); + } + + + + + + Returns 1, as runs a single thread and all tasks must execute on that thread. + + + + + Not supported. + + Always thrown. + + + + Get whether this object is currently polling its sockets and timers. + + + + + Runs the poller in a background thread, returning once the poller has started. + + + The created thread is named "NetMQPollerThread". Use to specify the thread name. + + + + + Runs the poller in a background thread, returning once the poller has started. + + The thread name to use. + + + + Runs the poller on the caller's thread. Only returns when or are called from another thread. + + + + + Runs the poller on the caller's thread. Only returns when or are called from another thread. + + The synchronization context that will be used. + + + + Runs the poller on the caller's thread. Only returns when or are called from another thread. + + + + + Stops the poller. + + + If called from a thread other than the poller thread, this method will block until the poller has stopped. + If called from the poller thread it is not possible to block. + + + + + Stops the poller, returning immediately and most likely before the poller has actually stopped. + + + + This class only implements in order to support collection initialiser syntax. + An empty enumerator. + + + + Stops and disposes the poller. The poller may not be used once disposed. + + + Note that you cannot dispose the poller on the poller's thread. Doing so immediately throws an exception. + + A socket in the poller has been disposed. + Dispose called from the poller thread. + + + Dispatches an asynchronous message to a synchronization context. + + + Dispatches a synchronous message to a synchronization context. + + + + Class to quickly handle incoming messages of socket. + New thread is created to handle the messages. Call dispose to stop the thread. + Provided socket will not be disposed by the class. + + + + + Create NetMQProactor and start dedicate thread to handle incoming messages. + + Socket to handle messages from + Handler to handle incoming messages + + + + Stop the proactor. Provided socket will not be disposed. + + + + + Multi producer single consumer queue which you can poll on with a Poller. + + Type of the item in queue + + + + Create new NetMQQueue. + + The capacity of the queue, use zero for unlimited + + + + Register for this event for notification when there are items in the queue. Queue must be added to a poller for this to work. + + + + + Try to dequeue an item from the queue. Dequeueing and item is not thread safe. + + Will be filled with the item upon success + Timeout to try and dequeue and item + Will return false if it didn't succeed to dequeue an item after the timeout. + + + + Dequeue an item from the queue, will block if queue is empty. Dequeueing and item is not thread safe. + + Dequeued item + + + + Enqueue an item to the queue, will block if the queue is full. + + + + + + Dispose the queue. + + + + + For selecting on and regular .NET objects. + + + This is for advanced scenarios only. + Most use cases are better served by . + + + + + Selector Item used to hold the NetMQSocket/Socket and PollEvents + + + + + Select on NetMQSocket or Socket, similar behavior to Socket.Select. + + Items to select on (must not be null) + Number of items in the array to select on + a time-out period, in milliseconds + + The internal select operation failed. + is null. + The socket has been stopped. + + + + Abstract base class for NetMQ's different socket types. + + + Various options are available in this base class, though their affect can vary by socket type. + + + + + Create a new NetMQSocket with the given . + + Type of socket to create + + + + + + Create a new NetMQSocket with the given . + + a SocketBase object to assign to the new socket + + + + This event occurs when at least one message may be received from the socket without blocking. + + + This event is raised when a is added to a running . + + + + + This event occurs when at least one message may be sent via the socket without blocking. + + + This event is raised when a is added to a running . + + + + + Fires when either the or event is set. + + + + + Raise the event. + + + + + Get or set an integer that represents the number of errors that have accumulated. + + + + + Get the of this socket. + + + + + Get the underlying . + + + + + Bind the socket to . + + a string representing the address to bind this socket to + thrown if the socket was already disposed + The socket has been stopped. + The specified address is already in use. + No IO thread was found, or the protocol's listener encountered an + error during initialisation. + + + Binds the specified TCP to an available port, assigned by the operating system. + the chosen port-number + thrown if the socket was already disposed + uses a protocol other than TCP. + The socket has been stopped. + The specified address is already in use. + No IO thread was found, or the protocol's listener errored during + initialisation. + + + + Connect the socket to . + + a string denoting the address to connect this socket to + thrown if the socket was already disposed + The socket has been stopped. + No IO thread was found. + The specified address is already in use. + + + + Disconnect this socket from . + + a string denoting the address to disconnect from + thrown if the socket was already disposed + The socket has been stopped. + Endpoint was not found and cannot be disconnected. + + + + Unbind this socket from . + + a string denoting the address to unbind from + thrown if the socket was already disposed + The socket has been stopped. + Endpoint was not found and cannot be disconnected. + + + Closes this socket, rendering it unusable. Equivalent to calling . + + + + Wait until a message is ready to be received from the socket. + + + + + Wait until a message is ready to be received/sent from this socket or until timeout is reached. + If a message is available, the ReceiveReady/SendReady event is fired. + + a TimeSpan that represents the timeout-period + true if a message was available within the timeout, false otherwise + + + + Poll this socket, which means wait for an event to happen within the given timeout period. + + the poll event(s) to listen for + the timeout period + + PollEvents.None -> no message available + PollEvents.PollIn -> at least one message has arrived + PollEvents.PollOut -> at least one message is ready to send + PollEvents.Error -> an error has occurred + or any combination thereof + + The internal select operation failed. + The socket has been stopped. + + + + Return a value that indicates which bit-flags have a corresponding listener, + with PollError always set, + and PollOut set based upon m_sendReady + and PollIn set based upon m_receiveReady. + + a PollEvents value that denotes which events have a listener + + + + Unless this socket is closed, + based upon the given PollEvents - raise the m_receiveReady event if PollIn is set, + and m_sendReady if PollOut is set. + + what to use as the source of the events + the given PollEvents that dictates when of the two events to raise + + + Attempt to receive a message for the specified amount of time. + A reference to a instance into which the received message + data should be placed. + The maximum amount of time the call should wait for a message before returning. + true if a message was received before elapsed, + otherwise false. + + + + Send a message if one is available within . + + An object with message's data to send. + The maximum length of time to try and send a message. If , no + wait occurs. + Indicate if another frame is expected after this frame + true if a message was sent, otherwise false. + + + + Listen to the given endpoint for SocketEvent events. + + A string denoting the endpoint to monitor + The specific events to report on. Defaults to if omitted. + is null. + cannot be empty or whitespace. + This object is already disposed. + The protocol of is not supported. + The socket has been stopped. + Maximum number of sockets reached. + + + + Get whether a message is waiting to be picked up (true if there is, false if there is none). + + The socket has been stopped. + + + + Get whether a message is waiting to be sent. + + + This is true if at least one message is waiting to be sent, false if there is none. + + The socket has been stopped. + + + + Get the integer-value of the specified . + + a ZmqSocketOption that specifies what to get + an integer that is the value of that option + The socket has been stopped. + This object is already disposed. + + + + Get the (generically-typed) value of the specified . + + a ZmqSocketOption that specifies what to get + an object of the given type, that is the value of that option + The socket has been stopped. + This object is already disposed. + + + + Get the value of the specified ZmqSocketOption. + + a ZmqSocketOption that specifies what to get + a TimeSpan that is the value of that option + The socket has been stopped. + + + + Get the 64-bit integer-value of the specified . + + a ZmqSocketOption that specifies what to get + a long that is the value of that option + The socket has been stopped. + + + + Assign the given integer value to the specified . + + a ZmqSocketOption that specifies what to set + an integer that is the value to set that option to + The socket has been stopped. + This object is already disposed. + + + + Assign the given TimeSpan to the specified . + + a ZmqSocketOption that specifies what to set + a TimeSpan that is the value to set that option to + The socket has been stopped. + + + + Assign the given Object value to the specified . + + a ZmqSocketOption that specifies what to set + an object that is the value to set that option to + The socket has been stopped. + This object is already disposed. + + + Closes this socket, rendering it unusable. Equivalent to calling . + + + Closes this socket, rendering it unusable. Equivalent to calling . + true if releasing managed resources + + + + + + + This subclass of EventArgs contains a NetMQSocket, + and IsReadyToReceive and IsReadyToSend flags to indicate whether ready to receive or send. + + + + + Create a new NetMQSocketEventArgs referencing the given socket. + + the NetMQSocket that this is in reference to + + + + Initialise the ReceiveReady and SendReady flags from the given PollEvents value. + + a PollEvents value that indicates whether the socket is ready to send or receive without blocking + + + + Get the NetMQSocket that this references. + + + + + Get whether at least one message may be received by the socket without blocking. + + + + + Get whether at least one message may be sent by the socket without blocking. + + + + + Class NetMQTimerEventArgs is an EventArgs that contains a reference to a NetMQTimer. + + + + + Create a new NetMQTimerEventArgs that contains a reference to the given NetMQTimer. + + the NetMQTimer to hold a reference to + + + + Get the NetMQTimer that this has a reference to. + + + + + A NetMQTimer instance provides the state-information for a timer function, + which is periodically checked by a Poller or a NetMQBeacon. + + + + + A pre-constructed NetMQTimerEventArgs to use whenever raising the Elapsed event. + + + + + This is the timer-interval in milliseconds. + + + + + This flag dictates whether this timer is currently enabled. + + + + + This event is used to signal when the timer has expired. + + + + + Create a new NetMQTimer with the timer-interval specified by the given TimeSpan. + + a TimeSpan that denotes the timer-interval + + This sets the When property to an initial value of -1, to indicate it no future-time applies as yet. + + + + + Create a new NetMQTimer with the given timer-interval in milliseconds. + + an integer specifying the timer-interval in milliseconds + + This sets the When property to an initial value of -1, to indicate it no future-time applies as yet. + + + + + Get or set the timer-interval, in milliseconds. + + + When setting this, When is set to the future point in time from now at which the interval will expire (or -1 if not Enabled). + + + + + Get or set whether this NetMQTimer is on. + + + When setting this to true, When is set to the future point in time from now at which the interval will expire. + When setting this to false, When is set to -1. + + + + + Get or set the value of the low-precision timestamp (a value in milliseconds) that signals when the timer is to expire, + or -1 if not applicable at this time. + + + + + Enable the timer and reset the interval + + + + + If there are any subscribers - raise the Elapsed event. + + the sender to include within the event's event-args + + + + This static class serves to convert between byte-arrays, and various integer sizes + - all of which assume the byte-data is in Big-endian, or "Network Byte Order". + + + + + Given a byte-array assumed to be in Big-endian order, and an offset into it + - return a 16-bit integer derived from the 2 bytes starting at that offset. + + the byte-array to get the short from + + + + + Given a 16-bit integer, return it as a byte-array in Big-endian order. + + the short to convert + a 2-byte array containing that short's bits + + + + Given a 16-bit integer, and a byte-array buffer and offset, + - write the 2 bytes of that integer into the buffer starting at that offset, in Big-endian order. + + the short to convert into bytes + the byte-array to write the short's bytes into + + + + Given a byte-array assumed to be in Big-endian order, and an offset into it + - return a 32-bit integer derived from the 4 bytes starting at that offset. + + the byte-array to get the integer from + + + + + Given a 32-bit integer, return it as a byte-array in Big-endian order. + + the int to convert + a 4-byte array containing that integer's bits + + + + Given a 32-bit integer, and a byte-array buffer and offset, + - write the 4 bytes of that integer into the buffer starting at that offset, in Big-endian order. + + the integer to convert into bytes + the byte-array to write the integer's bytes into + + + + Given a byte-array assumed to be in Big-endian order, and an offset into it + - return a 64-bit integer derived from the 8 bytes starting at that offset. + + the byte-array to get the Int64 from + + + + + Given a 64-bit integer, return it as a byte-array in Big-endian order. + + The long value to convert from. + The network order presentation of as an 8-byte array. + + + + Given a 64-bit integer, and a byte-array buffer and offset, + - write the 8 bytes of that integer into the buffer starting at that offset, in Big-endian order. + + the long value to convert into bytes + the byte-array to write the long value's bytes into + + + + This static class serves to provide extension methods for IOutgoingSocket. + + + + + Block until the message can be sent. + + + The call blocks until the message can be sent and cannot be interrupted. + Whether the message can be sent depends on the socket type. + + The socket to send the message on. + An object with message's data to send. + Indicate if another frame is expected after this frame + + + + Transmit a byte-array of data over this socket, block until frame is sent. + + the IOutgoingSocket to transmit on + the byte-array of data to send + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + + + + Transmit a byte-array of data over this socket, block until frame is sent. + + the IOutgoingSocket to transmit on + the byte-array of data to send + the number of bytes to send from . + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + + + + Transmit a byte-array of data over this socket, block until frame is sent. + Send more frame, another frame must be sent after this frame. Use to chain Send methods. + + the IOutgoingSocket to transmit on + the byte-array of data to send + a reference to this IOutgoingSocket so that method-calls may be chained together + + + + Transmit a byte-array of data over this socket, block until frame is sent. + Send more frame, another frame must be sent after this frame. Use to chain Send methods. + + the IOutgoingSocket to transmit on + the byte-array of data to send + the number of bytes to send from . + a reference to this IOutgoingSocket so that method-calls may be chained together + + + + Attempt to transmit a single frame on . + If message cannot be sent within , return false. + + the IOutgoingSocket to transmit on + The maximum period of time to try to send a message. + the byte-array of data to send + the number of bytes to send from . + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + true if a message was available, otherwise false. + + + + Attempt to transmit a single frame on . + If message cannot be sent within , return false. + + the IOutgoingSocket to transmit on + The maximum period of time to try to send a message. + the byte-array of data to send + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + true if a message was available, otherwise false. + + + + Attempt to transmit a single frame on . + If message cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + the byte-array of data to send + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + true if a message was available, otherwise false. + + + + Attempt to transmit a single frame on . + If message cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + the byte-array of data to send + the number of bytes to send from . + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + true if a message was available, otherwise false. + + + + Send multiple frames on , blocking until all frames are sent. + + the IOutgoingSocket to transmit on + frames to transmit + + + + Send multiple frames on , blocking until all frames are sent. + + the IOutgoingSocket to transmit on + frames to transmit + + + + Attempt to transmit a multiple frames on . + If frames cannot be sent within , return false. + + the IOutgoingSocket to transmit on + The maximum period of time to try to send a message. + frames to transmit + + + + Attempt to transmit a multiple frames on . + If frames cannot be sent within , return false. + + the IOutgoingSocket to transmit on + The maximum period of time to try to send a message. + frames to transmit + + + + Attempt to transmit a multiple frames on . + If frames cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + frames to transmit + + + + Attempt to transmit a multiple frames on . + If frames cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + frames to transmit + + + + Transmit a string over this socket, block until frame is sent. + + the IOutgoingSocket to transmit on + the string to send + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + + + + Transmit a string over this socket, block until frame is sent. + Send more frame, another frame must be sent after this frame. Use to chain Send methods. + + the IOutgoingSocket to transmit on + the string to send + a reference to this IOutgoingSocket so that method-calls may be chained together + + + + Attempt to transmit a single string frame on . + If message cannot be sent within , return false. + + the IOutgoingSocket to transmit on + The maximum period of time to try to send a message. + the string to send + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + true if a message was available, otherwise false. + + + + Attempt to transmit a single string frame on . + If message cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + the string to send + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + true if a message was available, otherwise false. + + + + Send multiple message on , blocking until all entire message is sent. + + the IOutgoingSocket to transmit on + message to transmit + + + + Attempt to transmit a multiple message on . + If message cannot be sent within , return false. + + the IOutgoingSocket to transmit on + The maximum period of time to try to send a message. + message to transmit + + + + Attempt to transmit a multiple message on . + If frames cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + message to transmit + + + + Transmit an empty frame over this socket, block until frame is sent. + + the IOutgoingSocket to transmit on + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + + + + Transmit an empty frame over this socket, block until frame is sent. + Send more frame, another frame must be sent after this frame. Use to chain Send methods. + + the IOutgoingSocket to transmit on + a reference to this IOutgoingSocket so that method-calls may be chained together + + + + Attempt to transmit an empty frame on . + If message cannot be sent within , return false. + + the IOutgoingSocket to transmit on + The maximum period of time to try to send a message. + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + true if a message was available, otherwise false. + + + + Attempt to transmit an empty frame on . + If message cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + set this flag to true to signal that you will be immediately sending another frame (optional: default is false) + true if a message was available, otherwise false. + + + + Transmit a status-signal over this socket. + + the IOutgoingSocket to transmit on + a byte that contains the status signal to send + + + + Attempt to transmit a status-signal over this socket. + If signal cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + a byte that contains the status signal to send + + + + Transmit a specific status-signal over this socket that indicates OK. + + the IOutgoingSocket to transmit on + + + + Attempt to transmit a specific status-signal over this socket that indicates OK. + If signal cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + + + + Transmit a specific status-signal over this socket that indicates there is an error. + + the IOutgoingSocket to transmit on + + + + Attempt to transmit a specific status-signal over this socket that indicates there is an error. + If signal cannot be sent immediately, return false. + + the IOutgoingSocket to transmit on + + + + This flags enum-type is simply an indication of the direction of the poll-event, + and can be None, PollIn, PollOut, or PollError. + + + + + Extension methods for the enum. + + + + Test whether has the flag set. + + + Test whether has the flag set. + + + Test whether has the flag set. + + + + Forwards messages bidirectionally between two sockets. You can also specify a control socket tn which proxied messages will be sent. + + + This class must be explicitly started by calling . If an external has been specified, + then that call will block until is called. + + If using an external , ensure the front and back end sockets have been added to it. + + Users of this class must call when messages should no longer be proxied. + + + + + Create a new instance of a Proxy (NetMQ.Proxy) + with the given sockets to serve as a front-end, a back-end, and a control socket. + + the socket that messages will be forwarded from + the socket that messages will be forwarded to + this socket will have incoming messages also sent to it - you can set this to null if not needed + this socket will have outgoing messages also sent to it - you can set this to null if not needed + an optional external poller to use within this proxy + + + + Create a new instance of a Proxy (NetMQ.Proxy) + with the given sockets to serve as a front-end, a back-end, and a control socket. + + the socket that messages will be forwarded from + the socket that messages will be forwarded to + this socket will have messages also sent to it - you can set this to null if not needed + an optional external poller to use within this proxy + is not null and either or are not contained within it. + + + + Start proxying messages between the front and back ends. Blocks, unless using an external . + + The proxy has already been started. + + + + Stops the proxy, blocking until the underlying has completed. + + The proxy has not been started. + + + + Provides extension methods for the interface, + via which messages may be received in several ways. + + + + + Block until the next message arrives, then make the message's data available via . + + + The call blocks until the next message arrives, and cannot be interrupted. This a convenient and safe when + you know a message is available, such as for code within a callback. + + The socket to receive from. + An object to receive the message's data into. + + + + Receive a single frame from , blocking until one arrives. + + The socket to receive from. + The content of the received message frame. + + + + Receive a single frame from , blocking until one arrives. + Indicate whether further frames exist via . + + The socket to receive from. + true if another frame of the same message follows, otherwise false. + The content of the received message frame. + + + + Attempt to receive a single frame from . + If no message is immediately available, return false. + + The socket to receive from. + The content of the received message frame, or null if no message was available. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from . + If no message is immediately available, return false. + Indicate whether further frames exist via . + + The socket to receive from. + true if another frame of the same message follows, otherwise false. + The content of the received message frame, or null if no message was available. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + The content of the received message frame, or null if no message was available. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from . + If no message is available within , return false. + Indicate whether further frames exist via . + + The socket to receive from. + true if another frame of the same message follows, otherwise false. + The maximum period of time to wait for a message to become available. + The content of the received message frame, or null if no message was available. + true if a message was available, otherwise false. + + + + Receive all frames of the next message from , blocking until a message arrives. + + The socket to receive from. + Optional initial for the returned . + All frames of a multipart message as a list having one or more items. + + + + Receive all frames of the next message from , blocking until a message arrives. + + The socket to receive from. + Reference to a list for return values. If null a new instance will be assigned, otherwise the provided list will be cleared and populated. + Optional initial for the returned . + + + + Attempt to receive all frames of the next message from . + If no message is immediately available, return false. + + The socket to receive from. + Reference to a list for return values. If null a new instance will be assigned, otherwise the provided list will be cleared and populated. + Optional initial for the returned . + + + + Attempt to receive all frames of the next message from . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + Reference to a list for return values. If null a new instance will be assigned, otherwise the provided list will be cleared and populated. + Optional initial for the returned . + + + + Receive a single frame from , blocking until one arrives, and decode as a string using . + + The socket to receive from. + The content of the received message frame as a string. + + + + Receive a single frame from , blocking until one arrives, and decode as a string using . + Indicate whether further frames exist via . + + The socket to receive from. + true if another frame of the same message follows, otherwise false. + The content of the received message frame. + + + + Receive a single frame from , blocking until one arrives, and decode as a string using . + + The socket to receive from. + The encoding used to convert the frame's data to a string. + The content of the received message frame as a string. + + + + Receive a single frame from , blocking until one arrives, and decode as a string using . + Indicate whether further frames exist via . + + The socket to receive from. + The encoding used to convert the frame's data to a string. + true if another frame of the same message follows, otherwise false. + The content of the received message frame as a string. + + + + Attempt to receive a single frame from , and decode as a string using . + If no message is immediately available, return false. + + The socket to receive from. + The content of the received message frame as a string, or null if no message was available. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from , and decode as a string using . + If no message is immediately available, return false. + + The socket to receive from. + The content of the received message frame as a string, or null if no message was available. + true if another frame of the same message follows, otherwise false. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from , and decode as a string using . + If no message is immediately available, return false. + + The socket to receive from. + The encoding used to convert the frame's data to a string. + The content of the received message frame as a string, or null if no message was available. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from , and decode as a string using . + If no message is immediately available, return false. + + The socket to receive from. + The encoding used to convert the frame's data to a string. + The content of the received message frame as a string, or null if no message was available. + true if another frame of the same message follows, otherwise false. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from , and decode as a string using . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + The content of the received message frame as a string, or null if no message was available. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from , and decode as a string using . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + The content of the received message frame as a string, or null if no message was available. + true if another frame of the same message follows, otherwise false. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from , and decode as a string using . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + The encoding used to convert the frame's data to a string. + The content of the received message frame as a string, or null if no message was available. + true if a message was available, otherwise false. + + + + Attempt to receive a single frame from , and decode as a string using . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + The encoding used to convert the frame's data to a string. + The content of the received message frame as a string, or null if no message was available. + true if another frame of the same message follows, otherwise false. + true if a message was available, otherwise false. + + + + Receive all frames of the next message from , blocking until they arrive, and decode as strings using . + + The socket to receive from. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + The content of the received message frame as a string. + + + + Receive all frames of the next message from , blocking until they arrive, and decode as strings using . + + The socket to receive from. + The encoding used to convert the frame's data to a string. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + + + + Attempt to receive all frames of the next message from , and decode them as strings using . + If no message is immediately available, return false. + + The socket to receive from. + The frames of the received message as strings. Untouched if no message was available. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + true if a message was available, otherwise false. + + + + Attempt to receive all frames of the next message from , and decode them as strings using . + If no message is immediately available, return false. + + The socket to receive from. + The encoding used to convert the frame's data to a string. + The frames of the received message as strings. Untouched if no message was available. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + true if a message was available, otherwise false. + + + + Attempt to receive all frames of the next message from , and decode them as strings using . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + The frames of the received message as strings. Untouched if no message was available. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + true if a message was available, otherwise false. + + + + Attempt to receive all frames of the next message from , and decode them as strings using . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + The encoding used to convert the frame's data to a string. + The frames of the received message as strings. Untouched if no message was available. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + true if a message was available, otherwise false. + + + + Receive all frames of the next message from , blocking until they arrive. + + The socket to receive from. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + The content of the received message frame as a string. + + + + Attempt to receive all frames of the next message from . + If no message is immediately available, return false. + + The socket to receive from. + The received message. Untouched if no message was available. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + true if a message was available, otherwise false. + + + + Attempt to receive all frames of the next message from . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + The received message. Untouched if no message was available. + Specifies the initial capacity of the used + to buffer results. If the number of frames is known, set it here. If more frames arrive than expected, + an extra allocation will occur, but the result will still be correct. + true if a message was available, otherwise false. + + + + Receive frames from , blocking until a valid signal arrives. + + The socket to receive from. + true if the received signal was zero, otherwise false. + + + + Attempt to receive a valid signal from . + If no message is immediately available, return false. + + The socket to receive from. + true if the received signal was zero, otherwise false. If no signal received, false. + true if a valid signal was observed, otherwise false. + + + + Attempt to receive a valid signal from . + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + true if the received signal was zero, otherwise false. If no signal received, false. + true if a valid signal was observed, otherwise false. + + + + Receive a single frame from , blocking until one arrives, then ignore its content. + + The socket to receive from. + + + + Receive a single frame from , blocking until one arrives, then ignore its content. + Indicate whether further frames exist via . + + The socket to receive from. + true if another frame of the same message follows, otherwise false. + + + + Attempt to receive a single frame from , then ignore its content. + If no message is immediately available, return false. + + The socket to receive from. + true if a frame was received and ignored, otherwise false. + + + + Attempt to receive a single frame from , then ignore its content. + If no message is immediately available, return false. + Indicate whether further frames exist via . + + The socket to receive from. + true if another frame of the same message follows, otherwise false. + true if a frame was received and ignored, otherwise false. + + + + Attempt to receive a single frame from , then ignore its content. + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + true if a frame was received and ignored, otherwise false. + + + + Attempt to receive a single frame from , then ignore its content. + If no message is available within , return false. + Indicate whether further frames exist via . + + The socket to receive from. + The maximum period of time to wait for a message to become available. + true if another frame of the same message follows, otherwise false. + true if a frame was received and ignored, otherwise false. + + + + Receive all frames of the next message from , blocking until a message arrives, then ignore their contents. + + The socket to receive from. + + + + Attempt to receive all frames of the next message from , then ignore their contents. + If no message is immediately available, return false. + + The socket to receive from. + true if a frame was received and ignored, otherwise false. + + + + Attempt to receive all frames of the next message from , then ignore their contents. + If no message is available within , return false. + + The socket to receive from. + The maximum period of time to wait for a message to become available. + true if a frame was received and ignored, otherwise false. + + + + The used in string related methods that do + not explicitly provide an encoding parameter. + + + + Indicates an infinite timeout for send and receive operations. + + + + This enum-type specifies socket transport events (TCP and IPC only). + + + + + A SocketOptions is simply a convenient way to access the options of a particular socket. + This class holds a reference to the socket, and it's properties provide a concise way + to access that socket's option values -- instead of calling GetSocketOption/SetSocketOption. + + + + + The NetMQSocket that this SocketOptions is referencing. + + + + + Create a new SocketOptions that references the given NetMQSocket. + + the NetMQSocket for this SocketOptions to hold a reference to + + + + Get or set the I/O-thread affinity. This is a 64-bit value used to specify which threads from the I/O thread-pool + associated with the socket's context shall handle newly-created connections. + 0 means no affinity, meaning that work shall be distributed fairly among all I/O threads. + For non-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2, and so on. + + + + + Get or set unique identity of the socket, from a message-queueing router's perspective. + This is a byte-array of at most 255 bytes. + + + + + Get or set the maximum send or receive data rate for multicast transports on the specified socket. + + + + + Get or set the recovery-interval for multicast transports using the specified socket. + This option determines the maximum time that a receiver can be absent from a multicast group + before unrecoverable data loss will occur. Default is 10,000 ms (10 seconds). + + + + + Get or set the size of the transmit buffer for the specified socket. + + + + + Get or set the size of the receive buffer for the specified socket. + A value of zero means that the OS default is in effect. + + + + + Gets whether the last frame received on the socket had the more flag set or not. + + true if receive more; otherwise, false. + + + + Get or set the linger period for the specified socket, + which determines how long pending messages which have yet to be sent to a peer + shall linger in memory after a socket is closed. + + + If socket created with Context default is -1 if socket created without socket (using new keyword) default is zero. + If context is used this also affects the termination of context, otherwise this affects the exit of the process. + -1: Specifies an infinite linger period. Pending messages shall not be discarded after the socket is closed; + attempting to terminate the socket's context shall block until all pending messages have been sent to a peer. + 0: Specifies no linger period. Pending messages shall be discarded immediately when the socket is closed. + Positive values specify an upper bound for the linger period. Pending messages shall not be discarded after the socket is closed; + attempting to terminate the socket's context shall block until either all pending messages have been sent to a peer, + or the linger period expires, after which any pending messages shall be discarded. + + + + + Get or set the initial reconnection interval for the specified socket. + This is the period to wait between attempts to reconnect disconnected peers + when using connection-oriented transports. The default is 100 ms. + -1 means no reconnection. + + + With ZeroMQ, the reconnection interval may be randomized to prevent reconnection storms + in topologies with a large number of peers per socket. + + + + + Get or set the maximum reconnection interval for the specified socket. + This is the maximum period to shall wait between attempts + to reconnect. On each reconnect attempt, the previous interval shall be doubled + until this maximum period is reached. + The default value of zero means no exponential backoff is performed. + + + This is the maximum period NetMQ shall wait between attempts + to reconnect. On each reconnect attempt, the previous interval shall be doubled + until this maximum period is reached. + This allows for an exponential backoff strategy. + The default value of zero means no exponential backoff is performed + and reconnect interval calculations are only based on ReconnectIvl. + + + + + Get or set the maximum length of the queue of outstanding peer connections + for the specified socket. This only applies to connection-oriented transports. + Default is 100. + + + + + Get or set the upper limit to the size for inbound messages. + If a peer sends a message larger than this it is disconnected. + The default value is -1, which means no limit. + + + + + Get or set the high-water-mark for transmission. + This is a hard limit on the number of messages that are allowed to queue up + before mitigative action is taken. + The default is 1000. + + + + + Get or set the high-water-mark for reception. + This is a hard limit on the number of messages that are allowed to queue up + before mitigative action is taken. + The default is 1000. + + + + + The low-water mark for message transmission. + This is the number of messages that should be processed before transmission is + unblocked (in case it was blocked by reaching high-watermark). The default value is + calculated using relevant high-watermark (HWM): HWM > 2048 ? HWM - 1024 : (HWM + 1) / 2 + + + + + The low-water mark for message reception. + This is the number of messages that should be processed before reception is + unblocked (in case it was blocked by reaching high-watermark). The default value is + calculated using relevant high-watermark (HWM): HWM > 2048 ? HWM - 1024 : (HWM + 1) / 2 + + + + + Get or set the time-to-live (maximum number of hops) that outbound multicast packets + are allowed to propagate. + The default value of 1 means that the multicast packets don't leave the local network. + + + + + Get or set whether the underlying socket is for IPv4 only (not IPv6), + as opposed to one that allows connections with either IPv4 or IPv6. + + + + + Get the last endpoint bound for TCP and IPC transports. + The returned value will be a string in the form of a ZMQ DSN. + + + If the TCP host is ANY, indicated by a *, then the returned address + will be 0.0.0.0 (for IPv4). + + + + + Set the RouterSocket behavior when an unroutable message is encountered. + A value of false is the default and discards the message silently when it cannot be routed. + A value of true causes throw of HostUnreachableException if the message cannot be routed. + + + + + Get or set whether to use TCP keepalive. + + + When Keepalive is enabled, then your socket will periodically send an empty keepalive probe packet + with the ACK flag on. The remote endpoint does not need to support keepalive at all, just TCP/IP. + If you receive a reply to your keepalive probe, you can assume that the connection is still up and running. + This procedure is useful because if the other peers lose their connection (for example, by rebooting) + you will notice that the connection is broken, even if you don't have traffic on it. + If the keepalive probes are not replied to by your peer, you can assert that the connection + cannot be considered valid and then take the corrective action. + + + + + Get or set the keep-alive time - the duration between two keepalive transmissions in idle condition. + The TCP keepalive period is required by socket implementers to be configurable and by default is + set to no less than 2 hours. + + + + + Get or set the TCP keep-alive interval - the duration between two keepalive transmission if no response was received to a previous keepalive probe. + + + By default a keepalive packet is sent every 2 hours or 7,200,000 milliseconds + (TODO: Check these comments concerning default values! jh) + if no other data have been carried over the TCP connection. + If there is no response to a keepalive, it is repeated once every KeepAliveInterval seconds. + The default is one second. + + + + + Get or set the attach-on-connect value. + If set to true, this will delay the attachment of a pipe on connect until + the underlying connection has completed. This will cause the socket + to block if there are no other connections, but will prevent queues + from filling on pipes awaiting connection. + Default is false. + + + + + This applies only to publisher sockets. + Set whether to send all subscription messages upstream, not just unique ones. + The default is false. + + + + + This applies only to publisher sockets. + Set whether to support broadcast functionality + + + + + This applies only to router sockets. + Set whether RouterSocket allows non-zmq tcp connects. + If true, router socket accepts non-zmq tcp connections + + + + + When enabled new router connections with same identity take over old ones + + + + + Get or set the byte-order: big-endian, vs little-endian. + + + + + Get the last PEER allocated routing id + + + + + Controls the maximum datagram size for PGM. + + + + + A DealerSocket is a NetMQSocket, whereby the dealer sends messages in a way intended to achieve load-balancing + - which are received in a fair queueing manner. + + + + + Create a new DealerSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is connect (if endpoint doesn't start with '@' or '>') + var socket = new DealerSocket(">tcp://127.0.0.1:5555,@127.0.0.1:55556"); + + + + Create a new DealerSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + A PairSocket is a NetMQSocket, usually used to synchronize two threads - using only one socket on each side. + + + + + Create a new PairSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is connect (if endpoint doesn't start with '@' or '>') + var socket = new PairSocket(">tcp://127.0.0.1:5555,@127.0.0.1:55556"); + + + + Create a new PairSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + Create and return an inproc pipe where socket1 is bound and socket2 is connected. + + the Bind socket + the Connect socket + + + + Create and return an inproc pipe where socket1 is bound and socket2 is connected. + + the Bind socket + the Connect socket + Method to initialize socket1 before connection + Method to initialize socket2 before connection + + + + Peer socket, the first message is always the identity of the sender + + + + + Create a new PeerSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is connect (if endpoint doesn't start with '@' or '>') + var socket = new PeerSocket(">tcp://127.0.0.1:5555,>127.0.0.1:55556"); + + + + Create a new PeerSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + Connect the peer socket to . + + a string denoting the address to connect this socket to + The peer allocated routing id + thrown if the socket was already disposed + The socket has been stopped. + No IO thread was found. + The specified address is already in use. + + + + A PublisherSocket is a NetMQSocket intended to be used as the Pub in the PubSub pattern. + The intended usage is for publishing messages to all subscribers which are subscribed to a given topic. + + + + + Create a new PublisherSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is bind (if endpoint doesn't start with '@' or '>') + var socket = new PublisherSocket(">tcp://127.0.0.1:5555,>127.0.0.1:55556"); + + + + Create a new PublisherSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + doesn't support sending, so this override throws . + Receive is not supported. + + + + A PullSocket is a NetMQSocket intended to be used as the "Pull" part of the Push-Pull pattern. + This will "pull" messages that have been pushed from the "push" socket. + + + + + Create a new PullSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is bind (if endpoint doesn't start with '@' or '>') + var socket = new PullSocket(">tcp://127.0.0.1:5555,>127.0.0.1:55556"); + + + + Create a new PullSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + A PushSocket is a NetMQSocket intended to be used as the "Push" part of the Push-Pull pattern. + This will "push" messages to be pulled by the "pull" socket. + + + + + Create a new PushSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is connect (if endpoint doesn't start with '@' or '>') + var socket = new PushSocket(">tcp://127.0.0.1:5555,@127.0.0.1:55556"); + + + + Create a new PushSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + doesn't support sending, so this override throws . + Receive is not supported. + + + + A RequestSocket is a NetMQSocket intended to be used as the Request part of the Request-Response pattern. + This is generally paired with a ResponseSocket. + + + + + Create a new RequestSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is connect (if endpoint doesn't start with '@' or '>') + var socket = new RequestSocket(">tcp://127.0.0.1:5555,@127.0.0.1:55556"); + + + + Create a new RequestSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + Try to send request message and return the response as a message, or return null if not successful + + a string denoting the address to connect to + The request message + The number of times to try + The timeout for each request + Report topics: Failure, Retry, Send, Success + the response message, or null if not successful + + + + Try to send request string and return the response string, or return null if not successful + + a string denoting the address to connect to + The request string + The number of times to try + The timeout for each request + Report topics: Failure, Retry, Send, Success + the response message, or null if not successful + + + + A ResponseSocket is a NetMQSocket intended to be used as the Response part of the Request-Response pattern. + This is generally paired with a RequestSocket. + + + + + Create a new ResponseSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is bind (if endpoint doesn't start with '@' or '>') + var socket = new ResponseSocket(">tcp://127.0.0.1:5555,>127.0.0.1:55556"); + + + + Create a new ResponseSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + Router socket, the first message is always the identity of the sender + + + + + Create a new RouterSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is bind (if endpoint doesn't start with '@' or '>') + var socket = new RouterSocket(">tcp://127.0.0.1:5555,>127.0.0.1:55556"); + + + + Create a new RouterSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + This is a NetMQSocket but provides no additional functionality. + You can use it when you need an instance that is a NetMQSocket + but with none of the distinguishing behavior of any of the other socket types. + + + This is provided because NetMQSocket is an abstract class, so you cannot instantiate it directly. + + + + + Create a new StreamSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is connect (if endpoint doesn't start with '@' or '>') + var socket = new StreamSocket(">tcp://127.0.0.1:5555,@127.0.0.1:55556"); + + + + Create a new StreamSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + A SubscriberSocket is a NetMQSocket intended to be used as the "Sub" in the PubSub pattern. + The intended usage is to receive messages from the publisher socket. + + + + + Create a new SubscriberSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is connect (if endpoint doesn't start with '@' or '>') + var socket = new SubscriberSocket(">tcp://127.0.0.1:5555,@127.0.0.1:55556"); + + + + Create a new SubscriberSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + Subscribe this socket to the given 'topic' - which means enable this socket to receive + messages that begin with this string prefix. + You can set topic to an empty string to subscribe to everything. + + this specifies what text-prefix to subscribe to, or may be an empty-string to specify ALL + + + + Subscribe this socket to the given 'topic' - which means enable this socket to receive + messages that begin with this string prefix, using the given Encoding. + You can set topic to an empty string to subscribe to everything. + + this specifies what text-prefix to subscribe to, or may be an empty-string to specify ALL + the character-Encoding to use when converting the topic string internally into a byte-array + + + + Subscribe this socket to the given 'topic' - which means enable this socket to receive + messages that begin with this array of bytes. + + this specifies what byte-array prefix to subscribe to + + + + Subscribe this socket to all topics - which means enable this socket to receive + all messages regardless of what the string prefix is. + This is the same as calling Subscribe with an empty-string for the topic. + + + + + Remove this socket's subscription to the given topic. + + a string denoting which the topic to stop receiving + + + + Remove this socket's subscription to the given topic. + + a string denoting which the topic to stop receiving + the Encoding to use when converting the topic string internally into a byte-array + + + + Remove this socket's subscription to the given topic. + + a byte-array denoting which the topic to stop receiving + + + + An XPublisherSocket is a NetMQSocket intended to be used as the XPub in the XPub/XSub pattern. + The intended usage is for serving, together with a matching XSubscriberSocket, + as a stable intermediary between a PublisherSocket and it's SubscriberSockets. + + + + + Create a new XPublisherSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is bind (if endpoint doesn't start with '@' or '>') + var socket = new XPublisherSocket(">tcp://127.0.0.1:5555,>127.0.0.1:55556"); + + + + Create a new XPublisherSocket based upon the given . + + the SocketBase to create the new socket from + + + + In case of socket set to manual mode will subscribe the last subscriber to the topic + + a string specifying the Topic to subscribe to + + + + In case of socket set to manual mode will subscribe the last subscriber to the topic + + a string specifying the Topic to subscribe to + the character-Encoding to use when converting the topic string internally into a byte-array + + + + In case of socket set to manual mode will subscribe the last subscriber to the topic + + a byte-array specifying the Topic to subscribe to + + + + In case of socket set to manual mode will unsubscribe the last subscriber from a topic + + a string specifying the Topic to unsubscribe from + + + + In case of socket set to manual mode will unsubscribe the last subscriber from a topic + + a string specifying the Topic to unsubscribe from + the character-Encoding to use when converting the topic string internally into a byte-array + + + + In case of socket set to manual mode will unsubscribe the last subscriber from a topic + + a byte-array specifying the Topic to unsubscribe from + + + + Publisher sockets generally send a welcome-message to subscribers to give an indication that they have successful subscribed. + This method clears that message, such that none is sent. + + + + + Publisher sockets send a welcome-message to subscribers to give an indication that they have successful subscribed. + This method is how you set the text of that welcome-message. + + a string denoting the new value for the welcome-message + the character-Encoding to use when converting the topic string internally into a byte-array + + + + Publisher sockets send a welcome-message to subscribers to give an indication that they have successful subscribed. + This method is how you set the text of that welcome-message. The Encoding is assumed to be ASCII. + + a string denoting the new value for the welcome-message + + + + Publisher sockets send a welcome-message to subscribers to give an indication that they have successful subscribed. + This method is how you set the text of that welcome-message. The Encoding is assumed to be ASCII. + + a byte-array denoting the new value for the welcome-message + + + + An XSubscriberSocket is a NetMQSocket intended to be used as the XSub in the XPub/XSub pattern. + The intended usage is for serving, together with a matching XPublisherSocket, + as a stable intermediary between a PublisherSocket and it's SubscriberSockets. + + + + + Create a new XSubscriberSocket and attach socket to zero or more endpoints. + + List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket). + Default action is connect (if endpoint doesn't start with '@' or '>') + var socket = new XSubscriberSocket(">tcp://127.0.0.1:5555,@127.0.0.1:55556"); + + + + Create a new XSubscriberSocket based upon the given SocketBase. + + the SocketBase to create the new socket from + + + + Subscribe this socket to the given 'topic' - which means enable this socket to receive + messages that begin with this string prefix. + You can set topic to an empty string to subscribe to everything. + + this specifies what text-prefix to subscribe to, or may be an empty-string to specify ALL + + + + Subscribe this socket to the given 'topic' - which means enable this socket to receive + messages that begin with this string prefix, using the given Encoding. + You can set topic to an empty string to subscribe to everything. + + this specifies what text-prefix to subscribe to, or may be an empty-string to specify ALL + the Encoding to use when converting the topic string internally into a byte-array + + + + Subscribe this socket to the given 'topic' - which means enable this socket to receive + messages that begin with this array of bytes. + + this specifies what byte-array prefix to subscribe to + + + + Subscribe this socket to all topics - which means enable this socket to receive + all messages regardless of what the string prefix is. + This is the same as calling Subscribe with an empty-string for the topic. + + + + + Remove this socket's subscription to the given topic. + + a string denoting which the topic to stop receiving + + + + Remove this socket's subscription to the given topic. + + a string denoting which the topic to stop receiving + the Encoding to use when converting the topic string internally into a byte-array + + + + Remove this socket's subscription to the given topic. + + a byte-array denoting which the topic to stop receiving + + + + This enum-type is used to specify the basic type of message-queue socket + based upon the intended pattern, such as Pub,Sub, Req,Rep, Dealer,Router, Pull,Push, Xpub,Xsub. + + + + + No socket-type is specified + + + + + This denotes a Pair socket (usually paired with another Pair socket). + + + + + This denotes a Publisher socket (usually paired with a Subscriber socket). + + + + + This denotes a Subscriber socket (usually paired with a Publisher socket). + + + + + This denotes a Request socket (usually paired with a Response socket). + + + + + This denotes a Response socket (usually paired with a Request socket). + + + + + This denotes an Dealer socket. + + + + + This denotes an Router socket. + + + + + This denotes a Pull socket (usually paired with a PUsh socket). + + + + + This denotes a Push socket (usually paired with a Pull socket). + + + + + This denotes an XPublisher socket. + + + + + This denotes an XSubscriber socket. + + + + + This denotes a Stream socket - which is a parent-class to the other socket types. + + + + diff --git a/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.xml.meta b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.xml.meta new file mode 100644 index 00000000..022ee1ba --- /dev/null +++ b/Assets/Plugins/NetMQ.4.0.0.207/lib/net40/NetMQ.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f33afeaad94d0fe7b95dd7a25791e1dc +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/VSCode.meta b/Assets/Plugins/VSCode.meta new file mode 100644 index 00000000..04ee2b5b --- /dev/null +++ b/Assets/Plugins/VSCode.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8102519f4f7bebc3e8b3cf8481eb869a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/VSCode/HOWTO.pdf b/Assets/Plugins/VSCode/HOWTO.pdf new file mode 100644 index 00000000..a94dd3f2 Binary files /dev/null and b/Assets/Plugins/VSCode/HOWTO.pdf differ diff --git a/Assets/Plugins/VSCode/HOWTO.pdf.meta b/Assets/Plugins/VSCode/HOWTO.pdf.meta new file mode 100644 index 00000000..53b138f8 --- /dev/null +++ b/Assets/Plugins/VSCode/HOWTO.pdf.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9519be3d5789b4c5ca14e07b375d6884 +timeCreated: 1444651605 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/VSCode/LICENSE b/Assets/Plugins/VSCode/LICENSE new file mode 100644 index 00000000..13b5259a --- /dev/null +++ b/Assets/Plugins/VSCode/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 dotBunny Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/Assets/Plugins/VSCode/LICENSE.meta b/Assets/Plugins/VSCode/LICENSE.meta new file mode 100644 index 00000000..a24433e2 --- /dev/null +++ b/Assets/Plugins/VSCode/LICENSE.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: edc517f07ba5e4cf9984f8753de7388f +timeCreated: 1444651605 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/VSCode/Plugins.meta b/Assets/Plugins/VSCode/Plugins.meta new file mode 100644 index 00000000..71559cf3 --- /dev/null +++ b/Assets/Plugins/VSCode/Plugins.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0d0aa2ea87e4246f3b7fd58b757ff82c +folderAsset: yes +timeCreated: 1444652904 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/VSCode/Plugins/Editor.meta b/Assets/Plugins/VSCode/Plugins/Editor.meta new file mode 100644 index 00000000..b44f6815 --- /dev/null +++ b/Assets/Plugins/VSCode/Plugins/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 47b6573edc17b4b19b6f06515ff01748 +folderAsset: yes +timeCreated: 1444652910 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/VSCode/Plugins/Editor/VSCode.cs b/Assets/Plugins/VSCode/Plugins/Editor/VSCode.cs new file mode 100644 index 00000000..134c5200 --- /dev/null +++ b/Assets/Plugins/VSCode/Plugins/Editor/VSCode.cs @@ -0,0 +1,1405 @@ +/* + * Unity VSCode Support + * + * Seamless support for Microsoft Visual Studio Code in Unity + * + * Version: + * 2.9 + * + * Authors: + * Matthew Davey + */ +namespace dotBunny.Unity +{ + using System; + using System.IO; + using System.Text.RegularExpressions; + using UnityEditor; + using UnityEngine; + + [InitializeOnLoad] + public static class VSCode + { + /// + /// Current Version Number + /// + public const float Version = 2.9f; + + /// + /// Current Version Code + /// + public const string VersionCode = "-RELEASE"; + + /// + /// Additional File Extensions + /// + public const string FileExtensions = ".ts, .bjs, .javascript, .json, .html, .shader, .template"; + + /// + /// Download URL for Unity Debbuger + /// + public const string UnityDebuggerURL = "https://unity.gallery.vsassets.io/_apis/public/gallery/publisher/unity/extension/unity-debug/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage"; + + // Used to keep Unity from crashing when the editor is quit + static bool alreadyFixedPreferences; + + #region Properties + + /// + /// Path to VSCode executable + public static string CodePath + { + get + { + string current = EditorPrefs.GetString("VSCode_CodePath", ""); + if(current == "" || !VSCodeExists(current)) + { + //Value not set, set to "" or current path is invalid, try to autodetect it + //If autodetect fails, a error will be printed and the default value set + EditorPrefs.SetString("VSCode_CodePath", AutodetectCodePath()); + //If its not installed or the install folder isn't a "normal" one, + //AutodetectCodePath will print a error message to the Unity Console + } + return EditorPrefs.GetString("VSCode_CodePath", current); + } + set + { + EditorPrefs.SetString("VSCode_CodePath", value); + } + } + + /// + /// Get Program Files Path + /// + /// The platforms "Program Files" path. + static string ProgramFilesx86() + { + return Environment.GetEnvironmentVariable("ProgramFiles(x86)"); + } + + /// + /// Get Program Files Path + /// + /// The platforms "Program Files" path. + static string ProgramFiles() + { + return Environment.GetEnvironmentVariable("ProgramFiles"); + } + + + /// + /// Should debug information be displayed in the Unity terminal? + /// + public static bool Debug + { + get + { + return EditorPrefs.GetBool("VSCode_Debug", false); + } + set + { + EditorPrefs.SetBool("VSCode_Debug", value); + } + } + + /// + /// Is the Visual Studio Code Integration Enabled? + /// + /// + /// We do not want to automatically turn it on, for in larger projects not everyone is using VSCode + /// + public static bool Enabled + { + get + { + return EditorPrefs.GetBool("VSCode_Enabled", false); + } + set + { + // When turning the plugin on, we should remove all the previous project files + if (!Enabled && value) + { + ClearProjectFiles(); + } + EditorPrefs.SetBool("VSCode_Enabled", value); + } + } + public static bool UseUnityDebugger + { + get + { + return EditorPrefs.GetBool("VSCode_UseUnityDebugger", false); + } + set + { + if ( value != UseUnityDebugger ) { + + // Set value + EditorPrefs.SetBool("VSCode_UseUnityDebugger", value); + + // Do not write the launch JSON file because the debugger uses its own + if ( value ) { + WriteLaunchFile = false; + } + + // Update launch file + UpdateLaunchFile(); + } + } + } + + /// + /// When opening a project in Unity, should it automatically open in VS Code. + /// + public static bool AutoOpenEnabled + { + get + { + return EditorPrefs.GetBool("VSCode_AutoOpenEnabled", false); + } + set + { + EditorPrefs.SetBool("VSCode_AutoOpenEnabled", value); + } + } + + /// + /// Should the launch.json file be written? + /// + /// + /// Useful to disable if someone has their own custom one rigged up + /// + public static bool WriteLaunchFile + { + get + { + return EditorPrefs.GetBool("VSCode_WriteLaunchFile", true); + } + set + { + EditorPrefs.SetBool("VSCode_WriteLaunchFile", value); + } + } + + /// + /// Should the plugin automatically update itself. + /// + static bool AutomaticUpdates + { + get + { + return EditorPrefs.GetBool("VSCode_AutomaticUpdates", false); + } + set + { + EditorPrefs.SetBool("VSCode_AutomaticUpdates", value); + } + } + + static float GitHubVersion + { + get + { + return EditorPrefs.GetFloat("VSCode_GitHubVersion", Version); + } + set + { + EditorPrefs.SetFloat("VSCode_GitHubVersion", value); + } + } + + /// + /// When was the last time that the plugin was updated? + /// + static DateTime LastUpdate + { + get + { + // Feature creation date. + DateTime lastTime = new DateTime(2015, 10, 8); + + if (EditorPrefs.HasKey("VSCode_LastUpdate")) + { + DateTime.TryParse(EditorPrefs.GetString("VSCode_LastUpdate"), out lastTime); + } + return lastTime; + } + set + { + EditorPrefs.SetString("VSCode_LastUpdate", value.ToString()); + } + } + + /// + /// Quick reference to the VSCode launch settings file + /// + static string LaunchPath + { + get + { + return SettingsFolder + System.IO.Path.DirectorySeparatorChar + "launch.json"; + } + } + + /// + /// The full path to the project + /// + static string ProjectPath + { + get + { + return System.IO.Path.GetDirectoryName(UnityEngine.Application.dataPath); + } + } + + /// + /// Should the script editor be reverted when quiting Unity. + /// + /// + /// Useful for environments where you do not use VSCode for everything. + /// + static bool RevertExternalScriptEditorOnExit + { + get + { + return EditorPrefs.GetBool("VSCode_RevertScriptEditorOnExit", true); + } + set + { + EditorPrefs.SetBool("VSCode_RevertScriptEditorOnExit", value); + } + } + + /// + /// Quick reference to the VSCode settings folder + /// + static string SettingsFolder + { + get + { + return ProjectPath + System.IO.Path.DirectorySeparatorChar + ".vscode"; + } + } + + static string SettingsPath + { + + get + { + return SettingsFolder + System.IO.Path.DirectorySeparatorChar + "settings.json"; + } + } + + static int UpdateTime + { + get + { + return EditorPrefs.GetInt("VSCode_UpdateTime", 7); + } + set + { + EditorPrefs.SetInt("VSCode_UpdateTime", value); + } + } + + #endregion + + /// + /// Integration Constructor + /// + static VSCode() + { + if (Enabled) + { + UpdateUnityPreferences(true); + UpdateLaunchFile(); + + // Add Update Check + DateTime targetDate = LastUpdate.AddDays(UpdateTime); + if (DateTime.Now >= targetDate && AutomaticUpdates) + { + CheckForUpdate(); + } + + // Open VS Code automatically when project is loaded + if (AutoOpenEnabled) + { + CheckForAutoOpen(); + } + + } + + // Event for when script is reloaded + System.AppDomain.CurrentDomain.DomainUnload += System_AppDomain_CurrentDomain_DomainUnload; + } + static void System_AppDomain_CurrentDomain_DomainUnload(object sender, System.EventArgs e) + { + if (Enabled && RevertExternalScriptEditorOnExit) + { + UpdateUnityPreferences(false); + } + } + + + #region Public Members + + /// + /// Force Unity To Write Project File + /// + /// + /// Reflection! + /// + public static void SyncSolution() + { + System.Type T = System.Type.GetType("UnityEditor.SyncVS,UnityEditor"); + System.Reflection.MethodInfo SyncSolution = T.GetMethod("SyncSolution", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + SyncSolution.Invoke(null, null); + + } + + /// + /// Update the solution files so that they work with VS Code + /// + public static void UpdateSolution() + { + // No need to process if we are not enabled + if (!VSCode.Enabled) + { + return; + } + + if (VSCode.Debug) + { + UnityEngine.Debug.Log("[VSCode] Updating Solution & Project Files"); + } + + var currentDirectory = Directory.GetCurrentDirectory(); + var solutionFiles = Directory.GetFiles(currentDirectory, "*.sln"); + var projectFiles = Directory.GetFiles(currentDirectory, "*.csproj"); + + foreach (var filePath in solutionFiles) + { + string content = File.ReadAllText(filePath); + content = ScrubSolutionContent(content); + + File.WriteAllText(filePath, content); + + ScrubFile(filePath); + } + + foreach (var filePath in projectFiles) + { + string content = File.ReadAllText(filePath); + content = ScrubProjectContent(content); + + File.WriteAllText(filePath, content); + + ScrubFile(filePath); + } + + } + + #endregion + + #region Private Members + + /// + /// Try to find automatically the installation of VSCode + /// + static string AutodetectCodePath() + { + string[] possiblePaths = +#if UNITY_EDITOR_OSX + { + "/Applications/Visual Studio Code.app", + "/Applications/Visual Studio Code - Insiders.app" + }; +#elif UNITY_EDITOR_WIN + { + ProgramFiles() + Path.DirectorySeparatorChar + "Microsoft VS Code" + + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar + "code.cmd", + ProgramFiles() + Path.DirectorySeparatorChar + "Microsoft VS Code Insiders" + + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar + "code-insiders.cmd", + ProgramFilesx86() + Path.DirectorySeparatorChar + "Microsoft VS Code" + + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar + "code.cmd", + ProgramFilesx86() + Path.DirectorySeparatorChar + "Microsoft VS Code Insiders" + + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar + "code-insiders.cmd" + }; +#else + { + "/usr/bin/code", + "/usr/bin/code-insiders", + "/bin/code", + "/usr/local/bin/code", + "/var/lib/flatpak/exports/bin/com.visualstudio.code", + "/snap/bin/code", + "/snap/bin/code-insiders" + }; +#endif + for(int i = 0; i < possiblePaths.Length; i++) + { + if(VSCodeExists(possiblePaths[i])) + { + return possiblePaths[i]; + } + } + PrintNotFound(possiblePaths[0]); + return possiblePaths[0]; //returns the default one, printing a warning message 'executable not found' + } + + /// + /// Call VSCode with arguments + /// + static void CallVSCode(string args) + { + System.Diagnostics.Process proc = new System.Diagnostics.Process(); + if(!VSCodeExists(CodePath)) + { + PrintNotFound(CodePath); + return; + } + +#if UNITY_EDITOR_OSX + proc.StartInfo.FileName = "open"; + + // Check the path to see if there is "Insiders" + if (CodePath.Contains("Insiders")) + { + proc.StartInfo.Arguments = " -n -b \"com.microsoft.VSCodeInsiders\" --args " + args.Replace(@"\", @"\\"); + } + else + { + proc.StartInfo.Arguments = " -n -b \"com.microsoft.VSCode\" --args " + args.Replace(@"\", @"\\"); + } + + proc.StartInfo.UseShellExecute = false; +#elif UNITY_EDITOR_WIN + proc.StartInfo.FileName = CodePath; + proc.StartInfo.Arguments = args; + proc.StartInfo.UseShellExecute = false; +#else + proc.StartInfo.FileName = CodePath; + proc.StartInfo.Arguments = args.Replace(@"\", @"\\"); + proc.StartInfo.UseShellExecute = false; +#endif + proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; + proc.StartInfo.CreateNoWindow = true; + proc.StartInfo.RedirectStandardOutput = true; + proc.Start(); + } + + /// + /// Check for Updates with GitHub + /// + static void CheckForUpdate() + { + var fileContent = string.Empty; + + EditorUtility.DisplayProgressBar("VSCode", "Checking for updates ...", 0.5f); + + // Because were not a runtime framework, lets just use the simplest way of doing this + try + { + using (var webClient = new System.Net.WebClient()) + { + fileContent = webClient.DownloadString("https://raw.githubusercontent.com/dotBunny/VSCode/master/Plugins/Editor/VSCode.cs"); + } + } + catch (Exception e) + { + if (Debug) + { + UnityEngine.Debug.Log("[VSCode] " + e.Message); + + } + + // Don't go any further if there is an error + return; + } + finally + { + EditorUtility.ClearProgressBar(); + } + + // Set the last update time + LastUpdate = DateTime.Now; + + // Fix for oddity in downlo + if (fileContent.Substring(0, 2) != "/*") + { + int startPosition = fileContent.IndexOf("/*", StringComparison.CurrentCultureIgnoreCase); + + // Jump over junk characters + fileContent = fileContent.Substring(startPosition); + } + + string[] fileExploded = fileContent.Split('\n'); + if (fileExploded.Length > 7) + { + float github = Version; + if (float.TryParse(fileExploded[6].Replace("*", "").Trim(), out github)) + { + GitHubVersion = github; + } + + + if (github > Version) + { + var GUIDs = AssetDatabase.FindAssets("t:Script VSCode"); + var path = Application.dataPath.Substring(0, Application.dataPath.Length - "/Assets".Length) + System.IO.Path.DirectorySeparatorChar + + AssetDatabase.GUIDToAssetPath(GUIDs[0]).Replace('/', System.IO.Path.DirectorySeparatorChar); + + if (EditorUtility.DisplayDialog("VSCode Update", "A newer version of the VSCode plugin is available, would you like to update your version?", "Yes", "No")) + { + // Always make sure the file is writable + System.IO.FileInfo fileInfo = new System.IO.FileInfo(path); + fileInfo.IsReadOnly = false; + + // Write update file + File.WriteAllText(path, fileContent); + + // Force update on text file + AssetDatabase.ImportAsset(AssetDatabase.GUIDToAssetPath(GUIDs[0]), ImportAssetOptions.ForceUpdate); + } + + } + } + } + + /// + /// Checks whether it should auto-open VSCode + /// + /// + /// VSCode() gets called on Launch and Run, through IntializeOnLoad + /// https://docs.unity3d.com/ScriptReference/InitializeOnLoadAttribute.html + /// To make sure it only opens VSCode when Unity (re)launches (i.e. opens a project), + /// we compare the launch time, which we calculate using EditorApplication.timeSinceStartup. + /// + static void CheckForAutoOpen() + { + double timeInSeconds = (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; + int unityLaunchTimeInSeconds = (int)(timeInSeconds - EditorApplication.timeSinceStartup); + int prevUnityLaunchTime = EditorPrefs.GetInt("VSCode_UnityLaunchTime", 0); + // If launch time has changed, then Unity was re-opened + if (unityLaunchTimeInSeconds > prevUnityLaunchTime) { + // Launch VSCode + VSCode.MenuOpenProject(); + // Save new launch time + EditorPrefs.SetInt("VSCode_UnityLaunchTime", unityLaunchTimeInSeconds); + } + } + + /// + /// Clear out any existing project files and lingering stuff that might cause problems + /// + static void ClearProjectFiles() + { + var currentDirectory = Directory.GetCurrentDirectory(); + var solutionFiles = Directory.GetFiles(currentDirectory, "*.sln"); + var projectFiles = Directory.GetFiles(currentDirectory, "*.csproj"); + var unityProjectFiles = Directory.GetFiles(currentDirectory, "*.unityproj"); + + foreach (string solutionFile in solutionFiles) + { + File.Delete(solutionFile); + } + foreach (string projectFile in projectFiles) + { + File.Delete(projectFile); + } + foreach (string unityProjectFile in unityProjectFiles) + { + File.Delete(unityProjectFile); + } + + // Replace with our clean files (only in Unity 5) +#if !UNITY_4_0 && !UNITY_4_1 && !UNITY_4_2 && !UNITY_4_3 && !UNITY_4_5 && !UNITY_4_6 && !UNITY_4_7 + SyncSolution(); +#endif + } + + /// + /// Force Unity Preferences Window To Read From Settings + /// + static void FixUnityPreferences() + { + // I want that window, please and thank you + System.Type T = System.Type.GetType("UnityEditor.PreferencesWindow,UnityEditor"); + + if (EditorWindow.focusedWindow == null) + return; + + // Only run this when the editor window is visible (cause its what screwed us up) + if (EditorWindow.focusedWindow.GetType() == T) + { + var window = EditorWindow.GetWindow(T, true, "Unity Preferences"); + + + if (window == null) + { + if (Debug) + { + UnityEngine.Debug.Log("[VSCode] No Preferences Window Found (really?)"); + } + return; + } + + var invokerType = window.GetType(); + var invokerMethod = invokerType.GetMethod("ReadPreferences", + System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + + if (invokerMethod != null) + { + invokerMethod.Invoke(window, null); + } + else if (Debug) + { + UnityEngine.Debug.Log("[VSCode] No Reflection Method Found For Preferences"); + } + } + } + + /// + /// Determine what port Unity is listening for on Windows + /// + static int GetDebugPort() + { +#if UNITY_EDITOR_WIN + System.Diagnostics.Process process = new System.Diagnostics.Process(); + process.StartInfo.FileName = "netstat"; + process.StartInfo.Arguments = "-a -n -o -p TCP"; + process.StartInfo.UseShellExecute = false; + process.StartInfo.RedirectStandardOutput = true; + process.Start(); + + string output = process.StandardOutput.ReadToEnd(); + string[] lines = output.Split('\n'); + + process.WaitForExit(); + + foreach (string line in lines) + { + string[] tokens = Regex.Split(line, "\\s+"); + if (tokens.Length > 4) + { + int test = -1; + int.TryParse(tokens[5], out test); + + if (test > 1023) + { + try + { + var p = System.Diagnostics.Process.GetProcessById(test); + if (p.ProcessName == "Unity") + { + return test; + } + } + catch + { + + } + } + } + } +#else + System.Diagnostics.Process process = new System.Diagnostics.Process(); + process.StartInfo.FileName = "lsof"; + process.StartInfo.Arguments = "-c /^Unity$/ -i 4tcp -a"; + process.StartInfo.UseShellExecute = false; + process.StartInfo.RedirectStandardOutput = true; + process.Start(); + + // Not thread safe (yet!) + string output = process.StandardOutput.ReadToEnd(); + string[] lines = output.Split('\n'); + + process.WaitForExit(); + + foreach (string line in lines) + { + int port = -1; + if (line.StartsWith("Unity")) + { + string[] portions = line.Split(new string[] { "TCP *:" }, System.StringSplitOptions.None); + if (portions.Length >= 2) + { + Regex digitsOnly = new Regex(@"[^\d]"); + string cleanPort = digitsOnly.Replace(portions[1], ""); + if (int.TryParse(cleanPort, out port)) + { + if (port > -1) + { + return port; + } + } + } + } + } +#endif + return -1; + } + + /// + /// Manually install the original Unity Debuger + /// + /// + /// This should auto update to the latest. + /// + static void InstallUnityDebugger() + { + EditorUtility.DisplayProgressBar("VSCode", "Downloading Unity Debugger ...", 0.1f); + byte[] fileContent; + + try + { + using (var webClient = new System.Net.WebClient()) + { + fileContent = webClient.DownloadData(UnityDebuggerURL); + } + } + catch (Exception e) + { + if (Debug) + { + UnityEngine.Debug.Log("[VSCode] " + e.Message); + } + // Don't go any further if there is an error + return; + } + finally + { + EditorUtility.ClearProgressBar(); + } + + // Do we have a file to install? + if ( fileContent != null ) { + string fileName = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".vsix"; + File.WriteAllBytes(fileName, fileContent); + + CallVSCode(fileName); + } + + } + + // HACK: This is in until Unity can figure out why MD keeps opening even though a different program is selected. + [MenuItem("Assets/Open C# Project In Code", false, 1000)] + static void MenuOpenProject() + { + // Force the project files to be sync + SyncSolution(); + + // Load Project + CallVSCode("\"" + ProjectPath + "\""); + } + + /// + /// Print a error message to the Unity Console about not finding the code executable + /// + static void PrintNotFound(string path) + { + UnityEngine.Debug.LogError("[VSCode] Code executable in '" + path + "' not found. Check your" + + "Visual Studio Code installation and insert the correct path in the Preferences menu."); + } + + [MenuItem("Assets/Open C# Project In Code", true, 1000)] + static bool ValidateMenuOpenProject() + { + return Enabled; + } + + /// + /// VS Code Integration Preferences Item + /// + /// + /// Contains all 3 toggles: Enable/Disable; Debug On/Off; Writing Launch File On/Off + /// + [PreferenceItem("VSCode")] + static void VSCodePreferencesItem() + { + if (EditorApplication.isCompiling) + { + EditorGUILayout.HelpBox("Please wait for Unity to finish compiling. \nIf the window doesn't refresh, simply click on the window or move it around to cause a repaint to happen.", MessageType.Warning); + return; + } + EditorGUILayout.BeginVertical(); + + var developmentInfo = "Support development of this plugin, follow @reapazor and @dotbunny on Twitter."; + var versionInfo = string.Format("{0:0.00}", Version) + VersionCode + ", GitHub version @ " + string.Format("{0:0.00}", GitHubVersion); + EditorGUILayout.HelpBox(developmentInfo + " --- [ " + versionInfo + " ]", MessageType.None); + + EditorGUI.BeginChangeCheck(); + +// Need the VS Code executable + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("VS Code Path", GUILayout.Width(75)); +#if UNITY_5_3_OR_NEWER + CodePath = EditorGUILayout.DelayedTextField(CodePath, GUILayout.ExpandWidth(true)); +#else + CodePath = EditorGUILayout.TextField(CodePath, GUILayout.ExpandWidth(true)); +#endif + GUI.SetNextControlName("PathSetButton"); + if(GUILayout.Button("...", GUILayout.Height(14), GUILayout.Width(20))) + { + GUI.FocusControl("PathSetButton"); + string path = EditorUtility.OpenFilePanel( "Visual Studio Code Executable", "", "" ); + if( path.Length != 0 && File.Exists(path) || Directory.Exists(path)) + { + CodePath = path; + } + } + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(); + + Enabled = EditorGUILayout.Toggle(new GUIContent("Enable Integration", "Should the integration work its magic for you?"), Enabled); + + UseUnityDebugger = EditorGUILayout.Toggle(new GUIContent("Use Unity Debugger", "Should the integration integrate with Unity's VSCode Extension (must be installed)."), UseUnityDebugger); + + AutoOpenEnabled = EditorGUILayout.Toggle(new GUIContent("Enable Auto Open", "When opening a project in Unity, should it automatically open in VS Code?"), AutoOpenEnabled); + + EditorGUILayout.Space(); + RevertExternalScriptEditorOnExit = EditorGUILayout.Toggle(new GUIContent("Revert Script Editor On Unload", "Should the external script editor setting be reverted to its previous setting on project unload? This is useful if you do not use Code with all your projects."),RevertExternalScriptEditorOnExit); + + Debug = EditorGUILayout.Toggle(new GUIContent("Output Messages To Console", "Should informational messages be sent to Unity's Console?"), Debug); + + WriteLaunchFile = EditorGUILayout.Toggle(new GUIContent("Always Write Launch File", "Always write the launch.json settings when entering play mode?"), WriteLaunchFile); + + EditorGUILayout.Space(); + + AutomaticUpdates = EditorGUILayout.Toggle(new GUIContent("Automatic Updates", "Should the plugin automatically update itself?"), AutomaticUpdates); + + UpdateTime = EditorGUILayout.IntSlider(new GUIContent("Update Timer (Days)", "After how many days should updates be checked for?"), UpdateTime, 1, 31); + + EditorGUILayout.Space(); + EditorGUILayout.Space(); + + if (EditorGUI.EndChangeCheck()) + { + UpdateUnityPreferences(Enabled); + + // TODO: Force Unity To Reload Preferences + // This seems to be a hick up / issue + if (VSCode.Debug) + { + if (Enabled) + { + UnityEngine.Debug.Log("[VSCode] Integration Enabled"); + } + else + { + UnityEngine.Debug.Log("[VSCode] Integration Disabled"); + } + } + } + + if (GUILayout.Button(new GUIContent("Force Update", "Check for updates to the plugin, right NOW!"))) + { + CheckForUpdate(); + EditorGUILayout.EndVertical(); + return; + } + if (GUILayout.Button(new GUIContent("Write Workspace Settings", "Output a default set of workspace settings for VSCode to use, ignoring many different types of files."))) + { + WriteWorkspaceSettings(); + EditorGUILayout.EndVertical(); + return; + } + EditorGUILayout.Space(); + + if (UseUnityDebugger) + { + EditorGUILayout.HelpBox("In order for the \"Use Unity Debuggger\" option to function above, you need to have installed the Unity Debugger Extension for Visual Studio Code.", MessageType.Warning); + if (GUILayout.Button(new GUIContent("Install Unity Debugger", "Install the Unity Debugger Extension into Code"))) + { + InstallUnityDebugger(); + EditorGUILayout.EndVertical(); + return; + } + } + + EditorGUILayout.EndVertical(); + } + + /// + /// Asset Open Callback (from Unity) + /// + /// + /// Called when Unity is about to open an asset. + /// + [UnityEditor.Callbacks.OnOpenAssetAttribute()] + static bool OnOpenedAsset(int instanceID, int line) + { + // bail out if we are not using VSCode + if (!Enabled) + { + return false; + } + + // current path without the asset folder + string appPath = ProjectPath; + + // determine asset that has been double clicked in the project view + UnityEngine.Object selected = EditorUtility.InstanceIDToObject(instanceID); + + // additional file extensions + string selectedFilePath = AssetDatabase.GetAssetPath(selected); + string selectedFileExt = Path.GetExtension(selectedFilePath); + if (selectedFileExt == null) { + selectedFileExt = String.Empty; + } + if (!String.IsNullOrEmpty(selectedFileExt)) { + selectedFileExt = selectedFileExt.ToLower(); + } + + // open supported object types + if (selected.GetType().ToString() == "UnityEditor.MonoScript" || + selected.GetType().ToString() == "UnityEngine.Shader" || + VSCode.FileExtensions.IndexOf(selectedFileExt, StringComparison.OrdinalIgnoreCase) >= 0) + { + string completeFilepath = appPath + Path.DirectorySeparatorChar + AssetDatabase.GetAssetPath(selected); + + string args = null; + if (line == -1) + { + args = "\"" + ProjectPath + "\" \"" + completeFilepath + "\" -r"; + } + else + { + args = "\"" + ProjectPath + "\" -g \"" + completeFilepath + ":" + line.ToString() + "\" -r"; + } + // call 'open' + CallVSCode(args); + + return true; + } + + // Didnt find a code file? let Unity figure it out + return false; + + } + + /// + /// Executed when the Editor's playmode changes allowing for capture of required data + /// +#if UNITY_2017_2_OR_NEWER + static void OnPlaymodeStateChanged(UnityEditor.PlayModeStateChange state) +#else + static void OnPlaymodeStateChanged() +#endif + { + if (UnityEngine.Application.isPlaying && EditorApplication.isPlayingOrWillChangePlaymode) + { + UpdateLaunchFile(); + } + } + + /// + /// Detect when scripts are reloaded and relink playmode detection + /// + [UnityEditor.Callbacks.DidReloadScripts()] + static void OnScriptReload() + { +#if UNITY_2017_2_OR_NEWER + EditorApplication.playModeStateChanged -= OnPlaymodeStateChanged; + EditorApplication.playModeStateChanged += OnPlaymodeStateChanged; +#else + EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged; + EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged; +#endif + } + + /// + /// Remove extra/erroneous lines from a file. + static void ScrubFile(string path) + { + string[] lines = File.ReadAllLines(path); + System.Collections.Generic.List newLines = new System.Collections.Generic.List(); + for (int i = 0; i < lines.Length; i++) + { + // Check Empty + if (string.IsNullOrEmpty(lines[i].Trim()) || lines[i].Trim() == "\t" || lines[i].Trim() == "\t\t") + { + + } + else + { + newLines.Add(lines[i]); + } + } + File.WriteAllLines(path, newLines.ToArray()); + } + + /// + /// Remove extra/erroneous data from project file (content). + /// + static string ScrubProjectContent(string content) + { + if (content.Length == 0) + return ""; + +#if !UNITY_EDITOR_WIN + // Moved to 3.5, 2.0 is legacy. + if (content.IndexOf("v3.5") != -1) + { + content = Regex.Replace(content, "v3.5", "v2.0"); + } +#endif + + string targetPath = "";// "Temp" + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar + "Debug" + Path.DirectorySeparatorChar + ""; //OutputPath + string langVersion = "default"; + + + bool found = true; + int location = 0; + string addedOptions = ""; + int startLocation = -1; + int endLocation = -1; + int endLength = 0; + + while (found) + { + startLocation = -1; + endLocation = -1; + endLength = 0; + addedOptions = ""; + startLocation = content.IndexOf("", startLocation); + endLength = (endLocation - startLocation); + + + if (endLocation == -1) + { + found = false; + continue; + } + else + { + found = true; + location = endLocation; + } + + if (content.Substring(startLocation, endLength).IndexOf("") == -1) + { + addedOptions += "\n\r\t" + targetPath + "\n\r"; + } + + if (content.Substring(startLocation, endLength).IndexOf("") == -1) + { + addedOptions += "\n\r\t" + langVersion + "\n\r"; + } + + if (!string.IsNullOrEmpty(addedOptions)) + { + content = content.Substring(0, endLocation) + addedOptions + content.Substring(endLocation); + } + } + else + { + found = false; + } + } + + return content; + } + + /// + /// Remove extra/erroneous data from solution file (content). + /// + static string ScrubSolutionContent(string content) + { + // Replace Solution Version + content = content.Replace( + "Microsoft Visual Studio Solution File, Format Version 11.00\r\n# Visual Studio 2008\r\n", + "\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 2012"); + + // Remove Solution Properties (Unity Junk) + int startIndex = content.IndexOf("GlobalSection(SolutionProperties) = preSolution"); + if (startIndex != -1) + { + int endIndex = content.IndexOf("EndGlobalSection", startIndex); + content = content.Substring(0, startIndex) + content.Substring(endIndex + 16); + } + + return content; + } + + /// + /// Update Visual Studio Code Launch file + /// + static void UpdateLaunchFile() + { + if (!VSCode.Enabled) + { + return; + } + else if (VSCode.UseUnityDebugger) + { + if (!Directory.Exists(VSCode.SettingsFolder)) + System.IO.Directory.CreateDirectory(VSCode.SettingsFolder); + + // Write out proper formatted JSON (hence no more SimpleJSON here) + string fileContent = "{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": [\n\t\t{\n\t\t\t\"name\": \"Unity Editor\",\n\t\t\t\"type\": \"unity\",\n\t\t\t\"request\": \"launch\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Windows Player\",\n\t\t\t\"type\": \"unity\",\n\t\t\t\"request\": \"launch\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"OSX Player\",\n\t\t\t\"type\": \"unity\",\n\t\t\t\"request\": \"launch\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Linux Player\",\n\t\t\t\"type\": \"unity\",\n\t\t\t\"request\": \"launch\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"iOS Player\",\n\t\t\t\"type\": \"unity\",\n\t\t\t\"request\": \"launch\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Android Player\",\n\t\t\t\"type\": \"unity\",\n\t\t\t\"request\": \"launch\"\n\n\t\t}\n\t]\n}"; + File.WriteAllText(VSCode.LaunchPath, fileContent); + } + else if (VSCode.WriteLaunchFile) + { + int port = GetDebugPort(); + if (port > -1) + { + if (!Directory.Exists(VSCode.SettingsFolder)) + System.IO.Directory.CreateDirectory(VSCode.SettingsFolder); + + // Write out proper formatted JSON (hence no more SimpleJSON here) + string fileContent = "{\n\t\"version\":\"0.2.0\",\n\t\"configurations\":[ \n\t\t{\n\t\t\t\"name\":\"Unity\",\n\t\t\t\"type\":\"mono\",\n\t\t\t\"request\":\"attach\",\n\t\t\t\"address\":\"localhost\",\n\t\t\t\"port\":" + port + "\n\t\t}\n\t]\n}"; + File.WriteAllText(VSCode.LaunchPath, fileContent); + + if (VSCode.Debug) + { + UnityEngine.Debug.Log("[VSCode] Debug Port Found (" + port + ")"); + } + } + else + { + if (VSCode.Debug) + { + UnityEngine.Debug.LogWarning("[VSCode] Unable to determine debug port."); + } + } + } + } + + /// + /// Update Unity Editor Preferences + /// + /// Should we turn on this party! + static void UpdateUnityPreferences(bool enabled) + { + if (enabled) + { + // App + if (EditorPrefs.GetString("kScriptsDefaultApp") != CodePath) + { + EditorPrefs.SetString("VSCode_PreviousApp", EditorPrefs.GetString("kScriptsDefaultApp")); + } + EditorPrefs.SetString("kScriptsDefaultApp", CodePath); + + // Arguments + if (EditorPrefs.GetString("kScriptEditorArgs") != "-r -g `$(File):$(Line)`") + { + EditorPrefs.SetString("VSCode_PreviousArgs", EditorPrefs.GetString("kScriptEditorArgs")); + } + + EditorPrefs.SetString("kScriptEditorArgs", "-r -g `$(File):$(Line)`"); + EditorPrefs.SetString("kScriptEditorArgs" + CodePath, "-r -g `$(File):$(Line)`"); + + + // MonoDevelop Solution + if (EditorPrefs.GetBool("kMonoDevelopSolutionProperties", false)) + { + EditorPrefs.SetBool("VSCode_PreviousMD", true); + } + EditorPrefs.SetBool("kMonoDevelopSolutionProperties", false); + + // Support Unity Proj (JS) + if (EditorPrefs.GetBool("kExternalEditorSupportsUnityProj", false)) + { + EditorPrefs.SetBool("VSCode_PreviousUnityProj", true); + } + EditorPrefs.SetBool("kExternalEditorSupportsUnityProj", false); + + if (!EditorPrefs.GetBool("AllowAttachedDebuggingOfEditor", false)) + { + EditorPrefs.SetBool("VSCode_PreviousAttach", false); + } + EditorPrefs.SetBool("AllowAttachedDebuggingOfEditor", true); + + } + else + { + // Restore previous app + if (!string.IsNullOrEmpty(EditorPrefs.GetString("VSCode_PreviousApp"))) + { + EditorPrefs.SetString("kScriptsDefaultApp", EditorPrefs.GetString("VSCode_PreviousApp")); + } + + // Restore previous args + if (!string.IsNullOrEmpty(EditorPrefs.GetString("VSCode_PreviousArgs"))) + { + EditorPrefs.SetString("kScriptEditorArgs", EditorPrefs.GetString("VSCode_PreviousArgs")); + } + + // Restore MD setting + if (EditorPrefs.GetBool("VSCode_PreviousMD", false)) + { + EditorPrefs.SetBool("kMonoDevelopSolutionProperties", true); + } + + // Restore MD setting + if (EditorPrefs.GetBool("VSCode_PreviousUnityProj", false)) + { + EditorPrefs.SetBool("kExternalEditorSupportsUnityProj", true); + } + + // Always leave editor attaching on, I know, it solves the problem of needing to restart for this + // to actually work + EditorPrefs.SetBool("AllowAttachedDebuggingOfEditor", true); + } + + if (!alreadyFixedPreferences) + { + alreadyFixedPreferences = true; + FixUnityPreferences(); + } + } + + /// + /// Determines if the current path to the code executable is valid or not (exists) + /// + static bool VSCodeExists(string curPath) + { + #if UNITY_EDITOR_OSX + return System.IO.Directory.Exists(curPath); + #else + System.IO.FileInfo code = new System.IO.FileInfo(curPath); + return code.Exists; + #endif + } + + /// + /// Write Default Workspace Settings + /// + static void WriteWorkspaceSettings() + { + if (Debug) + { + UnityEngine.Debug.Log("[VSCode] Workspace Settings Written"); + } + + if (!Directory.Exists(VSCode.SettingsFolder)) + { + System.IO.Directory.CreateDirectory(VSCode.SettingsFolder); + } + + string exclusions = + // Associations + "{\n" + + "\t\"files.associations\":\n" + + "\t{\n" + + "\t\t\"*.bjs\":\"javascript\",\n" + + "\t\t\"*.javascript\":\"javascript\"\n" + + "\t},\n" + + "\t\"files.exclude\":\n" + + "\t{\n" + + // Hidden Files + "\t\t\"**/.DS_Store\":true,\n" + + "\t\t\"**/.git\":true,\n" + + "\t\t\"**/.gitignore\":true,\n" + + "\t\t\"**/.gitattributes\":true,\n" + + "\t\t\"**/.gitmodules\":true,\n" + + "\t\t\"**/.svn\":true,\n" + + + // Compressed Files + "\t\t\"**/*.zip\":true,\n" + + "\t\t\"**/*.gz\":true,\n" + + "\t\t\"**/*.7z\":true,\n" + + + // Project Files + "\t\t\"**/*.booproj\":true,\n" + + "\t\t\"**/*.pidb\":true,\n" + + "\t\t\"**/*.suo\":true,\n" + + "\t\t\"**/*.user\":true,\n" + + "\t\t\"**/*.userprefs\":true,\n" + + "\t\t\"**/*.unityproj\":true,\n" + + "\t\t\"**/*.dll\":true,\n" + + "\t\t\"**/*.exe\":true,\n" + + + // Media Files + "\t\t\"**/*.pdf\":true,\n" + + + // Video + "\t\t\"**/*.mp4\":true,\n" + + + // Audio + "\t\t\"**/*.mid\":true,\n" + + "\t\t\"**/*.midi\":true,\n" + + "\t\t\"**/*.wav\":true,\n" + + "\t\t\"**/*.mp3\":true,\n" + + "\t\t\"**/*.ogg\":true,\n" + + + // Textures + "\t\t\"**/*.gif\":true,\n" + + "\t\t\"**/*.ico\":true,\n" + + "\t\t\"**/*.jpg\":true,\n" + + "\t\t\"**/*.jpeg\":true,\n" + + "\t\t\"**/*.png\":true,\n" + + "\t\t\"**/*.psd\":true,\n" + + "\t\t\"**/*.tga\":true,\n" + + "\t\t\"**/*.tif\":true,\n" + + "\t\t\"**/*.tiff\":true,\n" + + "\t\t\"**/*.hdr\":true,\n" + + "\t\t\"**/*.exr\":true,\n" + + + // Models + "\t\t\"**/*.3ds\":true,\n" + + "\t\t\"**/*.3DS\":true,\n" + + "\t\t\"**/*.fbx\":true,\n" + + "\t\t\"**/*.FBX\":true,\n" + + "\t\t\"**/*.lxo\":true,\n" + + "\t\t\"**/*.LXO\":true,\n" + + "\t\t\"**/*.ma\":true,\n" + + "\t\t\"**/*.MA\":true,\n" + + "\t\t\"**/*.obj\":true,\n" + + "\t\t\"**/*.OBJ\":true,\n" + + + // Unity File Types + "\t\t\"**/*.asset\":true,\n" + + "\t\t\"**/*.cubemap\":true,\n" + + "\t\t\"**/*.flare\":true,\n" + + "\t\t\"**/*.mat\":true,\n" + + "\t\t\"**/*.meta\":true,\n" + + "\t\t\"**/*.prefab\":true,\n" + + "\t\t\"**/*.unity\":true,\n" + + "\t\t\"**/*.anim\":true,\n" + + "\t\t\"**/*.controller\":true,\n" + + + // Folders + "\t\t\"build/\":true,\n" + + "\t\t\"Build/\":true,\n" + + "\t\t\"Library/\":true,\n" + + "\t\t\"library/\":true,\n" + + "\t\t\"obj/\":true,\n" + + "\t\t\"Obj/\":true,\n" + + "\t\t\"ProjectSettings/\":true,\r" + + "\t\t\"temp/\":true,\n" + + "\t\t\"Temp/\":true\n" + + "\t}\n" + + "}"; + + // Dont like the replace but it fixes the issue with the JSON + File.WriteAllText(VSCode.SettingsPath, exclusions); + } + + #endregion + } + + /// + /// VSCode Asset AssetPostprocessor + /// This will ensure any time that the project files are generated the VSCode versions will be made + /// + /// Undocumented Event + public class VSCodeAssetPostprocessor : AssetPostprocessor + { + /// + /// On documented, project generation event callback + /// + private static void OnGeneratedCSProjectFiles() + { + // Force execution of VSCode update + VSCode.UpdateSolution(); + } + } +} diff --git a/Assets/Plugins/VSCode/Plugins/Editor/VSCode.cs.meta b/Assets/Plugins/VSCode/Plugins/Editor/VSCode.cs.meta new file mode 100644 index 00000000..d2c039f0 --- /dev/null +++ b/Assets/Plugins/VSCode/Plugins/Editor/VSCode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c34beeaf0d4cf44c49f1039006a08591 +timeCreated: 1444653497 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/VSCode/README.md b/Assets/Plugins/VSCode/README.md new file mode 100644 index 00000000..3e4df0ce --- /dev/null +++ b/Assets/Plugins/VSCode/README.md @@ -0,0 +1,37 @@ +# VSCode +> Seamless Visual Studio Code Integration in Unity - As seen in the [Visual Studio Code documentation!](https://code.visualstudio.com/Docs/runtimes/unity) + +### Requirements +##### Unity > 4.5 && Unity < 5.5 +I am not sure exactly where in the 4.x cycle some of the features I'm using were introduced, but I'm guessing its around the 4.5+ mark. I've checked with the latest 4.5.0f6 release. Unity has also committed to having full support for Code when Unity 5.5 drops. So at that point all bets are off for the usefulness of this plugin. Like our MonoDevelop.Unity plugin of past, Unity catches up eventually. + +#####Visual Studio Code 0.10.1+ +Get the [latest version](https://code.visualstudio.com), or have a look at the past releases of the VSCode [plugin](https://github.com/dotBunny/VSCode/releases/tag/1.6.5) for support for your version. + +######Mono +A good number of people have needed to install Mono in order for many of the issues with OmniSharp to be resolved. +I would suggest installing the latest package available at the [Mono Project](http://www.mono-project.com/download/). Don't worry it will not mess with Unity. + +### Installation +It is important to make sure that the `VSCode.cs` file is placed under an `Editor` folder in the project. An example of this arrangement would be placing the file in `/Assets/Plugins/Editor/VSCode.cs`. By default it has its own folder structure which does this for you. + +### Unity Asset Store Package +A UAS packaged version of the plugin is [available](http://u3d.as/jmM) for your consumption. + +### Usage +Once the VSCode file is in place, simply navigate your way to the `Unity Preferences` and select `VSCode` and check the `Enable Integration` option. + +That's it! Your ready to go! + +OK, so maybe some people need a little video explaining some of the finer details of how to use the plugin. So I shot a [quick video](https://vimeo.com/dotbunny/vscode) that highlights the ups and the downs (like Unity hanging after debugging sometimes) for people to watch. Please note this video is from a previous version of the plugin where things are in the menu, this has changed since then. + +### Platform Support +I use the plugin every day on a Mac (so it's battle tested there), and occasionally test it on a Windows VM. As for the recently announced Linux support, it should work just like the Mac version. I'll get around to installing the Linux editor sometime in the near future. + +The Windows version of Visual Studio Code currently does not support debugging Mono, and will just throw a warning if you try to do it. The "Code" team is aware of this limitation, and we'll leave it at that. + +### Automatic Update +With version 2.0 of the plugin, I've introduced a feature where it will auto-update itself if allowed. This should make things a lot easier in the future. + +### Support +Please provide feedback through the GitHub [Issue](https://github.com/dotBunny/VSCode/issues) system. diff --git a/Assets/Plugins/VSCode/README.md.meta b/Assets/Plugins/VSCode/README.md.meta new file mode 100644 index 00000000..6f6e8a5e --- /dev/null +++ b/Assets/Plugins/VSCode/README.md.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5a47489a858c74f3ea182d15dec0dd72 +timeCreated: 1444651605 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/WebSocketSharp.1.0.3-rc11.meta b/Assets/Plugins/WebSocketSharp.1.0.3-rc11.meta new file mode 100644 index 00000000..89a6ce86 --- /dev/null +++ b/Assets/Plugins/WebSocketSharp.1.0.3-rc11.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c94065d17a103282f84e94fdfb45d4cd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib.meta b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib.meta new file mode 100644 index 00000000..0fb19c41 --- /dev/null +++ b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e49d29172e0cc81408d3571dd736b276 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.dll b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.dll new file mode 100755 index 00000000..6ec719f7 Binary files /dev/null and b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.dll differ diff --git a/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.dll.meta b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.dll.meta new file mode 100644 index 00000000..823a7bad --- /dev/null +++ b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: f7e94908f55d837a5836fdfd8c3c3d3e +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.xml b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.xml new file mode 100755 index 00000000..9df57dc7 --- /dev/null +++ b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.xml @@ -0,0 +1,7850 @@ + + + + websocket-sharp + + + + + Provides a set of static methods for websocket-sharp. + + + + + Determines whether the specified equals the specified , + and invokes the specified Action<int> delegate at the same time. + + + true if equals ; + otherwise, false. + + + An to compare. + + + A to compare. + + + An Action<int> delegate that references the method(s) called + at the same time as comparing. An parameter to pass to + the method(s) is . + + + + + Gets the absolute path from the specified . + + + A that represents the absolute path if it's successfully found; + otherwise, . + + + A that represents the URI to get the absolute path from. + + + + + Gets the name from the specified that contains a pair of name and + value separated by a separator character. + + + A that represents the name if any; otherwise, null. + + + A that contains a pair of name and value separated by + a separator character. + + + A that represents the separator character. + + + + + Gets the value from the specified that contains a pair of name and + value separated by a separator character. + + + A that represents the value if any; otherwise, null. + + + A that contains a pair of name and value separated by + a separator character. + + + A that represents the separator character. + + + + + Tries to create a for WebSocket with + the specified . + + + true if a is successfully created; otherwise, false. + + + A that represents a WebSocket URL to try. + + + When this method returns, a that represents a WebSocket URL, + or if is invalid. + + + When this method returns, a that represents an error message, + or if is valid. + + + + + Determines whether the specified contains any of characters in + the specified array of . + + + true if contains any of ; + otherwise, false. + + + A to test. + + + An array of that contains characters to find. + + + + + Determines whether the specified contains + the entry with the specified . + + + true if contains the entry with + ; otherwise, false. + + + A to test. + + + A that represents the key of the entry to find. + + + + + Determines whether the specified contains the entry with + the specified both and . + + + true if contains the entry with both + and ; otherwise, false. + + + A to test. + + + A that represents the key of the entry to find. + + + A that represents the value of the entry to find. + + + + + Emits the specified delegate if it isn't . + + + A to emit. + + + An from which emits this . + + + A that contains no event data. + + + + + Emits the specified EventHandler<TEventArgs> delegate if it isn't + . + + + An EventHandler<TEventArgs> to emit. + + + An from which emits this . + + + A TEventArgs that represents the event data. + + + The type of the event data generated by the event. + + + + + Gets the collection of the HTTP cookies from the specified HTTP . + + + A that receives a collection of the HTTP cookies. + + + A that contains a collection of the HTTP headers. + + + true if is a collection of the response headers; + otherwise, false. + + + + + Gets the description of the specified HTTP status . + + + A that represents the description of the HTTP status code. + + + One of enum values, indicates the HTTP status code. + + + + + Gets the description of the specified HTTP status . + + + A that represents the description of the HTTP status code. + + + An that represents the HTTP status code. + + + + + Determines whether the specified is in the allowable range of + the WebSocket close status code. + + + Not allowable ranges are the following: + + + + Numbers in the range 0-999 are not used. + + + + + Numbers greater than 4999 are out of the reserved close status code ranges. + + + + + + true if is in the allowable range of the WebSocket + close status code; otherwise, false. + + + A to test. + + + + + Determines whether the specified is enclosed in the specified + . + + + true if is enclosed in ; + otherwise, false. + + + A to test. + + + A that represents the character to find. + + + + + Determines whether the specified is host (this computer + architecture) byte order. + + + true if is host byte order; otherwise, false. + + + One of the enum values, to test. + + + + + Determines whether the specified represents + a local IP address. + + + This local means NOT REMOTE for the current host. + + + true if represents a local IP address; + otherwise, false. + + + A to test. + + + + + Determines whether the specified is or empty. + + + true if is or empty; + otherwise, false. + + + A to test. + + + + + Determines whether the specified is a predefined scheme. + + + true if is a predefined scheme; otherwise, false. + + + A to test. + + + + + Determines whether the specified is + an HTTP Upgrade request to switch to the specified . + + + true if is an HTTP Upgrade request to switch to + ; otherwise, false. + + + A that represents the HTTP request. + + + A that represents the protocol name. + + + + is . + + + -or- + + + is . + + + + is empty. + + + + + Determines whether the specified is a URI string. + + + true if may be a URI string; otherwise, false. + + + A to test. + + + + + Retrieves a sub-array from the specified . A sub-array starts at + the specified element position in . + + + An array of T that receives a sub-array, or an empty array of T if any problems with + the parameters. + + + An array of T from which to retrieve a sub-array. + + + An that represents the zero-based starting position of + a sub-array in . + + + An that represents the number of elements to retrieve. + + + The type of elements in . + + + + + Retrieves a sub-array from the specified . A sub-array starts at + the specified element position in . + + + An array of T that receives a sub-array, or an empty array of T if any problems with + the parameters. + + + An array of T from which to retrieve a sub-array. + + + A that represents the zero-based starting position of + a sub-array in . + + + A that represents the number of elements to retrieve. + + + The type of elements in . + + + + + Executes the specified delegate times. + + + An is the number of times to execute. + + + An delegate that references the method(s) to execute. + + + + + Executes the specified delegate times. + + + A is the number of times to execute. + + + An delegate that references the method(s) to execute. + + + + + Executes the specified delegate times. + + + A is the number of times to execute. + + + An delegate that references the method(s) to execute. + + + + + Executes the specified delegate times. + + + A is the number of times to execute. + + + An delegate that references the method(s) to execute. + + + + + Executes the specified Action<int> delegate times. + + + An is the number of times to execute. + + + An Action<int> delegate that references the method(s) to execute. + An parameter to pass to the method(s) is the zero-based count of + iteration. + + + + + Executes the specified Action<long> delegate times. + + + A is the number of times to execute. + + + An Action<long> delegate that references the method(s) to execute. + A parameter to pass to the method(s) is the zero-based count of + iteration. + + + + + Executes the specified Action<uint> delegate times. + + + A is the number of times to execute. + + + An Action<uint> delegate that references the method(s) to execute. + A parameter to pass to the method(s) is the zero-based count of + iteration. + + + + + Executes the specified Action<ulong> delegate times. + + + A is the number of times to execute. + + + An Action<ulong> delegate that references the method(s) to execute. + A parameter to pass to this method(s) is the zero-based count of + iteration. + + + + + Converts the specified array of to the specified type data. + + + A T converted from , or a default value of + T if is an empty array of or + if the type of T isn't , , , + , , , , + , , or . + + + An array of to convert. + + + One of the enum values, specifies the byte order of + . + + + The type of the return. The T must be a value type. + + + is . + + + + + Converts the specified to an array of . + + + An array of converted from . + + + A T to convert. + + + One of the enum values, specifies the byte order of the return. + + + The type of . The T must be a value type. + + + + + Converts the order of the specified array of to the host byte order. + + + An array of converted from . + + + An array of to convert. + + + One of the enum values, specifies the byte order of + . + + + is . + + + + + Converts the specified to a that + concatenates the each element of across the specified + . + + + A converted from , + or if is empty. + + + An array of T to convert. + + + A that represents the separator string. + + + The type of elements in . + + + is . + + + + + Converts the specified to a . + + + A converted from , + or if isn't successfully converted. + + + A to convert. + + + + + URL-decodes the specified . + + + A that receives the decoded string, + or the if it's or empty. + + + A to decode. + + + + + URL-encodes the specified . + + + A that receives the encoded string, + or if it's or empty. + + + A to encode. + + + + + Writes and sends the specified data with the specified + . + + + A that represents the HTTP response used to + send the content data. + + + An array of that represents the content data to send. + + + + is . + + + -or- + + + is . + + + + + + Represents the event data for the event. + + + + A event occurs when the receives + a text or binary message, or a ping if the property is + set to true. + + + If you would like to get the message data, you should access the or + property. + + + + + + Gets the message data as a . + + + A that represents the message data, + or if the message data cannot be decoded to a string. + + + + + Gets a value indicating whether the message type is binary. + + + true if the message type is binary; otherwise, false. + + + + + Gets a value indicating whether the message type is ping. + + + true if the message type is ping; otherwise, false. + + + + + Gets a value indicating whether the message type is text. + + + true if the message type is text; otherwise, false. + + + + + Gets the message data as an array of . + + + An array of that represents the message data. + + + + + Gets the message type. + + + , , or . + + + + + Represents the event data for the event. + + + + A event occurs when the WebSocket connection + has been closed. + + + If you would like to get the reason for the close, you should access + the or property. + + + + + + Gets the status code for the close. + + + A that represents the status code for the close if any. + + + + + Gets the reason for the close. + + + A that represents the reason for the close if any. + + + + + Gets a value indicating whether the connection has been closed cleanly. + + + true if the connection has been closed cleanly; otherwise, false. + + + + + Specifies the byte order. + + + + + Specifies Little-endian. + + + + + Specifies Big-endian. + + + + + Represents the event data for the event. + + + + A event occurs when the gets + an error. + + + If you would like to get the error message, you should access + the property. + + + And if the error is due to an exception, you can get the exception by accessing + the property. + + + + + + Gets the exception that caused the error. + + + An instance that represents the cause of the error, + or if the error isn't due to an exception. + + + + + Gets the error message. + + + A that represents the error message. + + + + + Implements the WebSocket interface. + + + The WebSocket class provides a set of methods and properties for two-way communication using + the WebSocket protocol (RFC 6455). + + + + + Represents the empty array of used internally. + + + + + Represents the length used to determine whether the data should be fragmented in sending. + + + + The data will be fragmented if that length is greater than the value of this field. + + + If you would like to change the value, you must set it to a value between 125 and + Int32.MaxValue - 14 inclusive. + + + + + + Represents the random number generator used internally. + + + + + Initializes a new instance of the class with + the specified WebSocket URL and subprotocols. + + + A that represents the WebSocket URL to connect. + + + An array of that contains the WebSocket subprotocols if any. + Each value of must be a token defined in + RFC 2616. + + + is . + + + + is invalid. + + + -or- + + + is invalid. + + + + + + Accepts the WebSocket handshake request. + + + This method isn't available in a client. + + + + + Accepts the WebSocket handshake request asynchronously. + + + + This method doesn't wait for the accept to be complete. + + + This method isn't available in a client. + + + + + + Closes the WebSocket connection, and releases all associated resources. + + + + + Closes the WebSocket connection with the specified , + and releases all associated resources. + + + This method emits a event if isn't in + the allowable range of the close status code. + + + A that represents the status code indicating the reason for the close. + + + + + Closes the WebSocket connection with the specified , + and releases all associated resources. + + + One of the enum values, represents the status code indicating + the reason for the close. + + + + + Closes the WebSocket connection with the specified and + , and releases all associated resources. + + + This method emits a event if isn't in + the allowable range of the close status code or the size of is + greater than 123 bytes. + + + A that represents the status code indicating the reason for the close. + + + A that represents the reason for the close. + + + + + Closes the WebSocket connection with the specified and + , and releases all associated resources. + + + This method emits a event if the size of is + greater than 123 bytes. + + + One of the enum values, represents the status code indicating + the reason for the close. + + + A that represents the reason for the close. + + + + + Closes the WebSocket connection asynchronously, and releases all associated resources. + + + This method doesn't wait for the close to be complete. + + + + + Closes the WebSocket connection asynchronously with the specified , + and releases all associated resources. + + + + This method doesn't wait for the close to be complete. + + + This method emits a event if isn't in + the allowable range of the close status code. + + + + A that represents the status code indicating the reason for the close. + + + + + Closes the WebSocket connection asynchronously with the specified + , and releases all associated resources. + + + This method doesn't wait for the close to be complete. + + + One of the enum values, represents the status code indicating + the reason for the close. + + + + + Closes the WebSocket connection asynchronously with the specified and + , and releases all associated resources. + + + + This method doesn't wait for the close to be complete. + + + This method emits a event if isn't in + the allowable range of the close status code or the size of is + greater than 123 bytes. + + + + A that represents the status code indicating the reason for the close. + + + A that represents the reason for the close. + + + + + Closes the WebSocket connection asynchronously with the specified + and , and releases + all associated resources. + + + + This method doesn't wait for the close to be complete. + + + This method emits a event if the size of + is greater than 123 bytes. + + + + One of the enum values, represents the status code indicating + the reason for the close. + + + A that represents the reason for the close. + + + + + Establishes a WebSocket connection. + + + This method isn't available in a server. + + + + + Establishes a WebSocket connection asynchronously. + + + + This method doesn't wait for the connect to be complete. + + + This method isn't available in a server. + + + + + + Sends a ping using the WebSocket connection. + + + true if the receives a pong to this ping in a time; + otherwise, false. + + + + + Sends a ping with the specified using the WebSocket connection. + + + true if the receives a pong to this ping in a time; + otherwise, false. + + + A that represents the message to send. + + + + + Sends binary using the WebSocket connection. + + + An array of that represents the binary data to send. + + + + + Sends the specified as binary data using the WebSocket connection. + + + A that represents the file to send. + + + + + Sends text using the WebSocket connection. + + + A that represents the text data to send. + + + + + Sends binary asynchronously using the WebSocket connection. + + + This method doesn't wait for the send to be complete. + + + An array of that represents the binary data to send. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sends the specified as binary data asynchronously using + the WebSocket connection. + + + This method doesn't wait for the send to be complete. + + + A that represents the file to send. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sends text asynchronously using the WebSocket connection. + + + This method doesn't wait for the send to be complete. + + + A that represents the text data to send. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sends binary data from the specified asynchronously using + the WebSocket connection. + + + This method doesn't wait for the send to be complete. + + + A from which contains the binary data to send. + + + An that represents the number of bytes to send. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sets an HTTP to send with + the WebSocket handshake request to the server. + + + A that represents the cookie to send. + + + + + Sets a pair of and for + the HTTP authentication (Basic/Digest). + + + A that represents the user name used to authenticate. + + + A that represents the password for + used to authenticate. + + + true if the sends the Basic authentication credentials with + the first handshake request to the server; otherwise, false. + + + + + Sets an HTTP proxy server URL to connect through, and if necessary, + a pair of and for + the proxy server authentication (Basic/Digest). + + + A that represents the proxy server URL to connect through. + + + A that represents the user name used to authenticate. + + + A that represents the password for + used to authenticate. + + + + + Closes the WebSocket connection, and releases all associated resources. + + + This method closes the connection with . + + + + + Gets or sets the compression method used to compress a message on the WebSocket connection. + + + One of the enum values, specifies the compression method + used to compress a message. The default value is . + + + + + Gets the HTTP cookies included in the WebSocket handshake request and response. + + + An + instance that provides an enumerator which supports the iteration over the collection of + the cookies. + + + + + Gets the credentials for the HTTP authentication (Basic/Digest). + + + A that represents the credentials for + the authentication. The default value is . + + + + + Gets or sets a value indicating whether the emits + a event when receives a ping. + + + true if the emits a event + when receives a ping; otherwise, false. The default value is false. + + + + + Gets or sets a value indicating whether the redirects + the handshake request to the new URL located in the handshake response. + + + true if the redirects the handshake request to + the new URL; otherwise, false. The default value is false. + + + + + Gets the WebSocket extensions selected by the server. + + + A that represents the extensions if any. + The default value is . + + + + + Gets a value indicating whether the WebSocket connection is alive. + + + true if the connection is alive; otherwise, false. + + + + + Gets a value indicating whether the WebSocket connection is secure. + + + true if the connection is secure; otherwise, false. + + + + + Gets the logging functions. + + + The default logging level is . If you would like to change it, + you should set this Log.Level property to any of the enum + values. + + + A that provides the logging functions. + + + + + Gets or sets the value of the HTTP Origin header to send with + the WebSocket handshake request to the server. + + + The sends the Origin header if this property has any. + + + + A that represents the value of + the Origin header to send. + The default value is . + + + The Origin header has the following syntax: + <scheme>://<host>[:<port>] + + + + + + Gets the WebSocket subprotocol selected by the server. + + + A that represents the subprotocol if any. + The default value is . + + + + + Gets the state of the WebSocket connection. + + + One of the enum values, indicates the state of the connection. + The default value is . + + + + + Gets or sets the SSL configuration used to authenticate the server and + optionally the client for secure connection. + + + A that represents the configuration used + to authenticate the server and optionally the client for secure connection, + or if the is used in a server. + + + + + Gets the WebSocket URL used to connect, or accepted. + + + A that represents the URL used to connect, or accepted. + + + + + Gets or sets the wait time for the response to the Ping or Close. + + + A that represents the wait time. The default value is the same as + 5 seconds, or 1 second if the is used in a server. + + + + + Occurs when the WebSocket connection has been closed. + + + + + Occurs when the gets an error. + + + + + Occurs when the receives a message. + + + + + Occurs when the WebSocket connection has been established. + + + + + Provides a WebSocket protocol server. + + + The WebSocketServer class can provide multiple WebSocket services. + + + + + Initializes a new instance of the class. + + + An instance initialized by this constructor listens for the incoming connection requests on + port 80. + + + + + Initializes a new instance of the class with + the specified . + + + + An instance initialized by this constructor listens for the incoming connection requests + on . + + + If is 443, that instance provides a secure connection. + + + + An that represents the port number on which to listen. + + + isn't between 1 and 65535 inclusive. + + + + + Initializes a new instance of the class with + the specified WebSocket URL. + + + + An instance initialized by this constructor listens for the incoming connection requests + on the host name and port in . + + + If doesn't include a port, either port 80 or 443 is used on + which to listen. It's determined by the scheme (ws or wss) in . + (Port 80 if the scheme is ws.) + + + + A that represents the WebSocket URL of the server. + + + is . + + + + is empty. + + + -or- + + + is invalid. + + + + + + Initializes a new instance of the class with + the specified and . + + + An instance initialized by this constructor listens for the incoming connection requests on + . + + + An that represents the port number on which to listen. + + + A that indicates providing a secure connection or not. + (true indicates providing a secure connection.) + + + isn't between 1 and 65535 inclusive. + + + + + Initializes a new instance of the class with + the specified and . + + + + An instance initialized by this constructor listens for the incoming connection requests + on and . + + + If is 443, that instance provides a secure connection. + + + + A that represents the local IP address of the server. + + + An that represents the port number on which to listen. + + + is . + + + isn't a local IP address. + + + isn't between 1 and 65535 inclusive. + + + + + Initializes a new instance of the class with + the specified , , + and . + + + An instance initialized by this constructor listens for the incoming connection requests on + and . + + + A that represents the local IP address of the server. + + + An that represents the port number on which to listen. + + + A that indicates providing a secure connection or not. + (true indicates providing a secure connection.) + + + is . + + + isn't a local IP address. + + + isn't between 1 and 65535 inclusive. + + + + + Adds a WebSocket service with the specified behavior, , + and . + + + + This method converts to URL-decoded string, + and removes '/' from tail end of . + + + returns an initialized specified typed + instance. + + + + A that represents the absolute path to the service to add. + + + A Func<T> delegate that references the method used to initialize + a new specified typed instance (a new + instance). + + + The type of the behavior of the service to add. The TBehavior must inherit + the class. + + + + + Adds a WebSocket service with the specified behavior and . + + + This method converts to URL-decoded string, + and removes '/' from tail end of . + + + A that represents the absolute path to the service to add. + + + The type of the behavior of the service to add. The TBehaviorWithNew must inherit + the class, and must have a public parameterless + constructor. + + + + + Removes the WebSocket service with the specified . + + + This method converts to URL-decoded string, + and removes '/' from tail end of . + + + true if the service is successfully found and removed; otherwise, false. + + + A that represents the absolute path to the service to find. + + + + + Starts receiving the WebSocket connection requests. + + + + + Stops receiving the WebSocket connection requests. + + + + + Stops receiving the WebSocket connection requests with + the specified and . + + + A that represents the status code indicating the reason for the stop. + + + A that represents the reason for the stop. + + + + + Stops receiving the WebSocket connection requests with + the specified and . + + + One of the enum values, represents the status code indicating + the reason for the stop. + + + A that represents the reason for the stop. + + + + + Gets the local IP address of the server. + + + A that represents the local IP address of the server. + + + + + Gets or sets the scheme used to authenticate the clients. + + + One of the enum values, + indicates the scheme used to authenticate the clients. The default value is + . + + + + + Gets a value indicating whether the server has started. + + + true if the server has started; otherwise, false. + + + + + Gets a value indicating whether the server provides a secure connection. + + + true if the server provides a secure connection; otherwise, false. + + + + + Gets or sets a value indicating whether the server cleans up + the inactive sessions periodically. + + + true if the server cleans up the inactive sessions every 60 seconds; + otherwise, false. The default value is true. + + + + + Gets the logging functions. + + + The default logging level is . If you would like to change it, + you should set the Log.Level property to any of the enum + values. + + + A that provides the logging functions. + + + + + Gets the port on which to listen for incoming connection requests. + + + An that represents the port number on which to listen. + + + + + Gets or sets the name of the realm associated with the server. + + + If this property is or empty, "SECRET AREA" will be used as + the name of the realm. + + + A that represents the name of the realm. The default value is + . + + + + + Gets or sets a value indicating whether the server is allowed to be bound to + an address that is already in use. + + + If you would like to resolve to wait for socket in TIME_WAIT state, + you should set this property to true. + + + true if the server is allowed to be bound to an address that is already in use; + otherwise, false. The default value is false. + + + + + Gets or sets the SSL configuration used to authenticate the server and + optionally the client for secure connection. + + + A that represents the configuration used to + authenticate the server and optionally the client for secure connection. + + + + + Gets or sets the delegate called to find the credentials for an identity used to + authenticate a client. + + + A Func<, > delegate + that references the method(s) used to find the credentials. The default value is + . + + + + + Gets or sets the wait time for the response to the WebSocket Ping or Close. + + + A that represents the wait time. The default value is + the same as 1 second. + + + + + Gets the access to the WebSocket services provided by the server. + + + A that manages the WebSocket services. + + + + + Specifies the scheme for authentication. + + + + + No authentication is allowed. + + + + + Specifies digest authentication. + + + + + Specifies basic authentication. + + + + + Specifies anonymous authentication. + + + + + Provides a set of methods and properties used to manage an HTTP Cookie. + + + + The Cookie class supports the following cookie formats: + Netscape specification, + RFC 2109, and + RFC 2965 + + + The Cookie class cannot be inherited. + + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified + and . + + + A that represents the Name of the cookie. + + + A that represents the Value of the cookie. + + + + is or empty. + + + - or - + + + contains an invalid character. + + + - or - + + + is . + + + - or - + + + contains a string not enclosed in double quotes + that contains an invalid character. + + + + + + Initializes a new instance of the class with the specified + , , and . + + + A that represents the Name of the cookie. + + + A that represents the Value of the cookie. + + + A that represents the value of the Path attribute of the cookie. + + + + is or empty. + + + - or - + + + contains an invalid character. + + + - or - + + + is . + + + - or - + + + contains a string not enclosed in double quotes + that contains an invalid character. + + + + + + Initializes a new instance of the class with the specified + , , , and + . + + + A that represents the Name of the cookie. + + + A that represents the Value of the cookie. + + + A that represents the value of the Path attribute of the cookie. + + + A that represents the value of the Domain attribute of the cookie. + + + + is or empty. + + + - or - + + + contains an invalid character. + + + - or - + + + is . + + + - or - + + + contains a string not enclosed in double quotes + that contains an invalid character. + + + + + + Determines whether the specified is equal to the current + . + + + An to compare with the current . + + + true if is equal to the current ; + otherwise, false. + + + + + Serves as a hash function for a object. + + + An that represents the hash code for the current . + + + + + Returns a that represents the current . + + + This method returns a to use to send an HTTP Cookie to + an origin server. + + + A that represents the current . + + + + + Gets or sets the value of the Comment attribute of the cookie. + + + A that represents the comment to document intended use of the cookie. + + + + + Gets or sets the value of the CommentURL attribute of the cookie. + + + A that represents the URI that provides the comment to document intended + use of the cookie. + + + + + Gets or sets a value indicating whether the client discards the cookie unconditionally + when the client terminates. + + + true if the client discards the cookie unconditionally when the client terminates; + otherwise, false. The default value is false. + + + + + Gets or sets the value of the Domain attribute of the cookie. + + + A that represents the URI for which the cookie is valid. + + + + + Gets or sets a value indicating whether the cookie has expired. + + + true if the cookie has expired; otherwise, false. + The default value is false. + + + + + Gets or sets the value of the Expires attribute of the cookie. + + + A that represents the date and time at which the cookie expires. + The default value is . + + + + + Gets or sets a value indicating whether non-HTTP APIs can access the cookie. + + + true if non-HTTP APIs cannot access the cookie; otherwise, false. + The default value is false. + + + + + Gets or sets the Name of the cookie. + + + A that represents the Name of the cookie. + + + + The value specified for a set operation is or empty. + + + - or - + + + The value specified for a set operation contains an invalid character. + + + + + + Gets or sets the value of the Path attribute of the cookie. + + + A that represents the subset of URI on the origin server + to which the cookie applies. + + + + + Gets or sets the value of the Port attribute of the cookie. + + + A that represents the list of TCP ports to which the cookie applies. + + + The value specified for a set operation isn't enclosed in double quotes or + couldn't be parsed. + + + + + Gets or sets a value indicating whether the security level of the cookie is secure. + + + When this property is true, the cookie may be included in the HTTP request + only if the request is transmitted over the HTTPS. + + + true if the security level of the cookie is secure; otherwise, false. + The default value is false. + + + + + Gets the time when the cookie was issued. + + + A that represents the time when the cookie was issued. + + + + + Gets or sets the Value of the cookie. + + + A that represents the Value of the cookie. + + + + The value specified for a set operation is . + + + - or - + + + The value specified for a set operation contains a string not enclosed in double quotes + that contains an invalid character. + + + + + + Gets or sets the value of the Version attribute of the cookie. + + + An that represents the version of the HTTP state management + to which the cookie conforms. + + + The value specified for a set operation isn't 0 or 1. + + + + + Provides a collection container for instances of the class. + + + + + Initializes a new instance of the class. + + + + + Adds the specified to the collection. + + + A to add. + + + is . + + + + + Adds the specified to the collection. + + + A that contains the cookies to add. + + + is . + + + + + Copies the elements of the collection to the specified , starting at + the specified in the . + + + An that represents the destination of the elements copied from + the collection. + + + An that represents the zero-based index in + at which copying begins. + + + is . + + + is less than zero. + + + + is multidimensional. + + + -or- + + + The number of elements in the collection is greater than the available space from + to the end of the destination . + + + + The elements in the collection cannot be cast automatically to the type of the destination + . + + + + + Copies the elements of the collection to the specified array of , + starting at the specified in the . + + + An array of that represents the destination of the elements + copied from the collection. + + + An that represents the zero-based index in + at which copying begins. + + + is . + + + is less than zero. + + + The number of elements in the collection is greater than the available space from + to the end of the destination . + + + + + Gets the enumerator used to iterate through the collection. + + + An instance used to iterate through the collection. + + + + + Gets the number of cookies in the collection. + + + An that represents the number of cookies in the collection. + + + + + Gets a value indicating whether the collection is read-only. + + + true if the collection is read-only; otherwise, false. + The default value is true. + + + + + Gets a value indicating whether the access to the collection is thread safe. + + + true if the access to the collection is thread safe; otherwise, false. + The default value is false. + + + + + Gets the at the specified from + the collection. + + + A at the specified in the collection. + + + An that represents the zero-based index of the + to find. + + + is out of allowable range of indexes for the collection. + + + + + Gets the with the specified from + the collection. + + + A with the specified in the collection. + + + A that represents the name of the to find. + + + is . + + + + + Gets an object used to synchronize access to the collection. + + + An used to synchronize access to the collection. + + + + + The exception that is thrown when a gets an error. + + + + + Initializes a new instance of the class from + the specified and . + + + A that contains the serialized object data. + + + A that specifies the source for the deserialization. + + + + + Initializes a new instance of the class. + + + + + Populates the specified with the data needed to serialize + the current . + + + A that holds the serialized object data. + + + A that specifies the destination for the serialization. + + + + + Populates the specified with the data needed to serialize + the current . + + + A that holds the serialized object data. + + + A that specifies the destination for the serialization. + + + + + Provides a simple, programmatically controlled HTTP listener. + + + + + Initializes a new instance of the class. + + + + + Shuts down the listener immediately. + + + + + Begins getting an incoming request asynchronously. + + + This asynchronous operation must be completed by calling the EndGetContext method. + Typically, the method is invoked by the delegate. + + + An that represents the status of the asynchronous operation. + + + An delegate that references the method to invoke when + the asynchronous operation completes. + + + An that represents a user defined object to pass to + the delegate. + + + + This listener has no URI prefix on which listens. + + + -or- + + + This listener hasn't been started, or is currently stopped. + + + + This listener has been closed. + + + + + Shuts down the listener. + + + + + Ends an asynchronous operation to get an incoming request. + + + This method completes an asynchronous operation started by calling + the BeginGetContext method. + + + A that represents a request. + + + An obtained by calling the BeginGetContext method. + + + is . + + + wasn't obtained by calling the BeginGetContext method. + + + This method was already called for the specified . + + + This listener has been closed. + + + + + Gets an incoming request. + + + This method waits for an incoming request, and returns when a request is received. + + + A that represents a request. + + + + This listener has no URI prefix on which listens. + + + -or- + + + This listener hasn't been started, or is currently stopped. + + + + This listener has been closed. + + + + + Starts receiving incoming requests. + + + This listener has been closed. + + + + + Stops receiving incoming requests. + + + This listener has been closed. + + + + + Releases all resources used by the listener. + + + + + Gets or sets the scheme used to authenticate the clients. + + + One of the enum values, + represents the scheme used to authenticate the clients. The default value is + . + + + This listener has been closed. + + + + + Gets or sets the delegate called to select the scheme used to authenticate the clients. + + + If you set this property, the listener uses the authentication scheme selected by + the delegate for each request. Or if you don't set, the listener uses the value of + the property as the authentication + scheme for all requests. + + + A Func<, > + delegate that references the method used to select an authentication scheme. The default + value is . + + + This listener has been closed. + + + + + Gets or sets the path to the folder in which stores the certificate files used to + authenticate the server on the secure connection. + + + + This property represents the path to the folder in which stores the certificate files + associated with each port number of added URI prefixes. A set of the certificate files + is a pair of the 'port number'.cer (DER) and 'port number'.key + (DER, RSA Private Key). + + + If this property is or empty, the result of + System.Environment.GetFolderPath + () is used as the default path. + + + + A that represents the path to the folder in which stores + the certificate files. The default value is . + + + This listener has been closed. + + + + + Gets or sets a value indicating whether the listener returns exceptions that occur when + sending the response to the client. + + + true if the listener shouldn't return those exceptions; otherwise, false. + The default value is false. + + + This listener has been closed. + + + + + Gets a value indicating whether the listener has been started. + + + true if the listener has been started; otherwise, false. + + + + + Gets a value indicating whether the listener can be used with the current operating system. + + + true. + + + + + Gets the logging functions. + + + The default logging level is . If you would like to change it, + you should set the Log.Level property to any of the enum + values. + + + A that provides the logging functions. + + + + + Gets the URI prefixes handled by the listener. + + + A that contains the URI prefixes. + + + This listener has been closed. + + + + + Gets or sets the name of the realm associated with the listener. + + + If this property is or empty, "SECRET AREA" will be used as + the name of the realm. + + + A that represents the name of the realm. The default value is + . + + + This listener has been closed. + + + + + Gets or sets the SSL configuration used to authenticate the server and + optionally the client for secure connection. + + + A that represents the configuration used to + authenticate the server and optionally the client for secure connection. + + + This listener has been closed. + + + + + Gets or sets a value indicating whether, when NTLM authentication is used, + the authentication information of first request is used to authenticate + additional requests on the same connection. + + + This property isn't currently supported and always throws + a . + + + true if the authentication information of first request is used; + otherwise, false. + + + Any use of this property. + + + + + Gets or sets the delegate called to find the credentials for an identity used to + authenticate a client. + + + A Func<, > delegate + that references the method used to find the credentials. The default value is + . + + + This listener has been closed. + + + + + Provides the access to the HTTP request and response objects used by + the . + + + This class cannot be inherited. + + + + + Accepts a WebSocket handshake request. + + + A that represents + the WebSocket handshake request. + + + A that represents the subprotocol supported on + this WebSocket connection. + + + + is empty. + + + -or- + + + contains an invalid character. + + + + This method has already been called. + + + + + Gets the HTTP request object that represents a client request. + + + A that represents the client request. + + + + + Gets the HTTP response object used to send a response to the client. + + + A that represents a response to the client request. + + + + + Gets the client information (identity, authentication, and security roles). + + + A instance that represents the client information. + + + + + The exception that is thrown when a gets an error + processing an HTTP request. + + + + + Initializes a new instance of the class from + the specified and . + + + A that contains the serialized object data. + + + A that specifies the source for the deserialization. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with the specified . + + + An that identifies the error. + + + + + Initializes a new instance of the class + with the specified and . + + + An that identifies the error. + + + A that describes the error. + + + + + Gets the error code that identifies the error that occurred. + + + An that identifies the error. + + + + + Provides the collection used to store the URI prefixes for the . + + + The responds to the request which has a requested URI that + the prefixes most closely match. + + + + + Adds the specified to the collection. + + + A that represents the URI prefix to add. The prefix must be + a well-formed URI prefix with http or https scheme, and must end with a '/'. + + + is . + + + is invalid. + + + The associated with this collection is closed. + + + + + Removes all URI prefixes from the collection. + + + The associated with this collection is closed. + + + + + Returns a value indicating whether the collection contains the specified + . + + + true if the collection contains ; + otherwise, false. + + + A that represents the URI prefix to test. + + + is . + + + The associated with this collection is closed. + + + + + Copies the contents of the collection to the specified . + + + An that receives the URI prefix strings in the collection. + + + An that represents the zero-based index in + at which copying begins. + + + The associated with this collection is closed. + + + + + Copies the contents of the collection to the specified array of . + + + An array of that receives the URI prefix strings in the collection. + + + An that represents the zero-based index in + at which copying begins. + + + The associated with this collection is closed. + + + + + Gets the enumerator used to iterate through the . + + + An instance used to iterate + through the collection. + + + + + Removes the specified from the collection. + + + true if is successfully found and removed; + otherwise, false. + + + A that represents the URI prefix to remove. + + + is . + + + The associated with this collection is closed. + + + + + Gets the enumerator used to iterate through the . + + + An instance used to iterate through the collection. + + + + + Gets the number of prefixes in the collection. + + + An that represents the number of prefixes. + + + + + Gets a value indicating whether the access to the collection is read-only. + + + Always returns false. + + + + + Gets a value indicating whether the access to the collection is synchronized. + + + Always returns false. + + + + + Provides the access to a request to the . + + + The HttpListenerRequest class cannot be inherited. + + + + + Begins getting the client's X.509 v.3 certificate asynchronously. + + + This asynchronous operation must be completed by calling + the method. Typically, + that method is invoked by the delegate. + + + An that contains the status of the asynchronous operation. + + + An delegate that references the method(s) called when + the asynchronous operation completes. + + + An that contains a user defined object to pass to + the delegate. + + + This method isn't implemented. + + + + + Ends an asynchronous operation to get the client's X.509 v.3 certificate. + + + This method completes an asynchronous operation started by calling + the method. + + + A that contains the client's X.509 v.3 certificate. + + + An obtained by calling + the method. + + + This method isn't implemented. + + + + + Gets the client's X.509 v.3 certificate. + + + A that contains the client's X.509 v.3 certificate. + + + This method isn't implemented. + + + + + Returns a that represents + the current . + + + A that represents the current . + + + + + Gets the media types which are acceptable for the response. + + + An array of that contains the media type names in + the Accept request-header, or if the request didn't include + the Accept header. + + + + + Gets an error code that identifies a problem with the client's certificate. + + + Always returns 0. + + + + + Gets the encoding for the entity body data included in the request. + + + A that represents the encoding for the entity body data, + or if the request didn't include the information about + the encoding. + + + + + Gets the number of bytes in the entity body data included in the request. + + + A that represents the value of the Content-Length entity-header, + or -1 if the value isn't known. + + + + + Gets the media type of the entity body included in the request. + + + A that represents the value of the Content-Type entity-header. + + + + + Gets the cookies included in the request. + + + A that contains the cookies included in the request. + + + + + Gets a value indicating whether the request has the entity body. + + + true if the request has the entity body; otherwise, false. + + + + + Gets the HTTP headers used in the request. + + + A that contains the HTTP headers used in the request. + + + + + Gets the HTTP method used in the request. + + + A that represents the HTTP method used in the request. + + + + + Gets a that contains the entity body data included in the request. + + + A that contains the entity body data included in the request. + + + + + Gets a value indicating whether the client that sent the request is authenticated. + + + true if the client is authenticated; otherwise, false. + + + + + Gets a value indicating whether the request is sent from the local computer. + + + true if the request is sent from the local computer; otherwise, false. + + + + + Gets a value indicating whether the HTTP connection is secured using the SSL protocol. + + + true if the HTTP connection is secured; otherwise, false. + + + + + Gets a value indicating whether the request is a WebSocket connection request. + + + true if the request is a WebSocket connection request; otherwise, false. + + + + + Gets a value indicating whether the client requests a persistent connection. + + + true if the client requests a persistent connection; otherwise, false. + + + + + Gets the server endpoint as an IP address and a port number. + + + A that represents the server endpoint. + + + + + Gets the HTTP version used in the request. + + + A that represents the HTTP version used in the request. + + + + + Gets the query string included in the request. + + + A that contains the query string parameters. + + + + + Gets the raw URL (without the scheme, host, and port) requested by the client. + + + A that represents the raw URL requested by the client. + + + + + Gets the client endpoint as an IP address and a port number. + + + A that represents the client endpoint. + + + + + Gets the request identifier of a incoming HTTP request. + + + A that represents the identifier of a request. + + + + + Gets the URL requested by the client. + + + A that represents the URL requested by the client. + + + + + Gets the URL of the resource from which the requested URL was obtained. + + + A that represents the value of the Referer request-header, + or if the request didn't include an Referer header. + + + + + Gets the information about the user agent originating the request. + + + A that represents the value of the User-Agent request-header. + + + + + Gets the server endpoint as an IP address and a port number. + + + A that represents the server endpoint. + + + + + Gets the internet host name and port number (if present) specified by the client. + + + A that represents the value of the Host request-header. + + + + + Gets the natural languages which are preferred for the response. + + + An array of that contains the natural language names in + the Accept-Language request-header, or if the request + didn't include an Accept-Language header. + + + + + Provides the access to a response to a request received by the . + + + The HttpListenerResponse class cannot be inherited. + + + + + Closes the connection to the client without returning a response. + + + + + Adds an HTTP header with the specified and + to the headers for the response. + + + A that represents the name of the header to add. + + + A that represents the value of the header to add. + + + is or empty. + + + + or contains invalid characters. + + + -or- + + + is a restricted header name. + + + + The length of is greater than 65,535 characters. + + + The header cannot be allowed to add to the current headers. + + + + + Appends the specified to the cookies sent with the response. + + + A to append. + + + is . + + + + + Appends a to the specified HTTP header sent with the response. + + + A that represents the name of the header to append + to. + + + A that represents the value to append to the header. + + + is or empty. + + + + or contains invalid characters. + + + -or- + + + is a restricted header name. + + + + The length of is greater than 65,535 characters. + + + The current headers cannot allow the header to append a value. + + + + + Returns the response to the client and releases the resources used by + this instance. + + + + + Returns the response with the specified array of to the client and + releases the resources used by this instance. + + + An array of that contains the response entity body data. + + + true if this method blocks execution while flushing the stream to the client; + otherwise, false. + + + is . + + + This object is closed. + + + + + Copies some properties from the specified to + this response. + + + A to copy. + + + is . + + + + + Configures the response to redirect the client's request to + the specified . + + + This method sets the property to + , the property to + 302, and the property to + "Found". + + + A that represents the URL to redirect the client's request to. + + + is . + + + isn't an absolute URL. + + + The response has already been sent. + + + This object is closed. + + + + + Adds or updates a in the cookies sent with the response. + + + A to set. + + + is . + + + already exists in the cookies and couldn't be replaced. + + + + + Releases all resources used by the . + + + + + Gets or sets the encoding for the entity body data included in the response. + + + A that represents the encoding for the entity body data, + or if no encoding is specified. + + + This object is closed. + + + + + Gets or sets the number of bytes in the entity body data included in the response. + + + A that represents the value of the Content-Length entity-header. + + + The value specified for a set operation is less than zero. + + + The response has already been sent. + + + This object is closed. + + + + + Gets or sets the media type of the entity body included in the response. + + + A that represents the media type of the entity body, + or if no media type is specified. This value is + used for the value of the Content-Type entity-header. + + + The value specified for a set operation is empty. + + + This object is closed. + + + + + Gets or sets the cookies sent with the response. + + + A that contains the cookies sent with the response. + + + + + Gets or sets the HTTP headers sent to the client. + + + A that contains the headers sent to the client. + + + The value specified for a set operation isn't valid for a response. + + + + + Gets or sets a value indicating whether the server requests a persistent connection. + + + true if the server requests a persistent connection; otherwise, false. + The default value is true. + + + The response has already been sent. + + + This object is closed. + + + + + Gets a to use to write the entity body data. + + + A to use to write the entity body data. + + + This object is closed. + + + + + Gets or sets the HTTP version used in the response. + + + A that represents the version used in the response. + + + The value specified for a set operation is . + + + The value specified for a set operation doesn't have its Major property set to 1 or + doesn't have its Minor property set to either 0 or 1. + + + The response has already been sent. + + + This object is closed. + + + + + Gets or sets the URL to which the client is redirected to locate a requested resource. + + + A that represents the value of the Location response-header, + or if no redirect location is specified. + + + The value specified for a set operation isn't an absolute URL. + + + This object is closed. + + + + + Gets or sets a value indicating whether the response uses the chunked transfer encoding. + + + true if the response uses the chunked transfer encoding; + otherwise, false. The default value is false. + + + The response has already been sent. + + + This object is closed. + + + + + Gets or sets the HTTP status code returned to the client. + + + An that represents the status code for the response to + the request. The default value is same as . + + + The response has already been sent. + + + This object is closed. + + + The value specified for a set operation is invalid. Valid values are + between 100 and 999 inclusive. + + + + + Gets or sets the description of the HTTP status code returned to the client. + + + A that represents the description of the status code. The default + value is the RFC 2616 + description for the property value, + or if an RFC 2616 description doesn't exist. + + + The value specified for a set operation contains invalid characters. + + + The response has already been sent. + + + This object is closed. + + + + + Decodes an HTML-encoded and returns the decoded . + + + A that represents the decoded string. + + + A to decode. + + + + + Decodes an HTML-encoded and sends the decoded + to the specified . + + + A to decode. + + + A that receives the decoded string. + + + + + HTML-encodes a and returns the encoded . + + + A that represents the encoded string. + + + A to encode. + + + + + HTML-encodes a and sends the encoded + to the specified . + + + A to encode. + + + A that receives the encoded string. + + + + + Provides a collection of the HTTP headers associated with a request or response. + + + + + Initializes a new instance of the class from + the specified and . + + + A that contains the serialized object data. + + + A that specifies the source for the deserialization. + + + is . + + + An element with the specified name isn't found in . + + + + + Initializes a new instance of the class. + + + + + Adds a header to the collection without checking if the header is on + the restricted header list. + + + A that represents the name of the header to add. + + + A that represents the value of the header to add. + + + is or empty. + + + or contains invalid characters. + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the . + + + + + Adds the specified to the collection. + + + A that represents the header with the name and value separated by + a colon (':'). + + + is , empty, or the name part of + is empty. + + + + doesn't contain a colon. + + + -or- + + + is a restricted header. + + + -or- + + + The name or value part of contains invalid characters. + + + + The length of the value part of is greater than 65,535 characters. + + + The current instance doesn't allow + the . + + + + + Adds the specified request with + the specified to the collection. + + + One of the enum values, represents + the request header to add. + + + A that represents the value of the header to add. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the request . + + + + + Adds the specified response with + the specified to the collection. + + + One of the enum values, represents + the response header to add. + + + A that represents the value of the header to add. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the response . + + + + + Adds a header with the specified and + to the collection. + + + A that represents the name of the header to add. + + + A that represents the value of the header to add. + + + is or empty. + + + + or contains invalid characters. + + + -or- + + + is a restricted header name. + + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the header . + + + + + Removes all headers from the collection. + + + + + Get the value of the header at the specified in the collection. + + + A that receives the value of the header. + + + An that represents the zero-based index of the header to find. + + + is out of allowable range of indexes for the collection. + + + + + Get the value of the header with the specified in the collection. + + + A that receives the value of the header if found; + otherwise, . + + + A that represents the name of the header to find. + + + + + Gets the enumerator used to iterate through the collection. + + + An instance used to iterate through the collection. + + + + + Get the name of the header at the specified in the collection. + + + A that receives the header name. + + + An that represents the zero-based index of the header to find. + + + is out of allowable range of indexes for the collection. + + + + + Gets an array of header values stored in the specified position of + the collection. + + + An array of that receives the header values if found; + otherwise, . + + + An that represents the zero-based index of the header to find. + + + is out of allowable range of indexes for the collection. + + + + + Gets an array of header values stored in the specified . + + + An array of that receives the header values if found; + otherwise, . + + + A that represents the name of the header to find. + + + + + Populates the specified with the data needed to serialize + the . + + + A that holds the serialized object data. + + + A that specifies the destination for the serialization. + + + is . + + + + + Determines whether the specified header can be set for the request. + + + true if the header is restricted; otherwise, false. + + + A that represents the name of the header to test. + + + is or empty. + + + contains invalid characters. + + + + + Determines whether the specified header can be set for the request or the response. + + + true if the header is restricted; otherwise, false. + + + A that represents the name of the header to test. + + + true if does the test for the response; for the request, false. + + + is or empty. + + + contains invalid characters. + + + + + Implements the interface and raises the deserialization event + when the deserialization is complete. + + + An that represents the source of the deserialization event. + + + + + Removes the specified request from the collection. + + + One of the enum values, represents + the request header to remove. + + + is a restricted header. + + + The current instance doesn't allow + the request . + + + + + Removes the specified response from the collection. + + + One of the enum values, represents + the response header to remove. + + + is a restricted header. + + + The current instance doesn't allow + the response . + + + + + Removes the specified header from the collection. + + + A that represents the name of the header to remove. + + + is or empty. + + + + contains invalid characters. + + + -or- + + + is a restricted header name. + + + + The current instance doesn't allow + the header . + + + + + Sets the specified request to the specified value. + + + One of the enum values, represents + the request header to set. + + + A that represents the value of the request header to set. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the request . + + + + + Sets the specified response to the specified value. + + + One of the enum values, represents + the response header to set. + + + A that represents the value of the response header to set. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the response . + + + + + Sets the specified header to the specified value. + + + A that represents the name of the header to set. + + + A that represents the value of the header to set. + + + is or empty. + + + + or contains invalid characters. + + + -or- + + + is a restricted header name. + + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the header . + + + + + Converts the current to an array of . + + + An array of that receives the converted current + . + + + + + Returns a that represents the current + . + + + A that represents the current . + + + + + Populates the specified with the data needed to serialize + the current . + + + A that holds the serialized object data. + + + A that specifies the destination for the serialization. + + + is . + + + + + Gets all header names in the collection. + + + An array of that contains all header names in the collection. + + + + + Gets the number of headers in the collection. + + + An that represents the number of headers in the collection. + + + + + Gets or sets the specified request in the collection. + + + A that represents the value of the request . + + + One of the enum values, represents + the request header to get or set. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the request . + + + + + Gets or sets the specified response in the collection. + + + A that represents the value of the response . + + + One of the enum values, represents + the response header to get or set. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65,535 characters. + + + The current instance doesn't allow + the response . + + + + + Gets a collection of header names in the collection. + + + A that contains + all header names in the collection. + + + + + Provides a simple HTTP server that allows to accept the WebSocket connection requests. + + + The HttpServer class can provide multiple WebSocket services. + + + + + Initializes a new instance of the class. + + + An instance initialized by this constructor listens for the incoming requests on port 80. + + + + + Initializes a new instance of the class with + the specified . + + + + An instance initialized by this constructor listens for the incoming requests on + . + + + If is 443, that instance provides a secure connection. + + + + An that represents the port number on which to listen. + + + isn't between 1 and 65535 inclusive. + + + + + Initializes a new instance of the class with + the specified HTTP URL. + + + + An instance initialized by this constructor listens for the incoming requests on + the host name and port in . + + + If doesn't include a port, either port 80 or 443 is used on + which to listen. It's determined by the scheme (http or https) in . + (Port 80 if the scheme is http.) + + + + A that represents the HTTP URL of the server. + + + is . + + + + is empty. + + + -or- + + + is invalid. + + + + + + Initializes a new instance of the class with + the specified and . + + + An instance initialized by this constructor listens for the incoming requests on + . + + + An that represents the port number on which to listen. + + + A that indicates providing a secure connection or not. + (true indicates providing a secure connection.) + + + isn't between 1 and 65535 inclusive. + + + + + Initializes a new instance of the class with + the specified and . + + + + An instance initialized by this constructor listens for the incoming requests on + and . + + + If is 443, that instance provides a secure connection. + + + + A that represents the local IP address of the server. + + + An that represents the port number on which to listen. + + + is . + + + isn't a local IP address. + + + isn't between 1 and 65535 inclusive. + + + + + Initializes a new instance of the class with + the specified , , + and . + + + An instance initialized by this constructor listens for the incoming requests on + and . + + + A that represents the local IP address of the server. + + + An that represents the port number on which to listen. + + + A that indicates providing a secure connection or not. + (true indicates providing a secure connection.) + + + is . + + + isn't a local IP address. + + + isn't between 1 and 65535 inclusive. + + + + + Adds the WebSocket service with the specified behavior, , + and . + + + + This method converts to URL-decoded string, + and removes '/' from tail end of . + + + returns an initialized specified typed + instance. + + + + A that represents the absolute path to the service to add. + + + A Func<T> delegate that references the method used to initialize + a new specified typed instance (a new + instance). + + + The type of the behavior of the service to add. The TBehavior must inherit + the class. + + + + + Adds a WebSocket service with the specified behavior and . + + + This method converts to URL-decoded string, + and removes '/' from tail end of . + + + A that represents the absolute path to the service to add. + + + The type of the behavior of the service to add. The TBehaviorWithNew must inherit + the class, and must have a public parameterless + constructor. + + + + + Gets the contents of the file with the specified . + + + An array of that receives the contents of the file, + or if it doesn't exist. + + + A that represents the virtual path to the file to find. + + + + + Removes the WebSocket service with the specified . + + + This method converts to URL-decoded string, + and removes '/' from tail end of . + + + true if the service is successfully found and removed; otherwise, false. + + + A that represents the absolute path to the service to find. + + + + + Starts receiving the HTTP requests. + + + + + Stops receiving the HTTP requests. + + + + + Stops receiving the HTTP requests with the specified and + used to stop the WebSocket services. + + + A that represents the status code indicating the reason for the stop. + + + A that represents the reason for the stop. + + + + + Stops receiving the HTTP requests with the specified and + used to stop the WebSocket services. + + + One of the enum values, represents the status code indicating + the reason for the stop. + + + A that represents the reason for the stop. + + + + + Gets the local IP address of the server. + + + A that represents the local IP address of the server. + + + + + Gets or sets the scheme used to authenticate the clients. + + + One of the enum values, + indicates the scheme used to authenticate the clients. The default value is + . + + + + + Gets a value indicating whether the server has started. + + + true if the server has started; otherwise, false. + + + + + Gets a value indicating whether the server provides a secure connection. + + + true if the server provides a secure connection; otherwise, false. + + + + + Gets or sets a value indicating whether the server cleans up + the inactive sessions in the WebSocket services periodically. + + + true if the server cleans up the inactive sessions every 60 seconds; + otherwise, false. The default value is true. + + + + + Gets the logging functions. + + + The default logging level is . If you would like to change it, + you should set the Log.Level property to any of the enum + values. + + + A that provides the logging functions. + + + + + Gets the port on which to listen for incoming requests. + + + An that represents the port number on which to listen. + + + + + Gets or sets the name of the realm associated with the server. + + + If this property is or empty, "SECRET AREA" will be used as + the name of the realm. + + + A that represents the name of the realm. The default value is + . + + + + + Gets or sets a value indicating whether the server is allowed to be bound to + an address that is already in use. + + + If you would like to resolve to wait for socket in TIME_WAIT state, + you should set this property to true. + + + true if the server is allowed to be bound to an address that is already in use; + otherwise, false. The default value is false. + + + + + Gets or sets the document root path of the server. + + + A that represents the document root path of the server. + The default value is "./Public". + + + + + Gets or sets the SSL configuration used to authenticate the server and + optionally the client for secure connection. + + + A that represents the configuration used to + authenticate the server and optionally the client for secure connection. + + + + + Gets or sets the delegate called to find the credentials for an identity used to + authenticate a client. + + + A Func<, > delegate + that references the method(s) used to find the credentials. The default value is + . + + + + + Gets or sets the wait time for the response to the WebSocket Ping or Close. + + + A that represents the wait time. The default value is + the same as 1 second. + + + + + Gets the access to the WebSocket services provided by the server. + + + A that manages the WebSocket services. + + + + + Occurs when the server receives an HTTP CONNECT request. + + + + + Occurs when the server receives an HTTP DELETE request. + + + + + Occurs when the server receives an HTTP GET request. + + + + + Occurs when the server receives an HTTP HEAD request. + + + + + Occurs when the server receives an HTTP OPTIONS request. + + + + + Occurs when the server receives an HTTP PATCH request. + + + + + Occurs when the server receives an HTTP POST request. + + + + + Occurs when the server receives an HTTP PUT request. + + + + + Occurs when the server receives an HTTP TRACE request. + + + + + Provides the HTTP version numbers. + + + + + Provides a instance for the HTTP/1.0. + + + + + Provides a instance for the HTTP/1.1. + + + + + Initializes a new instance of the class. + + + + + Contains the values of the HTTP status codes. + + + The HttpStatusCode enumeration contains the values of the HTTP status codes defined in + RFC 2616 for the HTTP/1.1. + + + + + Equivalent to status code 100. + Indicates that the client should continue with its request. + + + + + Equivalent to status code 101. + Indicates that the server is switching the HTTP version or protocol on the connection. + + + + + Equivalent to status code 200. + Indicates that the client's request has succeeded. + + + + + Equivalent to status code 201. + Indicates that the client's request has been fulfilled and resulted in a new resource being + created. + + + + + Equivalent to status code 202. + Indicates that the client's request has been accepted for processing, but the processing + hasn't been completed. + + + + + Equivalent to status code 203. + Indicates that the returned metainformation is from a local or a third-party copy instead of + the origin server. + + + + + Equivalent to status code 204. + Indicates that the server has fulfilled the client's request but doesn't need to return + an entity-body. + + + + + Equivalent to status code 205. + Indicates that the server has fulfilled the client's request, and the user agent should + reset the document view which caused the request to be sent. + + + + + Equivalent to status code 206. + Indicates that the server has fulfilled the partial GET request for the resource. + + + + + + Equivalent to status code 300. + Indicates that the requested resource corresponds to any of multiple representations. + + + MultipleChoices is a synonym for Ambiguous. + + + + + + + Equivalent to status code 300. + Indicates that the requested resource corresponds to any of multiple representations. + + + Ambiguous is a synonym for MultipleChoices. + + + + + + + Equivalent to status code 301. + Indicates that the requested resource has been assigned a new permanent URI and + any future references to this resource should use one of the returned URIs. + + + MovedPermanently is a synonym for Moved. + + + + + + + Equivalent to status code 301. + Indicates that the requested resource has been assigned a new permanent URI and + any future references to this resource should use one of the returned URIs. + + + Moved is a synonym for MovedPermanently. + + + + + + + Equivalent to status code 302. + Indicates that the requested resource is located temporarily under a different URI. + + + Found is a synonym for Redirect. + + + + + + + Equivalent to status code 302. + Indicates that the requested resource is located temporarily under a different URI. + + + Redirect is a synonym for Found. + + + + + + + Equivalent to status code 303. + Indicates that the response to the request can be found under a different URI and + should be retrieved using a GET method on that resource. + + + SeeOther is a synonym for RedirectMethod. + + + + + + + Equivalent to status code 303. + Indicates that the response to the request can be found under a different URI and + should be retrieved using a GET method on that resource. + + + RedirectMethod is a synonym for SeeOther. + + + + + + Equivalent to status code 304. + Indicates that the client has performed a conditional GET request and access is allowed, + but the document hasn't been modified. + + + + + Equivalent to status code 305. + Indicates that the requested resource must be accessed through the proxy given by + the Location field. + + + + + Equivalent to status code 306. + This status code was used in a previous version of the specification, is no longer used, + and is reserved for future use. + + + + + + Equivalent to status code 307. + Indicates that the requested resource is located temporarily under a different URI. + + + TemporaryRedirect is a synonym for RedirectKeepVerb. + + + + + + + Equivalent to status code 307. + Indicates that the requested resource is located temporarily under a different URI. + + + RedirectKeepVerb is a synonym for TemporaryRedirect. + + + + + + Equivalent to status code 400. + Indicates that the client's request couldn't be understood by the server due to + malformed syntax. + + + + + Equivalent to status code 401. + Indicates that the client's request requires user authentication. + + + + + Equivalent to status code 402. + This status code is reserved for future use. + + + + + Equivalent to status code 403. + Indicates that the server understood the client's request but is refusing to fulfill it. + + + + + Equivalent to status code 404. + Indicates that the server hasn't found anything matching the request URI. + + + + + Equivalent to status code 405. + Indicates that the method specified in the request line isn't allowed for the resource + identified by the request URI. + + + + + Equivalent to status code 406. + Indicates that the server doesn't have the appropriate resource to respond to the Accept + headers in the client's request. + + + + + Equivalent to status code 407. + Indicates that the client must first authenticate itself with the proxy. + + + + + Equivalent to status code 408. + Indicates that the client didn't produce a request within the time that the server was + prepared to wait. + + + + + Equivalent to status code 409. + Indicates that the client's request couldn't be completed due to a conflict on the server. + + + + + Equivalent to status code 410. + Indicates that the requested resource is no longer available at the server and + no forwarding address is known. + + + + + Equivalent to status code 411. + Indicates that the server refuses to accept the client's request without a defined + Content-Length. + + + + + Equivalent to status code 412. + Indicates that the precondition given in one or more of the request headers evaluated to + false when it was tested on the server. + + + + + Equivalent to status code 413. + Indicates that the entity of the client's request is larger than the server is willing or + able to process. + + + + + Equivalent to status code 414. + Indicates that the request URI is longer than the server is willing to interpret. + + + + + Equivalent to status code 415. + Indicates that the entity of the client's request is in a format not supported by + the requested resource for the requested method. + + + + + Equivalent to status code 416. + Indicates that none of the range specifier values in a Range request header overlap + the current extent of the selected resource. + + + + + Equivalent to status code 417. + Indicates that the expectation given in an Expect request header couldn't be met by + the server. + + + + + Equivalent to status code 500. + Indicates that the server encountered an unexpected condition which prevented it from + fulfilling the client's request. + + + + + Equivalent to status code 501. + Indicates that the server doesn't support the functionality required to fulfill the client's + request. + + + + + Equivalent to status code 502. + Indicates that a gateway or proxy server received an invalid response from the upstream + server. + + + + + Equivalent to status code 503. + Indicates that the server is currently unable to handle the client's request due to + a temporary overloading or maintenance of the server. + + + + + Equivalent to status code 504. + Indicates that a gateway or proxy server didn't receive a timely response from the upstream + server or some other auxiliary server. + + + + + Equivalent to status code 505. + Indicates that the server doesn't support the HTTP version used in the client's request. + + + + + Exposes the methods and properties used to access the information in a WebSocket service + provided by the or . + + + The WebSocketServiceHost class is an abstract class. + + + + + Initializes a new instance of the class. + + + + + Creates a new session in the WebSocket service. + + + A instance that represents a new session. + + + + + Gets or sets a value indicating whether the WebSocket service cleans up + the inactive sessions periodically. + + + true if the service cleans up the inactive sessions periodically; + otherwise, false. + + + + + Gets the path to the WebSocket service. + + + A that represents the absolute path to the service. + + + + + Gets the access to the sessions in the WebSocket service. + + + A that manages the sessions in the service. + + + + + Gets the of the behavior of the WebSocket service. + + + A that represents the type of the behavior of the service. + + + + + Gets or sets the wait time for the response to the WebSocket Ping or Close. + + + A that represents the wait time. The default value is + the same as 1 second. + + + + + Indicates the status code for the WebSocket connection close. + + + + The values of this enumeration are defined in + Section 7.4 of RFC 6455. + + + "Reserved value" must not be set as a status code in a connection close frame by + an endpoint. It's designated for use in applications expecting a status code to + indicate that the connection was closed due to the system grounds. + + + + + + Equivalent to close status 1000. Indicates normal close. + + + + + Equivalent to close status 1001. Indicates that an endpoint is going away. + + + + + Equivalent to close status 1002. Indicates that an endpoint is terminating + the connection due to a protocol error. + + + + + Equivalent to close status 1003. Indicates that an endpoint is terminating + the connection because it has received a type of data that it cannot accept. + + + + + Equivalent to close status 1004. Still undefined. A Reserved value. + + + + + Equivalent to close status 1005. Indicates that no status code was actually present. + A Reserved value. + + + + + Equivalent to close status 1006. Indicates that the connection was closed abnormally. + A Reserved value. + + + + + Equivalent to close status 1007. Indicates that an endpoint is terminating + the connection because it has received a message that contains data that + isn't consistent with the type of the message. + + + + + Equivalent to close status 1008. Indicates that an endpoint is terminating + the connection because it has received a message that violates its policy. + + + + + Equivalent to close status 1009. Indicates that an endpoint is terminating + the connection because it has received a message that is too big to process. + + + + + Equivalent to close status 1010. Indicates that a client is terminating + the connection because it has expected the server to negotiate one or more extension, + but the server didn't return them in the handshake response. + + + + + Equivalent to close status 1011. Indicates that a server is terminating + the connection because it has encountered an unexpected condition that + prevented it from fulfilling the request. + + + + + Equivalent to close status 1015. Indicates that the connection was closed + due to a failure to perform a TLS handshake. A Reserved value. + + + + + Indicates whether a WebSocket frame is the final frame of a message. + + + The values of this enumeration are defined in + Section 5.2 of RFC 6455. + + + + + Equivalent to numeric value 0. Indicates more frames of a message follow. + + + + + Equivalent to numeric value 1. Indicates the final frame of a message. + + + + + Indicates whether the payload data of a WebSocket frame is masked. + + + The values of this enumeration are defined in + Section 5.2 of RFC 6455. + + + + + Equivalent to numeric value 0. Indicates not masked. + + + + + Equivalent to numeric value 1. Indicates masked. + + + + + Indicates the WebSocket frame type. + + + The values of this enumeration are defined in + Section 5.2 of RFC 6455. + + + + + Equivalent to numeric value 0. Indicates continuation frame. + + + + + Equivalent to numeric value 1. Indicates text frame. + + + + + Equivalent to numeric value 2. Indicates binary frame. + + + + + Equivalent to numeric value 8. Indicates connection close frame. + + + + + Equivalent to numeric value 9. Indicates ping frame. + + + + + Equivalent to numeric value 10. Indicates pong frame. + + + + + Represents the empty payload data. + + + + + Represents the allowable max length. + + + + A will occur if the payload data length is + greater than the value of this field. + + + If you would like to change the value, you must set it to a value between + WebSocket.FragmentLength and Int64.MaxValue inclusive. + + + + + + Indicates whether each RSV (RSV1, RSV2, and RSV3) of a WebSocket frame is non-zero. + + + The values of this enumeration are defined in + Section 5.2 of RFC 6455. + + + + + Equivalent to numeric value 0. Indicates zero. + + + + + Equivalent to numeric value 1. Indicates non-zero. + + + + + Provides the properties used to access the information in + a WebSocket handshake request received by the . + + + + + Exposes the properties used to access the information in a WebSocket handshake request. + + + This class is an abstract class. + + + + + Initializes a new instance of the class. + + + + + Gets the HTTP cookies included in the request. + + + A that contains the cookies. + + + + + Gets the HTTP headers included in the request. + + + A that contains the headers. + + + + + Gets the value of the Host header included in the request. + + + A that represents the value of the Host header. + + + + + Gets a value indicating whether the client is authenticated. + + + true if the client is authenticated; otherwise, false. + + + + + Gets a value indicating whether the client connected from the local computer. + + + true if the client connected from the local computer; otherwise, false. + + + + + Gets a value indicating whether the WebSocket connection is secured. + + + true if the connection is secured; otherwise, false. + + + + + Gets a value indicating whether the request is a WebSocket handshake request. + + + true if the request is a WebSocket handshake request; otherwise, false. + + + + + Gets the value of the Origin header included in the request. + + + A that represents the value of the Origin header. + + + + + Gets the query string included in the request. + + + A that contains the query string parameters. + + + + + Gets the URI requested by the client. + + + A that represents the requested URI. + + + + + Gets the value of the Sec-WebSocket-Key header included in the request. + + + This property provides a part of the information used by the server to prove that + it received a valid WebSocket handshake request. + + + A that represents the value of the Sec-WebSocket-Key header. + + + + + Gets the values of the Sec-WebSocket-Protocol header included in the request. + + + This property represents the subprotocols requested by the client. + + + An instance that provides + an enumerator which supports the iteration over the values of the Sec-WebSocket-Protocol + header. + + + + + Gets the value of the Sec-WebSocket-Version header included in the request. + + + This property represents the WebSocket protocol version. + + + A that represents the value of the Sec-WebSocket-Version header. + + + + + Gets the server endpoint as an IP address and a port number. + + + A that represents the server endpoint. + + + + + Gets the client information (identity, authentication, and security roles). + + + A instance that represents the client information. + + + + + Gets the client endpoint as an IP address and a port number. + + + A that represents the client endpoint. + + + + + Gets the instance used for + two-way communication between client and server. + + + A . + + + + + Returns a that represents + the current . + + + A that represents + the current . + + + + + Gets the HTTP cookies included in the request. + + + A that contains the cookies. + + + + + Gets the HTTP headers included in the request. + + + A that contains the headers. + + + + + Gets the value of the Host header included in the request. + + + A that represents the value of the Host header. + + + + + Gets a value indicating whether the client is authenticated. + + + true if the client is authenticated; otherwise, false. + + + + + Gets a value indicating whether the client connected from the local computer. + + + true if the client connected from the local computer; otherwise, false. + + + + + Gets a value indicating whether the WebSocket connection is secured. + + + true if the connection is secured; otherwise, false. + + + + + Gets a value indicating whether the request is a WebSocket handshake request. + + + true if the request is a WebSocket handshake request; otherwise, false. + + + + + Gets the value of the Origin header included in the request. + + + A that represents the value of the Origin header. + + + + + Gets the query string included in the request. + + + A that contains the query string parameters. + + + + + Gets the URI requested by the client. + + + A that represents the requested URI. + + + + + Gets the value of the Sec-WebSocket-Key header included in the request. + + + This property provides a part of the information used by the server to prove that + it received a valid WebSocket handshake request. + + + A that represents the value of the Sec-WebSocket-Key header. + + + + + Gets the values of the Sec-WebSocket-Protocol header included in the request. + + + This property represents the subprotocols requested by the client. + + + An instance that provides + an enumerator which supports the iteration over the values of the Sec-WebSocket-Protocol + header. + + + + + Gets the value of the Sec-WebSocket-Version header included in the request. + + + This property represents the WebSocket protocol version. + + + A that represents the value of the Sec-WebSocket-Version header. + + + + + Gets the server endpoint as an IP address and a port number. + + + A that represents the server endpoint. + + + + + Gets the client information (identity, authentication, and security roles). + + + A instance that represents the client information. + + + + + Gets the client endpoint as an IP address and a port number. + + + A that represents the client endpoint. + + + + + Gets the instance used for + two-way communication between client and server. + + + A . + + + + + Provides the properties used to access the information in + a WebSocket handshake request received by the . + + + + + Returns a that represents + the current . + + + A that represents + the current . + + + + + Gets the HTTP cookies included in the request. + + + A that contains the cookies. + + + + + Gets the HTTP headers included in the request. + + + A that contains the headers. + + + + + Gets the value of the Host header included in the request. + + + A that represents the value of the Host header. + + + + + Gets a value indicating whether the client is authenticated. + + + true if the client is authenticated; otherwise, false. + + + + + Gets a value indicating whether the client connected from the local computer. + + + true if the client connected from the local computer; otherwise, false. + + + + + Gets a value indicating whether the WebSocket connection is secured. + + + true if the connection is secured; otherwise, false. + + + + + Gets a value indicating whether the request is a WebSocket handshake request. + + + true if the request is a WebSocket handshake request; otherwise, false. + + + + + Gets the value of the Origin header included in the request. + + + A that represents the value of the Origin header. + + + + + Gets the query string included in the request. + + + A that contains the query string parameters. + + + + + Gets the URI requested by the client. + + + A that represents the requested URI. + + + + + Gets the value of the Sec-WebSocket-Key header included in the request. + + + This property provides a part of the information used by the server to prove that + it received a valid WebSocket handshake request. + + + A that represents the value of the Sec-WebSocket-Key header. + + + + + Gets the values of the Sec-WebSocket-Protocol header included in the request. + + + This property represents the subprotocols requested by the client. + + + An instance that provides + an enumerator which supports the iteration over the values of the Sec-WebSocket-Protocol + header. + + + + + Gets the value of the Sec-WebSocket-Version header included in the request. + + + This property represents the WebSocket protocol version. + + + A that represents the value of the Sec-WebSocket-Version header. + + + + + Gets the server endpoint as an IP address and a port number. + + + A that represents the server endpoint. + + + + + Gets the client information (identity, authentication, and security roles). + + + A instance that represents the client information. + + + + + Gets the client endpoint as an IP address and a port number. + + + A that represents the client endpoint. + + + + + Gets the instance used for + two-way communication between client and server. + + + A . + + + + + Represents the event data for the HTTP request event that the emits. + + + + An HTTP request event occurs when the receives an HTTP request. + + + If you would like to get the request data sent from a client, + you should access the property. + + + And if you would like to get the response data used to return a response, + you should access the property. + + + + + + Gets the HTTP request data sent from a client. + + + A that represents the request data. + + + + + Gets the HTTP response data used to return a response to the client. + + + A that represents the response data. + + + + + Specifies the compression method used to compress a message on the WebSocket connection. + + + The compression methods are defined in + + Compression Extensions for WebSocket. + + + + + Specifies non compression. + + + + + Specifies DEFLATE. + + + + + The exception that is thrown when a gets a fatal error. + + + + + Gets the status code indicating the cause of the exception. + + + One of the enum values, represents the status code + indicating the cause of the exception. + + + + + Represents a log data used by the class. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets the information of the logging method caller. + + + A that provides the information of the logging method caller. + + + + + Gets the date and time when the log data was created. + + + A that represents the date and time when the log data was created. + + + + + Gets the logging level of the log data. + + + One of the enum values, indicates the logging level of the log data. + + + + + Gets the message of the log data. + + + A that represents the message of the log data. + + + + + Specifies the logging level. + + + + + Specifies the bottom logging level. + + + + + Specifies the 2nd logging level from the bottom. + + + + + Specifies the 3rd logging level from the bottom. + + + + + Specifies the 3rd logging level from the top. + + + + + Specifies the 2nd logging level from the top. + + + + + Specifies the top logging level. + + + + + Provides a set of methods and properties for logging. + + + + If you output a log with lower than the value of the property, + it cannot be outputted. + + + The default output action writes a log to the standard output stream and the log file + if the property has a valid path to it. + + + If you would like to use the custom output action, you should set + the property to any Action<LogData, string> + delegate. + + + + + + Initializes a new instance of the class. + + + This constructor initializes the current logging level with . + + + + + Initializes a new instance of the class with + the specified logging . + + + One of the enum values. + + + + + Initializes a new instance of the class with + the specified logging , path to the log , + and action. + + + One of the enum values. + + + A that represents the path to the log file. + + + An Action<LogData, string> delegate that references the method(s) used to + output a log. A parameter passed to this delegate is + . + + + + + Outputs as a log with . + + + If the current logging level is higher than , + this method doesn't output as a log. + + + A that represents the message to output as a log. + + + + + Outputs as a log with . + + + If the current logging level is higher than , + this method doesn't output as a log. + + + A that represents the message to output as a log. + + + + + Outputs as a log with . + + + A that represents the message to output as a log. + + + + + Outputs as a log with . + + + If the current logging level is higher than , + this method doesn't output as a log. + + + A that represents the message to output as a log. + + + + + Outputs as a log with . + + + If the current logging level is higher than , + this method doesn't output as a log. + + + A that represents the message to output as a log. + + + + + Outputs as a log with . + + + If the current logging level is higher than , + this method doesn't output as a log. + + + A that represents the message to output as a log. + + + + + Gets or sets the current path to the log file. + + + A that represents the current path to the log file if any. + + + + + Gets or sets the current logging level. + + + A log with lower than the value of this property cannot be outputted. + + + One of the enum values, specifies the current logging level. + + + + + Gets or sets the current output action used to output a log. + + + + An Action<LogData, string> delegate that references the method(s) used to + output a log. A parameter passed to this delegate is the value of + the property. + + + If the value to set is , the current output action is changed to + the default output action. + + + + + + Indicates the state of a WebSocket connection. + + + The values of this enumeration are defined in + The WebSocket API. + + + + + Equivalent to numeric value 0. Indicates that the connection hasn't yet been established. + + + + + Equivalent to numeric value 1. Indicates that the connection has been established, + and the communication is possible. + + + + + Equivalent to numeric value 2. Indicates that the connection is going through + the closing handshake, or the WebSocket.Close method has been invoked. + + + + + Equivalent to numeric value 3. Indicates that the connection has been closed or + couldn't be established. + + + + + Exposes the properties used to access the information in a session in a WebSocket service. + + + + + Gets the information in the connection request to the WebSocket service. + + + A that provides the access to the connection request. + + + + + Gets the unique ID of the session. + + + A that represents the unique ID of the session. + + + + + Gets the WebSocket subprotocol used in the session. + + + A that represents the subprotocol if any. + + + + + Gets the time that the session has started. + + + A that represents the time that the session has started. + + + + + Gets the state of the used in the session. + + + One of the enum values, indicates the state of + the used in the session. + + + + + Manages the sessions in a Websocket service. + + + + + Sends binary to every client in the WebSocket service. + + + An array of that represents the binary data to send. + + + + + Sends text to every client in the WebSocket service. + + + A that represents the text data to send. + + + + + Sends binary asynchronously to every client in + the WebSocket service. + + + This method doesn't wait for the send to be complete. + + + An array of that represents the binary data to send. + + + An delegate that references the method(s) called when + the send is complete. + + + + + Sends text asynchronously to every client in + the WebSocket service. + + + This method doesn't wait for the send to be complete. + + + A that represents the text data to send. + + + An delegate that references the method(s) called when + the send is complete. + + + + + Sends binary data from the specified asynchronously to + every client in the WebSocket service. + + + This method doesn't wait for the send to be complete. + + + A from which contains the binary data to send. + + + An that represents the number of bytes to send. + + + An delegate that references the method(s) called when + the send is complete. + + + + + Sends a Ping to every client in the WebSocket service. + + + A Dictionary<string, bool> that contains a collection of pairs of + a session ID and a value indicating whether the manager received a Pong from + each client in a time. + + + + + Sends a Ping with the specified to every client in + the WebSocket service. + + + A Dictionary<string, bool> that contains a collection of pairs of + a session ID and a value indicating whether the manager received a Pong from + each client in a time. + + + A that represents the message to send. + + + + + Closes the session with the specified . + + + A that represents the ID of the session to close. + + + + + Closes the session with the specified , , + and . + + + A that represents the ID of the session to close. + + + A that represents the status code indicating the reason for the close. + + + A that represents the reason for the close. + + + + + Closes the session with the specified , , + and . + + + A that represents the ID of the session to close. + + + One of the enum values, represents the status code + indicating the reason for the close. + + + A that represents the reason for the close. + + + + + Sends a Ping to the client on the session with the specified . + + + true if the manager receives a Pong from the client in a time; + otherwise, false. + + + A that represents the ID of the session to find. + + + + + Sends a Ping with the specified to the client on + the session with the specified . + + + true if the manager receives a Pong from the client in a time; + otherwise, false. + + + A that represents the message to send. + + + A that represents the ID of the session to find. + + + + + Sends binary to the client on the session with + the specified . + + + An array of that represents the binary data to send. + + + A that represents the ID of the session to find. + + + + + Sends text to the client on the session with + the specified . + + + A that represents the text data to send. + + + A that represents the ID of the session to find. + + + + + Sends binary asynchronously to the client on + the session with the specified . + + + This method doesn't wait for the send to be complete. + + + An array of that represents the binary data to send. + + + A that represents the ID of the session to find. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sends text asynchronously to the client on + the session with the specified . + + + This method doesn't wait for the send to be complete. + + + A that represents the text data to send. + + + A that represents the ID of the session to find. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sends binary data from the specified asynchronously to + the client on the session with the specified . + + + This method doesn't wait for the send to be complete. + + + A from which contains the binary data to send. + + + An that represents the number of bytes to send. + + + A that represents the ID of the session to find. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Cleans up the inactive sessions in the WebSocket service. + + + + + Tries to get the session with the specified . + + + true if the session is successfully found; otherwise, false. + + + A that represents the ID of the session to find. + + + When this method returns, a instance that + provides the access to the information in the session, or + if it's not found. This parameter is passed uninitialized. + + + + + Gets the IDs for the active sessions in the Websocket service. + + + An IEnumerable<string> instance that provides an enumerator which + supports the iteration over the collection of the IDs for the active sessions. + + + + + Gets the number of the sessions in the Websocket service. + + + An that represents the number of the sessions. + + + + + Gets the IDs for the sessions in the Websocket service. + + + An IEnumerable<string> instance that provides an enumerator which + supports the iteration over the collection of the IDs for the sessions. + + + + + Gets the IDs for the inactive sessions in the Websocket service. + + + An IEnumerable<string> instance that provides an enumerator which + supports the iteration over the collection of the IDs for the inactive sessions. + + + + + Gets the session with the specified . + + + A instance that provides the access to + the information in the session, or if it's not found. + + + A that represents the ID of the session to find. + + + + + Gets a value indicating whether the manager cleans up the inactive sessions in + the WebSocket service periodically. + + + true if the manager cleans up the inactive sessions every 60 seconds; + otherwise, false. + + + + + Gets the sessions in the Websocket service. + + + An IEnumerable<IWebSocketSession> instance that provides an enumerator + which supports the iteration over the collection of the sessions in the service. + + + + + Gets the wait time for the response to the WebSocket Ping or Close. + + + A that represents the wait time. + + + + + Holds the user name and password from the HTTP Basic authentication credentials. + + + + + Gets the password from the HTTP Basic authentication credentials. + + + A that represents the password. + + + + + Holds the user name and other parameters from the HTTP Digest authentication credentials. + + + + + Gets the algorithm parameter from the HTTP Digest authentication credentials. + + + A that represents the algorithm parameter. + + + + + Gets the cnonce parameter from the HTTP Digest authentication credentials. + + + A that represents the cnonce parameter. + + + + + Gets the nc parameter from the HTTP Digest authentication credentials. + + + A that represents the nc parameter. + + + + + Gets the nonce parameter from the HTTP Digest authentication credentials. + + + A that represents the nonce parameter. + + + + + Gets the opaque parameter from the HTTP Digest authentication credentials. + + + A that represents the opaque parameter. + + + + + Gets the qop parameter from the HTTP Digest authentication credentials. + + + A that represents the qop parameter. + + + + + Gets the realm parameter from the HTTP Digest authentication credentials. + + + A that represents the realm parameter. + + + + + Gets the response parameter from the HTTP Digest authentication credentials. + + + A that represents the response parameter. + + + + + Gets the uri parameter from the HTTP Digest authentication credentials. + + + A that represents the uri parameter. + + + + + Provides the credentials for the HTTP authentication (Basic/Digest). + + + + + Initializes a new instance of the class with + the specified user name and password. + + + A that represents the user name associated with the credentials. + + + A that represents the password for the user name associated with + the credentials. + + + is . + + + is empty. + + + + + Initializes a new instance of the class with + the specified user name, password, domain, and roles. + + + A that represents the user name associated with the credentials. + + + A that represents the password for the user name associated with + the credentials. + + + A that represents the name of the user domain associated with + the credentials. + + + An array of that contains the role names to which + the user associated with the credentials belongs if any. + + + is . + + + is empty. + + + + + Gets the name of the user domain associated with the credentials. + + + A that represents the name of the user domain associated with + the credentials. + + + + + Gets the password for the user name associated with the credentials. + + + A that represents the password for the user name associated with + the credentials. + + + + + Gets the role names to which the user associated with the credentials belongs. + + + An array of that contains the role names to which + the user associated with the credentials belongs if any. + + + + + Gets the user name associated with the credentials. + + + A that represents the user name associated with the credentials. + + + + + Manages the WebSocket services provided by the or + . + + + + + Sends binary to every client in the WebSocket services. + + + An array of that represents the binary data to send. + + + + + Sends text to every client in the WebSocket services. + + + A that represents the text data to send. + + + + + Sends binary asynchronously to every client in + the WebSocket services. + + + This method doesn't wait for the send to be complete. + + + An array of that represents the binary data to send. + + + An delegate that references the method(s) called when + the send is complete. + + + + + Sends text asynchronously to every client in + the WebSocket services. + + + This method doesn't wait for the send to be complete. + + + A that represents the text data to send. + + + An delegate that references the method(s) called when + the send is complete. + + + + + Sends binary data from the specified asynchronously to + every client in the WebSocket services. + + + This method doesn't wait for the send to be complete. + + + A from which contains the binary data to send. + + + An that represents the number of bytes to send. + + + An delegate that references the method(s) called when + the send is complete. + + + + + Sends a Ping to every client in the WebSocket services. + + + A Dictionary<string, Dictionary<string, bool>> that contains + a collection of pairs of a service path and a collection of pairs of a session ID + and a value indicating whether the manager received a Pong from each client in a time, + or if this method isn't available. + + + + + Sends a Ping with the specified to every client in + the WebSocket services. + + + A Dictionary<string, Dictionary<string, bool>> that contains + a collection of pairs of a service path and a collection of pairs of a session ID + and a value indicating whether the manager received a Pong from each client in a time, + or if this method isn't available or + is invalid. + + + A that represents the message to send. + + + + + Tries to get the WebSocket service host with the specified . + + + true if the service is successfully found; otherwise, false. + + + A that represents the absolute path to the service to find. + + + When this method returns, a instance that + provides the access to the information in the service, or + if it's not found. This parameter is passed uninitialized. + + + + + Gets the number of the WebSocket services. + + + An that represents the number of the services. + + + + + Gets the host instances for the Websocket services. + + + An IEnumerable<WebSocketServiceHost> instance that provides an enumerator + which supports the iteration over the collection of the host instances for the services. + + + + + Gets the WebSocket service host with the specified . + + + A instance that provides the access to + the information in the service, or if it's not found. + + + A that represents the absolute path to the service to find. + + + + + Gets a value indicating whether the manager cleans up the inactive sessions + in the WebSocket services periodically. + + + true if the manager cleans up the inactive sessions every 60 seconds; + otherwise, false. + + + + + Gets the paths for the WebSocket services. + + + An IEnumerable<string> instance that provides an enumerator which supports + the iteration over the collection of the paths for the services. + + + + + Gets the total number of the sessions in the WebSocket services. + + + An that represents the total number of the sessions in the services. + + + + + Gets the wait time for the response to the WebSocket Ping or Close. + + + A that represents the wait time. + + + + + Represents the ping frame without the payload data as an array of . + + + The value of this field is created from a non masked frame, so it can only be used to + send a ping from a server. + + + + + Exposes the methods and properties used to define the behavior of a WebSocket service + provided by the or . + + + The WebSocketBehavior class is an abstract class. + + + + + Initializes a new instance of the class. + + + + + Calls the method with the specified and + . + + + This method doesn't call the method if is + or empty. + + + A that represents the error message. + + + An instance that represents the cause of the error if any. + + + + + Called when the WebSocket connection used in a session has been closed. + + + A that represents the event data passed to + a event. + + + + + Called when the used in a session gets an error. + + + A that represents the event data passed to + a event. + + + + + Called when the used in a session receives a message. + + + A that represents the event data passed to + a event. + + + + + Called when the WebSocket connection used in a session has been established. + + + + + Sends binary to the client on a session. + + + This method is available after the WebSocket connection has been established. + + + An array of that represents the binary data to send. + + + + + Sends the specified as binary data to the client on a session. + + + This method is available after the WebSocket connection has been established. + + + A that represents the file to send. + + + + + Sends text to the client on a session. + + + This method is available after the WebSocket connection has been established. + + + A that represents the text data to send. + + + + + Sends binary asynchronously to the client on a session. + + + + This method is available after the WebSocket connection has been established. + + + This method doesn't wait for the send to be complete. + + + + An array of that represents the binary data to send. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sends the specified as binary data asynchronously to + the client on a session. + + + + This method is available after the WebSocket connection has been established. + + + This method doesn't wait for the send to be complete. + + + + A that represents the file to send. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sends text asynchronously to the client on a session. + + + + This method is available after the WebSocket connection has been established. + + + This method doesn't wait for the send to be complete. + + + + A that represents the text data to send. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Sends binary data from the specified asynchronously to + the client on a session. + + + + This method is available after the WebSocket connection has been established. + + + This method doesn't wait for the send to be complete. + + + + A from which contains the binary data to send. + + + An that represents the number of bytes to send. + + + An Action<bool> delegate that references the method(s) called when + the send is complete. A passed to this delegate is true + if the send is complete successfully. + + + + + Gets the logging functions. + + + A that provides the logging functions, + or if the WebSocket connection isn't established. + + + + + Gets the access to the sessions in the WebSocket service. + + + A that provides the access to the sessions, + or if the WebSocket connection isn't established. + + + + + Gets the information in a handshake request to the WebSocket service. + + + A instance that provides the access to the handshake request, + or if the WebSocket connection isn't established. + + + + + Gets or sets the delegate called to validate the HTTP cookies included in + a handshake request to the WebSocket service. + + + This delegate is called when the used in a session validates + the handshake request. + + + + A Func<CookieCollection, CookieCollection, bool> delegate that references + the method(s) used to validate the cookies. + + + 1st parameter passed to this delegate contains + the cookies to validate if any. + + + 2nd parameter passed to this delegate receives + the cookies to send to the client. + + + This delegate should return true if the cookies are valid. + + + The default value is , and it does nothing to validate. + + + + + + Gets or sets a value indicating whether the used in a session emits + a event when receives a Ping. + + + true if the emits a event + when receives a Ping; otherwise, false. The default value is false. + + + + + Gets the unique ID of a session. + + + A that represents the unique ID of the session, + or if the WebSocket connection isn't established. + + + + + Gets or sets a value indicating whether the WebSocket service ignores + the Sec-WebSocket-Extensions header included in a handshake request. + + + true if the WebSocket service ignores the extensions requested from + a client; otherwise, false. The default value is false. + + + + + Gets or sets the delegate called to validate the Origin header included in + a handshake request to the WebSocket service. + + + This delegate is called when the used in a session validates + the handshake request. + + + + A Func<string, bool> delegate that references the method(s) used to + validate the origin header. + + + parameter passed to this delegate represents the value of + the origin header to validate if any. + + + This delegate should return true if the origin header is valid. + + + The default value is , and it does nothing to validate. + + + + + + Gets or sets the WebSocket subprotocol used in the WebSocket service. + + + Set operation of this property is available before the WebSocket connection has + been established. + + + + A that represents the subprotocol if any. + The default value is . + + + The value to set must be a token defined in + RFC 2616. + + + + + + Gets the time that a session has started. + + + A that represents the time that the session has started, + or if the WebSocket connection isn't established. + + + + + Gets the state of the used in a session. + + + One of the enum values, indicates the state of + the . + + + + + Initializes a new instance of the class with + the specified . + + + This constructor must be called after calling the CheckPrefix method. + + + A that represents the URI prefix. + + + + + Determines whether this instance and the specified have the same value. + + + This method will be required to detect duplicates in any collection. + + + An to compare to this instance. + + + true if is a and + its value is the same as this instance; otherwise, false. + + + + + Gets the hash code for this instance. + + + This method will be required to detect duplicates in any collection. + + + An that represents the hash code. + + + + + Stores the parameters used to configure a instance as a client. + + + + + Stores the parameters used to configure a instance. + + + The SslConfiguration class is an abstract class. + + + + + Initializes a new instance of the class with + the specified and + . + + + The enum value that represents the protocols used for + authentication. + + + true if the certificate revocation list is checked during authentication; + otherwise, false. + + + + + Gets or sets the callback used to select a certificate to supply to the remote party. + + + If this callback returns , no certificate will be supplied. + + + A delegate that references the method + used to select a certificate. The default value is a function that only returns + . + + + + + Gets or sets the callback used to validate the certificate supplied by the remote party. + + + If this callback returns true, the certificate will be valid. + + + A delegate that references the method + used to validate the certificate. The default value is a function that only returns + true. + + + + + Gets or sets a value indicating whether the certificate revocation list is checked + during authentication. + + + true if the certificate revocation list is checked; otherwise, false. + + + + + Gets or sets the SSL protocols used for authentication. + + + The enum value that represents the protocols used for + authentication. + + + + + Initializes a new instance of the class with + the specified . + + + A that represents the name of the server that shares + a secure connection. + + + + + Initializes a new instance of the class with + the specified , , + , and . + + + A that represents the name of the server that shares + a secure connection. + + + A that contains client certificates. + + + The enum value that represents the protocols used for + authentication. + + + true if the certificate revocation list is checked during authentication; + otherwise, false. + + + + + Gets or sets the collection that contains client certificates. + + + A that contains client certificates. + + + + + Gets or sets the callback used to select a client certificate to supply to the server. + + + If this callback returns , no client certificate will be supplied. + + + A delegate that references the method + used to select the client certificate. The default value is a function that only returns + . + + + + + Gets or sets the callback used to validate the certificate supplied by the server. + + + If this callback returns true, the server certificate will be valid. + + + A delegate that references the method + used to validate the server certificate. The default value is a function that only returns + true. + + + + + Gets or sets the name of the server that shares a secure connection. + + + A that represents the name of the server that shares + a secure connection. + + + + + Stores the parameters used to configure a instance as a server. + + + + + Initializes a new instance of the class with + the specified . + + + A that represents the certificate used to authenticate + the server. + + + + + Initializes a new instance of the class with + the specified , + , , + and . + + + A that represents the certificate used to authenticate + the server. + + + true if the client must supply a certificate for authentication; + otherwise, false. + + + The enum value that represents the protocols used for + authentication. + + + true if the certificate revocation list is checked during authentication; + otherwise, false. + + + + + Gets or sets a value indicating whether the client must supply a certificate for + authentication. + + + true if the client must supply a certificate; otherwise, false. + + + + + Gets or sets the callback used to validate the certificate supplied by the client. + + + If this callback returns true, the client certificate will be valid. + + + A delegate that references the method + used to validate the client certificate. The default value is a function that only returns + true. + + + + + Gets or sets the certificate used to authenticate the server for secure connection. + + + A that represents the certificate used to authenticate + the server. + + + + + Contains the HTTP headers that may be specified in a client request. + + + The HttpRequestHeader enumeration contains the HTTP request headers defined in + RFC 2616 for the HTTP/1.1 and + RFC 6455 for the WebSocket. + + + + + Indicates the Cache-Control header. + + + + + Indicates the Connection header. + + + + + Indicates the Date header. + + + + + Indicates the Keep-Alive header. + + + + + Indicates the Pragma header. + + + + + Indicates the Trailer header. + + + + + Indicates the Transfer-Encoding header. + + + + + Indicates the Upgrade header. + + + + + Indicates the Via header. + + + + + Indicates the Warning header. + + + + + Indicates the Allow header. + + + + + Indicates the Content-Length header. + + + + + Indicates the Content-Type header. + + + + + Indicates the Content-Encoding header. + + + + + Indicates the Content-Language header. + + + + + Indicates the Content-Location header. + + + + + Indicates the Content-MD5 header. + + + + + Indicates the Content-Range header. + + + + + Indicates the Expires header. + + + + + Indicates the Last-Modified header. + + + + + Indicates the Accept header. + + + + + Indicates the Accept-Charset header. + + + + + Indicates the Accept-Encoding header. + + + + + Indicates the Accept-Language header. + + + + + Indicates the Authorization header. + + + + + Indicates the Cookie header. + + + + + Indicates the Expect header. + + + + + Indicates the From header. + + + + + Indicates the Host header. + + + + + Indicates the If-Match header. + + + + + Indicates the If-Modified-Since header. + + + + + Indicates the If-None-Match header. + + + + + Indicates the If-Range header. + + + + + Indicates the If-Unmodified-Since header. + + + + + Indicates the Max-Forwards header. + + + + + Indicates the Proxy-Authorization header. + + + + + Indicates the Referer header. + + + + + Indicates the Range header. + + + + + Indicates the TE header. + + + + + Indicates the Translate header. + + + + + Indicates the User-Agent header. + + + + + Indicates the Sec-WebSocket-Key header. + + + + + Indicates the Sec-WebSocket-Extensions header. + + + + + Indicates the Sec-WebSocket-Protocol header. + + + + + Indicates the Sec-WebSocket-Version header. + + + + + Contains the HTTP headers that can be specified in a server response. + + + The HttpResponseHeader enumeration contains the HTTP response headers defined in + RFC 2616 for the HTTP/1.1 and + RFC 6455 for the WebSocket. + + + + + Indicates the Cache-Control header. + + + + + Indicates the Connection header. + + + + + Indicates the Date header. + + + + + Indicates the Keep-Alive header. + + + + + Indicates the Pragma header. + + + + + Indicates the Trailer header. + + + + + Indicates the Transfer-Encoding header. + + + + + Indicates the Upgrade header. + + + + + Indicates the Via header. + + + + + Indicates the Warning header. + + + + + Indicates the Allow header. + + + + + Indicates the Content-Length header. + + + + + Indicates the Content-Type header. + + + + + Indicates the Content-Encoding header. + + + + + Indicates the Content-Language header. + + + + + Indicates the Content-Location header. + + + + + Indicates the Content-MD5 header. + + + + + Indicates the Content-Range header. + + + + + Indicates the Expires header. + + + + + Indicates the Last-Modified header. + + + + + Indicates the Accept-Ranges header. + + + + + Indicates the Age header. + + + + + Indicates the ETag header. + + + + + Indicates the Location header. + + + + + Indicates the Proxy-Authenticate header. + + + + + Indicates the Retry-After header. + + + + + Indicates the Server header. + + + + + Indicates the Set-Cookie header. + + + + + Indicates the Vary header. + + + + + Indicates the WWW-Authenticate header. + + + + + Indicates the Sec-WebSocket-Extensions header. + + + + + Indicates the Sec-WebSocket-Accept header. + + + + + Indicates the Sec-WebSocket-Protocol header. + + + + + Indicates the Sec-WebSocket-Version header. + + + + diff --git a/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.xml.meta b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.xml.meta new file mode 100644 index 00000000..4c39e606 --- /dev/null +++ b/Assets/Plugins/WebSocketSharp.1.0.3-rc11/lib/websocket-sharp.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: baed097cb297366a9a7e6828279b63ff +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/protobuf-net.2.4.6.meta b/Assets/Plugins/protobuf-net.2.4.6.meta new file mode 100644 index 00000000..4cd2d79d --- /dev/null +++ b/Assets/Plugins/protobuf-net.2.4.6.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8ca7e1da397d92995b3c66e47f1df519 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/protobuf-net.2.4.6/.signature.p7s b/Assets/Plugins/protobuf-net.2.4.6/.signature.p7s new file mode 100755 index 00000000..5610ae03 Binary files /dev/null and b/Assets/Plugins/protobuf-net.2.4.6/.signature.p7s differ diff --git a/Assets/Plugins/protobuf-net.2.4.6/lib.meta b/Assets/Plugins/protobuf-net.2.4.6/lib.meta new file mode 100644 index 00000000..e125c5c3 --- /dev/null +++ b/Assets/Plugins/protobuf-net.2.4.6/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e2139cfcb02fb881487ee806b82513f0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/protobuf-net.2.4.6/lib/net40.meta b/Assets/Plugins/protobuf-net.2.4.6/lib/net40.meta new file mode 100644 index 00000000..27273369 --- /dev/null +++ b/Assets/Plugins/protobuf-net.2.4.6/lib/net40.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20257f98d92fbaecb8a9a09db2e2a2c5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.dll b/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.dll new file mode 100755 index 00000000..a50bb368 Binary files /dev/null and b/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.dll differ diff --git a/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.dll.meta b/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.dll.meta new file mode 100644 index 00000000..2c20490f --- /dev/null +++ b/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.dll.meta @@ -0,0 +1,69 @@ +fileFormatVersion: 2 +guid: ee00e7f668820def59b2383783805de7 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude Win: 0 + Exclude Win64: 0 + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.xml b/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.xml new file mode 100755 index 00000000..a09f673c --- /dev/null +++ b/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.xml @@ -0,0 +1,3657 @@ + + + + protobuf-net + + + + + Provides support for common .NET types that do not have a direct representation + in protobuf, using the definitions from bcl.proto + + + + + Creates a new instance of the specified type, bypassing the constructor. + + The type to create + The new instance + If the platform does not support constructor-skipping + + + + The default value for dates that are following google.protobuf.Timestamp semantics + + + + + Writes a TimeSpan to a protobuf stream using protobuf-net's own representation, bcl.TimeSpan + + + + + Parses a TimeSpan from a protobuf stream using protobuf-net's own representation, bcl.TimeSpan + + + + + Parses a TimeSpan from a protobuf stream using the standardized format, google.protobuf.Duration + + + + + Writes a TimeSpan to a protobuf stream using the standardized format, google.protobuf.Duration + + + + + Parses a DateTime from a protobuf stream using the standardized format, google.protobuf.Timestamp + + + + + Writes a DateTime to a protobuf stream using the standardized format, google.protobuf.Timestamp + + + + + Parses a DateTime from a protobuf stream + + + + + Writes a DateTime to a protobuf stream, excluding the Kind + + + + + Writes a DateTime to a protobuf stream, including the Kind + + + + + Parses a decimal from a protobuf stream + + + + + Writes a decimal to a protobuf stream + + + + + Writes a Guid to a protobuf stream + + + + + Parses a Guid from a protobuf stream + + + + + Optional behaviours that introduce .NET-specific functionality + + + + + No special behaviour + + + + + Enables full object-tracking/full-graph support. + + + + + Embeds the type information into the stream, allowing usage with types not known in advance. + + + + + If false, the constructor for the type is bypassed during deserialization, meaning any field initializers + or other initialization code is skipped. + + + + + Should the object index be reserved, rather than creating an object promptly + + + + + Reads an *implementation specific* bundled .NET object, including (as options) type-metadata, identity/re-use, etc. + + + + + Writes an *implementation specific* bundled .NET object, including (as options) type-metadata, identity/re-use, etc. + + + + + Provides a simple buffer-based implementation of an extension object. + + + + + https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element + + + + Specifies a method on the root-contract in an hierarchy to be invoked before serialization. + + + Specifies a method on the root-contract in an hierarchy to be invoked after serialization. + + + Specifies a method on the root-contract in an hierarchy to be invoked before deserialization. + + + Specifies a method on the root-contract in an hierarchy to be invoked after deserialization. + + + + Pushes a null reference onto the stack. Note that this should only + be used to return a null (or set a variable to null); for null-tests + use BranchIfTrue / BranchIfFalse. + + + + + Creates a new "using" block (equivalent) around a variable; + the variable must exist, and note that (unlike in C#) it is + the variables *final* value that gets disposed. If you need + *original* disposal, copy your variable first. + + It is the callers responsibility to ensure that the variable's + scope fully-encapsulates the "using"; if not, the variable + may be re-used (and thus re-assigned) unexpectedly. + + + + + Sub-format to use when serializing/deserializing data + + + + + Uses the default encoding for the data-type. + + + + + When applied to signed integer-based data (including Decimal), this + indicates that zigzag variant encoding will be used. This means that values + with small magnitude (regardless of sign) take a small amount + of space to encode. + + + + + When applied to signed integer-based data (including Decimal), this + indicates that two's-complement variant encoding will be used. + This means that any -ve number will take 10 bytes (even for 32-bit), + so should only be used for compatibility. + + + + + When applied to signed integer-based data (including Decimal), this + indicates that a fixed amount of space will be used. + + + + + When applied to a sub-message, indicates that the value should be treated + as group-delimited. + + + + + When applied to members of types such as DateTime or TimeSpan, specifies + that the "well known" standardized representation should be use; DateTime uses Timestamp, + + + + + Represent multiple types as a union; this is used as part of OneOf - + note that it is the caller's responsbility to only read/write the value as the same type + + + The value typed as Object + + + Indicates whether the specified discriminator is assigned + + + Create a new discriminated union value + + + Reset a value if the specified discriminator is assigned + + + The discriminator value + + + Represent multiple types as a union; this is used as part of OneOf - + note that it is the caller's responsbility to only read/write the value as the same type + + + The value typed as Int64 + + + The value typed as UInt64 + + + The value typed as Int32 + + + The value typed as UInt32 + + + The value typed as Boolean + + + The value typed as Single + + + The value typed as Double + + + The value typed as DateTime + + + The value typed as TimeSpan + + + Indicates whether the specified discriminator is assigned + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Reset a value if the specified discriminator is assigned + + + The discriminator value + + + Represent multiple types as a union; this is used as part of OneOf - + note that it is the caller's responsbility to only read/write the value as the same type + + + The value typed as Int64 + + + The value typed as UInt64 + + + The value typed as Int32 + + + The value typed as UInt32 + + + The value typed as Boolean + + + The value typed as Single + + + The value typed as Double + + + The value typed as DateTime + + + The value typed as TimeSpan + + + The value typed as Guid + + + The value typed as Object + + + Indicates whether the specified discriminator is assigned + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Reset a value if the specified discriminator is assigned + + + The discriminator value + + + Represent multiple types as a union; this is used as part of OneOf - + note that it is the caller's responsbility to only read/write the value as the same type + + + The value typed as Int64 + + + The value typed as UInt64 + + + The value typed as Int32 + + + The value typed as UInt32 + + + The value typed as Boolean + + + The value typed as Single + + + The value typed as Double + + + The value typed as DateTime + + + The value typed as TimeSpan + + + The value typed as Guid + + + Indicates whether the specified discriminator is assigned + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Reset a value if the specified discriminator is assigned + + + The discriminator value + + + Represent multiple types as a union; this is used as part of OneOf - + note that it is the caller's responsbility to only read/write the value as the same type + + + The value typed as Int64 + + + The value typed as UInt64 + + + The value typed as Int32 + + + The value typed as UInt32 + + + The value typed as Boolean + + + The value typed as Single + + + The value typed as Double + + + The value typed as DateTime + + + The value typed as TimeSpan + + + The value typed as Object + + + Indicates whether the specified discriminator is assigned + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Reset a value if the specified discriminator is assigned + + + The discriminator value + + + Represent multiple types as a union; this is used as part of OneOf - + note that it is the caller's responsbility to only read/write the value as the same type + + + The value typed as Int32 + + + The value typed as UInt32 + + + The value typed as Boolean + + + The value typed as Single + + + Indicates whether the specified discriminator is assigned + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Reset a value if the specified discriminator is assigned + + + The discriminator value + + + Represent multiple types as a union; this is used as part of OneOf - + note that it is the caller's responsbility to only read/write the value as the same type + + + The value typed as Int32 + + + The value typed as UInt32 + + + The value typed as Boolean + + + The value typed as Single + + + The value typed as Object + + + Indicates whether the specified discriminator is assigned + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Create a new discriminated union value + + + Reset a value if the specified discriminator is assigned + + + The discriminator value + + + + Simple base class for supporting unexpected fields allowing + for loss-less round-tips/merge, even if the data is not understod. + The additional fields are (by default) stored in-memory in a buffer. + + As an example of an alternative implementation, you might + choose to use the file system (temporary files) as the back-end, tracking + only the paths [such an object would ideally be IDisposable and use + a finalizer to ensure that the files are removed]. + + + + + Retrieves the extension object for the current + instance, optionally creating it if it does not already exist. + + Should a new extension object be + created if it does not already exist? + The extension object if it exists (or was created), or null + if the extension object does not exist or is not available. + The createIfMissing argument is false during serialization, + and true during deserialization upon encountering unexpected fields. + + + + Provides a simple, default implementation for extension support, + optionally creating it if it does not already exist. Designed to be called by + classes implementing . + + Should a new extension object be + created if it does not already exist? + The extension field to check (and possibly update). + The extension object if it exists (or was created), or null + if the extension object does not exist or is not available. + The createIfMissing argument is false during serialization, + and true during deserialization upon encountering unexpected fields. + + + + Appends the value as an additional (unexpected) data-field for the instance. + Note that for non-repeated sub-objects, this equates to a merge operation; + for repeated sub-objects this adds a new instance to the set; for simple + values the new value supercedes the old value. + + Note that appending a value does not remove the old value from + the stream; avoid repeatedly appending values for the same field. + The type of the value to append. + The extensible object to append the value to. + The field identifier; the tag should not be defined as a known data-field for the instance. + The value to append. + + + + Appends the value as an additional (unexpected) data-field for the instance. + Note that for non-repeated sub-objects, this equates to a merge operation; + for repeated sub-objects this adds a new instance to the set; for simple + values the new value supercedes the old value. + + Note that appending a value does not remove the old value from + the stream; avoid repeatedly appending values for the same field. + The data-type of the field. + The data-format to use when encoding the value. + The extensible object to append the value to. + The field identifier; the tag should not be defined as a known data-field for the instance. + The value to append. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + The value returned is the composed value after merging any duplicated content; if the + value is "repeated" (a list), then use GetValues instead. + + The data-type of the field. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + The effective value of the field, or the default value if not found. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + The value returned is the composed value after merging any duplicated content; if the + value is "repeated" (a list), then use GetValues instead. + + The data-type of the field. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + The data-format to use when decoding the value. + The effective value of the field, or the default value if not found. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + The value returned (in "value") is the composed value after merging any duplicated content; + if the value is "repeated" (a list), then use GetValues instead. + + The data-type of the field. + The effective value of the field, or the default value if not found. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + True if data for the field was present, false otherwise. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + The value returned (in "value") is the composed value after merging any duplicated content; + if the value is "repeated" (a list), then use GetValues instead. + + The data-type of the field. + The effective value of the field, or the default value if not found. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + The data-format to use when decoding the value. + True if data for the field was present, false otherwise. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + The value returned (in "value") is the composed value after merging any duplicated content; + if the value is "repeated" (a list), then use GetValues instead. + + The data-type of the field. + The effective value of the field, or the default value if not found. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + The data-format to use when decoding the value. + Allow tags that are present as part of the definition; for example, to query unknown enum values. + True if data for the field was present, false otherwise. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + Each occurrence of the field is yielded separately, making this usage suitable for "repeated" + (list) fields. + + The extended data is processed lazily as the enumerator is iterated. + The data-type of the field. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + An enumerator that yields each occurrence of the field. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + Each occurrence of the field is yielded separately, making this usage suitable for "repeated" + (list) fields. + + The extended data is processed lazily as the enumerator is iterated. + The data-type of the field. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + The data-format to use when decoding the value. + An enumerator that yields each occurrence of the field. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + The value returned (in "value") is the composed value after merging any duplicated content; + if the value is "repeated" (a list), then use GetValues instead. + + The data-type of the field. + The model to use for configuration. + The effective value of the field, or the default value if not found. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + The data-format to use when decoding the value. + Allow tags that are present as part of the definition; for example, to query unknown enum values. + True if data for the field was present, false otherwise. + + + + Queries an extensible object for an additional (unexpected) data-field for the instance. + Each occurrence of the field is yielded separately, making this usage suitable for "repeated" + (list) fields. + + The extended data is processed lazily as the enumerator is iterated. + The model to use for configuration. + The data-type of the field. + The extensible object to obtain the value from. + The field identifier; the tag should not be defined as a known data-field for the instance. + The data-format to use when decoding the value. + An enumerator that yields each occurrence of the field. + + + + Appends the value as an additional (unexpected) data-field for the instance. + Note that for non-repeated sub-objects, this equates to a merge operation; + for repeated sub-objects this adds a new instance to the set; for simple + values the new value supercedes the old value. + + Note that appending a value does not remove the old value from + the stream; avoid repeatedly appending values for the same field. + The model to use for configuration. + The data-format to use when encoding the value. + The extensible object to append the value to. + The field identifier; the tag should not be defined as a known data-field for the instance. + The value to append. + + + + This class acts as an internal wrapper allowing us to do a dynamic + methodinfo invoke; an't put into Serializer as don't want on public + API; can't put into Serializer<T> since we need to invoke + across classes + + + + + All this does is call GetExtendedValuesTyped with the correct type for "instance"; + this ensures that we don't get issues with subclasses declaring conflicting types - + the caller must respect the fields defined for the type they pass in. + + + + + All this does is call GetExtendedValuesTyped with the correct type for "instance"; + this ensures that we don't get issues with subclasses declaring conflicting types - + the caller must respect the fields defined for the type they pass in. + + + + + Not all frameworks are created equal (fx1.1 vs fx2.0, + micro-framework, compact-framework, + silverlight, etc). This class simply wraps up a few things that would + otherwise make the real code unnecessarily messy, providing fallback + implementations if necessary. + + + + + Intended to be a direct map to regular TypeCode, but: + - with missing types + - existing on WinRT + + + + + Indicates that the implementing type has support for protocol-buffer + extensions. + + Can be implemented by deriving from Extensible. + + + + Retrieves the extension object for the current + instance, optionally creating it if it does not already exist. + + Should a new extension object be + created if it does not already exist? + The extension object if it exists (or was created), or null + if the extension object does not exist or is not available. + The createIfMissing argument is false during serialization, + and true during deserialization upon encountering unexpected fields. + + + + Provides addition capability for supporting unexpected fields during + protocol-buffer serialization/deserialization. This allows for loss-less + round-trip/merge, even when the data is not fully understood. + + + + + Requests a stream into which any unexpected fields can be persisted. + + A new stream suitable for storing data. + + + + Indicates that all unexpected fields have now been stored. The + implementing class is responsible for closing the stream. If + "commit" is not true the data may be discarded. + + The stream originally obtained by BeginAppend. + True if the append operation completed successfully. + + + + Requests a stream of the unexpected fields previously stored. + + A prepared stream of the unexpected fields. + + + + Indicates that all unexpected fields have now been read. The + implementing class is responsible for closing the stream. + + The stream originally obtained by BeginQuery. + + + + Requests the length of the raw binary stream; this is used + when serializing sub-entities to indicate the expected size. + + The length of the binary stream representing unexpected data. + + + + Provides the ability to remove all existing extension data + + + + + Remove all existing extension data + + + + + Specifies the method used to infer field tags for members of the type + under consideration. Tags are deduced using the invariant alphabetic + sequence of the members' names; this makes implicit field tags very brittle, + and susceptible to changes such as field names (normally an isolated + change). + + + + + No members are serialized implicitly; all members require a suitable + attribute such as [ProtoMember]. This is the recmomended mode for + most scenarios. + + + + + Public properties and fields are eligible for implicit serialization; + this treats the public API as a contract. Ordering beings from ImplicitFirstTag. + + + + + Public and non-public fields are eligible for implicit serialization; + this acts as a state/implementation serializer. Ordering beings from ImplicitFirstTag. + + + + + Represents the ability to deserialize values from an input of type + + + + + Deserialize a value from the input + + + + + Represents the ability to serialize values to an output of type + + + + + Serialize the provided value + + + + + Represents the ability to serialize values to an output of type + with pre-computation of the length + + + + + Measure the length of a value in advance of serialization + + + + + Serialize the previously measured value + + + + + Represents the outcome of computing the length of an object; since this may have required computing lengths + for multiple objects, some metadata is retained so that a subsequent serialize operation using + this instance can re-use the previously calculated lengths. If the object state changes between the + measure and serialize operations, the behavior is undefined. + + + + + Releases all resources associated with this value + + + + + Gets the calculated length of this serialize operation, in bytes + + + + + Represents the set of serialization callbacks to be used when serializing/deserializing a type. + + + + Called before serializing an instance + + + Called before deserializing an instance + + + Called after serializing an instance + + + Called after deserializing an instance + + + + True if any callback is set, else False + + + + + Represents a type at runtime for use with protobuf, allowing the field mappings (etc) to be defined + + + + + Get the name of the type being represented + + + + + Gets the base-type for this type + + + + + When used to compile a model, should public serialization/deserialzation methods + be included for this type? + + + + + Should this type be treated as a reference by default? + + + + + Adds a known sub-type to the inheritance model + + + + + Adds a known sub-type to the inheritance model + + + + + Indicates whether the current type has defined callbacks + + + + + Indicates whether the current type has defined subtypes + + + + + Returns the set of callbacks defined for this type + + + + + Assigns the callbacks to use during serialiation/deserialization. + + The method (or null) called before serialization begins. + The method (or null) called when serialization is complete. + The method (or null) called before deserialization begins (or when a new instance is created during deserialization). + The method (or null) called when deserialization is complete. + The set of callbacks. + + + + Assigns the callbacks to use during serialiation/deserialization. + + The name of the method (or null) called before serialization begins. + The name of the method (or null) called when serialization is complete. + The name of the method (or null) called before deserialization begins (or when a new instance is created during deserialization). + The name of the method (or null) called when deserialization is complete. + The set of callbacks. + + + + Gets or sets the name of this contract. + + + + + Designate a factory-method to use to create instances of this type + + + + + Designate a factory-method to use to create instances of this type + + + + + Throws an exception if the type has been made immutable + + + + + The runtime type that the meta-type represents + + + + + Adds a member (by name) to the MetaType + + + + + Adds a member (by name) to the MetaType, returning the ValueMember rather than the fluent API. + This is otherwise identical to Add. + + + + + Gets or sets whether the type should use a parameterless constructor (the default), + or whether the type should skip the constructor completely. This option is not supported + on compact-framework. + + + + + The concrete type to create when a new instance of this type is needed; this may be useful when dealing + with dynamic proxies, or with interface-based APIs + + + + + Adds a member (by name) to the MetaType + + + + + Performs serialization of this type via a surrogate; all + other serialization options are ignored and handled + by the surrogate's configuration. + + + + + Adds a set of members (by name) to the MetaType + + + + + Adds a member (by name) to the MetaType + + + + + Adds a member (by name) to the MetaType, including an itemType and defaultType for representing lists + + + + + Adds a member (by name) to the MetaType, including an itemType and defaultType for representing lists, returning the ValueMember rather than the fluent API. + This is otherwise identical to Add. + + + + + Returns the ValueMember that matchs a given field number, or null if not found + + + + + Returns the ValueMember that matchs a given member (property/field), or null if not found + + + + + Returns the ValueMember instances associated with this type + + + + + Returns the SubType instances associated with this type + + + + + Compiles the serializer for this type; this is *not* a full + standalone compile, but can significantly boost performance + while allowing additional types to be added. + + An in-place compile can access non-public types / members + + + + Gets or sets a value indicating that an enum should be treated directly as an int/short/etc, rather + than enforcing .proto enum rules. This is useful *in particul* for [Flags] enums. + + + + + Gets or sets a value indicating that this type should NOT be treated as a list, even if it has + familiar list-like characteristics (enumerable, add, etc) + + + + + Indicates whether this type should always be treated as a "group" (rather than a string-prefixed sub-message) + + + + + Apply a shift to all fields (and sub-types) on this type + + The change in field number to apply + The resultant field numbers must still all be considered valid + + + + Indiate the variant of the protobuf .proto DSL syntax to use + + + + + https://developers.google.com/protocol-buffers/docs/proto + + + + + https://developers.google.com/protocol-buffers/docs/proto3 + + + + + Provides protobuf serialization support for a number of types that can be defined at runtime + + + + + Global default that + enables/disables automatic tag generation based on the existing name / order + of the defined members. See + for usage and important warning / explanation. + You must set the global default before attempting to serialize/deserialize any + impacted type. + + + + + Global default that determines whether types are considered serializable + if they have [DataContract] / [XmlType]. With this enabled, ONLY + types marked as [ProtoContract] are added automatically. + + + + + Global switch that enables or disables the implicit + handling of "zero defaults"; meanning: if no other default is specified, + it assumes bools always default to false, integers to zero, etc. + + If this is disabled, no such assumptions are made and only *explicit* + default values are processed. This is enabled by default to + preserve similar logic to v1. + + + + + Global switch that determines whether types with a .ToString() and a Parse(string) + should be serialized as strings. + + + + + Global switch that determines whether DateTime serialization should include the Kind of the date/time. + + + + + Global switch that determines whether a single instance of the same string should be used during deserialization. + + Note this does not use the global .NET string interner + + + + Should the Kind be included on date/time values? + + + + + The default model, used to support ProtoBuf.Serializer + + + + + Returns a sequence of the Type instances that can be + processed by this model. + + + + + Suggest a .proto definition for the given type + + The type to generate a .proto definition for, or null to generate a .proto that represents the entire model + The .proto definition as a string + The .proto syntax to use + + + + Creates a new runtime model, to which the caller + can add support for a range of types. A model + can be used "as is", or can be compiled for + optimal performance. + + not used currently; this is for compatibility with v3 + + + + Obtains the MetaType associated with a given Type for the current model, + allowing additional configuration. + + + + + Adds support for an additional type in this model, optionally + applying inbuilt patterns. If the type is already known to the + model, the existing type is returned **without** applying + any additional behaviour. + + Inbuilt patterns include: + [ProtoContract]/[ProtoMember(n)] + [DataContract]/[DataMember(Order=n)] + [XmlType]/[XmlElement(Order=n)] + [On{Des|S}erializ{ing|ed}] + ShouldSerialize*/*Specified + + The type to be supported + Whether to apply the inbuilt configuration patterns (via attributes etc), or + just add the type with no additional configuration (the type must then be manually configured). + The MetaType representing this type, allowing + further configuration. + + + + Should serializers be compiled on demand? It may be useful + to disable this for debugging purposes. + + + + + Should support for unexpected types be added automatically? + If false, an exception is thrown when unexpected types + are encountered. + + + + + Verifies that the model is still open to changes; if not, an exception is thrown + + + + + Prevents further changes to this model + + + + + Provides the key that represents a given type in the current model. + + + + + Writes a protocol-buffer representation of the given instance to the supplied stream. + + Represents the type (including inheritance) to consider. + The existing instance to be serialized (cannot be null). + The destination stream to write to. + + + + Applies a protocol-buffer stream to an existing instance (which may be null). + + Represents the type (including inheritance) to consider. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Compiles the serializers individually; this is *not* a full + standalone compile, but can significantly boost performance + while allowing additional types to be added. + + An in-place compile can access non-public types / members + + + + Fully compiles the current model into a static-compiled model instance + + A full compilation is restricted to accessing public types / members + An instance of the newly created compiled type-model + + + + Represents configuration options for compiling a model to + a standalone assembly. + + + + + Import framework options from an existing type + + + + + The TargetFrameworkAttribute FrameworkName value to burn into the generated assembly + + + + + The TargetFrameworkAttribute FrameworkDisplayName value to burn into the generated assembly + + + + + The name of the TypeModel class to create + + + + + The path for the new dll + + + + + The runtime version for the generated assembly + + + + + The runtime version for the generated assembly + + + + + The acecssibility of the generated serializer + + + + + Type accessibility + + + + + Available to all callers + + + + + Available to all callers in the same assembly, or assemblies specified via [InternalsVisibleTo(...)] + + + + + Fully compiles the current model into a static-compiled serialization dll + (the serialization dll still requires protobuf-net for support services). + + A full compilation is restricted to accessing public types / members + The name of the TypeModel class to create + The path for the new dll + An instance of the newly created compiled type-model + + + + Fully compiles the current model into a static-compiled serialization dll + (the serialization dll still requires protobuf-net for support services). + + A full compilation is restricted to accessing public types / members + An instance of the newly created compiled type-model + + + + The amount of time to wait if there are concurrent metadata access operations + + + + + If a lock-contention is detected, this event signals the *owner* of the lock responsible for the blockage, indicating + what caused the problem; this is only raised if the lock-owning code successfully completes. + + + + + Designate a factory-method to use to create instances of any type; note that this only affect types seen by the serializer *after* setting the factory. + + + + + Raised before a type is auto-configured; this allows the auto-configuration to be electively suppressed + + This callback should be fast and not involve complex external calls, as it may block the model + + + + Raised after a type is auto-configured; this allows additional external customizations + + This callback should be fast and not involve complex external calls, as it may block the model + + + + Contains the stack-trace of the owning code when a lock-contention scenario is detected + + + + + The stack-trace of the code that owned the lock when a lock-contention scenario occurred + + + + + Event-type that is raised when a lock-contention scenario is detected + + + + + Represents an inherited type in a type hierarchy. + + + + + The field-number that is used to encapsulate the data (as a nested + message) for the derived dype. + + + + + The sub-type to be considered. + + + + + Creates a new SubType instance. + + The field-number that is used to encapsulate the data (as a nested + message) for the derived dype. + The sub-type to be considered. + Specific encoding style to use; in particular, Grouped can be used to avoid buffering, but is not the default. + + + + Event data associated with new types being added to a model + + + + + Whether or not to apply the default mapping behavior + + + + + The configuration of the type being added + + + + + The type that was added to the model + + + + + The model that is being changed + + + + + Event arguments needed to perform type-formatting functions; this could be resolving a Type to a string suitable for serialization, or could + be requesting a Type from a string. If no changes are made, a default implementation will be used (from the assembly-qualified names). + + + + + The type involved in this map; if this is initially null, a Type is expected to be provided for the string in FormattedName. + + + + + The formatted-name involved in this map; if this is initially null, a formatted-name is expected from the type in Type. + + + + + Delegate type used to perform type-formatting functions; the sender originates as the type-model. + + + + + Provides protobuf serialization support for a number of types + + + + + Should the Kind be included on date/time values? + + + + + Resolve a System.Type to the compiler-specific type + + + + + Resolve a System.Type to the compiler-specific type + + + + + This is the more "complete" version of Serialize, which handles single instances of mapped types. + The value is written as a complete field, including field-header and (for sub-objects) a + length-prefix + In addition to that, this provides support for: + - basic values; individual int / string / Guid / etc + - IEnumerable sequences of any type handled by TrySerializeAuxiliaryType + + + + + + Writes a protocol-buffer representation of the given instance to the supplied stream. + + The existing instance to be serialized (cannot be null). + The destination stream to write to. + + + + Writes a protocol-buffer representation of the given instance to the supplied stream. + + The existing instance to be serialized (cannot be null). + The destination stream to write to. + Additional information about this serialization operation. + + + + Writes a protocol-buffer representation of the given instance to the supplied writer. + + The existing instance to be serialized (cannot be null). + The destination writer to write to. + + + + Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed + data - useful with network IO. + + The type being merged. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + How to encode the length prefix. + The tag used as a prefix to each record (only used with base-128 style prefixes). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed + data - useful with network IO. + + The type being merged. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + How to encode the length prefix. + The tag used as a prefix to each record (only used with base-128 style prefixes). + Used to resolve types on a per-field basis. + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed + data - useful with network IO. + + The type being merged. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + How to encode the length prefix. + The tag used as a prefix to each record (only used with base-128 style prefixes). + Used to resolve types on a per-field basis. + Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed + data - useful with network IO. + + The type being merged. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + How to encode the length prefix. + The tag used as a prefix to each record (only used with base-128 style prefixes). + Used to resolve types on a per-field basis. + Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Reads a sequence of consecutive length-prefixed items from a stream, using + either base-128 or fixed-length prefixes. Base-128 prefixes with a tag + are directly comparable to serializing multiple items in succession + (use the tag to emulate the implicit behavior + when serializing a list/array). When a tag is + specified, any records with different tags are silently omitted. The + tag is ignored. The tag is ignores for fixed-length prefixes. + + The binary stream containing the serialized records. + The prefix style used in the data. + The tag of records to return (if non-positive, then no tag is + expected and all records are returned). + On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified). + The type of object to deserialize (can be null if "resolver" is specified). + The sequence of deserialized objects. + + + + Reads a sequence of consecutive length-prefixed items from a stream, using + either base-128 or fixed-length prefixes. Base-128 prefixes with a tag + are directly comparable to serializing multiple items in succession + (use the tag to emulate the implicit behavior + when serializing a list/array). When a tag is + specified, any records with different tags are silently omitted. The + tag is ignored. The tag is ignores for fixed-length prefixes. + + The binary stream containing the serialized records. + The prefix style used in the data. + The tag of records to return (if non-positive, then no tag is + expected and all records are returned). + On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified). + The type of object to deserialize (can be null if "resolver" is specified). + The sequence of deserialized objects. + Additional information about this serialization operation. + + + + Reads a sequence of consecutive length-prefixed items from a stream, using + either base-128 or fixed-length prefixes. Base-128 prefixes with a tag + are directly comparable to serializing multiple items in succession + (use the tag to emulate the implicit behavior + when serializing a list/array). When a tag is + specified, any records with different tags are silently omitted. The + tag is ignored. The tag is ignores for fixed-length prefixes. + + The type of object to deserialize. + The binary stream containing the serialized records. + The prefix style used in the data. + The tag of records to return (if non-positive, then no tag is + expected and all records are returned). + The sequence of deserialized objects. + + + + Reads a sequence of consecutive length-prefixed items from a stream, using + either base-128 or fixed-length prefixes. Base-128 prefixes with a tag + are directly comparable to serializing multiple items in succession + (use the tag to emulate the implicit behavior + when serializing a list/array). When a tag is + specified, any records with different tags are silently omitted. The + tag is ignored. The tag is ignores for fixed-length prefixes. + + The type of object to deserialize. + The binary stream containing the serialized records. + The prefix style used in the data. + The tag of records to return (if non-positive, then no tag is + expected and all records are returned). + The sequence of deserialized objects. + Additional information about this serialization operation. + + + + Writes a protocol-buffer representation of the given instance to the supplied stream, + with a length-prefix. This is useful for socket programming, + as DeserializeWithLengthPrefix can be used to read the single object back + from an ongoing stream. + + The type being serialized. + The existing instance to be serialized (cannot be null). + How to encode the length prefix. + The destination stream to write to. + The tag used as a prefix to each record (only used with base-128 style prefixes). + + + + Writes a protocol-buffer representation of the given instance to the supplied stream, + with a length-prefix. This is useful for socket programming, + as DeserializeWithLengthPrefix can be used to read the single object back + from an ongoing stream. + + The type being serialized. + The existing instance to be serialized (cannot be null). + How to encode the length prefix. + The destination stream to write to. + The tag used as a prefix to each record (only used with base-128 style prefixes). + Additional information about this serialization operation. + + + + Applies a protocol-buffer stream to an existing instance (which may be null). + + The type (including inheritance) to consider. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Applies a protocol-buffer stream to an existing instance (which may be null). + + The type (including inheritance) to consider. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + Additional information about this serialization operation. + + + + Applies a protocol-buffer stream to an existing instance (which may be null). + + The type (including inheritance) to consider. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The number of bytes to consume. + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Applies a protocol-buffer stream to an existing instance (which may be null). + + The type (including inheritance) to consider. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The number of bytes to consume. + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Applies a protocol-buffer stream to an existing instance (which may be null). + + The type (including inheritance) to consider. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The number of bytes to consume (or -1 to read to the end of the stream). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + Additional information about this serialization operation. + + + + Applies a protocol-buffer stream to an existing instance (which may be null). + + The type (including inheritance) to consider. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The number of bytes to consume (or -1 to read to the end of the stream). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + Additional information about this serialization operation. + + + + Applies a protocol-buffer reader to an existing instance (which may be null). + + The type (including inheritance) to consider. + The existing instance to be modified (can be null). + The reader to apply to the instance (cannot be null). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + This is the more "complete" version of Deserialize, which handles single instances of mapped types. + The value is read as a complete field, including field-header and (for sub-objects) a + length-prefix..kmc + + In addition to that, this provides support for: + - basic values; individual int / string / Guid / etc + - IList sets of any type handled by TryDeserializeAuxiliaryType + + + + + Creates a new runtime model, to which the caller + can add support for a range of types. A model + can be used "as is", or can be compiled for + optimal performance. + + + + + Applies common proxy scenarios, resolving the actual type to consider + + + + + Indicates whether the supplied type is explicitly modelled by the model + + + + + Provides the key that represents a given type in the current model. + The type is also normalized for proxies at the same time. + + + + + Advertise that a type's key can have changed + + + + + Provides the key that represents a given type in the current model. + + + + + Writes a protocol-buffer representation of the given instance to the supplied stream. + + Represents the type (including inheritance) to consider. + The existing instance to be serialized (cannot be null). + The destination stream to write to. + + + + Applies a protocol-buffer stream to an existing instance (which may be null). + + Represents the type (including inheritance) to consider. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Indicates the type of callback to be used + + + + + Invoked before an object is serialized + + + + + Invoked after an object is serialized + + + + + Invoked before an object is deserialized (or when a new instance is created) + + + + + Invoked after an object is deserialized + + + + + Create a deep clone of the supplied instance; any sub-items are also cloned. + + + + + Indicates that while an inheritance tree exists, the exact type encountered was not + specified in that hierarchy and cannot be processed. + + + + + Indicates that the given type was not expected, and cannot be processed. + + + + + Indicates that the given type cannot be constructed; it may still be possible to + deserialize into existing instances. + + + + + Returns true if the type supplied is either a recognised contract type, + or a *list* of a recognised contract type. + + Note that primitives always return false, even though the engine + will, if forced, try to serialize such + True if this type is recognised as a serializable entity, else false + + + + Returns true if the type supplied is a basic type with inbuilt handling, + a recognised contract type, or a *list* of a basic / contract type. + + + + + Returns true if the type supplied is a basic type with inbuilt handling, + or a *list* of a basic type with inbuilt handling + + + + + Suggest a .proto definition for the given type + + The type to generate a .proto definition for, or null to generate a .proto that represents the entire model + The .proto definition as a string + + + + Suggest a .proto definition for the given type + + The type to generate a .proto definition for, or null to generate a .proto that represents the entire model + The .proto definition as a string + The .proto syntax to use for the operation + + + + Used to provide custom services for writing and parsing type names when using dynamic types. Both parsing and formatting + are provided on a single API as it is essential that both are mapped identically at all times. + + + + + Creates a new IFormatter that uses protocol-buffer [de]serialization. + + A new IFormatter to be used during [de]serialization. + The type of object to be [de]deserialized by the formatter. + + + + Represents a member (property/field) that is mapped to a protobuf field + + + + + The number that identifies this member in a protobuf stream + + + + + Gets the member (field/property) which this member relates to. + + + + + Gets the backing member (field/property) which this member relates to + + + + + Within a list / array / etc, the type of object for each item in the list (especially useful with ArrayList) + + + + + The underlying type of the member + + + + + For abstract types (IList etc), the type of concrete object to create (if required) + + + + + The type the defines the member + + + + + The default value of the item (members with this value will not be serialized) + + + + + Creates a new ValueMember instance + + + + + Creates a new ValueMember instance + + + + + Specifies the rules used to process the field; this is used to determine the most appropriate + wite-type, but also to describe subtypes within that wire-type (such as SignedVariant) + + + + + Indicates whether this field should follow strict encoding rules; this means (for example) that if a "fixed32" + is encountered when "variant" is defined, then it will fail (throw an exception) when parsing. Note that + when serializing the defined type is always used. + + + + + Indicates whether this field should use packed encoding (which can save lots of space for repeated primitive values). + This option only applies to list/array data of primitive types (int, double, etc). + + + + + Indicates whether this field should *repace* existing values (the default is false, meaning *append*). + This option only applies to list/array data. + + + + + Indicates whether this field is mandatory. + + + + + Enables full object-tracking/full-graph support. + + + + + Embeds the type information into the stream, allowing usage with types not known in advance. + + + + + Indicates that the member should be treated as a protobuf Map + + + + + Specifies the data-format that should be used for the key, when IsMap is enabled + + + + + Specifies the data-format that should be used for the value, when IsMap is enabled + + + + + Specifies methods for working with optional data members. + + Provides a method (null for none) to query whether this member should + be serialized; it must be of the form "bool {Method}()". The member is only serialized if the + method returns true. + Provides a method (null for none) to indicate that a member was + deserialized; it must be of the form "void {Method}(bool)", and will be called with "true" + when data is found. + + + + Gets the logical name for this member in the schema (this is not critical for binary serialization, but may be used + when inferring a schema). + + + + + Should lists have extended support for null values? Note this makes the serialization less efficient. + + + + + Specifies the type of prefix that should be applied to messages. + + + + + No length prefix is applied to the data; the data is terminated only be the end of the stream. + + + + + A base-128 ("varint", the default prefix format in protobuf) length prefix is applied to the data (efficient for short messages). + + + + + A fixed-length (little-endian) length prefix is applied to the data (useful for compatibility). + + + + + A fixed-length (big-endian) length prefix is applied to the data (useful for compatibility). + + + + + Indicates that a type is defined for protocol-buffer serialization. + + + + + Gets or sets the defined name of the type. + + + + + Gets or sets the fist offset to use with implicit field tags; + only uesd if ImplicitFields is set. + + + + + If specified, alternative contract markers (such as markers for XmlSerailizer or DataContractSerializer) are ignored. + + + + + If specified, do NOT treat this type as a list, even if it looks like one. + + + + + Gets or sets the mechanism used to automatically infer field tags + for members. This option should be used in advanced scenarios only. + Please review the important notes against the ImplicitFields enumeration. + + + + + Enables/disables automatic tag generation based on the existing name / order + of the defined members. This option is not used for members marked + with ProtoMemberAttribute, as intended to provide compatibility with + WCF serialization. WARNING: when adding new fields you must take + care to increase the Order for new elements, otherwise data corruption + may occur. + + If not explicitly specified, the default is assumed from Serializer.GlobalOptions.InferTagFromName. + + + + Has a InferTagFromName value been explicitly set? if not, the default from the type-model is assumed. + + + + + Specifies an offset to apply to [DataMember(Order=...)] markers; + this is useful when working with mex-generated classes that have + a different origin (usually 1 vs 0) than the original data-contract. + + This value is added to the Order of each member. + + + + + If true, the constructor for the type is bypassed during deserialization, meaning any field initializers + or other initialization code is skipped. + + + + + Should this type be treated as a reference by default? Please also see the implications of this, + as recorded on ProtoMemberAttribute.AsReference + + + + + Indicates whether this type should always be treated as a "group" (rather than a string-prefixed sub-message) + + + + + Applies only to enums (not to DTO classes themselves); gets or sets a value indicating that an enum should be treated directly as an int/short/etc, rather + than enforcing .proto enum rules. This is useful *in particul* for [Flags] enums. + + + + + Allows to define a surrogate type used for serialization/deserialization purpose. + + + + + Has a EnumPassthru value been explicitly set? + + + + + Indicates that a static member should be considered the same as though + were an implicit / explicit conversion operator; in particular, this + is useful for conversions that operator syntax does not allow, such as + to/from interface types. + + + + + Used to define protocol-buffer specific behavior for + enumerated values. + + + + + Gets or sets the specific value to use for this enum during serialization. + + + + + Indicates whether this instance has a customised value mapping + + true if a specific value is set + + + + Gets or sets the defined name of the enum, as used in .proto + (this name is not used during serialization). + + + + + Indicates an error during serialization/deserialization of a proto stream. + + + + Creates a new ProtoException instance. + + + Creates a new ProtoException instance. + + + Creates a new ProtoException instance. + + + Creates a new ProtoException instance. + + + + Indicates that a member should be excluded from serialization; this + is only normally used when using implict fields. + + + + + Indicates that a member should be excluded from serialization; this + is only normally used when using implict fields. This allows + ProtoIgnoreAttribute usage + even for partial classes where the individual members are not + under direct control. + + + + + Creates a new ProtoPartialIgnoreAttribute instance. + + Specifies the member to be ignored. + + + + The name of the member to be ignored. + + + + + Indicates the known-types to support for an individual + message. This serializes each level in the hierarchy as + a nested message to retain wire-compatibility with + other protocol-buffer implementations. + + + + + Creates a new instance of the ProtoIncludeAttribute. + + The unique index (within the type) that will identify this data. + The additional type to serialize/deserialize. + + + + Creates a new instance of the ProtoIncludeAttribute. + + The unique index (within the type) that will identify this data. + The additional type to serialize/deserialize. + + + + Gets the unique index (within the type) that will identify this data. + + + + + Gets the additional type to serialize/deserialize. + + + + + Gets the additional type to serialize/deserialize. + + + + + Specifies whether the inherited sype's sub-message should be + written with a length-prefix (default), or with group markers. + + + + + Controls the formatting of elements in a dictionary, and indicates that + "map" rules should be used: duplicates *replace* earlier values, rather + than throwing an exception + + + + + Describes the data-format used to store the key + + + + + Describes the data-format used to store the value + + + + + Disables "map" handling; dictionaries will use ".Add(key,value)" instead of "[key] = value", + which means duplicate keys will cause an exception (instead of retaining the final value); if + a proto schema is emitted, it will be produced using "repeated" instead of "map" + + + + + Declares a member to be used in protocol-buffer serialization, using + the given Tag. A DataFormat may be used to optimise the serialization + format (for instance, using zigzag encoding for negative numbers, or + fixed-length encoding for large values. + + + + + Compare with another ProtoMemberAttribute for sorting purposes + + + + + Compare with another ProtoMemberAttribute for sorting purposes + + + + + Creates a new ProtoMemberAttribute instance. + + Specifies the unique tag used to identify this member within the type. + + + + Gets or sets the original name defined in the .proto; not used + during serialization. + + + + + Gets or sets the data-format to be used when encoding this value. + + + + + Gets the unique tag used to identify this member within the type. + + + + + Gets or sets a value indicating whether this member is mandatory. + + + + + Gets a value indicating whether this member is packed. + This option only applies to list/array data of primitive types (int, double, etc). + + + + + Indicates whether this field should *repace* existing values (the default is false, meaning *append*). + This option only applies to list/array data. + + + + + Enables full object-tracking/full-graph support. + + + + + Embeds the type information into the stream, allowing usage with types not known in advance. + + + + + Gets or sets a value indicating whether this member is packed (lists/arrays). + + + + + Additional (optional) settings that control serialization of members + + + + + Default; no additional options + + + + + Indicates that repeated elements should use packed (length-prefixed) encoding + + + + + Indicates that the given item is required + + + + + Enables full object-tracking/full-graph support + + + + + Embeds the type information into the stream, allowing usage with types not known in advance + + + + + Indicates whether this field should *repace* existing values (the default is false, meaning *append*). + This option only applies to list/array data. + + + + + Determines whether the types AsReferenceDefault value is used, or whether this member's AsReference should be used + + + + + Declares a member to be used in protocol-buffer serialization, using + the given Tag and MemberName. This allows ProtoMemberAttribute usage + even for partial classes where the individual members are not + under direct control. + A DataFormat may be used to optimise the serialization + format (for instance, using zigzag encoding for negative numbers, or + fixed-length encoding for large values. + + + + + Creates a new ProtoMemberAttribute instance. + + Specifies the unique tag used to identify this member within the type. + Specifies the member to be serialized. + + + + The name of the member to be serialized. + + + + + A stateful reader, used to read a protobuf stream. Typical usage would be (sequentially) to call + ReadFieldHeader and (after matching the field) an appropriate Read* method. + + + + + Gets the number of the field being processed. + + + + + Indicates the underlying proto serialization format on the wire. + + + + + Creates a new reader against a stream + + The source stream + The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects + Additional context about this serialization operation + + + + Gets / sets a flag indicating whether strings should be checked for repetition; if + true, any repeated UTF-8 byte sequence will result in the same String instance, rather + than a second instance of the same string. Enabled by default. Note that this uses + a custom interner - the system-wide string interner is not used. + + + + + Creates a new reader against a stream + + The source stream + The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects + Additional context about this serialization operation + The number of bytes to read, or -1 to read until the end of the stream + + + + Creates a new reader against a stream + + The source stream + The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects + Additional context about this serialization operation + The number of bytes to read, or -1 to read until the end of the stream + + + + Addition information about this deserialization operation. + + + + + Releases resources used by the reader, but importantly does not Dispose the + underlying stream; in many typical use-cases the stream is used for different + processes, so it is assumed that the consumer will Dispose their stream separately. + + + + + Reads an unsigned 32-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Returns the position of the current reader (note that this is not necessarily the same as the position + in the underlying stream, if multiple readers are used on the same stream) + + + + + Returns the position of the current reader (note that this is not necessarily the same as the position + in the underlying stream, if multiple readers are used on the same stream) + + + + + Reads a signed 16-bit integer from the stream: Variant, Fixed32, Fixed64, SignedVariant + + + + + Reads an unsigned 16-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Reads an unsigned 8-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Reads a signed 8-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant + + + + + Reads a signed 32-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant + + + + + Reads a signed 64-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant + + + + + Reads a string from the stream (using UTF8); supported wire-types: String + + + + + Throws an exception indication that the given value cannot be mapped to an enum. + + + + + Reads a double-precision number from the stream; supported wire-types: Fixed32, Fixed64 + + + + + Reads (merges) a sub-message from the stream, internally calling StartSubItem and EndSubItem, and (in between) + parsing the message in accordance with the model associated with the reader + + + + + Makes the end of consuming a nested message in the stream; the stream must be either at the correct EndGroup + marker, or all fields of the sub-message must have been consumed (in either case, this means ReadFieldHeader + should return zero) + + + + + Begins consuming a nested message in the stream; supported wire-types: StartGroup, String + + The token returned must be help and used when callining EndSubItem + + + + Reads a field header from the stream, setting the wire-type and retuning the field number. If no + more fields are available, then 0 is returned. This methods respects sub-messages. + + + + + Looks ahead to see whether the next field in the stream is what we expect + (typically; what we've just finished reading - for example ot read successive list items) + + + + + Get the TypeModel associated with this reader + + + + + Compares the streams current wire-type to the hinted wire-type, updating the reader if necessary; for example, + a Variant may be updated to SignedVariant. If the hinted wire-type is unrelated then no change is made. + + + + + Verifies that the stream's current wire-type is as expected, or a specialized sub-type (for example, + SignedVariant) - in which case the current wire-type is updated. Otherwise an exception is thrown. + + + + + Discards the data for the current field. + + + + + Reads an unsigned 64-bit integer from the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Reads a single-precision number from the stream; supported wire-types: Fixed32, Fixed64 + + + + + Reads a boolean value from the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + + Reads a byte-sequence from the stream, appending them to an existing byte-sequence (which can be null); supported wire-types: String + + + + + Reads the length-prefix of a message from a stream without buffering additional data, allowing a fixed-length + reader to be created. + + + + + Reads a little-endian encoded integer. An exception is thrown if the data is not all available. + + + + + Reads a big-endian encoded integer. An exception is thrown if the data is not all available. + + + + + Reads a varint encoded integer. An exception is thrown if the data is not all available. + + + + + Reads a string (of a given lenth, in bytes) directly from the source into a pre-existing buffer. An exception is thrown if the data is not all available. + + + + + Reads a given number of bytes directly from the source. An exception is thrown if the data is not all available. + + + + + Reads a string (of a given lenth, in bytes) directly from the source. An exception is thrown if the data is not all available. + + + + + Reads the length-prefix of a message from a stream without buffering additional data, allowing a fixed-length + reader to be created. + + + + + Reads the length-prefix of a message from a stream without buffering additional data, allowing a fixed-length + reader to be created. + + + + The number of bytes consumed; 0 if no data available + + + + Copies the current field into the instance as extension data + + + + + Indicates whether the reader still has data remaining in the current sub-item, + additionally setting the wire-type for the next field if there is more data. + This is used when decoding packed data. + + + + + Utility method, not intended for public use; this helps maintain the root object is complex scenarios + + + + + Reads a Type from the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String + + + + + Merge two objects using the details from the current reader; this is used to change the type + of objects when an inheritance relationship is discovered later than usual during deserilazation. + + + + + Creates a new reader against a stream + + The source stream + The model to use for serialization; this can be null, but this will impair the ability to deserialize sub-objects + Additional context about this serialization operation + The number of bytes to read, or -1 to read until the end of the stream + + + + Represents an output stream for writing protobuf data. + + Why is the API backwards (static methods with writer arguments)? + See: http://marcgravell.blogspot.com/2010/03/last-will-be-first-and-first-will-be.html + + + + + Write an encapsulated sub-object, using the supplied unique key (reprasenting a type). + + The object to write. + The key that uniquely identifies the type within the model. + The destination. + + + + Write an encapsulated sub-object, using the supplied unique key (reprasenting a type) - but the + caller is asserting that this relationship is non-recursive; no recursion check will be + performed. + + The object to write. + The key that uniquely identifies the type within the model. + The destination. + + + + Writes a field-header, indicating the format of the next data we plan to write. + + + + + Writes a byte-array to the stream; supported wire-types: String + + + + + Writes a byte-array to the stream; supported wire-types: String + + + + + Indicates the start of a nested record. + + The instance to write. + The destination. + A token representing the state of the stream; this token is given to EndSubItem. + + + + Indicates the end of a nested record. + + The token obtained from StartubItem. + The destination. + + + + Creates a new writer against a stream + + The destination stream + The model to use for serialization; this can be null, but this will impair the ability to serialize sub-objects + Additional context about this serialization operation + + + + Creates a new writer against a stream + + The destination stream + The model to use for serialization; this can be null, but this will impair the ability to serialize sub-objects + Additional context about this serialization operation + + + + Addition information about this serialization operation. + + + + + Flushes data to the underlying stream, and releases any resources. The underlying stream is *not* disposed + by this operation. + + + + + Get the TypeModel associated with this writer + + + + + Writes any buffered data (if possible) to the underlying stream. + + The writer to flush + It is not always possible to fully flush, since some sequences + may require values to be back-filled into the byte-stream. + + + + Writes an unsigned 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Writes a string to the stream; supported wire-types: String + + + + + Writes an unsigned 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Writes a signed 64-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant + + + + + Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Writes a signed 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant + + + + + Writes an unsigned 16-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Writes an unsigned 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Writes a signed 8-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant + + + + + Writes a signed 32-bit integer to the stream; supported wire-types: Variant, Fixed32, Fixed64, SignedVariant + + + + + Writes a double-precision number to the stream; supported wire-types: Fixed32, Fixed64 + + + + + Writes a single-precision number to the stream; supported wire-types: Fixed32, Fixed64 + + + + + Throws an exception indicating that the given enum cannot be mapped to a serialized value. + + + + + Writes a boolean to the stream; supported wire-types: Variant, Fixed32, Fixed64 + + + + + Copies any extension data stored for the instance to the underlying stream + + + + + Used for packed encoding; indicates that the next field should be skipped rather than + a field header written. Note that the field number must match, else an exception is thrown + when the attempt is made to write the (incorrect) field. The wire-type is taken from the + subsequent call to WriteFieldHeader. Only primitive types can be packed. + + + + + Used for packed encoding; explicitly reset the packed field marker; this is not required + if using StartSubItem/EndSubItem + + + + + Used for packed encoding; writes the length prefix using fixed sizes rather than using + buffering. Only valid for fixed-32 and fixed-64 encoding. + + + + + Specifies a known root object to use during reference-tracked serialization + + + + + Writes a Type to the stream, using the model's DynamicTypeFormatting if appropriate; supported wire-types: String + + + + + Additional information about a serialization operation + + + + + Gets or sets a user-defined object containing additional information about this serialization/deserialization operation. + + + + + A default SerializationContext, with minimal information. + + + + + Gets or sets the source or destination of the transmitted data. + + + + + Convert a SerializationContext to a StreamingContext + + + + + Convert a StreamingContext to a SerializationContext + + + + + Provides protocol-buffer serialization capability for concrete, attributed types. This + is a *default* model, but custom serializer models are also supported. + + + Protocol-buffer serialization is a compact binary format, designed to take + advantage of sparse data and knowledge of specific data types; it is also + extensible, allowing a type to be deserialized / merged even if some data is + not recognised. + + + + + Suggest a .proto definition for the given type + + The type to generate a .proto definition for + The .proto definition as a string + + + + Suggest a .proto definition for the given type + + The type to generate a .proto definition for + The .proto definition as a string + + + + Create a deep clone of the supplied instance; any sub-items are also cloned. + + + + + Applies a protocol-buffer stream to an existing instance. + + The type being merged. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Creates a new instance from a protocol-buffer stream + + The type to be created. + The binary stream to apply to the new instance (cannot be null). + A new, initialized instance. + + + + Creates a new instance from a protocol-buffer stream + + The type to be created. + The binary stream to apply to the new instance (cannot be null). + A new, initialized instance. + + + + Writes a protocol-buffer representation of the given instance to the supplied stream. + + The existing instance to be serialized (cannot be null). + The destination stream to write to. + + + + Serializes a given instance and deserializes it as a different type; + this can be used to translate between wire-compatible objects (where + two .NET types represent the same data), or to promote/demote a type + through an inheritance hierarchy. + + No assumption of compatibility is made between the types. + The type of the object being copied. + The type of the new object to be created. + The existing instance to use as a template. + A new instane of type TNewType, with the data from TOldType. + + + + Writes a protocol-buffer representation of the given instance to the supplied SerializationInfo. + + The type being serialized. + The existing instance to be serialized (cannot be null). + The destination SerializationInfo to write to. + + + + Writes a protocol-buffer representation of the given instance to the supplied SerializationInfo. + + The type being serialized. + The existing instance to be serialized (cannot be null). + The destination SerializationInfo to write to. + Additional information about this serialization operation. + + + + Writes a protocol-buffer representation of the given instance to the supplied XmlWriter. + + The type being serialized. + The existing instance to be serialized (cannot be null). + The destination XmlWriter to write to. + + + + Applies a protocol-buffer from an XmlReader to an existing instance. + + The type being merged. + The existing instance to be modified (cannot be null). + The XmlReader containing the data to apply to the instance (cannot be null). + + + + Applies a protocol-buffer from a SerializationInfo to an existing instance. + + The type being merged. + The existing instance to be modified (cannot be null). + The SerializationInfo containing the data to apply to the instance (cannot be null). + + + + Applies a protocol-buffer from a SerializationInfo to an existing instance. + + The type being merged. + The existing instance to be modified (cannot be null). + The SerializationInfo containing the data to apply to the instance (cannot be null). + Additional information about this serialization operation. + + + + Precompiles the serializer for a given type. + + + + + Creates a new IFormatter that uses protocol-buffer [de]serialization. + + The type of object to be [de]deserialized by the formatter. + A new IFormatter to be used during [de]serialization. + + + + Reads a sequence of consecutive length-prefixed items from a stream, using + either base-128 or fixed-length prefixes. Base-128 prefixes with a tag + are directly comparable to serializing multiple items in succession + (use the tag to emulate the implicit behavior + when serializing a list/array). When a tag is + specified, any records with different tags are silently omitted. The + tag is ignored. The tag is ignored for fixed-length prefixes. + + The type of object to deserialize. + The binary stream containing the serialized records. + The prefix style used in the data. + The tag of records to return (if non-positive, then no tag is + expected and all records are returned). + The sequence of deserialized objects. + + + + Creates a new instance from a protocol-buffer stream that has a length-prefix + on data (to assist with network IO). + + The type to be created. + The binary stream to apply to the new instance (cannot be null). + How to encode the length prefix. + A new, initialized instance. + + + + Creates a new instance from a protocol-buffer stream that has a length-prefix + on data (to assist with network IO). + + The type to be created. + The binary stream to apply to the new instance (cannot be null). + How to encode the length prefix. + The expected tag of the item (only used with base-128 prefix style). + A new, initialized instance. + + + + Applies a protocol-buffer stream to an existing instance, using length-prefixed + data - useful with network IO. + + The type being merged. + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + How to encode the length prefix. + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Writes a protocol-buffer representation of the given instance to the supplied stream, + with a length-prefix. This is useful for socket programming, + as DeserializeWithLengthPrefix/MergeWithLengthPrefix can be used to read the single object back + from an ongoing stream. + + The type being serialized. + The existing instance to be serialized (cannot be null). + How to encode the length prefix. + The destination stream to write to. + + + + Writes a protocol-buffer representation of the given instance to the supplied stream, + with a length-prefix. This is useful for socket programming, + as DeserializeWithLengthPrefix/MergeWithLengthPrefix can be used to read the single object back + from an ongoing stream. + + The type being serialized. + The existing instance to be serialized (cannot be null). + How to encode the length prefix. + The destination stream to write to. + The tag used as a prefix to each record (only used with base-128 style prefixes). + + + Indicates the number of bytes expected for the next message. + The stream containing the data to investigate for a length. + The algorithm used to encode the length. + The length of the message, if it could be identified. + True if a length could be obtained, false otherwise. + + + Indicates the number of bytes expected for the next message. + The buffer containing the data to investigate for a length. + The offset of the first byte to read from the buffer. + The number of bytes to read from the buffer. + The algorithm used to encode the length. + The length of the message, if it could be identified. + True if a length could be obtained, false otherwise. + + + + The field number that is used as a default when serializing/deserializing a list of objects. + The data is treated as repeated message with field number 1. + + + + + Provides non-generic access to the default serializer. + + + + + Create a deep clone of the supplied instance; any sub-items are also cloned. + + + + + Writes a protocol-buffer representation of the given instance to the supplied stream. + + The existing instance to be serialized (cannot be null). + The destination stream to write to. + + + + Creates a new instance from a protocol-buffer stream + + The type to be created. + The binary stream to apply to the new instance (cannot be null). + A new, initialized instance. + + + Applies a protocol-buffer stream to an existing instance. + The existing instance to be modified (cannot be null). + The binary stream to apply to the instance (cannot be null). + The updated instance + + + + Writes a protocol-buffer representation of the given instance to the supplied stream, + with a length-prefix. This is useful for socket programming, + as DeserializeWithLengthPrefix/MergeWithLengthPrefix can be used to read the single object back + from an ongoing stream. + + The existing instance to be serialized (cannot be null). + How to encode the length prefix. + The destination stream to write to. + The tag used as a prefix to each record (only used with base-128 style prefixes). + + + + Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed + data - useful with network IO. + + The existing instance to be modified (can be null). + The binary stream to apply to the instance (cannot be null). + How to encode the length prefix. + Used to resolve types on a per-field basis. + The updated instance; this may be different to the instance argument if + either the original instance was null, or the stream defines a known sub-type of the + original instance. + + + + Indicates whether the supplied type is explicitly modelled by the model + + + + + Precompiles the serializer for a given type. + + + + + Global switches that change the behavior of protobuf-net + + + + + + + + + + Maps a field-number to a type + + + + + Releases any internal buffers that have been reserved for efficiency; this does not affect any serialization + operations; simply: it can be used (optionally) to release the buffers for garbage collection (at the expense + of having to re-allocate a new buffer for the next operation, rather than re-use prior buffers). + + + + + The type that this serializer is intended to work for. + + + + + Perform the steps necessary to serialize this data. + + The value to be serialized. + The writer entity that is accumulating the output data. + + + + Perform the steps necessary to deserialize this data. + + The current value, if appropriate. + The reader providing the input data. + The updated / replacement value. + + + + Indicates whether a Read operation replaces the existing value, or + extends the value. If false, the "value" parameter to Read is + discarded, and should be passed in as null. + + + + + Now all Read operations return a value (although most do); if false no + value should be expected. + + + + Emit the IL necessary to perform the given actions + to serialize this data. + + Details and utilities for the method being generated. + The source of the data to work against; + If the value is only needed once, then LoadValue is sufficient. If + the value is needed multiple times, then note that a "null" + means "the top of the stack", in which case you should create your + own copy - GetLocalWithValue. + + + + Emit the IL necessary to perform the given actions to deserialize this data. + + Details and utilities for the method being generated. + For nested values, the instance holding the values; note + that this is not always provided - a null means not supplied. Since this is always + a variable or argument, it is not necessary to consume this value. + + + + Uses protocol buffer serialization on the specified operation; note that this + must be enabled on both the client and server. + + + + + Configuration element to swap out DatatContractSerilaizer with the XmlProtoSerializer for a given endpoint. + + + + + + Creates a new ProtoBehaviorExtension instance. + + + + + Gets the type of behavior. + + + + + Creates a behavior extension based on the current configuration settings. + + The behavior extension. + + + + Behavior to swap out DatatContractSerilaizer with the XmlProtoSerializer for a given endpoint. + + Add the following to the server and client app.config in the system.serviceModel section: + + + + + + + + + + + + + + Configure your endpoints to have a behaviorConfiguration as follows: + + + + + + + + + + + + + Describes a WCF operation behaviour that can perform protobuf serialization + + + + + Create a new ProtoOperationBehavior instance + + + + + The type-model that should be used with this behaviour + + + + + Creates a protobuf serializer if possible (falling back to the default WCF serializer) + + + + + An xml object serializer that can embed protobuf data in a base-64 hunk (looking like a byte[]) + + + + + Attempt to create a new serializer for the given model and type + + A new serializer instance if the type is recognised by the model; null otherwise + + + + Creates a new serializer for the given model and type + + + + + Ends an object in the output + + + + + Begins an object in the output + + + + + Writes the body of an object in the output + + + + + Indicates whether this is the start of an object we are prepared to handle + + + + + Reads the body of an object + + + + + Used to hold particulars relating to nested objects. This is opaque to the caller - simply + give back the token you are given at the end of an object. + + + + + Indicates the encoding used to represent an individual value in a protobuf stream + + + + + Represents an error condition + + + + + Base-128 variant-length encoding + + + + + Fixed-length 8-byte encoding + + + + + Length-variant-prefixed encoding + + + + + Indicates the start of a group + + + + + Indicates the end of a group + + + + + Fixed-length 4-byte encoding + 10 + + + + This is not a formal wire-type in the "protocol buffers" spec, but + denotes a variant integer that should be interpreted using + zig-zag semantics (so -ve numbers aren't a significant overhead) + + + + diff --git a/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.xml.meta b/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.xml.meta new file mode 100644 index 00000000..669aaacc --- /dev/null +++ b/Assets/Plugins/protobuf-net.2.4.6/lib/net40/protobuf-net.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c7e0331e4ce98de9985d964f4f79b222 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources.meta b/Assets/Resources.meta new file mode 100644 index 00000000..22f9f0fb --- /dev/null +++ b/Assets/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9a9c14381047cba687cd27342dd576f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials.meta b/Assets/Resources/Materials.meta new file mode 100644 index 00000000..0b96fbf1 --- /dev/null +++ b/Assets/Resources/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d3f2400365515b75bfaea1873c19912 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/DefaultZero.physicMaterial b/Assets/Resources/Materials/DefaultZero.physicMaterial new file mode 100644 index 00000000..5103626f --- /dev/null +++ b/Assets/Resources/Materials/DefaultZero.physicMaterial @@ -0,0 +1,14 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!134 &13400000 +PhysicMaterial: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: DefaultZero + dynamicFriction: 0.8 + staticFriction: 0.8 + bounciness: 0 + frictionCombine: 1 + bounceCombine: 1 diff --git a/Assets/Resources/Materials/DefaultZero.physicMaterial.meta b/Assets/Resources/Materials/DefaultZero.physicMaterial.meta new file mode 100644 index 00000000..4807b054 --- /dev/null +++ b/Assets/Resources/Materials/DefaultZero.physicMaterial.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 18e7b41a0fd92697b8aebb77976c6d66 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/icons.meta b/Assets/Resources/Materials/icons.meta new file mode 100644 index 00000000..d35d7d7b --- /dev/null +++ b/Assets/Resources/Materials/icons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 185ff6b21a6d5b0cab07c5f7b8d592fd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/icons/android-chrome-192x192.png b/Assets/Resources/Materials/icons/android-chrome-192x192.png new file mode 100644 index 00000000..a485696f Binary files /dev/null and b/Assets/Resources/Materials/icons/android-chrome-192x192.png differ diff --git a/Assets/Resources/Materials/icons/android-chrome-192x192.png.meta b/Assets/Resources/Materials/icons/android-chrome-192x192.png.meta new file mode 100644 index 00000000..85539131 --- /dev/null +++ b/Assets/Resources/Materials/icons/android-chrome-192x192.png.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 2187ebb8a17b0d5eab0d799764f17cce +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/icons/android-chrome-512x512.png b/Assets/Resources/Materials/icons/android-chrome-512x512.png new file mode 100644 index 00000000..0f8234ce Binary files /dev/null and b/Assets/Resources/Materials/icons/android-chrome-512x512.png differ diff --git a/Assets/Resources/Materials/icons/android-chrome-512x512.png.meta b/Assets/Resources/Materials/icons/android-chrome-512x512.png.meta new file mode 100644 index 00000000..a3347fe9 --- /dev/null +++ b/Assets/Resources/Materials/icons/android-chrome-512x512.png.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 42491c491c989c4f2a78e1338a397f7e +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/icons/apple-touch-icon.png b/Assets/Resources/Materials/icons/apple-touch-icon.png new file mode 100644 index 00000000..b57d81e5 Binary files /dev/null and b/Assets/Resources/Materials/icons/apple-touch-icon.png differ diff --git a/Assets/Resources/Materials/icons/apple-touch-icon.png.meta b/Assets/Resources/Materials/icons/apple-touch-icon.png.meta new file mode 100644 index 00000000..1f046e4f --- /dev/null +++ b/Assets/Resources/Materials/icons/apple-touch-icon.png.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 6cb5f0f77625037c4bef4d005d745eb5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/icons/cursor.png b/Assets/Resources/Materials/icons/cursor.png new file mode 100644 index 00000000..990606ce Binary files /dev/null and b/Assets/Resources/Materials/icons/cursor.png differ diff --git a/Assets/Resources/Materials/icons/cursor.png.meta b/Assets/Resources/Materials/icons/cursor.png.meta new file mode 100644 index 00000000..024ee13a --- /dev/null +++ b/Assets/Resources/Materials/icons/cursor.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 8c59cc8e2487aff97b53248ea15b74c0 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 0 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 7 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 1 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 1 + textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/icons/favicon-16x16.png b/Assets/Resources/Materials/icons/favicon-16x16.png new file mode 100644 index 00000000..2d6ba539 Binary files /dev/null and b/Assets/Resources/Materials/icons/favicon-16x16.png differ diff --git a/Assets/Resources/Materials/icons/favicon-16x16.png.meta b/Assets/Resources/Materials/icons/favicon-16x16.png.meta new file mode 100644 index 00000000..71354c37 --- /dev/null +++ b/Assets/Resources/Materials/icons/favicon-16x16.png.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 406f13e5fc437db1f98415cbfeb6bfdc +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/icons/favicon-32x32.png b/Assets/Resources/Materials/icons/favicon-32x32.png new file mode 100644 index 00000000..285a8b55 Binary files /dev/null and b/Assets/Resources/Materials/icons/favicon-32x32.png differ diff --git a/Assets/Resources/Materials/icons/favicon-32x32.png.meta b/Assets/Resources/Materials/icons/favicon-32x32.png.meta new file mode 100644 index 00000000..2d742cf1 --- /dev/null +++ b/Assets/Resources/Materials/icons/favicon-32x32.png.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 2852bac149b187eb4bfad5883490fee9 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/icons/favicon.ico b/Assets/Resources/Materials/icons/favicon.ico new file mode 100644 index 00000000..32abab7e Binary files /dev/null and b/Assets/Resources/Materials/icons/favicon.ico differ diff --git a/Assets/Resources/Materials/icons/favicon.ico.meta b/Assets/Resources/Materials/icons/favicon.ico.meta new file mode 100644 index 00000000..4ea5eb8e --- /dev/null +++ b/Assets/Resources/Materials/icons/favicon.ico.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 928ad2bd36ca7f5a6a792b0c22b31f62 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Materials/temp_material.physicMaterial b/Assets/Resources/Materials/temp_material.physicMaterial new file mode 100644 index 00000000..8a41977c --- /dev/null +++ b/Assets/Resources/Materials/temp_material.physicMaterial @@ -0,0 +1,14 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!134 &13400000 +PhysicMaterial: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: temp_material + dynamicFriction: 0.5 + staticFriction: 0.6 + bounciness: 0 + frictionCombine: 0 + bounceCombine: 0 diff --git a/Assets/Resources/Materials/temp_material.physicMaterial.meta b/Assets/Resources/Materials/temp_material.physicMaterial.meta new file mode 100644 index 00000000..e086b18c --- /dev/null +++ b/Assets/Resources/Materials/temp_material.physicMaterial.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9cf0822921b89b82fb8239bf69165329 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Shader.meta b/Assets/Resources/Shader.meta new file mode 100644 index 00000000..71c798b0 --- /dev/null +++ b/Assets/Resources/Shader.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d1255cffe7873820aac5fe0351fcc85 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Shader/SensorDepth.shader b/Assets/Resources/Shader/SensorDepth.shader new file mode 100644 index 00000000..b51de932 --- /dev/null +++ b/Assets/Resources/Shader/SensorDepth.shader @@ -0,0 +1,57 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' +Shader "Sensor/DepthShader" +{ + SubShader + { + Cull Back + ZWrite Off + ZTest LEqual + + Tags + { + "RenderType" = "Opaque" + "Queue" = "Geometry" + "ForceNoShadowCasting" = "True" + } + + Pass + { + Fog { Mode Off } + + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #pragma target 3.0 + #include "UnityCG.cginc" + + uniform sampler2D _CameraDepthTexture; + // uniform float4x4 _ViewProjInv; + uniform half4 _MainTex_TexelSize; + + v2f_img vert(appdata_img v) + { + v2f_img o; + o.pos = UnityObjectToClipPos(v.vertex); + o.uv = MultiplyUV(UNITY_MATRIX_TEXTURE0, v.texcoord); + + // why do we need this? cause sometimes the image I get is flipped. see: http://docs.unity3d.com/Manual/SL-PlatformDifferences.html + #if UNITY_UV_STARTS_AT_TOP + if (_MainTex_TexelSize.y < 0) + o.uv.y = 1 - o.uv.y; + #endif + + return o; + } + + float4 frag(v2f_img i) : COLOR + { + float depth = UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, i.uv.xy)); + return EncodeFloatRGBA( Linear01Depth(depth) ); + } + + ENDCG + } + } + FallBack "VertexLit" +} \ No newline at end of file diff --git a/Assets/Resources/Shader/SensorDepth.shader.meta b/Assets/Resources/Shader/SensorDepth.shader.meta new file mode 100644 index 00000000..1473dbb8 --- /dev/null +++ b/Assets/Resources/Shader/SensorDepth.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1a5580673dcecd5aca2677d75ef17de5 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Shader/SensorDepthCamera.shader b/Assets/Resources/Shader/SensorDepthCamera.shader new file mode 100644 index 00000000..e78a772c --- /dev/null +++ b/Assets/Resources/Shader/SensorDepthCamera.shader @@ -0,0 +1,56 @@ +Shader "Sensor/DepthCamera" +{ + SubShader + { + Cull Back + ZWrite Off + ZTest LEqual + + Tags + { + "RenderType" = "Opaque" + "Queue" = "Geometry" + "ForceNoShadowCasting" = "True" + } + + Pass + { + Fog { Mode Off } + + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #pragma target 3.0 + #include "UnityCG.cginc" + + uniform sampler2D _CameraDepthTexture; + // uniform float4x4 _ViewProjInv; + uniform half4 _MainTex_TexelSize; + + v2f_img vert(appdata_img v) + { + v2f_img o; + o.pos = UnityObjectToClipPos(v.vertex); + o.uv = MultiplyUV(UNITY_MATRIX_TEXTURE0, v.texcoord); + + // why do we need this? cause sometimes the image I get is flipped. see: http://docs.unity3d.com/Manual/SL-PlatformDifferences.html + #if UNITY_UV_STARTS_AT_TOP + if (_MainTex_TexelSize.y < 0) + o.uv.y = 1 - o.uv.y; + #endif + + return o; + } + + float frag(v2f_img i) : SV_Target + { + float depth = UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, i.uv.xy)); + return Linear01Depth(depth); + } + + ENDCG + } + } + FallBack "VertexLit" +} \ No newline at end of file diff --git a/Assets/Resources/Shader/SensorDepthCamera.shader.meta b/Assets/Resources/Shader/SensorDepthCamera.shader.meta new file mode 100644 index 00000000..43edd70d --- /dev/null +++ b/Assets/Resources/Shader/SensorDepthCamera.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f00df40f1e614149c8c27b8fc73a3bd5 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes.meta b/Assets/Scenes.meta new file mode 100644 index 00000000..eff64a64 --- /dev/null +++ b/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 722be9b8684754c3c9f798fa0a048713 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MainScene.meta b/Assets/Scenes/MainScene.meta new file mode 100644 index 00000000..450007f1 --- /dev/null +++ b/Assets/Scenes/MainScene.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d5d168f2909265a593a8cc6c47bf99e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity new file mode 100644 index 00000000..0c41f171 --- /dev/null +++ b/Assets/Scenes/MainScene.unity @@ -0,0 +1,7038 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.764151, g: 0.7261441, b: 0.58753115, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 16 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 705507994} + m_IndirectSpecularColor: {r: 0.17276844, g: 0.21589246, b: 0.2978263, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 512 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 1 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000000, guid: ca79b04ab7cd1071ca8ddf0d3a0beef1, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &10540286 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 10540287} + - component: {fileID: 10540290} + - component: {fileID: 10540289} + - component: {fileID: 10540288} + m_Layer: 0 + m_Name: RightWheel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &10540287 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 10540286} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.62, y: -0.19999999, z: 0.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 119213122} + - {fileID: 1419178855} + m_Father: {fileID: 223905745} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!114 &10540288 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 10540286} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72a1f3cb16d2788bbaf5cf1795ca33df, type: 3} + m_Name: + m_EditorClassIdentifier: + isSelfCollide: 0 +--- !u!59 &10540289 +HingeJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 10540286} + m_ConnectedBody: {fileID: 1884339981} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: -1, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.1399999, y: 0.000000015319308, z: -0.00000001668929} + m_UseSpring: 0 + m_Spring: + spring: 0 + damper: 0 + targetPosition: 0 + m_UseMotor: 1 + m_Motor: + targetVelocity: 698 + force: 0 + freeSpin: 1 + m_UseLimits: 0 + m_Limits: + min: 0 + max: 0 + bounciness: 0 + bounceMinVelocity: 0.2 + contactDistance: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &10540290 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 10540286} + serializedVersion: 2 + m_Mass: 0.4 + m_Drag: 0 + m_AngularDrag: 0.85 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &25597963 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 25597964} + - component: {fileID: 25597966} + - component: {fileID: 25597965} + m_Layer: 0 + m_Name: LeftWheel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &25597964 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 25597963} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: -0.6, y: -0.19999999, z: 0.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 779420289} + - {fileID: 1484210557} + m_Father: {fileID: 2106501633} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!59 &25597965 +HingeJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 25597963} + m_ConnectedBody: {fileID: 1411001346} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: -1, z: 0} + m_AutoConfigureConnectedAnchor: 0 + m_ConnectedAnchor: {x: -0.6, y: -0.55, z: 0.20000002} + m_UseSpring: 0 + m_Spring: + spring: 0 + damper: 0 + targetPosition: 0 + m_UseMotor: 1 + m_Motor: + targetVelocity: 800 + force: 0 + freeSpin: 1 + m_UseLimits: 0 + m_Limits: + min: 0 + max: 0 + bounciness: 0 + bounceMinVelocity: 0.2 + contactDistance: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &25597966 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 25597963} + serializedVersion: 2 + m_Mass: 1.5 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &34803206 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 34803207} + - component: {fileID: 34803210} + - component: {fileID: 34803209} + - component: {fileID: 34803208} + m_Layer: 0 + m_Name: visual + m_TagString: Visual + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &34803207 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 34803206} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.011, y: 0.05, z: 0.011} + m_Children: [] + m_Father: {fileID: 1756567521} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &34803208 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 34803206} + m_Mesh: {fileID: 10203, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &34803209 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 34803206} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!114 &34803210 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 34803206} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b88a01d91f53249a09d8c0d41c32d770, type: 3} + m_Name: + m_EditorClassIdentifier: + isCastingShadow: 0 +--- !u!1 &113319019 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 113319020} + - component: {fileID: 113319022} + - component: {fileID: 113319021} + m_Layer: 0 + m_Name: visual + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &113319020 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 113319019} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.1, z: 0.5} + m_Children: [] + m_Father: {fileID: 1791041573} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &113319021 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 113319019} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &113319022 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 113319019} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &119213121 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 119213122} + - component: {fileID: 119213124} + m_Layer: 0 + m_Name: collision + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &119213122 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 119213121} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.1, z: 0.5} + m_Children: [] + m_Father: {fileID: 10540287} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &119213124 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 119213121} + m_Material: {fileID: 13400000, guid: 9cf0822921b89b82fb8239bf69165329, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &126105768 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 126105769} + m_Layer: 0 + m_Name: Models + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &126105769 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 126105768} + 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: 1095822271} + - {fileID: 2106501633} + - {fileID: 223905745} + - {fileID: 1721554202} + - {fileID: 774957604} + - {fileID: 1889185996} + - {fileID: 2077744552} + - {fileID: 1349895855} + - {fileID: 540965988} + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &162674478 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 162674479} + - component: {fileID: 162674482} + - component: {fileID: 162674481} + - component: {fileID: 162674480} + m_Layer: 0 + m_Name: visual + m_TagString: Visual + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &162674479 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 162674478} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.011, y: 0.05, z: 0.011} + m_Children: [] + m_Father: {fileID: 1884339984} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &162674480 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 162674478} + m_Mesh: {fileID: 10203, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &162674481 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 162674478} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!114 &162674482 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 162674478} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b88a01d91f53249a09d8c0d41c32d770, type: 3} + m_Name: + m_EditorClassIdentifier: + isCastingShadow: 0 +--- !u!1 &223905744 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 223905745} + m_Layer: 0 + m_Name: CarWithSuspension + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &223905745 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 223905744} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -3.626, y: 0.597, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1566749266} + - {fileID: 1613444316} + - {fileID: 2133470736} + - {fileID: 1791041573} + - {fileID: 10540287} + - {fileID: 747390630} + m_Father: {fileID: 126105769} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &249819585 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 249819586} + - component: {fileID: 249819589} + - component: {fileID: 249819591} + - component: {fileID: 249819587} + - component: {fileID: 249819588} + - component: {fileID: 249819590} + m_Layer: 0 + m_Name: Core + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!4 &249819586 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249819585} + 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: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &249819587 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249819585} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 918c1bad59e9f0fb684f7a795431a3f2, type: 3} + m_Name: + m_EditorClassIdentifier: + defaultPipeAddress: 127.0.0.1 +--- !u!114 &249819588 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249819585} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fed3a835840db597d965c095f0331009, type: 3} + m_Name: + m_EditorClassIdentifier: + defaultPipeAddress: 127.0.0.1 + modelName: UnityRosInit +--- !u!114 &249819589 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249819585} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b919b529ee3735e1ad02c2e9e0e77e2, type: 3} + m_Name: + m_EditorClassIdentifier: + doNotLoad: 0 + pauseOnStart: 0 + clearAllOnStart: 1 + worldFileName: seocho_tower_multi.world +--- !u!114 &249819590 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249819585} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f27710de512a0490b04a13f196dea25, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &249819591 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249819585} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0b35ad012dfd6abcba18e5bd9503dd4f, type: 3} + m_Name: + m_EditorClassIdentifier: + defaultWebSocketAddress: 127.0.0.1 + defaultWebSocketPort: 8080 +--- !u!1 &333360875 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 333360876} + m_Layer: 0 + m_Name: Markers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &333360876 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 333360875} + 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: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &387521878 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 387521879} + - component: {fileID: 387521881} + - component: {fileID: 387521880} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &387521879 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 387521878} + 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: 1655136414} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -7.5, y: -0.5} + m_SizeDelta: {x: -35, y: 15} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &387521880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 387521878} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278848010 + m_fontColor: {r: 0.03773582, g: 0.03773582, b: 0.03773582, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_outlineColor: + serializedVersion: 2 + rgba: 4278190080 + m_fontSize: 13 + m_fontSizeBase: 13 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_textAlignment: 513 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 0 + m_wordWrappingRatios: 0.4 + m_overflowMode: 1 + m_firstOverflowCharacterIndex: -1 + m_linkedTextComponent: {fileID: 0} + m_isLinkedTextComponent: 0 + m_isTextTruncated: 0 + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_ignoreRectMaskCulling: 0 + m_ignoreCulling: 1 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_VertexBufferAutoSizeReduction: 1 + m_firstVisibleCharacter: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_textInfo: + textComponent: {fileID: 387521880} + characterCount: 0 + spriteCount: 0 + spaceCount: 0 + wordCount: 0 + linkCount: 0 + lineCount: 0 + pageCount: 0 + materialCount: 1 + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_spriteAnimator: {fileID: 0} + m_hasFontAssetChanged: 0 + m_subTextObjects: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &387521881 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 387521878} + m_CullTransparentMesh: 0 +--- !u!1 &402915475 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 402915476} + - component: {fileID: 402915481} + - component: {fileID: 402915480} + - component: {fileID: 402915479} + - component: {fileID: 402915478} + - component: {fileID: 402915477} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &402915476 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402915475} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.37, z: -0.6} + m_LocalScale: {x: 0.2, y: 0.2, z: 0.2} + m_Children: [] + m_Father: {fileID: 2106501633} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!153 &402915477 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402915475} + m_ConnectedBody: {fileID: 1411001346} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0, y: -0.925, z: -0.40000004} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 1, z: 0} + m_XMotion: 0 + m_YMotion: 0 + m_ZMotion: 0 + m_AngularXMotion: 2 + m_AngularYMotion: 2 + m_AngularZMotion: 2 + m_LinearLimitSpring: + spring: 0 + damper: 1 + m_LinearLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 1 + maximumForce: 3.4028233e+38 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &402915478 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402915475} + serializedVersion: 2 + m_Mass: 2 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!135 &402915479 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402915475} + m_Material: {fileID: 13400000, guid: 9cf0822921b89b82fb8239bf69165329, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &402915480 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402915475} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &402915481 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402915475} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &415239023 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 415239024} + - component: {fileID: 415239026} + m_Layer: 0 + m_Name: collision + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &415239024 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415239023} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.1, z: 0.5} + m_Children: [] + m_Father: {fileID: 1791041573} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &415239026 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415239023} + m_Material: {fileID: 13400000, guid: 9cf0822921b89b82fb8239bf69165329, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &428331598 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 428331599} + - component: {fileID: 428331602} + - component: {fileID: 428331601} + - component: {fileID: 428331600} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &428331599 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 428331598} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 3.6, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2106501633} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &428331600 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 428331598} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &428331601 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 428331598} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &428331602 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 428331598} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &502293188 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 502293189} + - component: {fileID: 502293191} + - component: {fileID: 502293190} + m_Layer: 5 + m_Name: Item Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &502293189 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 502293188} + 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: 1150446471} + 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: 5, y: -0.5} + m_SizeDelta: {x: -30, y: -3} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &502293190 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 502293188} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Option A + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_outlineColor: + serializedVersion: 2 + rgba: 4278190080 + m_fontSize: 14 + m_fontSizeBase: 14 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_textAlignment: 513 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_firstOverflowCharacterIndex: -1 + m_linkedTextComponent: {fileID: 0} + m_isLinkedTextComponent: 0 + m_isTextTruncated: 0 + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_ignoreRectMaskCulling: 0 + m_ignoreCulling: 1 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_VertexBufferAutoSizeReduction: 1 + m_firstVisibleCharacter: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_textInfo: + textComponent: {fileID: 502293190} + characterCount: 0 + spriteCount: 0 + spaceCount: 0 + wordCount: 0 + linkCount: 0 + lineCount: 0 + pageCount: 0 + materialCount: 1 + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_spriteAnimator: {fileID: 0} + m_hasFontAssetChanged: 0 + m_subTextObjects: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &502293191 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 502293188} + m_CullTransparentMesh: 0 +--- !u!1 &512943789 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 512943790} + - component: {fileID: 512943792} + - component: {fileID: 512943791} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &512943790 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 512943789} + 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: 1771353712} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0.2} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &512943791 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 512943789} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &512943792 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 512943789} + m_CullTransparentMesh: 0 +--- !u!1 &536702292 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 536702293} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &536702293 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 536702292} + 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: 1150446471} + m_Father: {fileID: 1117250924} + 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: 0} + m_SizeDelta: {x: 0, y: 28} + m_Pivot: {x: 0.5, y: 1} +--- !u!1 &540965987 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 540965988} + - component: {fileID: 540965991} + - component: {fileID: 540965990} + - component: {fileID: 540965989} + m_Layer: 0 + m_Name: Cube(Long) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &540965988 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540965987} + m_LocalRotation: {x: -0, y: 0.5467403, z: -0, w: 0.83730227} + m_LocalPosition: {x: 491.45, y: 0.58, z: 475.148} + m_LocalScale: {x: 4.9874, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 126105769} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 66.287, z: 0} +--- !u!65 &540965989 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540965987} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &540965990 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540965987} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &540965991 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540965987} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &568997911 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 568997912} + - component: {fileID: 568997917} + - component: {fileID: 568997916} + - component: {fileID: 568997915} + - component: {fileID: 568997913} + - component: {fileID: 568997914} + m_Layer: 0 + m_Name: pole_fl + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &568997912 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 568997911} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2, y: 1.527, z: 2} + m_LocalScale: {x: 0.5, y: 1, z: 0.5} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &568997913 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 568997911} + serializedVersion: 2 + m_Mass: 0.1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!153 &568997914 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 568997911} + m_ConnectedBody: {fileID: 1835497268} + m_Anchor: {x: 0, y: 0.5, z: 0} + m_Axis: {x: 0, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.25, y: -0.3364998, z: 0.25} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 1, z: 0} + m_XMotion: 0 + m_YMotion: 1 + m_ZMotion: 0 + m_AngularXMotion: 0 + m_AngularYMotion: 0 + m_AngularZMotion: 0 + m_LinearLimitSpring: + spring: 9000 + damper: 1000 + m_LinearLimit: + limit: 0.5 + bounciness: 0.1 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 90 + positionDamper: 20 + maximumForce: 3.402823e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 1 + m_ProjectionDistance: 0.5 + m_ProjectionAngle: 0 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!65 &568997915 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 568997911} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &568997916 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 568997911} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &568997917 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 568997911} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &610688432 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 610688433} + - component: {fileID: 610688436} + - component: {fileID: 610688435} + - component: {fileID: 610688434} + m_Layer: 5 + m_Name: VisualizerLider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 0 +--- !u!224 &610688433 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 610688432} + 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: 1183087834} + 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: 70, y: -60} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &610688434 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 610688432} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!222 &610688435 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 610688432} + m_CullTransparentMesh: 0 +--- !u!114 &610688436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 610688432} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 16254889ddec0ce0ba7f7db671e92d0b, type: 3} + m_Name: + m_EditorClassIdentifier: + targetLidarName: + textureSize: 0 + updateRate: 0.1 +--- !u!1 &622325894 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 622325895} + m_Layer: 0 + m_Name: Lights + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &622325895 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 622325894} + m_LocalRotation: {x: -0, y: -9.313226e-10, z: 4.656613e-10, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 705507995} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &683297084 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 683297085} + - component: {fileID: 683297087} + - component: {fileID: 683297086} + m_Layer: 0 + m_Name: UI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &683297085 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683297084} + 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: 1183087834} + - {fileID: 963194228} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &683297086 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683297084} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &683297087 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683297084} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!1 &702124002 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 702124003} + - component: {fileID: 702124008} + - component: {fileID: 702124007} + - component: {fileID: 702124006} + - component: {fileID: 702124005} + - component: {fileID: 702124004} + - component: {fileID: 702124009} + m_Layer: 0 + m_Name: foot_fr + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &702124003 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 702124002} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2, y: 0.69299984, z: -2} + m_LocalScale: {x: 1.65, y: 0.2, z: 1.65} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!59 &702124004 +HingeJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 702124002} + m_ConnectedBody: {fileID: 1525198632} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: 1, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0, y: -0.8340001, z: 0} + m_UseSpring: 0 + m_Spring: + spring: 0 + damper: 0 + targetPosition: 0 + m_UseMotor: 0 + m_Motor: + targetVelocity: 0 + force: 0 + freeSpin: 0 + m_UseLimits: 0 + m_Limits: + min: 0 + max: 0 + bounciness: 0 + bounceMinVelocity: 0.2 + contactDistance: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 1 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &702124005 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 702124002} + serializedVersion: 2 + m_Mass: 0.5 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &702124006 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 702124002} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &702124007 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 702124002} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &702124008 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 702124002} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &702124009 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 702124002} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72a1f3cb16d2788bbaf5cf1795ca33df, type: 3} + m_Name: + m_EditorClassIdentifier: + isSelfCollide: 0 +--- !u!1 &705507993 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 705507995} + - component: {fileID: 705507994} + m_Layer: 0 + m_Name: Sun + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &705507994 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.96862745, b: 0.92156863, a: 1} + m_Intensity: 1 + m_Range: 10000 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.802082 + m_CookieSize: 0 + m_Shadows: + m_Type: 1 + m_Resolution: 0 + m_CustomResolution: -1 + m_Strength: 0.6 + m_Bias: 0.01 + m_NormalBias: 0.3 + m_NearPlane: 0.1 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 1 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &705507995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 500, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 622325895} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!1 &705796951 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 705796952} + - component: {fileID: 705796954} + - component: {fileID: 705796953} + - component: {fileID: 705796955} + m_Layer: 5 + m_Name: SimulationDisplay + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!224 &705796952 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705796951} + 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: 1183087834} + 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: 360, y: 30} + m_SizeDelta: {x: 700, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &705796953 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705796951} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Simulation Information + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_outlineColor: + serializedVersion: 2 + rgba: 4278190080 + m_fontSize: 15 + m_fontSizeBase: 15 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_textAlignment: 513 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_firstOverflowCharacterIndex: -1 + m_linkedTextComponent: {fileID: 0} + m_isLinkedTextComponent: 0 + m_isTextTruncated: 0 + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_ignoreRectMaskCulling: 0 + m_ignoreCulling: 1 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_VertexBufferAutoSizeReduction: 1 + m_firstVisibleCharacter: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_textInfo: + textComponent: {fileID: 705796953} + characterCount: 22 + spriteCount: 0 + spaceCount: 1 + wordCount: 2 + linkCount: 0 + lineCount: 1 + pageCount: 1 + materialCount: 1 + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_spriteAnimator: {fileID: 0} + m_hasFontAssetChanged: 0 + m_subTextObjects: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &705796954 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705796951} + m_CullTransparentMesh: 0 +--- !u!114 &705796955 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705796951} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cbae07c6267889cceacfaf4e676c5ccf, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &747390629 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 747390630} + - component: {fileID: 747390635} + - component: {fileID: 747390633} + - component: {fileID: 747390632} + - component: {fileID: 747390631} + - component: {fileID: 747390634} + m_Layer: 0 + m_Name: Cube(Main)S + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &747390630 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747390629} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.008, z: 0} + m_LocalScale: {x: 1, y: 0.4, z: 1.5} + m_Children: [] + m_Father: {fileID: 223905745} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!75 &747390631 +ConstantForce: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747390629} + m_Enabled: 1 + m_Force: {x: 0, y: 0, z: 0} + m_RelativeForce: {x: 0, y: 0, z: 0} + m_Torque: {x: 0, y: 0, z: 0} + m_RelativeTorque: {x: 0, y: 0, z: 0} +--- !u!54 &747390632 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747390629} + serializedVersion: 2 + m_Mass: 80 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &747390633 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747390629} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!137 &747390634 +SkinnedMeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747390629} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 0 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} + m_Bones: [] + m_BlendShapeWeights: [] + m_RootBone: {fileID: 0} + m_AABB: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0.5, y: 0.5, z: 0.5} + m_DirtyAABB: 0 +--- !u!33 &747390635 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747390629} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &774957603 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 774957604} + - component: {fileID: 774957605} + m_Layer: 0 + m_Name: SpringObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &774957604 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 774957603} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 50, y: 10, z: 50} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1835497264} + - {fileID: 1314072910} + - {fileID: 702124003} + - {fileID: 1564278298} + - {fileID: 1041446058} + - {fileID: 568997912} + - {fileID: 1525198631} + - {fileID: 849325911} + - {fileID: 1614905073} + m_Father: {fileID: 126105769} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &774957605 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 774957603} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &779420288 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 779420289} + - component: {fileID: 779420291} + m_Layer: 0 + m_Name: collision + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &779420289 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 779420288} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.1, z: 0.5} + m_Children: [] + m_Father: {fileID: 25597964} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &779420291 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 779420288} + m_Material: {fileID: 13400000, guid: 9cf0822921b89b82fb8239bf69165329, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 20 + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &849325910 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 849325911} + - component: {fileID: 849325916} + - component: {fileID: 849325915} + - component: {fileID: 849325914} + - component: {fileID: 849325912} + - component: {fileID: 849325913} + m_Layer: 0 + m_Name: pole_rl + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &849325911 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849325910} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2, y: 1.527, z: 2} + m_LocalScale: {x: 0.5, y: 1, z: 0.5} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &849325912 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849325910} + serializedVersion: 2 + m_Mass: 0.1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!153 &849325913 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849325910} + m_ConnectedBody: {fileID: 1835497268} + m_Anchor: {x: 0, y: 0.5, z: 0} + m_Axis: {x: 0, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.25, y: -0.3364998, z: 0.25} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 1, z: 0} + m_XMotion: 0 + m_YMotion: 1 + m_ZMotion: 0 + m_AngularXMotion: 0 + m_AngularYMotion: 0 + m_AngularZMotion: 0 + m_LinearLimitSpring: + spring: 9000 + damper: 1000 + m_LinearLimit: + limit: 0.5 + bounciness: 0.1 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 90 + positionDamper: 20 + maximumForce: 3.402823e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 1 + m_ProjectionDistance: 0.5 + m_ProjectionAngle: 0 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!65 &849325914 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849325910} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &849325915 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849325910} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &849325916 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849325910} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &876502904 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 876502905} + - component: {fileID: 876502907} + - component: {fileID: 876502906} + m_Layer: 0 + m_Name: RightWheel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &876502905 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 876502904} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.6, y: -0.19999999, z: 0.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 905425802} + - {fileID: 887438905} + m_Father: {fileID: 2106501633} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!59 &876502906 +HingeJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 876502904} + m_ConnectedBody: {fileID: 1411001346} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: -1, z: 0} + m_AutoConfigureConnectedAnchor: 0 + m_ConnectedAnchor: {x: 0.6, y: -0.55, z: 0.20000002} + m_UseSpring: 0 + m_Spring: + spring: 0 + damper: 0 + targetPosition: 0 + m_UseMotor: 1 + m_Motor: + targetVelocity: 800 + force: 0 + freeSpin: 1 + m_UseLimits: 0 + m_Limits: + min: 0 + max: 0 + bounciness: 0 + bounceMinVelocity: 0.2 + contactDistance: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &876502907 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 876502904} + serializedVersion: 2 + m_Mass: 1.5 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &887438904 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 887438905} + - component: {fileID: 887438907} + - component: {fileID: 887438906} + m_Layer: 0 + m_Name: visual + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &887438905 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 887438904} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.1, z: 0.5} + m_Children: [] + m_Father: {fileID: 876502905} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &887438906 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 887438904} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &887438907 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 887438904} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &905425801 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 905425802} + - component: {fileID: 905425804} + m_Layer: 0 + m_Name: collision + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &905425802 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 905425801} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.1, z: 0.5} + m_Children: [] + m_Father: {fileID: 876502905} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &905425804 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 905425801} + m_Material: {fileID: 13400000, guid: 9cf0822921b89b82fb8239bf69165329, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 20 + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &925108812 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 925108813} + - component: {fileID: 925108814} + m_Layer: 0 + m_Name: collision + m_TagString: Collision + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &925108813 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 925108812} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.011, y: 0.05, z: 0.011} + m_Children: [] + m_Father: {fileID: 1756567521} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &925108814 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 925108812} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 10203, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &963194225 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 963194228} + - component: {fileID: 963194227} + - component: {fileID: 963194226} + - component: {fileID: 963194229} + - component: {fileID: 963194230} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &963194226 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8ec65e03504ece92cbeb7b40065a589c, type: 3} + m_Name: + m_EditorClassIdentifier: + blockControl: 0 + mainSpeed: 10 + shiftAdd: 20 + maxShift: 50 + camSens: 0.1 +--- !u!20 &963194227 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 70, y: 51} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.8 + far clip plane: 500 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 3 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 0 + m_HDR: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 1 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &963194228 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_LocalRotation: {x: 0.3987149, y: 0.012003932, z: -0.005219459, w: 0.91698146} + m_LocalPosition: {x: 0, y: 15, z: -15} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 683297085} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 47, y: 1.5, z: 0} +--- !u!114 &963194229 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c0a0594d67b881919b42a82caeb95d57, type: 3} + m_Name: + m_EditorClassIdentifier: + blockControl: 0 + distance: 1 + height: 3 + followingAngle: -90 + moveAmount: 0.1 + angleStep: 1.5 +--- !u!114 &963194230 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1c0ad0e8e55c95c4e931911c4b943a64, type: 3} + m_Name: + m_EditorClassIdentifier: + space: 0 + transformType: 0 + pivot: 0 + centerType: 0 + scaleType: 0 + planesOpacity: 0.25 + movementSnap: 0.25 + rotationSnap: 10 + scaleSnap: 1 + handleLength: 0.1 + handleWidth: 0.003 + planeSize: 0.025 + triangleSize: 0.015 + boxSize: 0.02 + circleDetail: 50 + allMoveHandleLengthMultiplier: 1 + allRotateHandleLengthMultiplier: 1 + allScaleHandleLengthMultiplier: 1 + minSelectedDistanceCheck: 0.01 + moveSpeedMultiplier: 1 + scaleSpeedMultiplier: 1 + rotateSpeedMultiplier: 1 + allRotateSpeedMultiplier: 20 + useFirstSelectedAsMain: 1 + circularRotationMethod: 0 + forceUpdatePivotPointOnChange: 1 + maxUndoStored: 100 + manuallyHandleGizmo: 0 + selectionMask: + serializedVersion: 2 + m_Bits: 1 + SetMoveType: 116 + SetRotateType: 114 + SetScaleType: 0 + SetAllTransformType: 121 + SetSpaceToggle: 120 + SetPivotModeToggle: 0 + SetCenterTypeToggle: 0 + SetScaleTypeToggle: 0 + translationSnapping: 306 + AddSelection: 0 + RemoveSelection: 0 + ActionKey: 0 + UndoAction: 0 + RedoAction: 0 + xColor: {r: 1, g: 0, b: 0, a: 0.8} + yColor: {r: 0, g: 1, b: 0, a: 0.8} + zColor: {r: 0, g: 0, b: 1, a: 0.8} + allColor: {r: 0.7, g: 0.7, b: 0.7, a: 0.8} + selectedColor: {r: 1, g: 1, b: 0, a: 0.8} + hoverColor: {r: 1, g: 0.75, b: 0, a: 0.8} +--- !u!1 &1041446057 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1041446058} + - component: {fileID: 1041446063} + - component: {fileID: 1041446062} + - component: {fileID: 1041446061} + - component: {fileID: 1041446060} + - component: {fileID: 1041446059} + - component: {fileID: 1041446064} + m_Layer: 0 + m_Name: foot_rr + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1041446058 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1041446057} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2, y: 0.69299984, z: -2} + m_LocalScale: {x: 1.65, y: 0.2, z: 1.65} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!59 &1041446059 +HingeJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1041446057} + m_ConnectedBody: {fileID: 1614905074} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: 1, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0, y: -0.8340001, z: 0} + m_UseSpring: 0 + m_Spring: + spring: 0 + damper: 0 + targetPosition: 0 + m_UseMotor: 0 + m_Motor: + targetVelocity: 0 + force: 0 + freeSpin: 0 + m_UseLimits: 0 + m_Limits: + min: 0 + max: 0 + bounciness: 0 + bounceMinVelocity: 0.2 + contactDistance: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 1 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &1041446060 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1041446057} + serializedVersion: 2 + m_Mass: 0.5 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &1041446061 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1041446057} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1041446062 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1041446057} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1041446063 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1041446057} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1041446064 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1041446057} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72a1f3cb16d2788bbaf5cf1795ca33df, type: 3} + m_Name: + m_EditorClassIdentifier: + isSelfCollide: 0 +--- !u!1 &1095822267 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1095822271} + - component: {fileID: 1095822270} + - component: {fileID: 1095822269} + - component: {fileID: 1095822268} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967294 + m_IsActive: 1 +--- !u!64 &1095822268 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1095822267} + m_Material: {fileID: 13400000, guid: 9cf0822921b89b82fb8239bf69165329, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 16 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1095822269 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1095822267} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 2 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1095822270 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1095822267} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1095822271 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1095822267} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1800, y: 1, z: 1800} + m_Children: [] + m_Father: {fileID: 126105769} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1117250923 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1117250924} + - component: {fileID: 1117250927} + - component: {fileID: 1117250926} + - component: {fileID: 1117250925} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1117250924 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1117250923} + 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: 536702293} + m_Father: {fileID: 1659892647} + m_RootOrder: 0 + 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: -18, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!114 &1117250925 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1117250923} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1117250926 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1117250923} + m_CullTransparentMesh: 0 +--- !u!114 &1117250927 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1117250923} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!1 &1150143107 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1150143108} + - component: {fileID: 1150143111} + - component: {fileID: 1150143110} + - component: {fileID: 1150143109} + m_Layer: 5 + m_Name: Scrollbar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1150143108 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1150143107} + 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: 1771353712} + m_Father: {fileID: 1659892647} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 1, y: 1} +--- !u!114 &1150143109 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1150143107} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, 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_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, 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_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 512943791} + m_HandleRect: {fileID: 512943790} + m_Direction: 2 + m_Value: 0 + m_Size: 0.2 + m_NumberOfSteps: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &1150143110 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1150143107} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1150143111 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1150143107} + m_CullTransparentMesh: 0 +--- !u!1 &1150446470 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1150446471} + - component: {fileID: 1150446472} + m_Layer: 5 + m_Name: Item + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1150446471 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1150446470} + 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: 1992708046} + - {fileID: 1705138704} + - {fileID: 502293189} + m_Father: {fileID: 536702293} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1150446472 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1150446470} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, 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_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, 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_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1992708047} + toggleTransition: 1 + graphic: {fileID: 1705138705} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_IsOn: 1 +--- !u!1 &1183087829 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1183087834} + - component: {fileID: 1183087833} + - component: {fileID: 1183087832} + - component: {fileID: 1183087831} + m_Layer: 5 + m_Name: Main Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!114 &1183087831 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1183087829} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1183087832 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1183087829} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &1183087833 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1183087829} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 963194227} + m_PlaneDistance: 100 + m_PixelPerfect: 1 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1183087834 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1183087829} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 610688433} + - {fileID: 705796952} + - {fileID: 1655136414} + m_Father: {fileID: 683297085} + 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, y: 0} +--- !u!1 &1314072909 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1314072910} + - component: {fileID: 1314072915} + - component: {fileID: 1314072914} + - component: {fileID: 1314072913} + - component: {fileID: 1314072912} + - component: {fileID: 1314072911} + - component: {fileID: 1314072916} + m_Layer: 0 + m_Name: foot_fl + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1314072910 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314072909} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2, y: 0.69299984, z: 2} + m_LocalScale: {x: 1.65, y: 0.2, z: 1.65} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!59 &1314072911 +HingeJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314072909} + m_ConnectedBody: {fileID: 568997913} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: 1, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0, y: -0.8340001, z: 0} + m_UseSpring: 0 + m_Spring: + spring: 0 + damper: 0 + targetPosition: 0 + m_UseMotor: 0 + m_Motor: + targetVelocity: 0 + force: 0 + freeSpin: 0 + m_UseLimits: 0 + m_Limits: + min: 0 + max: 0 + bounciness: 0 + bounceMinVelocity: 0.2 + contactDistance: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 1 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &1314072912 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314072909} + serializedVersion: 2 + m_Mass: 0.5 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &1314072913 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314072909} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1314072914 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314072909} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1314072915 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314072909} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1314072916 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1314072909} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72a1f3cb16d2788bbaf5cf1795ca33df, type: 3} + m_Name: + m_EditorClassIdentifier: + isSelfCollide: 0 +--- !u!1 &1349702467 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1349702468} + - component: {fileID: 1349702469} + m_Layer: 0 + m_Name: collision + m_TagString: Collision + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1349702468 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349702467} + m_LocalRotation: {x: -0, y: -0, z: 2.9597025e-17, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.011, y: 0.05, z: 0.011} + m_Children: [] + m_Father: {fileID: 1884339984} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!64 &1349702469 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349702467} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 10203, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1349895854 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1349895855} + - component: {fileID: 1349895858} + - component: {fileID: 1349895857} + - component: {fileID: 1349895856} + m_Layer: 0 + m_Name: mound + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1349895855 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349895854} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.765, y: 0.04, z: 0} + m_LocalScale: {x: 1, y: 0.13118, z: 4.4053} + m_Children: [] + m_Father: {fileID: 126105769} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1349895856 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349895854} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1349895857 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349895854} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1349895858 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1349895854} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1411001345 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1411001350} + - component: {fileID: 1411001349} + - component: {fileID: 1411001348} + - component: {fileID: 1411001347} + - component: {fileID: 1411001346} + - component: {fileID: 1411001351} + m_Layer: 0 + m_Name: Cube(Main) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!54 &1411001346 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1411001345} + serializedVersion: 2 + m_Mass: 80 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &1411001347 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1411001345} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1411001348 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1411001345} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1411001349 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1411001345} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1411001350 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1411001345} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 0.4, z: 1.5} + m_Children: [] + m_Father: {fileID: 2106501633} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!75 &1411001351 +ConstantForce: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1411001345} + m_Enabled: 1 + m_Force: {x: 0, y: 0, z: 0} + m_RelativeForce: {x: 0, y: 0, z: 0} + m_Torque: {x: 0, y: 0, z: 0} + m_RelativeTorque: {x: 0, y: 0, z: 0} +--- !u!1 &1419178854 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1419178855} + - component: {fileID: 1419178857} + - component: {fileID: 1419178856} + m_Layer: 0 + m_Name: visual + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1419178855 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1419178854} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.1, z: 0.5} + m_Children: [] + m_Father: {fileID: 10540287} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1419178856 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1419178854} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1419178857 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1419178854} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1484210556 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1484210557} + - component: {fileID: 1484210559} + - component: {fileID: 1484210558} + m_Layer: 0 + m_Name: visual + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1484210557 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484210556} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.1, z: 0.5} + m_Children: [] + m_Father: {fileID: 25597964} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1484210558 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484210556} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1484210559 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484210556} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1525198630 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1525198631} + - component: {fileID: 1525198636} + - component: {fileID: 1525198635} + - component: {fileID: 1525198634} + - component: {fileID: 1525198632} + - component: {fileID: 1525198633} + m_Layer: 0 + m_Name: pole_fr + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1525198631 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1525198630} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2, y: 1.527, z: -2} + m_LocalScale: {x: 0.5, y: 1, z: 0.5} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &1525198632 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1525198630} + serializedVersion: 2 + m_Mass: 0.1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!153 &1525198633 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1525198630} + m_ConnectedBody: {fileID: 1835497268} + m_Anchor: {x: 0, y: 0.5, z: 0} + m_Axis: {x: 0, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.25, y: -0.3364998, z: -0.25} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 1, z: 0} + m_XMotion: 0 + m_YMotion: 1 + m_ZMotion: 0 + m_AngularXMotion: 0 + m_AngularYMotion: 0 + m_AngularZMotion: 0 + m_LinearLimitSpring: + spring: 9000 + damper: 1000 + m_LinearLimit: + limit: 0.5 + bounciness: 0.1 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 90 + positionDamper: 20 + maximumForce: 3.402823e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 1 + m_ProjectionDistance: 0.5 + m_ProjectionAngle: 0 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!65 &1525198634 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1525198630} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1525198635 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1525198630} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1525198636 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1525198630} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1564278297 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1564278298} + - component: {fileID: 1564278303} + - component: {fileID: 1564278302} + - component: {fileID: 1564278301} + - component: {fileID: 1564278300} + - component: {fileID: 1564278299} + - component: {fileID: 1564278304} + m_Layer: 0 + m_Name: foot_rl + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1564278298 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564278297} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2, y: 0.69299984, z: 2} + m_LocalScale: {x: 1.65, y: 0.2, z: 1.65} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!59 &1564278299 +HingeJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564278297} + m_ConnectedBody: {fileID: 849325912} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: 1, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0, y: -0.8340001, z: 0} + m_UseSpring: 0 + m_Spring: + spring: 0 + damper: 0 + targetPosition: 0 + m_UseMotor: 0 + m_Motor: + targetVelocity: 0 + force: 0 + freeSpin: 0 + m_UseLimits: 0 + m_Limits: + min: 0 + max: 0 + bounciness: 0 + bounceMinVelocity: 0.2 + contactDistance: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 1 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &1564278300 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564278297} + serializedVersion: 2 + m_Mass: 0.5 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &1564278301 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564278297} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1564278302 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564278297} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1564278303 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564278297} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1564278304 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1564278297} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72a1f3cb16d2788bbaf5cf1795ca33df, type: 3} + m_Name: + m_EditorClassIdentifier: + isSelfCollide: 0 +--- !u!1 &1566749265 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1566749266} + - component: {fileID: 1566749272} + - component: {fileID: 1566749271} + - component: {fileID: 1566749270} + - component: {fileID: 1566749269} + - component: {fileID: 1566749268} + - component: {fileID: 1566749267} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1566749266 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566749265} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.37, z: -0.6} + m_LocalScale: {x: 0.2, y: 0.2, z: 0.2} + m_Children: [] + m_Father: {fileID: 223905745} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!153 &1566749267 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566749265} + m_ConnectedBody: {fileID: 747390632} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 1, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0, y: -0.945, z: -0.40000004} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 1, z: 0} + m_XMotion: 0 + m_YMotion: 0 + m_ZMotion: 0 + m_AngularXMotion: 2 + m_AngularYMotion: 2 + m_AngularZMotion: 2 + m_LinearLimitSpring: + spring: 0 + damper: 1 + m_LinearLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 1 + maximumForce: 3.4028233e+38 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!114 &1566749268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566749265} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72a1f3cb16d2788bbaf5cf1795ca33df, type: 3} + m_Name: + m_EditorClassIdentifier: + isSelfCollide: 0 +--- !u!54 &1566749269 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566749265} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!135 &1566749270 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566749265} + m_Material: {fileID: 13400000, guid: 9cf0822921b89b82fb8239bf69165329, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1566749271 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566749265} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1566749272 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1566749265} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1613444315 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1613444316} + m_Layer: 0 + m_Name: SuspensionLeft + m_TagString: Model + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1613444316 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1613444315} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.48, y: -0.2, z: 0.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1756567521} + m_Father: {fileID: 223905745} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1614905072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1614905073} + - component: {fileID: 1614905077} + - component: {fileID: 1614905076} + - component: {fileID: 1614905075} + - component: {fileID: 1614905074} + - component: {fileID: 1614905078} + m_Layer: 0 + m_Name: pole_rr + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1614905073 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614905072} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2, y: 1.527, z: -2} + m_LocalScale: {x: 0.5, y: 1, z: 0.5} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &1614905074 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614905072} + serializedVersion: 2 + m_Mass: 0.1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!65 &1614905075 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614905072} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1614905076 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614905072} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1614905077 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614905072} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!153 &1614905078 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1614905072} + m_ConnectedBody: {fileID: 1835497268} + m_Anchor: {x: 0, y: 0.5, z: 0} + m_Axis: {x: 0, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.25, y: -0.3364998, z: -0.25} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 1, z: 0} + m_XMotion: 0 + m_YMotion: 1 + m_ZMotion: 0 + m_AngularXMotion: 0 + m_AngularYMotion: 0 + m_AngularZMotion: 0 + m_LinearLimitSpring: + spring: 9000 + damper: 1000 + m_LinearLimit: + limit: 0.5 + bounciness: 0.1 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 90 + positionDamper: 20 + maximumForce: 3.402823e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 1 + m_ProjectionDistance: 0.5 + m_ProjectionAngle: 0 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &1655136413 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1655136414} + - component: {fileID: 1655136418} + - component: {fileID: 1655136417} + - component: {fileID: 1655136416} + - component: {fileID: 1655136415} + m_Layer: 5 + m_Name: FollowingTargetList + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1655136414 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1655136413} + 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: 387521879} + - {fileID: 2044078819} + - {fileID: 1659892647} + m_Father: {fileID: 1183087834} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -110, y: 30} + m_SizeDelta: {x: 180, y: 25} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1655136415 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1655136413} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b5c17b89baebdeca597971fbfdf4b2e9, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1655136416 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1655136413} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, 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_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, 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_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1655136417} + m_Template: {fileID: 1659892647} + m_CaptionText: {fileID: 387521880} + m_CaptionImage: {fileID: 0} + m_ItemText: {fileID: 502293190} + m_ItemImage: {fileID: 0} + m_Value: 0 + m_Options: + m_Options: [] + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &1655136417 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1655136413} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1655136418 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1655136413} + m_CullTransparentMesh: 0 +--- !u!1 &1659892646 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1659892647} + - component: {fileID: 1659892650} + - component: {fileID: 1659892649} + - component: {fileID: 1659892648} + m_Layer: 5 + m_Name: Template + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1659892647 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659892646} + 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: 1117250924} + - {fileID: 1150143108} + m_Father: {fileID: 1655136414} + m_RootOrder: 2 + 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: 2} + m_SizeDelta: {x: 0, y: 150} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &1659892648 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659892646} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 536702293} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 1117250924} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 1150143109} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &1659892649 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659892646} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1659892650 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659892646} + m_CullTransparentMesh: 0 +--- !u!1 &1662917554 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1662917555} + - component: {fileID: 1662917558} + - component: {fileID: 1662917557} + - component: {fileID: 1662917556} + - component: {fileID: 1662917560} + - component: {fileID: 1662917559} + m_Layer: 0 + m_Name: CubeRight + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1662917555 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1662917554} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1721554202} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1662917556 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1662917554} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1662917557 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1662917554} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1662917558 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1662917554} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!153 &1662917559 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1662917554} + m_ConnectedBody: {fileID: 1750713667} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: 0, z: 0} + m_AutoConfigureConnectedAnchor: 0 + m_ConnectedAnchor: {x: 0, y: 0, z: -1} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 0, z: 0} + m_XMotion: 0 + m_YMotion: 0 + m_ZMotion: 0 + m_AngularXMotion: 0 + m_AngularYMotion: 0 + m_AngularZMotion: 0 + m_LinearLimitSpring: + spring: 0 + damper: 0 + m_LinearLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 0 + m_ProjectionDistance: 0.1 + m_ProjectionAngle: 180 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 1 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &1662917560 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1662917554} + serializedVersion: 2 + m_Mass: 0.2 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &1705138703 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1705138704} + - component: {fileID: 1705138706} + - component: {fileID: 1705138705} + m_Layer: 5 + m_Name: Item Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1705138704 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1705138703} + 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: 1150446471} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 10, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1705138705 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1705138703} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10901, 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 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1705138706 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1705138703} + m_CullTransparentMesh: 0 +--- !u!1 &1721554201 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1721554202} + m_Layer: 0 + m_Name: StickObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1721554202 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1721554201} + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 43.7, y: 1, z: 36.84} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1750713663} + - {fileID: 1662917555} + m_Father: {fileID: 126105769} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!1 &1750713662 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1750713663} + - component: {fileID: 1750713666} + - component: {fileID: 1750713665} + - component: {fileID: 1750713664} + - component: {fileID: 1750713667} + m_Layer: 0 + m_Name: CubeLeft + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1750713663 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750713662} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1721554202} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1750713664 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750713662} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1750713665 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750713662} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1750713666 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750713662} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &1750713667 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750713662} + serializedVersion: 2 + m_Mass: 90 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &1756567517 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1756567521} + - component: {fileID: 1756567518} + - component: {fileID: 1756567519} + m_Layer: 0 + m_Name: linkL + m_TagString: Link + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!54 &1756567518 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756567517} + serializedVersion: 2 + m_Mass: 0.02 + m_Drag: 0.001 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!153 &1756567519 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756567517} + m_ConnectedBody: {fileID: 747390632} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: -1, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.48000002, y: -0.52, z: 0.20000002} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 0, z: 0} + m_XMotion: 1 + m_YMotion: 0 + m_ZMotion: 0 + m_AngularXMotion: 0 + m_AngularYMotion: 0 + m_AngularZMotion: 0 + m_LinearLimitSpring: + spring: 0 + damper: 0 + m_LinearLimit: + limit: 0.2 + bounciness: 0.01 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 700 + positionDamper: 520 + maximumForce: 3.402823e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 1 + m_ProjectionDistance: 0.3 + m_ProjectionAngle: 0 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!4 &1756567521 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756567517} + m_LocalRotation: {x: -0.000000008645656, y: -0.000000029802319, z: 9.204085e-10, + w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 34803207} + - {fileID: 925108813} + m_Father: {fileID: 1613444316} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1771353711 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1771353712} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1771353712 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1771353711} + 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: 512943790} + m_Father: {fileID: 1150143108} + m_RootOrder: 0 + 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: -20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1791041572 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1791041573} + - component: {fileID: 1791041576} + - component: {fileID: 1791041575} + - component: {fileID: 1791041574} + m_Layer: 0 + m_Name: LeftWheel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1791041573 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791041572} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: -0.62, y: -0.19999999, z: 0.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 415239024} + - {fileID: 113319020} + m_Father: {fileID: 223905745} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!114 &1791041574 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791041572} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72a1f3cb16d2788bbaf5cf1795ca33df, type: 3} + m_Name: + m_EditorClassIdentifier: + isSelfCollide: 0 +--- !u!59 &1791041575 +HingeJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791041572} + m_ConnectedBody: {fileID: 1756567518} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: -1, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: -0.1399999, y: 0.000000015158875, z: 0.000000008344643} + m_UseSpring: 0 + m_Spring: + spring: 0 + damper: 0 + targetPosition: 0 + m_UseMotor: 1 + m_Motor: + targetVelocity: 698 + force: 0 + freeSpin: 1 + m_UseLimits: 0 + m_Limits: + min: 0 + max: 0 + bounciness: 0 + bounceMinVelocity: 0.2 + contactDistance: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!54 &1791041576 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791041572} + serializedVersion: 2 + m_Mass: 0.4 + m_Drag: 0 + m_AngularDrag: 0.85 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &1835497263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1835497264} + - component: {fileID: 1835497267} + - component: {fileID: 1835497266} + - component: {fileID: 1835497265} + - component: {fileID: 1835497268} + - component: {fileID: 1835497269} + m_Layer: 0 + m_Name: SphereBody + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1835497264 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835497263} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 2.7, z: 0} + m_LocalScale: {x: 8, y: 2, z: 8} + m_Children: [] + m_Father: {fileID: 774957604} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &1835497265 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835497263} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.15 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1835497266 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835497263} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1835497267 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835497263} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &1835497268 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835497263} + serializedVersion: 2 + m_Mass: 80 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!138 &1835497269 +FixedJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1835497263} + m_ConnectedBody: {fileID: 774957605} + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 1 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!1 &1884339980 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1884339984} + - component: {fileID: 1884339981} + - component: {fileID: 1884339982} + m_Layer: 0 + m_Name: linkR + m_TagString: Link + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!54 &1884339981 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1884339980} + serializedVersion: 2 + m_Mass: 0.02 + m_Drag: 0.001 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!153 &1884339982 +ConfigurableJoint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1884339980} + m_ConnectedBody: {fileID: 747390632} + m_Anchor: {x: 0, y: 0, z: 0} + m_Axis: {x: 0, y: -1, z: 0} + m_AutoConfigureConnectedAnchor: 1 + m_ConnectedAnchor: {x: 0.48000002, y: -0.52, z: 0.20000002} + serializedVersion: 2 + m_SecondaryAxis: {x: 0, y: 0, z: 0} + m_XMotion: 1 + m_YMotion: 0 + m_ZMotion: 0 + m_AngularXMotion: 0 + m_AngularYMotion: 0 + m_AngularZMotion: 0 + m_LinearLimitSpring: + spring: 0 + damper: 0 + m_LinearLimit: + limit: 0.2 + bounciness: 0.01 + contactDistance: 0 + m_AngularXLimitSpring: + spring: 0 + damper: 0 + m_LowAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_HighAngularXLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularYZLimitSpring: + spring: 0 + damper: 0 + m_AngularYLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_AngularZLimit: + limit: 0 + bounciness: 0 + contactDistance: 0 + m_TargetPosition: {x: 0, y: 0, z: 0} + m_TargetVelocity: {x: 0, y: 0, z: 0} + m_XDrive: + serializedVersion: 3 + positionSpring: 700 + positionDamper: 520 + maximumForce: 3.402823e+38 + m_YDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_ZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} + m_TargetAngularVelocity: {x: 0, y: 0, z: 0} + m_RotationDriveMode: 0 + m_AngularXDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_AngularYZDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 0 + m_SlerpDrive: + serializedVersion: 3 + positionSpring: 0 + positionDamper: 0 + maximumForce: 3.4028233e+38 + m_ProjectionMode: 1 + m_ProjectionDistance: 0.3 + m_ProjectionAngle: 0 + m_ConfiguredInWorldSpace: 0 + m_SwapBodies: 0 + m_BreakForce: Infinity + m_BreakTorque: Infinity + m_EnableCollision: 0 + m_EnablePreprocessing: 0 + m_MassScale: 1 + m_ConnectedMassScale: 1 +--- !u!4 &1884339984 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1884339980} + m_LocalRotation: {x: 0.0000001252938, y: -0.000000059604638, z: -0.0000000014933901, + w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 162674479} + - {fileID: 1349702468} + m_Father: {fileID: 2133470736} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1889185995 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1889185996} + - component: {fileID: 1889185999} + - component: {fileID: 1889185998} + - component: {fileID: 1889185997} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1889185996 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889185995} + m_LocalRotation: {x: -0, y: 0.37569636, z: -0, w: 0.9267428} + m_LocalPosition: {x: 486.181, y: 0.577, z: 476.668} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 126105769} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 44.135002, z: 0} +--- !u!65 &1889185997 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889185995} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1889185998 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889185995} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1889185999 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889185995} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1992708045 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1992708046} + - component: {fileID: 1992708048} + - component: {fileID: 1992708047} + m_Layer: 5 + m_Name: Item Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1992708046 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1992708045} + 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: 1150446471} + m_RootOrder: 0 + 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: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1992708047 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1992708045} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + 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 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1992708048 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1992708045} + m_CullTransparentMesh: 0 +--- !u!1 &2044078818 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2044078819} + - component: {fileID: 2044078821} + - component: {fileID: 2044078820} + m_Layer: 5 + m_Name: Arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2044078819 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2044078818} + 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: 1655136414} + m_RootOrder: 1 + 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: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2044078820 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2044078818} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10915, 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 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2044078821 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2044078818} + m_CullTransparentMesh: 0 +--- !u!1 &2077744551 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2077744552} + - component: {fileID: 2077744555} + - component: {fileID: 2077744554} + - component: {fileID: 2077744553} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2077744552 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2077744551} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 484.4, y: 1.042, z: 472.313} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 126105769} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!136 &2077744553 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2077744551} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &2077744554 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2077744551} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &2077744555 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2077744551} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2106501632 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2106501633} + m_Layer: 0 + m_Name: Car + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2106501633 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2106501632} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 402915476} + - {fileID: 25597964} + - {fileID: 876502905} + - {fileID: 1411001350} + - {fileID: 428331599} + m_Father: {fileID: 126105769} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2133470735 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2133470736} + m_Layer: 0 + m_Name: SuspensionRight + m_TagString: Model + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2133470736 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2133470735} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.48, y: -0.2, z: 0.3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1884339984} + m_Father: {fileID: 223905745} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/MainScene.unity.meta b/Assets/Scenes/MainScene.unity.meta new file mode 100644 index 00000000..952bd1e9 --- /dev/null +++ b/Assets/Scenes/MainScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9fc0d4010bbf28b4594072e72b8655ab +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MainScene/LightingData.asset b/Assets/Scenes/MainScene/LightingData.asset new file mode 100644 index 00000000..51a6eacd Binary files /dev/null and b/Assets/Scenes/MainScene/LightingData.asset differ diff --git a/Assets/Scenes/MainScene/LightingData.asset.meta b/Assets/Scenes/MainScene/LightingData.asset.meta new file mode 100644 index 00000000..201884d2 --- /dev/null +++ b/Assets/Scenes/MainScene/LightingData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca79b04ab7cd1071ca8ddf0d3a0beef1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MainScene/ReflectionProbe-0.exr b/Assets/Scenes/MainScene/ReflectionProbe-0.exr new file mode 100644 index 00000000..2af7d91c Binary files /dev/null and b/Assets/Scenes/MainScene/ReflectionProbe-0.exr differ diff --git a/Assets/Scenes/MainScene/ReflectionProbe-0.exr.meta b/Assets/Scenes/MainScene/ReflectionProbe-0.exr.meta new file mode 100644 index 00000000..aba9f6f9 --- /dev/null +++ b/Assets/Scenes/MainScene/ReflectionProbe-0.exr.meta @@ -0,0 +1,91 @@ +fileFormatVersion: 2 +guid: 44fd1c569806b0663abaade849850cab +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 1 + seamlessCubemap: 1 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 0 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 2 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 100 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta new file mode 100644 index 00000000..4c0e370a --- /dev/null +++ b/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a24e78cfd1fa10458b79e99cc7feed3a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Connection.meta b/Assets/Scripts/Connection.meta new file mode 100644 index 00000000..f6fdd7d6 --- /dev/null +++ b/Assets/Scripts/Connection.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f03a9eb7612ca094ea61ba0d1769e092 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Connection/BridgePortManager.cs b/Assets/Scripts/Connection/BridgePortManager.cs new file mode 100644 index 00000000..33fa6f57 --- /dev/null +++ b/Assets/Scripts/Connection/BridgePortManager.cs @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections.Generic; +using System.Threading; +using UnityEngine; +using System.Net.NetworkInformation; +using System.Net; + +public class BridgePortManager : DeviceTransporter +{ + public readonly ushort pipePortNumber = 25554; + public const ushort minPortRange = 49152; + public const ushort maxPortRange = IPEndPoint.MaxPort; + + private Thread workerThread; + + private Dictionary portMapTable; + + private IPGlobalProperties properties = null; + + BridgePortManager() + { + portMapTable = new Dictionary(); + properties = IPGlobalProperties.GetIPGlobalProperties(); + } + + public void DeallocateSensorPort(string hashKey) + { + bool isRemoved = false; + + lock (portMapTable) + { + isRemoved = portMapTable.Remove(hashKey); + } + + if (isRemoved) + { + Debug.LogFormat("HashKey({0}) Removed.", hashKey); + } + else + { + Debug.LogFormat("Failed to remove HashKey({0})!!!", hashKey); + } + } + + public ushort SearchSensorPort(string hashKey) + { + ushort port = 0; + + lock (portMapTable) + { + foreach (KeyValuePair each in portMapTable) + { + string _Key = each.Key; + if (_Key == hashKey) + { + port = each.Value; + break; + } + } + } + + return port; + } + + public bool IsAvailablePort(in ushort port) + { + if (properties != null) + { + var connections = properties.GetActiveTcpConnections(); + foreach (var connection in connections) + { + // Debug.Log("TCP conn Local: " + connection.LocalEndPoint.Port); + // Debug.Log("TCP conn Remote: " + connection.RemoteEndPoint.Port); + if (connection.LocalEndPoint.Port == port) + { + return false; + } + } + } + + return true; + } + + public ushort AllocateSensorPort(string hashKey) + { + // check if already occupied + ushort newPort = SearchSensorPort(hashKey); + + if (newPort != 0) + { + Debug.LogFormat("HashKey({0}) is already occupied.", hashKey); + return newPort; + } + + // find available port number + // start with minimum port range + for (ushort index = 0; index < (maxPortRange - minPortRange); index++) + { + var port = (ushort)(minPortRange + index); + var isContained = false; + lock (portMapTable) + { + isContained = portMapTable.ContainsValue(port); + } + + // check if already binded + if (!isContained && IsAvailablePort(port)) + { + newPort = port; + break; + } + } + + if (newPort == 0) + { + Debug.LogFormat("Failed to allocate port for HashKey({0}).", hashKey); + } + else + { + lock (portMapTable) + { + Debug.LogFormat("Allocated for HashKey({0}), Port({1})", hashKey, newPort); + portMapTable.Add(hashKey, newPort); + } + } + + return newPort; + } + + private void PortManageWorker() + { + // Debug.LogFormat("Start SensorPortManager - {0}::{1}", GetType().Name, MethodBase.GetCurrentMethod().Name); + while (true) + { + // Debug.Log("Waiting for Request Data"); + var hashKey = ReceiveRequest(); + + var hashKeyInString = (hashKey == null) ? string.Empty : System.Text.Encoding.Default.GetString(hashKey); + var port = SearchSensorPort(hashKeyInString); + var portBuf = System.Convert.ToString(port); + + SendResponse(portBuf); + Debug.LogFormat("-> Reply for {0} = {1}", hashKeyInString, port); + } + } + + void OnDestroy() + { + if (workerThread != null) + { + workerThread.Abort(); + } + // Debug.LogFormat("{0}::{1}", GetType().Name, MethodBase.GetCurrentMethod().Name); + } + + // Start is called before the first frame update + void Start() + { + SetTagSize(0); + InitializeResponsor(pipePortNumber); + + workerThread = new Thread(PortManageWorker); + workerThread.Start(); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connection/BridgePortManager.cs.meta b/Assets/Scripts/Connection/BridgePortManager.cs.meta new file mode 100644 index 00000000..a346eb53 --- /dev/null +++ b/Assets/Scripts/Connection/BridgePortManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 918c1bad59e9f0fb684f7a795431a3f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Connection/DeviceTransporter.cs b/Assets/Scripts/Connection/DeviceTransporter.cs new file mode 100644 index 00000000..e4fdbfbb --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.cs @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System; +using System.IO; +using UnityEngine; +using NetMQ.Sockets; + +public partial class DeviceTransporter : MonoBehaviour +{ + public const bool isTCP = true; // Currently, NetMQ does not support UDP protocol + private ushort tagSize = 8; + public string defaultPipeAddress = "127.0.0.1"; + + private RequestSocket requestSocket = null; + private PublisherSocket publisherSocket = null; + private ResponseSocket responseSocket = null; + private SubscriberSocket subscriberSocket = null; + + private byte[] hashValueForSend = null; + private byte[] hashValueForReceive = null; + private byte[] dataToSend = null; + + private int highwatermark = 0; + + public DeviceTransporter() + { + var enviromentPipeAddress = Environment.GetEnvironmentVariable("SIM_MASTER_IP"); + + if (!string.IsNullOrEmpty(enviromentPipeAddress)) + { + defaultPipeAddress = enviromentPipeAddress; + } + + SetPipeAddress(defaultPipeAddress); + + highwatermark = 1000; + } + + ~DeviceTransporter() + { + if (requestSocket != null) + { + requestSocket.Close(); + } + + if (responseSocket != null) + { + responseSocket.Close(); + } + + if (subscriberSocket != null) + { + subscriberSocket.Close(); + } + + if (publisherSocket != null) + { + publisherSocket.Close(); + } + } + + public void SetTagSize(in ushort value) + { + tagSize = value; + } + + public void SetPipeAddress(in string pipeAddress) + { + defaultPipeAddress = pipeAddress; + } + + private string GetAddress(in ushort port) + { + return ((isTCP)?"tcp":"udp") + "://" + defaultPipeAddress + ":" + port; + } + + public void SetHashForSend(in ulong hash) + { + hashValueForSend = BitConverter.GetBytes(hash); + } + + public void SetHashForReceive(in ulong hash) + { + hashValueForReceive = BitConverter.GetBytes(hash); + } + + private bool StoreTagIntoDataToSend(in byte[] targetTag) + { + dataToSend = new byte[tagSize]; + + if (targetTag != null) + { + if (targetTag.Length > tagSize || dataToSend == null) + { + Debug.LogError("Failed to set hash value " + dataToSend); + return false; + } + else + Buffer.BlockCopy(targetTag, 0, dataToSend, 0, tagSize); + } + + return true; + } + + private bool IsNotValidTag(in byte[] receivedTag, in byte[] targetTag) + { + if (targetTag.Length == tagSize && receivedTag.Length == tagSize) + { + for (int index = 0; index < tagSize; index++) + if (targetTag[index] != receivedTag[index]) + return true; + } + + return false; + } + + private bool StoreData(in byte[] dataToStore, in int dataToStoreLength) + { + if (dataToStoreLength > 0 && dataToStore != null && dataToSend != null) + { + var dataLength = tagSize + dataToStoreLength; + Array.Resize(ref dataToSend, dataLength); + + try + { + Buffer.BlockCopy(dataToStore, 0, dataToSend, tagSize, dataToStoreLength); + } + catch (ArgumentException ex) + { + Debug.LogErrorFormat("Error: BlockCopy with buffer src({0}) dst({1}) tagSize({2}) length({3}) Send() : {4}", + dataToStore, dataToSend, tagSize, dataToStoreLength, ex.Message); + } + } + else + { + Debug.LogWarning("Nothing to do : " + dataToStoreLength); + return false; + } + + return true; + } + + private byte[] RetrieveData(in byte[] receivedFrame, in byte[] targetTag = null) + { + byte[] retrievedData = null; + + if (receivedFrame != null) + { + if (targetTag != null && tagSize > 0) + { + byte[] receivedTag = new byte[tagSize]; + try + { + Buffer.BlockCopy(receivedFrame, 0, receivedTag, 0, tagSize); + if (IsNotValidTag(receivedTag, targetTag)) + return null; + } + catch + { + Debug.LogError("Failed to check Tag just skip!!!"); + } + } + + var dataLength = receivedFrame.Length - tagSize; + + if (dataLength > 0) + { + retrievedData = new byte[dataLength]; + + try + { + Buffer.BlockCopy(receivedFrame, tagSize, retrievedData, 0, dataLength); + // Debug.LogWarning("dataReceived Length - " + dataLength + "," + topic.ToString()); + } + catch + { + Debug.LogError("Error: BlockCopy with buffer @ Receiver() "); + } + } + else + { + Debug.LogWarning("Nothing received : " + receivedFrame.Length); + } + } + + return retrievedData; + } + + private bool isValidMemoryStream(in MemoryStream stream) + { + return (stream != null && stream.CanRead && stream.Length > 0); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connection/DeviceTransporter.cs.meta b/Assets/Scripts/Connection/DeviceTransporter.cs.meta new file mode 100644 index 00000000..5c85520f --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec11f40d5947dd165b58b50f0e35e5c7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Connection/DeviceTransporter.publisher.cs b/Assets/Scripts/Connection/DeviceTransporter.publisher.cs new file mode 100644 index 00000000..d5e05254 --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.publisher.cs @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.IO; +using System; +using UnityEngine; +using NetMQ; +using NetMQ.Sockets; + +public partial class DeviceTransporter +{ + protected bool InitializePublisher(in ushort targetPort) + { + var initialized = false; + publisherSocket = new PublisherSocket(); + + if (publisherSocket != null) + { + publisherSocket.Options.SendHighWatermark = highwatermark; + publisherSocket.Options.Linger = new TimeSpan(0); + publisherSocket.Bind(GetAddress(targetPort)); + // Debug.Log("Publisher socket binding for - " + targetPort); + initialized = StoreTagIntoDataToSend(hashValueForSend); + } + + return initialized; + } + + protected bool Publish(in MemoryStream streamToSend) + { + if (isValidMemoryStream(streamToSend) == false) + { + return false; + } + + byte[] buffer = null; + int bufferLength = 0; + + lock (streamToSend) + { + buffer = streamToSend.GetBuffer(); + bufferLength = (int)streamToSend.Length; + } + + return Publish(buffer, bufferLength); + } + + protected bool Publish(in string stringToSend) + { + var buffer = System.Text.Encoding.UTF8.GetBytes(stringToSend); + return Publish(buffer,stringToSend.Length); + } + + protected bool Publish(in byte[] bufferToSend, in int bufferLength) + { + bool wasSucessful = false; + + if (StoreData(bufferToSend, bufferLength) == false) + { + return wasSucessful; + } + + if (publisherSocket != null) + { + wasSucessful = publisherSocket.TrySendFrame(dataToSend); + // Debug.LogFormat("Publish data({0}) length({1})", bufferToSend, bufferLength); + } + else + { + Debug.LogWarning("Socket for publisher or response-request is not initilized yet."); + } + + return wasSucessful; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connection/DeviceTransporter.publisher.cs.meta b/Assets/Scripts/Connection/DeviceTransporter.publisher.cs.meta new file mode 100644 index 00000000..b1cc378c --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.publisher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb65d2618fc3f59bcb0242477a59fcc0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Connection/DeviceTransporter.request.cs b/Assets/Scripts/Connection/DeviceTransporter.request.cs new file mode 100644 index 00000000..ef7b96c5 --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.request.cs @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.IO; +using UnityEngine; +using NetMQ; +using NetMQ.Sockets; + +public partial class DeviceTransporter +{ + protected bool InitializeRequester(in ushort targetPort) + { + var initialized = false; + requestSocket = new RequestSocket(); + + if (requestSocket != null) + { + requestSocket.Bind(GetAddress(targetPort)); + // Debug.Log("Requester socket connecting... " + targetPort); + initialized = StoreTagIntoDataToSend(hashValueForSend); + } + + return initialized; + } + + protected bool SendRequest(in MemoryStream streamToSend) + { + if (isValidMemoryStream(streamToSend) == false) + { + return false; + } + + byte[] buffer = null; + int bufferLength = 0; + + lock (streamToSend) + { + buffer = streamToSend.GetBuffer(); + bufferLength = (int)streamToSend.Length; + } + + return SendRequest(buffer, bufferLength); + } + + protected bool SendRequest(in string stringToSend) + { + var buffer = System.Text.Encoding.UTF8.GetBytes(stringToSend); + return SendRequest(buffer, stringToSend.Length); + } + + /// + /// Request-response message pattern + /// required to initialize `requestSocket` + /// must send request message first before receive response + /// + /// message data buffer to send in bytes array + /// the length of data buffer + /// It returns false if failed to send, otherwise returns true + protected bool SendRequest(in byte[] bytesToSend, in int bytesLength) + { + bool wasSucessful = false; + + if (StoreData(bytesToSend, bytesLength) == false) + { + return wasSucessful; + } + + if (requestSocket != null) + { + wasSucessful = requestSocket.TrySendFrame(dataToSend); + } + else + { + Debug.LogWarning("Socket for request is not initilized yet."); + } + + return wasSucessful; + } + + /// + /// Request-response message pattern + /// required to initialize `requestSocket` + /// must send request message first before receive response + /// + /// whether to check hash tag + /// It is received bytes array data through socket without hash tag. + protected byte[] ReceiveResponse(in bool checkTag = false) + { + byte[] frameReceived = null; + + if (requestSocket != null) + { + frameReceived = requestSocket.ReceiveFrameBytes(); + } + else + { + Debug.LogWarning("Socket for request is not initilized yet."); + } + + byte[] receivedData = RetrieveData(frameReceived, (checkTag)? hashValueForSend : null); + return receivedData; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connection/DeviceTransporter.request.cs.meta b/Assets/Scripts/Connection/DeviceTransporter.request.cs.meta new file mode 100644 index 00000000..691093a8 --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.request.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 038c2654c230123c68ac9cbedf442de1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Connection/DeviceTransporter.response.cs b/Assets/Scripts/Connection/DeviceTransporter.response.cs new file mode 100644 index 00000000..d2998285 --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.response.cs @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.IO; +using UnityEngine; +using NetMQ; +using NetMQ.Sockets; + +public partial class DeviceTransporter +{ + protected bool InitializeResponsor(in ushort targetPort) + { + var initialized = false; + responseSocket = new ResponseSocket(); + + if (responseSocket != null) + { + responseSocket.Bind(GetAddress(targetPort)); + // Debug.Log("Responsor socket connecting... " + targetPort); + initialized = StoreTagIntoDataToSend(hashValueForReceive); + } + + return initialized; + } + + protected byte[] ReceiveRequest(in bool checkTag = false) + { + byte[] frameReceived = null; + + if (responseSocket != null) + { + frameReceived = responseSocket.ReceiveFrameBytes(); + } + else + { + Debug.LogWarning("Socket for response is not initilized yet."); + } + + var receivedData = RetrieveData(frameReceived, (checkTag)? hashValueForReceive : null); + return receivedData; + } + + protected bool SendResponse(in MemoryStream streamToSend) + { + if (isValidMemoryStream(streamToSend) == false) + { + return false; + } + + byte[] buffer = null; + int bufferLength = 0; + + lock (streamToSend) + { + buffer = streamToSend.GetBuffer(); + bufferLength = (int)streamToSend.Length; + } + + return SendResponse(buffer, bufferLength); + } + + protected bool SendResponse(in string stringToSend) + { + var buffer = System.Text.Encoding.UTF8.GetBytes(stringToSend); + return SendResponse(buffer, stringToSend.Length); + } + + private bool SendResponse(in byte[] bytesToSend, in int bytesLength) + { + var wasSucessful = false; + + if (StoreData(bytesToSend, bytesLength) == false) + { + return wasSucessful; + } + + if (responseSocket != null) + { + wasSucessful = responseSocket.TrySendFrame(dataToSend); + } + else + { + Debug.LogWarning("Socket for response is not initilized yet."); + } + + return wasSucessful; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connection/DeviceTransporter.response.cs.meta b/Assets/Scripts/Connection/DeviceTransporter.response.cs.meta new file mode 100644 index 00000000..a959d322 --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.response.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 374cc9340d7169195af665da96d8145e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Connection/DeviceTransporter.subscriber.cs b/Assets/Scripts/Connection/DeviceTransporter.subscriber.cs new file mode 100644 index 00000000..6c508780 --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.subscriber.cs @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System; +using UnityEngine; +using NetMQ; +using NetMQ.Sockets; + +public partial class DeviceTransporter +{ + protected bool InitializeSubscriber(in ushort targetPort) + { + var initialized = false; + subscriberSocket = new SubscriberSocket(); + + if (subscriberSocket != null) + { + subscriberSocket.Options.SendHighWatermark = highwatermark; + subscriberSocket.Options.Linger = new TimeSpan(0); + subscriberSocket.Bind(GetAddress(targetPort)); + // Debug.Log("Subscriber socket connecting... " + targetPort); + + if (hashValueForReceive != null) + subscriberSocket.Subscribe(hashValueForReceive); + + initialized = true; + } + + return initialized; + } + + protected byte[] Subscribe() + { + byte[] frameReceived = null; + + if (subscriberSocket != null) + { + frameReceived = subscriberSocket.ReceiveFrameBytes(); + } + else + { + Debug.LogWarning("Socket for subscriber is not initilized yet."); + } + + byte[] receivedData = RetrieveData(frameReceived); + return receivedData; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connection/DeviceTransporter.subscriber.cs.meta b/Assets/Scripts/Connection/DeviceTransporter.subscriber.cs.meta new file mode 100644 index 00000000..66e75b79 --- /dev/null +++ b/Assets/Scripts/Connection/DeviceTransporter.subscriber.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9dc602a806d1fc479b69785cb9286b22 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Connection/SimulationService.cs b/Assets/Scripts/Connection/SimulationService.cs new file mode 100644 index 00000000..809f2755 --- /dev/null +++ b/Assets/Scripts/Connection/SimulationService.cs @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Net; +using UnityEngine; +using WebSocketSharp.Server; + +public class SimulationService : MonoBehaviour +{ + public const string SUCCESS = "ok"; + public const string FAIL = "fail"; + public const string Delimiter = "!%!"; + + public string defaultWebSocketAddress = "127.0.0.1"; + public int defaultWebSocketPort = 8080; + private WebSocketServer wsServer = null; + + SimulationService() + { + var wsAddress = IPAddress.Parse(defaultWebSocketAddress); + wsServer = new WebSocketServer(wsAddress, defaultWebSocketPort); + } + + // Start is called before the first frame update + void Start() + { + InitializeServices(); + + wsServer.KeepClean = true; + wsServer.Start(); + + if (wsServer.IsListening) + { + Debug.LogFormat("Listening on port {0}, and providing services:", wsServer.Port); + foreach (var path in wsServer.WebSocketServices.Paths) + { + Debug.LogFormat(" - {0}", path); + } + } + } + + private void InitializeServices() + { + if (wsServer == null) + { + return; + } + + var modelLoader = gameObject.GetComponent(); + wsServer.AddWebSocketService("/control", () => new SimulationControlService(modelLoader)); + + var markerVisualizer = gameObject.GetComponent(); + wsServer.AddWebSocketService("/markers", () => new MarkerVisualizerService(markerVisualizer)); + } + + void OnDestroy() + { + if (wsServer != null) + { + Debug.Log("Stop WebSocket Server"); + wsServer.Stop(); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Connection/SimulationService.cs.meta b/Assets/Scripts/Connection/SimulationService.cs.meta new file mode 100644 index 00000000..b949b8e6 --- /dev/null +++ b/Assets/Scripts/Connection/SimulationService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b35ad012dfd6abcba18e5bd9503dd4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins.meta b/Assets/Scripts/CustomPlugins.meta new file mode 100644 index 00000000..c050c36e --- /dev/null +++ b/Assets/Scripts/CustomPlugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba74279ea8b4b030193edeeb41986d9e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins/CameraPlugin.cs b/Assets/Scripts/CustomPlugins/CameraPlugin.cs new file mode 100644 index 00000000..227a93ff --- /dev/null +++ b/Assets/Scripts/CustomPlugins/CameraPlugin.cs @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +public class CameraPlugin : CustomPlugin +{ + public string partName = string.Empty; + + private SensorDevices.Camera cam = null; + + protected override void OnAwake() + { + partName = DeviceHelper.GetPartName(gameObject); + + string hashKey = MakeHashKey(partName); + if (!RegisterTxDevice(hashKey)) + { + Debug.LogError("Failed to register for CameraPlugin - " + hashKey); + } + } + + protected override void OnStart() + { + cam = gameObject.GetComponent(); + + AddThread(Sender); + } + + private void Sender() + { + Stopwatch sw = new Stopwatch(); + while (true) + { + if (cam == null) + { + continue; + } + + var datastreamToSend = cam.PopData(); + sw.Restart(); + Publish(datastreamToSend); + sw.Stop(); + cam.SetTransportTime((float)sw.Elapsed.TotalSeconds); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/CustomPlugins/CameraPlugin.cs.meta b/Assets/Scripts/CustomPlugins/CameraPlugin.cs.meta new file mode 100644 index 00000000..880daae4 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/CameraPlugin.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f63e1ed842f40d57b0655195940d861 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins/CustomPlugin.cs b/Assets/Scripts/CustomPlugins/CustomPlugin.cs new file mode 100644 index 00000000..2318602f --- /dev/null +++ b/Assets/Scripts/CustomPlugins/CustomPlugin.cs @@ -0,0 +1,282 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Xml; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using System; +using UnityEngine; + +public abstract class CustomPlugin : DeviceTransporter +{ + public string modelName = String.Empty; + + private XmlNode pluginData; + + private BridgePortManager devicePortManager = null; + + private List threadList = null; + + protected CustomPlugin() + { + threadList = new List(); + } + + protected abstract void OnAwake(); + protected abstract void OnStart(); + protected virtual void OnReset() { + + } + + void OnDestroy() + { + // Debug.Log("OnDestroy - abort thread" + name); + if (threadList != null) + { + foreach (var thread in threadList) + { + if (thread != null && thread.IsAlive) + thread.Abort(); + } + } + } + + protected bool AddThread(in ThreadStart function) + { + if (threadList != null && function != null) + { + threadList.Add(new Thread(function)); + // thread.Priority = System.Threading.ThreadPriority.AboveNormal; + return true; + } + + return false; + } + private void StartThreads() + { + if (threadList != null) + { + foreach (var thread in threadList) + { + if (thread != null && !thread.IsAlive) + thread.Start(); + } + } + } + public void SetPluginData(XmlNode node) + { + pluginData = node.SelectSingleNode("."); + } + + private static T XmlNodeToValue(XmlNode node) + { + if (node == null) + { + return default(T); + } + var value = node.InnerXml.Trim(); + return SDF.Entity.ConvertValueType(value); + } + + protected T GetPluginAttribute(in string xpath, in string attributeName, in T defaultValue = default(T)) + { + var node = pluginData.SelectSingleNode(xpath); + if (node != null) + { + var attributes = node.Attributes; + var attributeNode = attributes[attributeName]; + if (attributeNode != null) + { + var attributeValue = attributeNode.Value; + return SDF.Entity.ConvertValueType(attributeValue); + } + } + + return defaultValue; + } + + protected T GetPluginValue(in string xpath, T defaultValue = default(T)) + { + if (string.IsNullOrEmpty(xpath) || pluginData == null) + { + return defaultValue; + } + + try + { + var node = pluginData.SelectSingleNode(xpath); + return XmlNodeToValue(node); + } + catch (XmlException ex) + { + Debug.LogErrorFormat("ERROR: GetPluginValue with {0} : {1} ", xpath, ex.Message); + return defaultValue; + } + } + + protected bool GetPluginValues(in string xpath, out List valueList) + { + valueList = null; + + var result = GetPluginValues(xpath, out var nodeList); + valueList = nodeList.ConvertAll(s => XmlNodeToValue(s)); + + return result; + } + + protected bool GetPluginValues(in string xpath, out List valueList) + { + valueList = null; + + if (string.IsNullOrEmpty(xpath) || pluginData == null) + { + return false; + } + + try + { + valueList = new List(pluginData.SelectNodes(xpath).Cast()); + if (valueList == null) + { + return false; + } + + return true; + } + catch (XmlException ex) + { + Debug.LogErrorFormat("ERROR: GetPluginValue with {0} : {1} ", xpath, ex.Message); + return false; + } + } + + protected void PrintPluginData() + { + if (pluginData != null) + { + Debug.LogWarning("Plugin Data is empty"); + } + else + { + // Print all SDF contents + StringWriter sw = new StringWriter(); + XmlTextWriter xw = new XmlTextWriter(sw); + pluginData.WriteTo(xw); + Debug.Log(sw.ToString()); + } + } + + protected bool PrepareDevice(in string hashKey, out ushort port, out ulong hash) + { + port = devicePortManager.AllocateSensorPort(hashKey); + hash = DeviceHelper.GetStringHashCode(hashKey); + + if (port == 0) + { + Debug.LogError("Port for device is not allocated!!!!!!!!"); + return false; + } + // Debug.LogFormat("PrepareDevice - port({0}) hash({1})", port, hash); + + return true; + } + + protected string MakeHashKey(in string partName = "", string subPartName = "") + { + return modelName + partName + subPartName; + } + + protected bool RegisterTxDevice(in string hashKey) + { + if (PrepareDevice(hashKey, out ushort port, out ulong hash)) + { + SetHashForSend(hash); + InitializePublisher(port); + return true; + } + + return false; + } + + protected bool RegisterRxDevice(in string hashKey) + { + if (PrepareDevice(hashKey, out ushort port, out ulong hash)) + { + SetHashForReceive(hash); + InitializeSubscriber(port); + return true; + } + + return true; + } + + protected bool RegisterServiceDevice(in string hashKey) + { + if (PrepareDevice(hashKey, out ushort port, out ulong hash)) + { + SetHashForReceive(hash); + InitializeResponsor(port); + + return true; + } + + return true; + } + + protected bool RegisterClientDevice(in string hashKey) + { + if (PrepareDevice(hashKey, out ushort port, out ulong hash)) + { + SetHashForSend(hash); + InitializeRequester(port); + return true; + } + + return true; + } + + void Awake() + { + var coreObject = GameObject.Find("Core"); + + if (coreObject == null) + { + Debug.LogError("Failed to Find 'Core'!!!!"); + } + else + { + devicePortManager = coreObject.GetComponent(); + if (devicePortManager == null) + { + Debug.LogError("Failed to get 'devicePortManager'!!!!"); + } + + if (string.IsNullOrEmpty(modelName)) + { + modelName = DeviceHelper.GetModelName(gameObject); + } + } + + OnAwake(); + } + + // Start is called before the first frame update + void Start() + { + hideFlags |= HideFlags.NotEditable; + // PrintPluginData(); + + OnStart(); + + StartThreads(); + } + + public void Reset() { + OnReset(); + } +} \ No newline at end of file diff --git a/Assets/Scripts/CustomPlugins/CustomPlugin.cs.meta b/Assets/Scripts/CustomPlugins/CustomPlugin.cs.meta new file mode 100644 index 00000000..b9ae37d2 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/CustomPlugin.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b244c0ec4779f9c6db127680d6683769 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 700 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins/DepthCameraPlugin.cs b/Assets/Scripts/CustomPlugins/DepthCameraPlugin.cs new file mode 100644 index 00000000..eac8a1f0 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/DepthCameraPlugin.cs @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +public class DepthCameraPlugin : CustomPlugin +{ + public string partName = string.Empty; + + private SensorDevices.DepthCamera depthCam = null; + + protected override void OnAwake() + { + partName = DeviceHelper.GetPartName(gameObject); + + string hashKey = MakeHashKey(partName); + if (!RegisterTxDevice(hashKey)) + { + Debug.LogError("Failed to register for DepthCameraPlugin - " + hashKey); + } + } + + protected override void OnStart() + { + depthCam = gameObject.GetComponent(); + + AddThread(Sender); + } + + private void Sender() + { + Stopwatch sw = new Stopwatch(); + while (true) + { + if (depthCam == null) + { + continue; + } + + var datastreamToSend = depthCam.PopData(); + sw.Restart(); + Publish(datastreamToSend); + sw.Stop(); + depthCam.SetTransportTime((float)sw.Elapsed.TotalSeconds); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/CustomPlugins/DepthCameraPlugin.cs.meta b/Assets/Scripts/CustomPlugins/DepthCameraPlugin.cs.meta new file mode 100644 index 00000000..4a2693a3 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/DepthCameraPlugin.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8cbd733257e9af39810a1c62eb2dfd4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs b/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs new file mode 100644 index 00000000..3248b81b --- /dev/null +++ b/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using UnityEngine; + +public partial class ElevatorSystem : CustomPlugin +{ + private enum ElevatorState {STOP = 0, UPWARD, DOWNWARD}; + private struct ElevatorEntity + { + private ElevatorState state; + private string name; + private ElevatorControl elevator; + + public ElevatorEntity(in string elevatorName, in ElevatorControl elevatorControl) + { + state = ElevatorState.STOP; + name = elevatorName; + elevator = elevatorControl; + } + + public ElevatorState State => state; + public string Name => name; + public float Height => elevator.Height; + public ElevatorControl Elevator => elevator; + + public void SetHeight(in float targetHeight) + { + elevator.Height = targetHeight; + } + + public bool IsArrived(in float targetHeight) + { + return elevator.IsArrived(targetHeight); + } + + public void SetState(in float from, in float to) + { + if (to > from) + { + state = ElevatorState.UPWARD; + } + else if (to < from) + { + state = ElevatorState.DOWNWARD; + } + else + { + state = ElevatorState.STOP; + } + } + + public void SetState(in ElevatorState currentState) + { + state = currentState; + } + + public void MoveElevatorTo(in float to) + { + var from = Height; + SetState(from, to); + elevator.MoveTo(to); + } + + public void MoveElevatorTo(in float to, in float from) + { + SetState(from, to); + elevator.MoveTo(to); + } + }; + + private bool RequestDoorOpen(in int elevatorIndex) + { + var task = new ElevatorTask(elevatorIndex); + task.state = ElevatorTaskState.DOOR_OPEN; + elevatorTaskQueue.Enqueue(task); + + return true; + } + + private bool RequestDoorClose(in int elevatorIndex) + { + var task = new ElevatorTask(elevatorIndex); + task.state = ElevatorTaskState.DOOR_CLOSE; + elevatorTaskQueue.Enqueue(task); + + return true; + } + + private bool IsElevatorDoorOpened(in int elevatorIndex) + { + var entity = elevatorList[elevatorIndex]; + return entity.Elevator.IsDoorOpened(); + } + + private float GetElevatorCurrentHeight(in int elevatorIndex) + { + var entity = elevatorList[elevatorIndex]; + return entity.Height; + } + + private bool SelectElevatorFloor(in int elevatorIndex, in string toTargetFloor, in string fromCurrentFloor) + { + var targetFloorHeight = GetFloorHeight(toTargetFloor); + if (float.IsNaN(targetFloorHeight)) + { + return false; + } + + var task = new ElevatorTask(elevatorIndex); + task.toFloor = toTargetFloor; + task.toFloorHeight = targetFloorHeight; + task.fromFloor = fromCurrentFloor; + task.fromFloorHeight = GetFloorHeight(task.fromFloor); + elevatorTaskQueue.Enqueue(task); + + return true; + } + + private bool CallElevator(in string currentFloor, in string targetFloor) + { + var task = new ElevatorTask(NON_ELEVATOR_INDEX); + task.toFloor = targetFloor; + task.toFloorHeight = GetFloorHeight(task.toFloor); + task.fromFloor = currentFloor; + task.fromFloorHeight = GetFloorHeight(task.fromFloor); + elevatorTaskQueue.Enqueue(task); + + // Debug.Log("Call elevator: " + task.elevatorIndex); + + return true; + } + + private bool GetCalledElevator(in string currentFloor, in string targetFloor, out int elevatorIndex) + { + elevatorIndex = NON_ELEVATOR_INDEX; + + // Try to find in task queue + foreach (var task in elevatorTaskQueue) + { + if (task.toFloor.Equals(currentFloor) && task.state.Equals(ElevatorTaskState.PROCESSING)) + { + elevatorIndex = task.elevatorIndex; + return true; + } + } + + var currentFloorHeight = GetFloorHeight(currentFloor); + // If not, try to find in stopped elevator + foreach (var elevatorItem in elevatorList) + { + var elevator = elevatorItem.Value; + if (elevator.State.Equals(ElevatorState.STOP) && elevator.IsArrived(currentFloorHeight)) + { + elevatorIndex = elevatorItem.Key; + return true; + } + } + + return false; + } +} \ No newline at end of file diff --git a/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs.meta b/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs.meta new file mode 100644 index 00000000..775bf692 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4273d632b9ebee45083401ba414739c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins/ElevatorSystem.cs b/Assets/Scripts/CustomPlugins/ElevatorSystem.cs new file mode 100644 index 00000000..91c8aa99 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/ElevatorSystem.cs @@ -0,0 +1,604 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections.Generic; +using System.Collections.Concurrent; +using System.Collections; +using System.IO; +using UnityEngine; +using ProtoBuf; +using Param = gazebo.msgs.Param; +using Any = gazebo.msgs.Any; + +public partial class ElevatorSystem : CustomPlugin +{ + private enum ElevatorTaskState {DOOR_OPEN, DOOR_CLOSE, STANDBY, PROCESSING, DONE} + + private struct ElevatorTask + { + public ElevatorTaskState state; + public int elevatorIndex; + public string fromFloor; + public float fromFloorHeight; + public string toFloor; + public float toFloorHeight; + + public ElevatorTask(in int index) + { + state = ElevatorTaskState.STANDBY; + elevatorIndex = index; + fromFloor = string.Empty; + fromFloorHeight = float.NaN; + toFloor = string.Empty; + toFloorHeight = float.NaN; + } + } + + private const int NON_ELEVATOR_INDEX = -1; + + private bool isRunningThread = true; + private MemoryStream memoryStreamForService = null; + private Param responseMessage = null; + private Dictionary floorList; + private Dictionary elevatorList; + private ConcurrentQueue elevatorTaskQueue; + + ElevatorSystem() + { + memoryStreamForService = new MemoryStream(); + responseMessage = new Param(); + floorList = new Dictionary(); + elevatorList = new Dictionary(); + elevatorTaskQueue = new ConcurrentQueue(); + } + + protected override void OnAwake() + { + const string partName = "ElevatorSystem"; + var hashKey = modelName + partName; + if (!RegisterServiceDevice(hashKey)) + { + Debug.LogError("Failed to register ElevatorSystem service - " + hashKey); + } + } + + protected override void OnStart() + { + ReadFloorContext(); + ReadElevatorContext(); + GenerateResponseMessage(); + + AddThread(ServiceThread); + StartCoroutine(ServiceLoop()); + } + + protected override void OnReset() + { + const string initialFloor = "B1F"; + + var targetFloorHeight = GetFloorHeight(initialFloor); + + if (!float.IsNaN(targetFloorHeight)) + { + foreach (var item in elevatorList) + { + var elevator = item.Value; + elevator.SetHeight(targetFloorHeight); + } + } + else + { + Debug.Log("There is no initialFloor info. " + initialFloor); + } + + // empty the task queue + while (elevatorTaskQueue.Count > 0) + { + if (elevatorTaskQueue.TryDequeue(out var result)) + { + Debug.LogFormat("Empty task Queue: {0}, {1}, {2}",result.elevatorIndex, result.fromFloor, result.toFloor); + } + } + } + + void OnDestroy() + { + isRunningThread = false; + } + + public void ReadElevatorContext() + { + // ex) plugin parameters example + // + // floor_collision + // + // + // seocho_EV_door_L_link + // seocho_EV_door_R_link + // + // + // seocho_EV_out_doors_L_link + // seocho_EV_out_doors_R_link + // + // + // + + var elevatorPrefixName = GetPluginAttribute("elevator", "prefix_name"); + var elevatorSpeed = GetPluginAttribute("elevator", "speed"); + var elevatorFloor = GetPluginValue("elevator/floor"); + + var elevatorDoorSpeed = GetPluginAttribute("elevator/doors", "speed"); + var elevatorDoorAutoClosingTimer = GetPluginAttribute("elevator/doors", "closing_timer"); + + var elevatorInsideopenOffset = GetPluginAttribute("elevator/doors/inside","open_offset"); + var elevatorInsideDoorNameLeft = GetPluginValue("elevator/doors/inside/door[@name='left']"); + var elevatorInsideDoorNameRight = GetPluginValue("elevator/doors/inside/door[@name='right']"); + + var elevatorOutsideopenOffset = GetPluginAttribute("elevator/doors/outside","open_offset"); + var elevatorOutsideDoorNameLeft = GetPluginValue("elevator/doors/outside/door[@name='left']"); + var elevatorOutsideDoorNameRight = GetPluginValue("elevator/doors/outside/door[@name='right']"); + + var index = 0; + foreach (Transform child in transform) + { + var objectName = child.name; + if (objectName.StartsWith(elevatorPrefixName)) + { + var elevatorControl = child.gameObject.AddComponent(); + elevatorControl.liftControl.speed = elevatorSpeed; + elevatorControl.liftControl.floorColliderName = elevatorFloor; + + elevatorControl.doorLinkNameLeft = elevatorInsideDoorNameLeft; + elevatorControl.doorLinkNameRight = elevatorInsideDoorNameRight; + elevatorControl.doorsControl.speed = elevatorDoorSpeed; + elevatorControl.doorsControl.openOffset = elevatorInsideopenOffset; + + elevatorControl.outsideDoorLinkNameLeft = elevatorOutsideDoorNameLeft; + elevatorControl.outsideDoorLinkNameRight = elevatorOutsideDoorNameRight; + elevatorControl.outsideDoorsControl.speed = elevatorDoorSpeed; + elevatorControl.outsideDoorsControl.openOffset = elevatorOutsideopenOffset; + elevatorControl.doorAutoClosingTimer = elevatorDoorAutoClosingTimer; + + var elevatorEntity = new ElevatorEntity(objectName, elevatorControl); + elevatorList.Add(index, elevatorEntity); + + index++; + } + } + } + + public void ReadFloorContext() + { + if (GetPluginValues("floors/floor/name", out var listFloorName) && + GetPluginValues("floors/floor/height", out var listFloorHeight)) + { + if (listFloorName.Count == listFloorHeight.Count) + { + var count = listFloorName.Count; + while (count-- > 0) + { + floorList.Add(listFloorName[count], listFloorHeight[count]); + Debug.Log(listFloorName[count] + " => " + listFloorHeight[count]); + } + } + } + } + + public float GetFloorHeight(in string targetFloor) + { + if (!string.IsNullOrEmpty(targetFloor)) + { + if (floorList.TryGetValue(targetFloor, out var targetFloorHeight)) + { + return targetFloorHeight; + } + } + return float.NaN; + } + + public string GetFloorName(in float targetFloorHeight) + { + if (!float.IsNaN(targetFloorHeight)) + { + foreach (var floorItem in floorList) + { + var floorHeight = floorItem.Value; + + if (Mathf.Abs(floorHeight - targetFloorHeight) < Mathf.Epsilon) + { + return floorItem.Key; + } + } + } + return string.Empty; + } + + private void GenerateResponseMessage() + { + var serviceNameParam = new Param + { + Name = "service_name", + Value = new Any { Type = Any.ValueType.String, StringValue = string.Empty } + }; + + var resultParam = new Param + { + Name = "result", + Value = new Any { Type = Any.ValueType.Boolean, BoolValue = false } + }; + + var elevatorIndexParam = new Param + { + Name = "elevator_index", + Value = new Any { Type = Any.ValueType.Int32, IntValue = NON_ELEVATOR_INDEX } + }; + + var floorParam = new Param + { + Name = "current_floor", + Value = new Any { Type = Any.ValueType.String, StringValue = string.Empty } + }; + + var heightParam = new Param + { + Name = "height", + Value = new Any { Type = Any.ValueType.Double, DoubleValue = 0 } + }; + + responseMessage.Name = string.Empty; + responseMessage.Childrens.Add(serviceNameParam); + responseMessage.Childrens.Add(resultParam); + responseMessage.Childrens.Add(elevatorIndexParam); + responseMessage.Childrens.Add(floorParam); + responseMessage.Childrens.Add(heightParam); + } + + private void SetResponseMessage(in string elevatorSystemName, in string serviceName) + { + responseMessage.Name = elevatorSystemName; + responseMessage.Childrens[0].Value.StringValue = serviceName; + } + + private void SetResponseMessage(in bool result, in int elevatorIndex, in string currentFloor, in float height) + { + responseMessage.Childrens[1].Value.BoolValue = result; + responseMessage.Childrens[2].Value.IntValue = elevatorIndex; + responseMessage.Childrens[3].Value.StringValue = currentFloor; + responseMessage.Childrens[4].Value.DoubleValue = height; + } + + private void ServiceThread() + { + byte[] receivedBuffer; + + while (isRunningThread) + { + receivedBuffer = ReceiveRequest(); + + var receivedMessage = GetReceivedMessage(receivedBuffer); + + var streamToResponse = HandleServiceRequest(receivedMessage); + + SendResponse(streamToResponse); + } + } + + private Param GetReceivedMessage(in byte[] buffer) + { + ClearMemoryStream(ref memoryStreamForService); + + memoryStreamForService.Write(buffer, 0, buffer.Length); + memoryStreamForService.Position = 0; + + return Serializer.Deserialize(memoryStreamForService); + } + + private MemoryStream HandleServiceRequest(in Param receivedMessage) + { + Param param = null; + + var elevatorSystemName = receivedMessage.Name; + + var serviceName = string.Empty; + param = receivedMessage.Childrens[0]; + if (param.Name.Equals("service_name") && + param.Value.Type.Equals(Any.ValueType.String)) + { + serviceName = param.Value.StringValue; + } + + var currentFloor = string.Empty; + param = receivedMessage.Childrens[1]; + if (param.Name.Equals("current_floor") && + param.Value.Type.Equals(Any.ValueType.String)) + { + currentFloor = param.Value.StringValue; + } + + var targetFloor = string.Empty; + param = receivedMessage.Childrens[2]; + if (param.Name.Equals("target_floor") && + param.Value.Type.Equals(Any.ValueType.String)) + { + targetFloor = param.Value.StringValue; + } + + var elevatorIndex = NON_ELEVATOR_INDEX; + param = receivedMessage.Childrens[3]; + if (param.Name.Equals("elevator_index") && + param.Value.Type.Equals(Any.ValueType.Int32)) + { + elevatorIndex = param.Value.IntValue; + } + + Debug.LogFormat("Parsed {0} {1} {2} {3} {4}", elevatorSystemName, serviceName, currentFloor, targetFloor, elevatorIndex); + + SetResponseMessage(elevatorSystemName, serviceName); + + HandleService(serviceName, currentFloor, targetFloor, elevatorIndex); + + ClearMemoryStream(ref memoryStreamForService); + + Serializer.Serialize(memoryStreamForService, responseMessage); + + return memoryStreamForService; + } + + private void HandleService(in string serviceName, string currentFloor, in string targetFloor, int elevatorIndex) + { + var result = true; + var height = 0f; + + if (serviceName.Equals("call_elevator")) + { + elevatorIndex = NON_ELEVATOR_INDEX; + result = GetCalledElevator(currentFloor, targetFloor, out elevatorIndex); + if (!result) + { + result = CallElevator(currentFloor, targetFloor); + } + } + else if (serviceName.Equals("get_called_elevator")) + { + result = GetCalledElevator(currentFloor, targetFloor, out elevatorIndex); + } + else if (serviceName.Equals("select_elevator_floor")) + { + result = SelectElevatorFloor(elevatorIndex, targetFloor, currentFloor); + } + else if (serviceName.Equals("request_door_open")) + { + result = RequestDoorOpen(elevatorIndex); + } + else if (serviceName.Equals("request_door_close")) + { + result = RequestDoorClose(elevatorIndex); + } + else if (serviceName.Equals("is_door_opened")) + { + result = IsElevatorDoorOpened(elevatorIndex); + } + else if (serviceName.Equals("get_elevator_information")) + { + height = GetElevatorCurrentHeight(elevatorIndex); + currentFloor = GetFloorName(height); + } + else + { + Debug.LogError("Unkown service name: " + serviceName); + result = false; + } + + SetResponseMessage(result, elevatorIndex, currentFloor, height); + } + + private IEnumerator ServiceLoop() + { + var waitForSeconds = new WaitForSeconds(Time.fixedDeltaTime); + var waitUntil = new WaitUntil(() => elevatorTaskQueue.IsEmpty == false); + while (true) + { + yield return waitUntil; + // Debug.Log("New Task Queue added!!"); + + if (elevatorTaskQueue.TryDequeue(out var task)) + { + // Trigger service + if (task.state.Equals(ElevatorTaskState.DOOR_OPEN)) + { + DoServiceOpenDoor(ref task); + } + else if (task.state.Equals(ElevatorTaskState.DOOR_CLOSE)) + { + DoServiceCloseDoor(ref task); + } + else if (task.state.Equals(ElevatorTaskState.STANDBY)) + { + DoServiceInStandby(ref task); + } + + // handling service + if (task.state.Equals(ElevatorTaskState.PROCESSING)) + { + DoServiceInProcess(ref task); + } + + // finishing service + // Queue the task again if it is still in process. + if (!task.state.Equals(ElevatorTaskState.DONE)) + { + elevatorTaskQueue.Enqueue(task); + } + + yield return waitForSeconds; + } + } + } + + private void DoServiceOpenDoor(ref ElevatorTask task) + { + var entity = elevatorList[task.elevatorIndex]; + entity.Elevator.OpenDoor(); + task.state = ElevatorTaskState.DONE; + } + + private void DoServiceCloseDoor(ref ElevatorTask task) + { + var entity = elevatorList[task.elevatorIndex]; + entity.Elevator.CloseDoor(); + task.state = ElevatorTaskState.DONE; + } + + private void DoServiceInStandby(ref ElevatorTask task) + { + // new call + if (task.elevatorIndex <= NON_ELEVATOR_INDEX) + { + // check if the elevator is already arrived + foreach (var elevatorItem in elevatorList) + { + var elevator = elevatorItem.Value; + if (elevator.State.Equals(ElevatorState.STOP) && elevator.IsArrived(task.fromFloorHeight)) + { + Debug.LogFormat("Already arrived: {0}, {1}, {2} => {3}", elevator.Name, task.fromFloor, task.toFloor, task.fromFloorHeight); + task.state = ElevatorTaskState.DONE; + return; + } + } + + // check if the elevator is already moving to target + foreach (var otherTask in elevatorTaskQueue) + { + if (!otherTask.Equals(task) && otherTask.state.Equals(ElevatorTaskState.PROCESSING)) + { + if (otherTask.toFloor.Equals(task.fromFloor)) + { + Debug.LogFormat("Already moving: {0}, {1}, {2}", task.fromFloor, task.toFloor, task.fromFloorHeight); + task.state = ElevatorTaskState.DONE; + return; + } + } + } + + // find a new elevator among the elevators at rest and move!! + foreach (var elevatorItem in elevatorList) + { + var entity = elevatorItem.Value; + if (entity.State.Equals(ElevatorState.STOP)) + { + var elevatorIndex = elevatorItem.Key; + task.elevatorIndex = elevatorIndex; + + entity.MoveElevatorTo(task.fromFloorHeight); + + Debug.LogFormat("Move floor: {0}, {1}, {2} => {3} == {4}", entity.Name, task.fromFloor, task.toFloor, task.fromFloorHeight, entity.Height); + + task.state = ElevatorTaskState.PROCESSING; + break; + } + } + } + // select floor + else + { + var entity = elevatorList[task.elevatorIndex]; + Debug.LogFormat("Select floor: {0}, {1}, {2} => {3} == {4}", entity.Name, task.fromFloor, task.toFloor, task.fromFloorHeight, entity.Height); + + if (entity.Elevator.IsArrived(task.fromFloorHeight)) + { + entity.MoveElevatorTo(task.toFloorHeight); + task.state = ElevatorTaskState.PROCESSING; + } + else + { + Debug.LogErrorFormat("Wrong:: elevator is not arrived yet Select floor: {0}, {1}, {2}", entity.Name, task.fromFloor, task.toFloor); + task.state = ElevatorTaskState.DONE; + } + } + } + + private void DoServiceInProcess(ref ElevatorTask task) + { + // check if the elevator arrived + var elevatorIndex = task.elevatorIndex; + var entity = elevatorList[elevatorIndex]; + + if (entity.Elevator.IsArrived(task.toFloorHeight)) + { + entity.SetState(ElevatorState.STOP); + + task.state = ElevatorTaskState.DONE; + } + } + + private static void ClearMemoryStream(ref MemoryStream ms) + { + if (ms != null) + { + if (ms != null) + { + ms.SetLength(0); + ms.Position = 0; + ms.Capacity = 0; + } + } + } + +#if UNITY_EDITOR + // just for test + private KeyCode[] numKeyCodes = { + KeyCode.Alpha0, + KeyCode.Alpha1, + KeyCode.Alpha2, + KeyCode.Alpha3, + KeyCode.Alpha4, + KeyCode.Alpha5, + KeyCode.Alpha6, + KeyCode.Alpha7, + KeyCode.Alpha8, + KeyCode.Alpha9, + }; + + void Update() + { + foreach (var numKey in numKeyCodes) + { + if (Input.GetKeyUp(numKey)) + { + var elevatorIndex = (int)numKey - (int)(KeyCode.Alpha0); + Debug.Log("Test elevatorIndex: " + elevatorIndex); + + if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.LeftShift)) + { + RequestDoorClose(elevatorIndex); + } + else if (Input.GetKey(KeyCode.Tab) && Input.GetKey(KeyCode.LeftShift)) + { + var result = GetCalledElevator("B1F", "25F", out elevatorIndex); + // Debug.Log(elevatorIndex + " - " + result); + } + else if (Input.GetKey(KeyCode.Tab)) + { + var result = CallElevator("B1F", "25F"); + // Debug.Log(result); + } + else if (Input.GetKey(KeyCode.LeftAlt)) + { + SelectElevatorFloor(elevatorIndex, "B1F", "25F"); + } + else if (Input.GetKey(KeyCode.LeftShift)) + { + SelectElevatorFloor(elevatorIndex, "25F", "B1F"); + } + else + { + RequestDoorOpen(elevatorIndex); + } + } + } + } +#endif +} \ No newline at end of file diff --git a/Assets/Scripts/CustomPlugins/ElevatorSystem.cs.meta b/Assets/Scripts/CustomPlugins/ElevatorSystem.cs.meta new file mode 100644 index 00000000..075580b5 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/ElevatorSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26367ead88a67d9f4b23d7ccdc702ed8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins/LaserPlugin.cs b/Assets/Scripts/CustomPlugins/LaserPlugin.cs new file mode 100644 index 00000000..88212fff --- /dev/null +++ b/Assets/Scripts/CustomPlugins/LaserPlugin.cs @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +public class LaserPlugin : CustomPlugin +{ + public string partName = string.Empty; + + private SensorDevices.Lidar lidar = null; + + protected override void OnAwake() + { + partName = DeviceHelper.GetPartName(gameObject); + + string hashKey = MakeHashKey(partName); + if (!RegisterTxDevice(hashKey)) + { + Debug.LogError("Failed to register for LaserPlugin - " + hashKey); + } + } + + protected override void OnStart() + { + lidar = gameObject.GetComponent(); + + AddThread(Sender); + } + + private void Sender() + { + Stopwatch sw = new Stopwatch(); + while (true) + { + if (lidar == null) + { + continue; + } + + var datastreamToSend = lidar.PopData(); + sw.Restart(); + Publish(datastreamToSend); + sw.Stop(); + lidar.SetTransportTime((float)sw.Elapsed.TotalSeconds); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/CustomPlugins/LaserPlugin.cs.meta b/Assets/Scripts/CustomPlugins/LaserPlugin.cs.meta new file mode 100644 index 00000000..98981406 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/LaserPlugin.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 02597afc963af1ed6a42980b0de66e67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins/RobotControl.cs b/Assets/Scripts/CustomPlugins/RobotControl.cs new file mode 100644 index 00000000..577ee32c --- /dev/null +++ b/Assets/Scripts/CustomPlugins/RobotControl.cs @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Threading; +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +public class RobotControl : CustomPlugin +{ + private MicomInput micomInput = null; + private MicomSensor micomSensor = null; + private SensorDevices.IMU imuSensor = null; + + private Motor motorLeft = null; + private Motor motorRight = null; + + public float wheelRadius = 0.0f; // in mether + public float divideWheelRadius = 0.0f; + + protected override void OnAwake() + { + micomInput = gameObject.AddComponent(); + micomSensor = gameObject.AddComponent(); + + string txHashKey = MakeHashKey("MICOM", "_SENSOR"); + if (!RegisterTxDevice(txHashKey)) + { + Debug.LogError("Failed to register for RobotControl TX- " + txHashKey); + } + + string rxHashKey = MakeHashKey("MICOM", "_INPUT"); + if (!RegisterRxDevice(rxHashKey)) + { + Debug.LogError("Failed to register for RobotControl RX- " + rxHashKey); + } + } + + protected override void OnStart() + { + const float MM2M = 0.001f; + var updateRate = GetPluginValue("update_rate", 20); + micomSensor.SetUpdateRate(updateRate); + + var kp = GetPluginValue("PID/kp"); + var ki = GetPluginValue("PID/ki"); + var kd = GetPluginValue("PID/kd"); + + var pidControl = new PID(kp, ki, kd); + + var wheelBase = GetPluginValue("wheel/base") * MM2M; + wheelRadius = GetPluginValue("wheel/radius") * MM2M; + divideWheelRadius = 1.0f/wheelRadius; // for performacne. + + var wheelNameLeft = GetPluginValue("wheel/location[@type='left']"); + var wheelNameRight = GetPluginValue("wheel/location[@type='right']"); + + var debugging = GetPluginValue("debug", false); + micomInput.EnableDebugging = debugging; + + var motorFriction = GetPluginValue("motor_friction", 0.1f); + var brakeFriction = GetPluginValue("brake_friction", 0.1f); + + var modelList = GetComponentsInChildren(); + foreach (var model in modelList) + { + // Debug.Log(model.name); + if (model.name.Equals(wheelNameLeft)) + { + var jointWheelLeft = model.GetComponentInChildren(); + motorLeft = new Motor("Left", jointWheelLeft, pidControl); + + var wheelLeftBody = jointWheelLeft.gameObject.GetComponent(); + + // Debug.Log("joint Wheel Left found : " + jointWheelLeft.name); + // Debug.Log("joint Wheel Left max angular velocity : " + jointWheelLeft.gameObject.GetComponent().maxAngularVelocity); + } + else if (model.name.Equals(wheelNameRight)) + { + var jointWheelRight = model.GetComponentInChildren(); + motorRight = new Motor("Right", jointWheelRight, pidControl); + + var wheelRightBody = jointWheelRight.gameObject.GetComponent(); + + // Debug.Log("joint Wheel Right found : " + jointWheelRight.name); + // Debug.Log("joint Wheel Right max angular velocity : " + jointWheelRight.gameObject.GetComponent().maxAngularVelocity); + } + + if (motorLeft != null && motorRight != null) + { + break; + } + } + + imuSensor = gameObject.GetComponentInChildren(); + + AddThread(Sender); + AddThread(Receiver); + } + + void FixedUpdate() + { + Quaternion localRotation = transform.rotation; + if (imuSensor != null) + { + micomSensor.SetIMU(imuSensor); + micomSensor.SetAccGyro(localRotation.eulerAngles); + // Debug.LogFormat("{0} {1}", localRotation, imuSensor.GetOrientation()); + } + + float linearVelocityLeft = 0; + float linearVelocityRight = 0; + + if (motorLeft != null) + { + var targetWheelVelocityLeft = micomInput.GetWheelVelocityLeft() * divideWheelRadius; + motorLeft.SetVelocityTarget(targetWheelVelocityLeft); + linearVelocityLeft = motorLeft.GetCurrentVelocity() * wheelRadius; + } + + if (motorRight != null) + { + var targetWheelVelocityRight = micomInput.GetWheelVelocityRight() * divideWheelRadius; + motorRight.SetVelocityTarget(targetWheelVelocityRight); + linearVelocityRight = motorRight.GetCurrentVelocity() * wheelRadius; + } + + // Debug.LogFormat("{0} {1}, {2} {3} | {4}", motorLeft.GetCurrentVelocity(), linearVelocityLeft, motorRight.GetCurrentVelocity(), linearVelocityRight, wheelRadius); + micomSensor.SetOdomData(linearVelocityLeft, linearVelocityRight); + } + + private void Sender() + { + var sw = new Stopwatch(); + while (true) + { + if (micomSensor == null) + { + continue; + } + + var datastreamToSend = micomSensor.PopData(); + sw.Restart(); + Publish(datastreamToSend); + sw.Stop(); + + micomSensor.SetTransportTime((float)sw.Elapsed.TotalSeconds); + } + } + + private void Receiver() + { + while (true) + { + if (micomInput == null) + { + continue; + } + + var receivedData = Subscribe(); + micomInput.SetDataStream(receivedData); + Thread.SpinWait(5); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/CustomPlugins/RobotControl.cs.meta b/Assets/Scripts/CustomPlugins/RobotControl.cs.meta new file mode 100644 index 00000000..98109d67 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/RobotControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43ac33aabd0dd90f697792a9a7f734a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CustomPlugins/UnityRosInit.cs b/Assets/Scripts/CustomPlugins/UnityRosInit.cs new file mode 100644 index 00000000..dfced6b6 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/UnityRosInit.cs @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Threading; +using System; +using UnityEngine; + +public class UnityRosInit : CustomPlugin +{ + private Clock clock = null; + + protected override void OnAwake() + { + clock = gameObject.AddComponent(); + + string hashKey = MakeHashKey(); + if (!RegisterTxDevice(hashKey)) + { + Debug.LogError("Failed to register for UnityRosInit - " + hashKey); + } + } + + protected override void OnStart() + { + AddThread(Sender); + } + + private void Sender() + { + while (true) + { + if (clock == null) + { + continue; + } + + var datastreamToSend = clock.PopData(); + Publish(datastreamToSend); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/CustomPlugins/UnityRosInit.cs.meta b/Assets/Scripts/CustomPlugins/UnityRosInit.cs.meta new file mode 100644 index 00000000..973755e9 --- /dev/null +++ b/Assets/Scripts/CustomPlugins/UnityRosInit.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fed3a835840db597d965c095f0331009 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 1000 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/DebugLogWriter.cs b/Assets/Scripts/DebugLogWriter.cs new file mode 100644 index 00000000..b8426621 --- /dev/null +++ b/Assets/Scripts/DebugLogWriter.cs @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using UnityEngine; + +public class DebugLogWriter : System.IO.TextWriter +{ + private bool isSkip = false; + private bool isWarning = false; + + public void SetSkip(in bool value) { + { + isSkip = value; + } +} + public void SetWarning(in bool value) + { + isWarning = value; + } + + public DebugLogWriter() + { + //Debug.Log("Initialized!!!"); + } + + public override void Write(string value) + { + if (isSkip || value == null) + { + return; + } + + base.Write(value); + + if (isWarning) + { + Debug.LogWarning(value); + } + else + { + Debug.Log(value); + } + } + + public override void WriteLine(string value) + { + if (isSkip || value == null) + return; + + base.WriteLine(value); + + if (isWarning) + { + Debug.LogWarning(value); + } + else + { + Debug.Log(value); + } + } + + public override System.Text.Encoding Encoding + { + get { return System.Text.Encoding.UTF8; } + } +} \ No newline at end of file diff --git a/Assets/Scripts/DebugLogWriter.cs.meta b/Assets/Scripts/DebugLogWriter.cs.meta new file mode 100644 index 00000000..78419b26 --- /dev/null +++ b/Assets/Scripts/DebugLogWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 892e39a6489b5b797aca1e188ca72d73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices.meta b/Assets/Scripts/Devices.meta new file mode 100644 index 00000000..e0e6ee8c --- /dev/null +++ b/Assets/Scripts/Devices.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4b39c918983e9530ac0447af65ba1c8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Camera.CameraData.cs b/Assets/Scripts/Devices/Camera.CameraData.cs new file mode 100644 index 00000000..3b819661 --- /dev/null +++ b/Assets/Scripts/Devices/Camera.CameraData.cs @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System; +using Unity.Collections; +using UnityEngine; + +namespace SensorDevices +{ + public partial class Camera : Device + { + public enum PixelFormat + { + UNKNOWN_PIXEL_FORMAT = 0, L_INT8, L_INT16, + RGB_INT8, RGBA_INT8, BGRA_INT8, RGB_INT16, RGB_INT32, + BGR_INT8, BGR_INT16, BGR_INT32, + R_FLOAT16, RGB_FLOAT16, R_FLOAT32, RGB_FLOAT32, + BAYER_RGGB8, BAYER_RGGR8, BAYER_GBRG8, BAYER_GRBG8, + PIXEL_FORMAT_COUNT + }; + + static public PixelFormat GetPixelFormat(in string imageFormat) + { + var parsedEnum = PixelFormat.UNKNOWN_PIXEL_FORMAT; + + if (imageFormat == null || imageFormat.Equals(string.Empty)) + { + return parsedEnum; + } + + // Handle old format strings + if (imageFormat.Equals("L8") || imageFormat.Equals("L_INT8")) + { + parsedEnum = PixelFormat.L_INT8; + } + else if (imageFormat.Equals("L16") || imageFormat.Equals("L_INT16") || imageFormat.Equals("L_UINT16")) + { + // Note: we are treating unsigned and signed 16bit the same but it is + // better to add a L_UINT16 format to distinguish between the two + parsedEnum = PixelFormat.L_INT16; + } + else if (imageFormat.Equals("R8G8B8") || imageFormat.Equals("RGB_INT8")) + { + parsedEnum = PixelFormat.RGB_INT8; + } + else if (imageFormat.Equals("R16G16B16") || imageFormat.Equals("RGB_INT16")|| imageFormat.Equals("RGB_UINT16")) + { + // Note: we are treating unsigned and signed 16bit the same but it is + // better to add a RGB_UINT16 format to distinguish between the two + parsedEnum = PixelFormat.RGB_INT16; + } + else + { + parsedEnum = (PixelFormat)Enum.Parse(typeof(PixelFormat), imageFormat); + } + + return parsedEnum; + } + + static public uint GetImageDepth(in string imageFormat) + { + uint depth = 0; + + if (imageFormat == null || imageFormat.Equals(string.Empty)) + { + return depth; + } + + if (imageFormat.Equals("L8") || imageFormat.Equals("L_INT8")) + { + depth = 1; + } + else if (imageFormat.Equals("L16") || imageFormat.Equals("L_INT16")|| imageFormat.Equals("L_UINT16")) + { + depth = 2; + } + else if (imageFormat.Equals("R8G8B8")|| imageFormat.Equals("RGB_INT8")) + { + depth = 3; + } + else if (imageFormat.Equals("B8G8R8")|| imageFormat.Equals("BGR_INT8")) + { + depth = 3; + } + else if (imageFormat.Equals("R_FLOAT32")) + { + depth = 4; + } + else if (imageFormat.Equals("R16G16B16")|| imageFormat.Equals("RGB_INT16")|| imageFormat.Equals("RGB_UINT16")) + { + depth = 6; + } + else if (imageFormat.Equals("BAYER_RGGB8") || imageFormat.Equals("BAYER_BGGR8") || + imageFormat.Equals("BAYER_GBRG8") || imageFormat.Equals("BAYER_GRBG8")) + { + depth = 1; + } + else + { + Debug.LogErrorFormat("Error parsing image format ({0}), using default PF_R8G8B8", imageFormat); + } + + return depth; + } + + private struct CamData + { + private Texture2D cameraImage; + private Rect pixelSource; + + public int ImageWidth + { + get => cameraImage.width; + } + + public int ImageHeight + { + get => cameraImage.height; + } + + public void AllocateTexture(in int width, in int height, in string imageFormat) + { + var isLinear = false; + + var format = GetPixelFormat(imageFormat); + var textureFormat = TextureFormat.RGB24; + switch (format) + { + case PixelFormat.L_INT8: + textureFormat = TextureFormat.R8; + break; + + case PixelFormat.L_INT16: + textureFormat = TextureFormat.RG16; + break; + + case PixelFormat.R_FLOAT32: + textureFormat = TextureFormat.RFloat; + isLinear = true; + break; + + case PixelFormat.RGB_FLOAT32: + textureFormat = TextureFormat.RGBAFloat; + isLinear = true; + break; + + case PixelFormat.RGB_INT8: + default: + textureFormat = TextureFormat.RGB24; + break; + } + + cameraImage = new Texture2D(width, height, textureFormat, false, isLinear); + pixelSource = new Rect(0, 0, width, height); + } + + public void SetTextureData(in RenderTexture rt) + { + if (rt != null) + { + var currentRenderTexture = RenderTexture.active; + RenderTexture.active = rt; + cameraImage.ReadPixels(pixelSource, 0, 0); + cameraImage.Apply(); + RenderTexture.active = currentRenderTexture; + } + } + + public void SetTextureData(in NativeArray buffer) + { + cameraImage.LoadRawTextureData(buffer); + cameraImage.Apply(); + } + + public byte[] GetTextureData() + { + return cameraImage.GetRawTextureData(); + } + + public void SaveRawImageData(in string path, in string name) + { + var bytes = cameraImage.EncodeToPNG(); + var fileName = string.Format("{0}/{1}", path, name); + System.IO.File.WriteAllBytes(fileName, bytes); + } + } + + private CamData camData; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Camera.CameraData.cs.meta b/Assets/Scripts/Devices/Camera.CameraData.cs.meta new file mode 100644 index 00000000..f67ee832 --- /dev/null +++ b/Assets/Scripts/Devices/Camera.CameraData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b1b2c78c9d74417e944e95af178881a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Camera.cs b/Assets/Scripts/Devices/Camera.cs new file mode 100644 index 00000000..2cc11fcd --- /dev/null +++ b/Assets/Scripts/Devices/Camera.cs @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using System; +using Unity.Collections; +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +namespace SensorDevices +{ + public partial class Camera : Device + { + protected gazebo.msgs.ImageStamped imageStamped = null; + + public SDF.Camera parameters = null; + + // TODO : Need to be implemented!!! + // TBD + // TBD + // TBD + + protected Transform cameraLink = null; + + protected UnityEngine.Camera cam = null; + + public float adjustCapturingRate = 1.5f; + + public bool runningDeviceWork = true; + + protected Camera() + { + // Initialize Gazebo Message + imageStamped = new gazebo.msgs.ImageStamped(); + imageStamped.Time = new gazebo.msgs.Time(); + imageStamped.Image = new gazebo.msgs.Image(); + } + + void Awake() + { + cam = gameObject.AddComponent(); + cameraLink = transform.parent; + } + + protected override void OnStart() + { + InitializeMessages(); + + if (cam) + { + cam.transform.Rotate(Vector3.up, 90.0000000000f); + + SetupCamera(); + StartCoroutine(CameraWorker()); + } + } + + private void InitializeMessages() + { + var image = imageStamped.Image; + image.Width = (uint)parameters.image_width; + image.Height = (uint)parameters.image_height; + image.PixelFormat = (uint)GetPixelFormat(parameters.image_format); + image.Step = image.Width * GetImageDepth(parameters.image_format); + image.Data = new byte[image.Height * image.Step]; + } + + private void SetupCamera() + { + cam.ResetWorldToCameraMatrix(); + cam.ResetProjectionMatrix(); + + cam.allowHDR = true; + cam.allowMSAA = false; + cam.targetDisplay = 0; + cam.stereoTargetEye = StereoTargetEyeMask.None; + + cam.orthographic = false; + cam.nearClipPlane = (float)parameters.clip.near; + cam.farClipPlane = (float)parameters.clip.far; + + var targetRTname = "CameraTexture"; + var targetRTdepth = 0; + var targetRTformat = RenderTextureFormat.ARGB32; + var targetRTrwmode = RenderTextureReadWrite.sRGB; + + if (cam.depthTextureMode.Equals(DepthTextureMode.Depth)) + { + targetRTname = "CameraDepthTexture"; + targetRTdepth = 24; + targetRTformat = RenderTextureFormat.RFloat; + targetRTrwmode = RenderTextureReadWrite.Linear; + } + + var targetRT = new RenderTexture(parameters.image_width, parameters.image_height, targetRTdepth, targetRTformat, targetRTrwmode); + targetRT.name = targetRTname; + cam.targetTexture = targetRT; + + var camHFov = (float)parameters.horizontal_fov * Mathf.Rad2Deg; + var camVFov = DeviceHelper.HorizontalToVerticalFOV(camHFov, cam.aspect); + cam.fieldOfView = camVFov; + + // Invert projection matrix for gazebo msg + var projMatrix = DeviceHelper.MakeCustomProjectionMatrix(camHFov, camVFov, cam.nearClipPlane, cam.farClipPlane); + var invertMatrix = Matrix4x4.Scale(new Vector3(1, -1, 1)); + cam.projectionMatrix = projMatrix * invertMatrix; + cam.enabled = false; + // cam.hideFlags |= HideFlags.NotEditable; + + camData.AllocateTexture(parameters.image_width, parameters.image_height, parameters.image_format); + } + + private IEnumerator CameraWorker() + { + var waitForSeconds = new WaitForSeconds(UpdatePeriod * adjustCapturingRate); + while (true) + { + var oldCulling = GL.invertCulling; + GL.invertCulling = !oldCulling; + cam.Render(); + GL.invertCulling = oldCulling; + + camData.SetTextureData(cam.targetTexture); + + if (parameters.save_enabled) + { + var saveName = name + "_" + Time.time; + camData.SaveRawImageData(parameters.save_path, saveName); + // Debug.LogFormat("{0}|{1} captured", parameters.save_path, saveName); + } + cam.enabled = false; + + yield return waitForSeconds; + } + } + + protected override IEnumerator MainDeviceWorker() + { + var sw = new Stopwatch(); + while (runningDeviceWork) + { + sw.Restart(); + GenerateMessage(); + sw.Stop(); + + yield return new WaitForSeconds(WaitPeriod((float)sw.Elapsed.TotalSeconds)); + } + } + + protected override void GenerateMessage() + { + var image = imageStamped.Image; + var imageData = camData.GetTextureData(); + if (image.Data.Length == imageData.Length) + { + image.Data = imageData; + } + // Debug.Log(imageStamped.Image.Height + "," + imageStamped.Image.Width); + + DeviceHelper.SetCurrentTime(imageStamped.Time); + PushData(imageStamped); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Camera.cs.meta b/Assets/Scripts/Devices/Camera.cs.meta new file mode 100644 index 00000000..ba2f819e --- /dev/null +++ b/Assets/Scripts/Devices/Camera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3165cabeacd2c7a1aa5245d886ba3b6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Clock.cs b/Assets/Scripts/Devices/Clock.cs new file mode 100644 index 00000000..3d942ca2 --- /dev/null +++ b/Assets/Scripts/Devices/Clock.cs @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using UnityEngine; + +public class Clock : Device +{ + private const float updateRate = 250f; + + private gazebo.msgs.Param timeInfo = null; + private gazebo.msgs.Time simTime = null; + private gazebo.msgs.Time realTime = null; + + Clock() + { + simTime = new gazebo.msgs.Time(); + realTime = new gazebo.msgs.Time(); + + timeInfo = new gazebo.msgs.Param(); + timeInfo.Name = "timeInfo"; + timeInfo.Value = new gazebo.msgs.Any(); + timeInfo.Value.Type = gazebo.msgs.Any.ValueType.None; + + gazebo.msgs.Param simTimeParam = new gazebo.msgs.Param(); + simTimeParam.Name = "simTime"; + simTimeParam.Value = new gazebo.msgs.Any(); + simTimeParam.Value.Type = gazebo.msgs.Any.ValueType.Time; + simTimeParam.Value.TimeValue = simTime; + timeInfo.Childrens.Add(simTimeParam); + + gazebo.msgs.Param realTimeParam = new gazebo.msgs.Param(); + realTimeParam.Name = "realTime"; + realTimeParam.Value = new gazebo.msgs.Any(); + realTimeParam.Value.Type = gazebo.msgs.Any.ValueType.Time; + realTimeParam.Value.TimeValue = realTime; + timeInfo.Childrens.Add(realTimeParam); + } + + protected override void OnStart() + { + deviceName = "Unity Clock"; + SetUpdateRate(updateRate); + } + + protected override IEnumerator MainDeviceWorker() + { + var waitForSeconds = new WaitForSeconds(UpdatePeriod); + while (true) + { + GenerateMessage(); + yield return waitForSeconds; + } + } + + protected override void GenerateMessage() + { + if (timeInfo != null) + { + DeviceHelper.SetCurrentTime(simTime, false); + DeviceHelper.SetCurrentTime(realTime, true); + PushData(timeInfo); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Clock.cs.meta b/Assets/Scripts/Devices/Clock.cs.meta new file mode 100644 index 00000000..6fb28f0a --- /dev/null +++ b/Assets/Scripts/Devices/Clock.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf181370af84b78df8c42d5bef33e52b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/DepthCamera.cs b/Assets/Scripts/Devices/DepthCamera.cs new file mode 100644 index 00000000..ac10da0a --- /dev/null +++ b/Assets/Scripts/Devices/DepthCamera.cs @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using System; +using Unity.Collections; +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +namespace SensorDevices +{ + public partial class DepthCamera : Camera + { + // TBD + // TBD + // TBD + + private Material depthMaterial = null; + + public bool isPointCloud = false; + + private DepthCamera() + : base() + { + } + + void OnRenderImage(RenderTexture source, RenderTexture destination) + { + if (depthMaterial) + { + Graphics.Blit(source, destination, depthMaterial); + } + else + { + Graphics.Blit(source, destination); + } + } + + protected override void OnStart() + { + SetupDepthCamera(); + + base.OnStart(); + } + + private void SetupDepthCamera() + { + // TODO : Need to be implemented!!! + var depthShader = Shader.Find("Sensor/DepthCamera"); + // depthMaterial = new Material(depthShader); + + if (parameters.depth_camera_output.Equals("points")) + { + isPointCloud = true; + Debug.Log("Enable Point Cloud data mode"); + parameters.image_format = "RGB_FLOAT32"; + } + else + { + parameters.image_format = "R_FLOAT32"; + } + + cam.backgroundColor = Color.white; + cam.clearFlags = CameraClearFlags.SolidColor; + cam.depthTextureMode = DepthTextureMode.Depth; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/DepthCamera.cs.meta b/Assets/Scripts/Devices/DepthCamera.cs.meta new file mode 100644 index 00000000..43b61797 --- /dev/null +++ b/Assets/Scripts/Devices/DepthCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44deae7bee4133a57b7e87b873cab50f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Device.cs b/Assets/Scripts/Devices/Device.cs new file mode 100644 index 00000000..d3ddc478 --- /dev/null +++ b/Assets/Scripts/Devices/Device.cs @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using System.Collections.Concurrent; +using System.IO; +using UnityEngine; +using ProtoBuf; + +public class Device : MonoBehaviour +{ + public string deviceName = string.Empty; + + private const int maxQueue = 3; + private BlockingCollection memoryStreamOutboundQueue; + + private MemoryStream memoryStream = null; + + protected const float SEC2MSEC = 1000.0f; + + private float updateRate = 1; + + private bool debugginOn = true; + + private bool visualize = true; + + private float transportingTimeSeconds = 0; + + public Device() + { + memoryStreamOutboundQueue = new BlockingCollection(maxQueue); + memoryStream = new MemoryStream(); + ResetDataStream(); + } + + void OnDestroy() + { + if (memoryStreamOutboundQueue.IsCompleted) + { + memoryStreamOutboundQueue.Dispose(); + } + } + + public float UpdateRate => updateRate; + + public float UpdatePeriod => 1f/updateRate; + + public int UpdatePeriodInMillisecond => (int)(UpdatePeriod * SEC2MSEC); + + public float TransportingTime => transportingTimeSeconds; + + public bool EnableDebugging + { + get => debugginOn; + set => debugginOn = value; + } + + public bool EnableVisualize + { + get => visualize; + set => visualize = value; + } + + void Start() + { + OnStart(); + StartCoroutine(MainDeviceWorker()); + + if (EnableVisualize) + { + StartCoroutine(OnVisualize()); + } + } + + protected virtual void OnStart() + { + // do nothing + } + + protected virtual IEnumerator MainDeviceWorker() + { + // do nothing + yield return null; + } + + protected virtual IEnumerator OnVisualize() + { + // do nothing + yield return null; + } + + protected float WaitPeriod(in float messageGenerationTime = 0) + { + var waitTime = UpdatePeriod - messageGenerationTime - TransportingTime; + // Debug.Log("elapsedTime : "+ messageGenerationTime.ToString("F5")); + // Debug.Log("waitTime : "+ waitTime.ToString("F5")); + return (waitTime < 0)? 0:waitTime; + } + + public void SetUpdateRate(in float value) + { + updateRate = value; + } + + public void SetTransportTime(in float value) + { + transportingTimeSeconds = value; + } + + protected bool ResetDataStream() + { + lock (memoryStream) + { + if (memoryStream == null) + return false; + + memoryStream.SetLength(0); + memoryStream.Position = 0; + memoryStream.Capacity = 0; + + return true; + } + } + + protected MemoryStream GetDataStream() + { + if (memoryStream.CanRead) + { + return memoryStream; + } + else + { + return null; + } + } + + public void SetDataStream(in byte[] data) + { + lock (memoryStream) + { + if (ResetDataStream()) + { + if (data != null) + { + if (memoryStream.CanWrite) + { + memoryStream.Write(data, 0, data.Length); + memoryStream.Position = 0; + } + else + Debug.LogError("Failed to write memory stream"); + } + } + } + } + + protected void SetMessageData(T instance) + { + lock (memoryStream) + { + if (memoryStream == null) + { + Debug.LogError("Cannot set data stream... it's null"); + return; + } + + ResetDataStream(); + Serializer.Serialize(memoryStream, instance); + } + } + + protected T GetMessageData() + { + lock (memoryStream) + { + if (memoryStream == null) + { + Debug.LogError("Cannot Get data message... it's null"); + return default(T); + } + + T result = Serializer.Deserialize(memoryStream); + ResetDataStream(); + return result; + } + } + + protected virtual void GenerateMessage() + { + Debug.Log("Need to implement!!"); + } + + protected bool PushData(T instance) + { + SetMessageData(instance); + return PushData(); + } + + protected bool PushData() + { + if (memoryStreamOutboundQueue == null) + { + return false; + } + + if (memoryStreamOutboundQueue.Count > maxQueue) + { + Debug.LogWarningFormat("Outbound queue is reached to maximum capacity({0})!!", maxQueue); + } + + return memoryStreamOutboundQueue.TryAdd(GetDataStream()); + } + + public MemoryStream PopData() + { + if (memoryStreamOutboundQueue == null) + { + return null; + } + + if (memoryStreamOutboundQueue.TryTake(out var item, UpdatePeriodInMillisecond)) + { + return item; + } + else + { + return null; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Device.cs.meta b/Assets/Scripts/Devices/Device.cs.meta new file mode 100644 index 00000000..27b8caf6 --- /dev/null +++ b/Assets/Scripts/Devices/Device.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44c091b0bf00d436f83c3d1c5ae68616 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 900 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/DeviceHelper.cs b/Assets/Scripts/Devices/DeviceHelper.cs new file mode 100644 index 00000000..cc3d9958 --- /dev/null +++ b/Assets/Scripts/Devices/DeviceHelper.cs @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Runtime.InteropServices; +using UnityEngine; + +public class DeviceHelper +{ + public static string GetModelName(in GameObject targetObject, in bool searchOnlyOneDepth = false) + { + try + { + var nextObject = targetObject.GetComponentInParent(); + + if (searchOnlyOneDepth == false) + { + while (!nextObject.transform.parent.Equals(nextObject.transform.root)) + { + nextObject = nextObject.transform.parent.GetComponentInParent(); + if (nextObject == null) + return string.Empty; + } + } + + return nextObject.name; + } + catch + { + Debug.LogError("Thee is no parent object model"); + return string.Empty; + } + } + + public static string GetPartName(in GameObject targetObject) + { + return GetModelName(targetObject, true); + } + + [DllImport("StdHash")] + public static extern ulong GetStringHashCode(string value); + + public static void SetCurrentTime(gazebo.msgs.Time gazeboMsgsTime, in bool useRealTime = false) + { + try + { + if (gazeboMsgsTime == null) + { + gazeboMsgsTime = new gazebo.msgs.Time(); + } + + var timeNow = (useRealTime)? Time.realtimeSinceStartup:Time.time; + gazeboMsgsTime.Sec = (int)timeNow; + gazeboMsgsTime.Nsec = (int)((timeNow - (float)gazeboMsgsTime.Sec) * (float)1e+9); + } + catch + { + Debug.LogError("time message is not initialized yet."); + } + } + + public static void SetVector3d(gazebo.msgs.Vector3d vector3d, in Vector3 position) + { + if (vector3d == null) + { + vector3d = new gazebo.msgs.Vector3d(); + } + + vector3d.X = position.x; + vector3d.Y = position.z; + vector3d.Z = position.y; + } + + public static void SetQuaternion(gazebo.msgs.Quaternion quaternion, in Quaternion rotation) + { + if (quaternion == null) + { + quaternion = new gazebo.msgs.Quaternion(); + } + + quaternion.X = rotation.x; + quaternion.Y = rotation.z; + quaternion.Z = rotation.y; + quaternion.W = rotation.w; + } + + public static Matrix4x4 MakeCustomProjectionMatrix(in float hFov, in float vFov, in float near, in float far) + { + // construct custom aspect ratio projection matrix + // math from https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/opengl-perspective-projection-matrix + float h = 1.0f / Mathf.Tan(hFov * Mathf.Deg2Rad / 2f); + float v = 1.0f / Mathf.Tan(vFov * Mathf.Deg2Rad / 2f); + float a = (far + near) / (near - far); + float b = (2.0f * far * near / (near - far)); + + var projMatrix = new Matrix4x4( + new Vector4(h, 0, 0, 0), + new Vector4(0, v, 0, 0), + new Vector4(0, 0, a, -1), + new Vector4(0, 0, b, 0)); + + return projMatrix; + } + + + public static float HorizontalToVerticalFOV(in float horizontalFOV, in float aspect = 1.0f) + { + return Mathf.Rad2Deg * 2 * Mathf.Atan(Mathf.Tan((horizontalFOV * Mathf.Deg2Rad) / 2f) / aspect); + } + + public static bool IsSamePosition(in float A, in float B) + { + var distance = Mathf.Abs(A - B); + if (distance < Mathf.Epsilon) + { + return true; + } + return false; + } + + public static bool IsSamePosition(in Vector3 A, in Vector3 B) + { + var distance = Vector3.SqrMagnitude(A - B); + if (distance < Vector3.kEpsilon) + { + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/DeviceHelper.cs.meta b/Assets/Scripts/Devices/DeviceHelper.cs.meta new file mode 100644 index 00000000..1df2f8fa --- /dev/null +++ b/Assets/Scripts/Devices/DeviceHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 750522b0fd2ca63ebbcb204ae249c5ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/IMU.cs b/Assets/Scripts/Devices/IMU.cs new file mode 100644 index 00000000..e532cbed --- /dev/null +++ b/Assets/Scripts/Devices/IMU.cs @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +namespace SensorDevices +{ + public partial class IMU : Device + { + private gazebo.msgs.Imu imu = null; + + // + // + // + // + // + // + + private Vector3 imuInitialRotation = Vector3.zero; + private Quaternion imuOrientation = Quaternion.identity; + private Vector3 imuAngularVelocity = Vector3.zero; + private Vector3 imuLinearAcceleration = Vector3.zero; + + private Vector3 previousImuPosition = Vector3.zero; + private Vector3 previousImuRotation = Vector3.zero; + private Vector3 previousLinearVelocity = Vector3.zero; + + public float samplingRate = 100f; + public float samplingPeriod = 0; + public float timeElapsed = 0; + + IMU() + { + // Initialize Gazebo Message + imu = new gazebo.msgs.Imu(); + imu.Stamp = new gazebo.msgs.Time(); + imu.Orientation = new gazebo.msgs.Quaternion(); + imu.AngularVelocity = new gazebo.msgs.Vector3d(); + imu.LinearAcceleration = new gazebo.msgs.Vector3d(); + } + + void Awake() + { + } + + protected override void OnStart() + { + deviceName = name; + imuInitialRotation = transform.rotation.eulerAngles; + previousImuPosition = transform.position; + previousImuRotation = Vector3.zero; + + samplingPeriod = 1/samplingRate; + } + + + void FixedUpdate() + { + // Caculate orientation and acceleration + var imuRotation = transform.rotation.eulerAngles - imuInitialRotation; + imuOrientation = Quaternion.Euler(imuRotation.x, imuRotation.y, imuRotation.z); + imuOrientation.Normalize(); + imuOrientation.y *= -1.0f; + + imuAngularVelocity.x = Mathf.DeltaAngle(imuRotation.x, previousImuRotation.x) / Time.fixedDeltaTime; + imuAngularVelocity.y = Mathf.DeltaAngle(imuRotation.y, previousImuRotation.y) / Time.fixedDeltaTime; + imuAngularVelocity.z = Mathf.DeltaAngle(imuRotation.z, previousImuRotation.z) / Time.fixedDeltaTime; + + var currentPosition = transform.position; + var currentLinearVelocity = (currentPosition - previousImuPosition) / Time.fixedDeltaTime; + imuLinearAcceleration = (currentLinearVelocity - previousLinearVelocity) / Time.fixedDeltaTime; + imuLinearAcceleration.y += (-Physics.gravity.y); + + previousImuRotation = imuRotation; + previousImuPosition = currentPosition; + previousLinearVelocity = currentLinearVelocity; + } + + protected override IEnumerator MainDeviceWorker() + { + var sw = new Stopwatch(); + while (true) + { + sw.Restart(); + GenerateMessage(); + sw.Stop(); + + yield return new WaitForSeconds(WaitPeriod((float)sw.Elapsed.TotalSeconds)); + } + } + + protected override void GenerateMessage() + { + DeviceHelper.SetQuaternion(imu.Orientation, imuOrientation); + DeviceHelper.SetVector3d(imu.AngularVelocity, imuAngularVelocity * Mathf.Deg2Rad); + DeviceHelper.SetVector3d(imu.LinearAcceleration, imuLinearAcceleration); + DeviceHelper.SetCurrentTime(imu.Stamp); + SetMessageData(imu); + } + + public Quaternion GetOrientation() + { + try + { + var orientation = new Quaternion((float)imu.Orientation.X, (float)imu.Orientation.Y, + (float)imu.Orientation.Z, (float)imu.Orientation.W); + return orientation; + } + catch + { + return Quaternion.identity; + } + } + + public Vector3 GetAngularVelocity() + { + try + { + var angularVelocity = new Vector3((float)imu.AngularVelocity.X, (float)imu.AngularVelocity.Y, (float)imu.AngularVelocity.Z); + return angularVelocity; + } + catch + { + return Vector3.zero; + } + } + + public Vector3 GetLinearAcceleration() + { + try + { + var linearAccel = new Vector3((float)imu.LinearAcceleration.X, (float)imu.LinearAcceleration.Y, (float)imu.LinearAcceleration.Z); + return linearAccel; + } + catch + { + return Vector3.zero; + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/IMU.cs.meta b/Assets/Scripts/Devices/IMU.cs.meta new file mode 100644 index 00000000..7acfb7e6 --- /dev/null +++ b/Assets/Scripts/Devices/IMU.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a62e4df440361ae3fa0f679ae3b47ba1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Lidar.LaserCameraData.cs b/Assets/Scripts/Devices/Lidar.LaserCameraData.cs new file mode 100644 index 00000000..d20a9ae1 --- /dev/null +++ b/Assets/Scripts/Devices/Lidar.LaserCameraData.cs @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using UnityEngine; +using Unity.Collections; + +namespace SensorDevices +{ + public partial class Lidar : Device + { + struct LaserCamData + { + private int index; + private float centerAngle; + private Texture2D cameraImage; + private Rect pixelSource; + + public float CenterAngle + { + get => centerAngle; + set => centerAngle = value; + } + + public int ImageWidth + { + get => cameraImage.width; + } + + public int ImageHeight + { + get => cameraImage.height; + } + + public void AllocateTexture(in int dataIndex, in int width, in int height) + { + index = dataIndex; + cameraImage = new Texture2D(width, height, TextureFormat.RGBA32, false, true); + pixelSource = new Rect(0, 0, width, height); + } + + public void SetTextureData(in RenderTexture rt) + { + if (rt != null) + { + var currentRenderTexture = RenderTexture.active; + RenderTexture.active = rt; + cameraImage.ReadPixels(pixelSource, 0, 0); + cameraImage.Apply(); + RenderTexture.active = currentRenderTexture; + } + } + + public void SetTextureData(in NativeArray buffer) + { + cameraImage.LoadRawTextureData(buffer); + cameraImage.Apply(); + } + + public NativeArray GetTextureData() + { + return cameraImage.GetRawTextureData(); + } + + public void SaveRawImageData(in string name) + { + var bytes = cameraImage.EncodeToPNG(); + var fileName = string.Format("./Logs/{0}_{1:00}_{2:000}", name, index, centerAngle); + System.IO.File.WriteAllBytes(fileName, bytes); + } + } + + private LaserData tempLaserData; + + struct LaserData + { + [ReadOnly] + public NativeArray data; + + [ReadOnly] + public int width; + + [ReadOnly] + public int height; + + private float DecodeChannel(in byte r, in byte g, in byte b, in byte a) + { + // decodedData = (r / 255f) + (g / 255f) / 255f + (b / 255f) / 65025f; + // decodedData = (r * 0.0039215686f) + (g * 0.0000153787f) + (b * 0.0000000603f); + // decodedData = (r / 255f) + (g / 255f) / 255f + (b / 255f) / 65025f + (a / 255f) / 16581375f; + return (r * 0.0039215686f) + (g * 0.0000153787f) + (b * 0.0000000603f) + (a * 0.0000000002f); + } + + private float GetDecodedData(in int pixelOffsetX, in int pixelOffsetY) + { + if (data.IsCreated) + { + // Decode + const int colorFormatUnit = 4; + var imageOffsetX = colorFormatUnit * pixelOffsetX; + var imageOffsetY = colorFormatUnit * width * pixelOffsetY; + var imageOffset = imageOffsetY + imageOffsetX; + + byte r = data[imageOffset + 0]; + byte g = data[imageOffset + 1]; + byte b = data[imageOffset + 2]; + byte a = data[imageOffset + 3]; + + return DecodeChannel(r, g, b, a); + } + else + { + return 0; + } + } + + public float GetDepthData(in float horizontalAngle, in float verticalAngle = 0) + { + var horizontalAngleInCamData = horizontalAngle * Mathf.Deg2Rad; + var verticalAngleInCamData = verticalAngle * Mathf.Deg2Rad; + + var maxAngleTangent = Mathf.Tan(laserCameraHFovHalf * Mathf.Deg2Rad); + var offsetY = (height * 0.5f) * (1f + (Mathf.Tan(verticalAngleInCamData) / maxAngleTangent)); + var offsetX = (width * 0.5f) * (1f + (Mathf.Tan(horizontalAngleInCamData) / maxAngleTangent)); + + var decodedData = GetDecodedData((int)offsetX, (int)offsetY); + + // Compensate distance + var compensateScale = (1f / Mathf.Cos(horizontalAngleInCamData)); + var finalDepthData = decodedData * compensateScale; + + // Cutoff + return (finalDepthData > 1.0f) ? 1.0f : finalDepthData; + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Lidar.LaserCameraData.cs.meta b/Assets/Scripts/Devices/Lidar.LaserCameraData.cs.meta new file mode 100644 index 00000000..1eb9b4e8 --- /dev/null +++ b/Assets/Scripts/Devices/Lidar.LaserCameraData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3dde5592d9c4824e9f2ad834ecc7f16 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Lidar.cs b/Assets/Scripts/Devices/Lidar.cs new file mode 100644 index 00000000..1d6a8649 --- /dev/null +++ b/Assets/Scripts/Devices/Lidar.cs @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using System; +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +namespace SensorDevices +{ + public partial class Lidar : Device + { + private gazebo.msgs.LaserScanStamped laserScanStamped = null; + + [Range(1, 2000)] + public uint samples = 0; + + [Range(0, 100)] + public double rangeMin = 0.0f; + + [Range(0, 100)] + public double rangeMax = 0.0f; + + [Range(-180, 0)] + public double angleMin = 0.0f; + + [Range(0, 180)] + public double angleMax = 0.0f; + public double resolution = 1; + + public uint verticalSamples = 1; + + [Range(-30, 0)] + public double verticalAngleMin = 0; + + [Range(0, 30)] + public double verticalAngleMax = 0; + + [ColorUsage(true)] + public Color rayColor = new Color(1, 0.1f, 0.1f, 0.2f); + + private Transform lidarLink = null; + + private UnityEngine.Camera laserCamera = null; + private Material depthMaterial = null; + + private const float defaultRotationOffset = 90.00000000000000f; + private const float laserCameraHFov = 45.0000000000f; + private const float laserCameraHFovHalf = laserCameraHFov / 2; + private const float laserCameraVFov = 40.0000000000f; + + private float laserHAngleResolution = 0; + private float laserVAngleResolution = 0; + + private int numberOfLaserCamData = 0; + + private LaserCamData[] laserCamData; + + + Lidar() + { + // Initialize Gazebo Message + laserScanStamped = new gazebo.msgs.LaserScanStamped(); + laserScanStamped.Time = new gazebo.msgs.Time(); + laserScanStamped.Scan = new gazebo.msgs.LaserScan(); + laserScanStamped.Scan.WorldPose = new gazebo.msgs.Pose(); + laserScanStamped.Scan.WorldPose.Position = new gazebo.msgs.Vector3d(); + laserScanStamped.Scan.WorldPose.Orientation = new gazebo.msgs.Quaternion(); + } + + void OnRenderImage(RenderTexture source, RenderTexture destination) + { + if (depthMaterial) + { + Graphics.Blit(source, destination, depthMaterial); + } + else + { + Graphics.Blit(source, destination); + } + } + + private double GetAngleStep(in double minAngle, in double maxAngle, in uint totalSamples) + { + return (maxAngle - minAngle) / (resolution * (totalSamples - 1)); + } + + protected override void OnStart() + { + laserCamera = gameObject.AddComponent(); + + lidarLink = transform.parent; + + InitializeMessages(); + + if (laserCamera) + { + SetupLaserCamera(); + + SetupLaserCameraData(); + + StartCoroutine(LaserCameraWorker()); + } + } + + private void InitializeMessages() + { + var laserScan = laserScanStamped.Scan; + laserScan.Frame = deviceName; + laserScan.AngleMin = angleMin * Mathf.Deg2Rad; + laserScan.AngleMax = angleMax * Mathf.Deg2Rad; + laserScan.AngleStep = GetAngleStep(laserScan.AngleMin, laserScan.AngleMax, samples); + laserScan.RangeMin = rangeMin; + laserScan.RangeMax = rangeMax; + laserScan.Count = samples; + + laserScan.VerticalAngleMin = verticalAngleMin * Mathf.Deg2Rad; + laserScan.VerticalAngleMax = verticalAngleMax * Mathf.Deg2Rad; + laserScan.VerticalCount = verticalSamples; + laserScan.VerticalAngleStep + = (verticalAngleMin == 0 && verticalAngleMax == 0) ? + 1 : GetAngleStep(laserScan.VerticalAngleMin, laserScan.VerticalAngleMax, verticalSamples); + + laserScan.Ranges = new double[samples]; + laserScan.Intensities = new double[samples]; + + laserHAngleResolution = (float)(laserScan.AngleStep * Mathf.Rad2Deg); + laserVAngleResolution = (float)(laserScan.VerticalAngleStep * Mathf.Rad2Deg); + } + + private void SetupLaserCamera() + { + var depthShader = Shader.Find("Sensor/DepthShader"); + depthMaterial = new Material(depthShader); + + laserCamera.backgroundColor = Color.white; + laserCamera.clearFlags = CameraClearFlags.SolidColor; + laserCamera.depthTextureMode = DepthTextureMode.Depth; + laserCamera.cullingMask = LayerMask.GetMask("Default"); + + laserCamera.allowHDR = true; + laserCamera.allowMSAA = false; + laserCamera.renderingPath = RenderingPath.DeferredLighting; + laserCamera.stereoTargetEye = StereoTargetEyeMask.None; + + laserCamera.orthographic = false; + laserCamera.nearClipPlane = (float)rangeMin; + laserCamera.farClipPlane = (float)rangeMax; + var projMatrix = DeviceHelper.MakeCustomProjectionMatrix(laserCameraHFov, laserCameraVFov, (float)rangeMin, (float)rangeMax); + laserCamera.projectionMatrix = projMatrix; + + var renderTextrueWidth = Mathf.CeilToInt(laserCameraHFov / laserHAngleResolution); + var aspectRatio = Mathf.Tan(laserCameraVFov / 2 * Mathf.Deg2Rad) / Mathf.Tan(laserCameraHFov / 2 * Mathf.Deg2Rad); + var renderTextrueHeight = Mathf.RoundToInt(renderTextrueWidth * aspectRatio); + var targetDepthRT = new RenderTexture(renderTextrueWidth, renderTextrueHeight, 24, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear); + targetDepthRT.name = "LidarDepthTexture"; + laserCamera.targetTexture = targetDepthRT; + laserCamera.enabled = false; + + laserCamera.hideFlags |= HideFlags.NotEditable; + } + + private void SetupLaserCameraData() + { + const float laserCameraRotationAngle = laserCameraHFov; + numberOfLaserCamData = Mathf.CeilToInt(360 / laserCameraRotationAngle); + + laserCamData = new LaserCamData[numberOfLaserCamData]; + + var targetDepthRT = laserCamera.targetTexture; + for (var index = 0; index < numberOfLaserCamData; index++) + { + var data = new LaserCamData(); + data.AllocateTexture(index, targetDepthRT.width, targetDepthRT.height); + data.CenterAngle = laserCameraRotationAngle * index; + laserCamData[index] = data; + } + + tempLaserData = new LaserData(); + } + + private IEnumerator LaserCameraWorker() + { + float ScanningPeriod = (UpdatePeriod/numberOfLaserCamData); + var axisRotation = Vector3.zero; + var waitForSeconds = new WaitForSeconds(ScanningPeriod); + + while (true) + { + for (var dataIndex = 0; dataIndex < numberOfLaserCamData; dataIndex++) + { + var data = laserCamData[dataIndex]; + axisRotation.y = data.CenterAngle; + laserCamera.transform.localRotation = Quaternion.Euler(axisRotation); + laserCamera.Render(); + data.SetTextureData(laserCamera.targetTexture); + // data.SaveRawImageData(name); + laserCamera.enabled = false; + + yield return waitForSeconds; + } + } + } + + protected override IEnumerator MainDeviceWorker() + { + var sw = new Stopwatch(); + while (true) + { + sw.Restart(); + GenerateMessage(); + sw.Stop(); + + yield return new WaitForSeconds(WaitPeriod((float)sw.Elapsed.TotalSeconds)); + } + } + + protected override void GenerateMessage() + { + var lidarPosition = lidarLink.position + transform.localPosition; + var lidarRotation = lidarLink.rotation; + var laserScan = laserScanStamped.Scan; + + DeviceHelper.SetVector3d(laserScan.WorldPose.Position, lidarPosition); + DeviceHelper.SetQuaternion(laserScan.WorldPose.Orientation, lidarRotation); + + var startAngle = defaultRotationOffset + (float)angleMin; + for (var hScanIndex = 0; hScanIndex < laserScanStamped.Scan.Count; hScanIndex++) + { + var rayAngleH = ((laserHAngleResolution * hScanIndex)) + startAngle; + + var convertedRayAngleH = (rayAngleH >= -laserCameraHFovHalf) ? rayAngleH : (360 + rayAngleH); + var dataIndexByAngle = (uint)Mathf.Round(convertedRayAngleH / laserCameraHFov); + var laserScanData = laserCamData[dataIndexByAngle]; + var centerAngleInCamData = laserScanData.CenterAngle; + + tempLaserData.data = laserScanData.GetTextureData(); + tempLaserData.width = laserScanData.ImageWidth; + tempLaserData.height = laserScanData.ImageHeight; + + var depthData = tempLaserData.GetDepthData(convertedRayAngleH - centerAngleInCamData); + var rayDistance = (depthData > 0) ? depthData * (float)rangeMax : Mathf.Infinity; + + // Store the laser data CCW + var scanIndexCcw = (uint)laserScanStamped.Scan.Count - hScanIndex - 1; + laserScan.Ranges[scanIndexCcw] = (double)rayDistance; + laserScan.Intensities[scanIndexCcw] = 0.0f; + } + + DeviceHelper.SetCurrentTime(laserScanStamped.Time); + PushData(laserScanStamped); + } + + protected override IEnumerator OnVisualize() + { + const float visualUpdatePeriod = 0.090f; + const float visualDrawDuration = visualUpdatePeriod * 1.01f; + var startAngle = defaultRotationOffset + (float)angleMin; + var waitForSeconds = new WaitForSeconds(visualUpdatePeriod); + + while (true) + { + var lidarSensorWorldPosition = lidarLink.position + transform.localPosition; + var rangeData = GetRangeData(); + + for (var hScanIndex = 0; hScanIndex < rangeData.Length; hScanIndex++) + { + var rayAngleH = ((laserHAngleResolution * hScanIndex)) + startAngle; + var rayRotation = Quaternion.AngleAxis((float)(rayAngleH), lidarLink.up) * lidarLink.forward; + var rayStart = (rayRotation * (float)rangeMin) + lidarSensorWorldPosition; + var rayDistance = (rangeData[hScanIndex] == Mathf.Infinity) ? (float)rangeMax : (rangeData[hScanIndex] - (float)rangeMin); + var rayDirection = rayRotation * rayDistance; + + Debug.DrawRay(rayStart, rayDirection, rayColor, visualDrawDuration, true); + } + + yield return waitForSeconds; + } + } + + public float[] GetRangeData() + { + try + { + var temp = Array.ConvertAll(laserScanStamped.Scan.Ranges, item => (float)item); + Array.Reverse(temp); + return temp; + } + catch + { + return new float[0]; + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Lidar.cs.meta b/Assets/Scripts/Devices/Lidar.cs.meta new file mode 100644 index 00000000..f9a16b8a --- /dev/null +++ b/Assets/Scripts/Devices/Lidar.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dccd95cd62567c8129f456f9c502d86c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/MicomInput.cs b/Assets/Scripts/Devices/MicomInput.cs new file mode 100644 index 00000000..fdc728fb --- /dev/null +++ b/Assets/Scripts/Devices/MicomInput.cs @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using UnityEngine; + +public class MicomInput : Device +{ + const float MM2M = 0.001f; + gazebo.msgs.Param micomWritingData = null; + + private int wheelVelocityLeft = 0; // linear velocity in millimeter per second + private int wheelVelocityRight = 0; // linear velocity in millimeter per second + + public float GetWheelVelocity(in int index) + { + var velocity = 0f; + switch (index) + { + case 0: + velocity = GetWheelVelocityLeft(); + break; + + case 1: + velocity = GetWheelVelocityRight(); + break; + + default: + Debug.LogError("Invalid index - " + index); + break; + } + + return velocity; + } + + public float GetWheelVelocityLeft() + { + return (float)wheelVelocityLeft * MM2M * Mathf.Rad2Deg; + } + + public float GetWheelVelocityRight() + { + return (float)wheelVelocityRight * MM2M * Mathf.Rad2Deg; + } + + // Start is called before the first frame update + protected override void OnStart() + { + deviceName = "MicomInput"; + } + + protected override IEnumerator MainDeviceWorker() + { + var waitUntil = new WaitUntil(() => GetDataStream().Length > 0); + while (true) + { + yield return waitUntil; + + try + { + micomWritingData = GetMessageData(); + + if (micomWritingData.Name.Equals("control_type") && + micomWritingData.Value.IntValue == 1 && + micomWritingData.Childrens.Count == 2) + { + wheelVelocityLeft + = (!micomWritingData.Childrens[0].Name.Equals("nLeftWheelVelocity")) ? + 0 : micomWritingData.Childrens[0].Value.IntValue; + + wheelVelocityRight + = (!micomWritingData.Childrens[1].Name.Equals("nRightWheelVelocity")) ? + 0 : micomWritingData.Childrens[1].Value.IntValue; + + // Debug.Log("nLeftWheelVel: " + wheelVelocityLeft + ", nRightWheelVel : " + wheelVelocityRight); + } + // Debug.Log("MicomInput: Working OK..."); + } + catch + { + Debug.LogError("MicomInput: Error"); + } + } + } +} diff --git a/Assets/Scripts/Devices/MicomInput.cs.meta b/Assets/Scripts/Devices/MicomInput.cs.meta new file mode 100644 index 00000000..ecfbe666 --- /dev/null +++ b/Assets/Scripts/Devices/MicomInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f33024d3029de7f3be454247e9056de +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/MicomSensor.cs b/Assets/Scripts/Devices/MicomSensor.cs new file mode 100644 index 00000000..5d88932f --- /dev/null +++ b/Assets/Scripts/Devices/MicomSensor.cs @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using UnityEngine; + +public class MicomSensor : Device +{ + private gazebo.msgs.Micom micomSensorData = null; + + MicomSensor() + { + // Initialize Gazebo Message + micomSensorData = new gazebo.msgs.Micom(); + micomSensorData.Time = new gazebo.msgs.Time(); + micomSensorData.Imu = new gazebo.msgs.Imu(); + micomSensorData.Imu.EntityName = "IMU"; + micomSensorData.Imu.Stamp = new gazebo.msgs.Time(); + micomSensorData.Imu.Orientation = new gazebo.msgs.Quaternion(); + micomSensorData.Imu.AngularVelocity = new gazebo.msgs.Vector3d(); + micomSensorData.Imu.LinearAcceleration = new gazebo.msgs.Vector3d(); + micomSensorData.Accgyro = new gazebo.msgs.Micom.AccGyro(); + micomSensorData.Odom = new gazebo.msgs.Micom.Odometry(); + } + + protected override void OnStart() + { + deviceName = "MicomSensor"; + } + + protected override IEnumerator MainDeviceWorker() + { + while (true) + { + GenerateMessage(); + yield return new WaitForSeconds(WaitPeriod()); + } + } + + protected override void GenerateMessage() + { + // Temporary + DeviceHelper.SetCurrentTime(micomSensorData.Time); + PushData(micomSensorData); + } + + public bool SetIMU(in SensorDevices.IMU imuSensor) + { + var imu = micomSensorData.Imu; + + if (micomSensorData == null || imu == null) + { + return false; + } + + if (imu.Orientation == null || imu.AngularVelocity == null || imu.LinearAcceleration == null) + { + return false; + } + + var orientation = imuSensor.GetOrientation(); + imu.Orientation.X = orientation.x; + imu.Orientation.Y = orientation.y; + imu.Orientation.Z = orientation.z; + imu.Orientation.W = orientation.w; + + var angularVelocity = imuSensor.GetAngularVelocity(); + imu.AngularVelocity.X = angularVelocity.x; + imu.AngularVelocity.Y = angularVelocity.y; + imu.AngularVelocity.Z = angularVelocity.z; + + var linearAcceleration = imuSensor.GetLinearAcceleration(); + imu.LinearAcceleration.X = linearAcceleration.x; + imu.LinearAcceleration.Y = linearAcceleration.y; + imu.LinearAcceleration.Z = linearAcceleration.z; + + DeviceHelper.SetCurrentTime(micomSensorData.Imu.Stamp); + + return true; + } + + public bool SetAccGyro(in Vector3 angle) + { + var accGyro = micomSensorData.Accgyro; + + if (micomSensorData == null || accGyro == null) + { + return false; + } + + accGyro.AngleX = angle.x; + accGyro.AngleY = angle.y; + accGyro.AngleZ = angle.z; + + accGyro.AccX = 0; + accGyro.AccY = 0; + accGyro.AccZ = 0; + + accGyro.AngulerRateX = 0; + accGyro.AngulerRateY = 0; + accGyro.AngulerRateZ = 0; + + return true; + } + + public bool SetOdomData(in float linearVelocityLeft, in float linearVelocityRight) + { + const float M2MM = 1000.0f; + var odom = micomSensorData.Odom; + + if (micomSensorData == null || odom == null) + return false; + + odom.SpeedLeft = (int)(linearVelocityLeft * Mathf.Deg2Rad * M2MM); + odom.SpeedRight = (int)(linearVelocityRight * Mathf.Deg2Rad * M2MM); + // Debug.LogFormat("Odom {0}, {1} ", linearVelocityLeft, linearVelocityRight); + // Debug.LogFormat("Odom {0}, {1} ", odom.SpeedLeft, odom.SpeedRight); + + return true; + } +} diff --git a/Assets/Scripts/Devices/MicomSensor.cs.meta b/Assets/Scripts/Devices/MicomSensor.cs.meta new file mode 100644 index 00000000..48a0fd58 --- /dev/null +++ b/Assets/Scripts/Devices/MicomSensor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c283f0834a8c9e3acbe35bbcc9c3a5e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Modules.meta b/Assets/Scripts/Devices/Modules.meta new file mode 100644 index 00000000..2ef59102 --- /dev/null +++ b/Assets/Scripts/Devices/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 80c117b325e134b8c95184447aaa24a9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Modules/Actuator.cs b/Assets/Scripts/Devices/Modules/Actuator.cs new file mode 100644 index 00000000..2d7d43eb --- /dev/null +++ b/Assets/Scripts/Devices/Modules/Actuator.cs @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using UnityEngine; + +public class Actuator +{ + public enum MovingType {MoveTowards = 0, Lerp, SmoothDamp}; + private const float lerpEpsilon = 0.009f; + private Vector3 currentVelocity = Vector3.zero; // only for SmoothDamp + + private Transform targetTransform = null; + + private MovingType movingType = MovingType.MoveTowards; + + private Vector3 targetPosition = Vector3.zero; + + private float distanceEpsilon = Vector3.kEpsilon; + private float maxMovingSpeed = 1; + private bool isMoving = false; + public bool IsMoving => isMoving; + + public Vector3 TargetPosition => targetPosition; + + public void SetTarget(in string name) + { + var tempObject = GameObject.Find(name); + if (tempObject != null) + { + SetTarget(tempObject); + } + } + + public void SetTarget(in GameObject target) + { + if (target != null) + { + var tempTranform = target.GetComponent(); + SetTarget(tempTranform); + } + } + + public void SetTarget(in Transform target) + { + targetTransform = target; + } + + public void SetMaxSpeed(in float value) + { + maxMovingSpeed = value; + } + + public void SetMovingType(in MovingType type) + { + movingType = type; + + switch (movingType) + { + case MovingType.Lerp: + distanceEpsilon = lerpEpsilon; + break; + + case MovingType.SmoothDamp: + distanceEpsilon = lerpEpsilon; + break; + + case MovingType.MoveTowards: + default: + distanceEpsilon = Vector3.kEpsilon; + break; + } + } + + public Vector3 CurrentPosition(in bool worldPosition = false) + { + if (targetTransform == null) + { + return Vector3.zero; + } + + return (worldPosition)? targetTransform.position : targetTransform.localPosition; + } + + // + // Summary: + // Set target position before drive. + // + // Parameters: + // direction: Vector3.up/down/forwad/back/left/right + // offset: target offset + // relative: if true, target shall move from current position, + // otherwise target shall be set absolute offset along with direction + // + public void SetTargetPosition(in Vector3 direction, in float offset, in bool relative = false) + { + var targetValue = (direction * offset); + + if (relative) + { + targetPosition = CurrentPosition() + targetValue; + } + else + { + targetPosition = CurrentPosition(); + SetZeroOnDirection(ref targetPosition, direction); + targetPosition += targetValue; + } + + // Debug.Log("SetTargetPosition: " + targetPosition.ToString("F5")); + } + + public void SetTargetPosition(in Vector3 absolutePosition) + { + targetPosition = absolutePosition; + } + + public void Drive() + { + if (targetTransform == null) + { + Debug.LogError("target Transform is null !!!!!!!!!!!"); + isMoving = false; + return; + } + + isMoving = true; + + var nextPosition = Vector3.zero; + switch (movingType) + { + case MovingType.Lerp: + nextPosition = Vector3.Lerp(CurrentPosition(), targetPosition, maxMovingSpeed * Time.deltaTime); + break; + + case MovingType.SmoothDamp: + nextPosition = Vector3.SmoothDamp(CurrentPosition(), targetPosition, ref currentVelocity, Time.deltaTime, maxMovingSpeed); + break; + + case MovingType.MoveTowards: + default: + nextPosition = Vector3.MoveTowards(CurrentPosition(), targetPosition, maxMovingSpeed * Time.deltaTime); + break; + } + + targetTransform.localPosition = nextPosition; + + // check if it arrived + var distance = Vector3.SqrMagnitude(targetPosition - nextPosition); + if (distance < distanceEpsilon) + { + // final touch + targetTransform.localPosition = targetPosition; + + // stop + isMoving = false; + } + } + + public bool IsSamePosition(in Vector3 checkPosition) + { + return DeviceHelper.IsSamePosition(CurrentPosition(), checkPosition); + } + + public bool IsSamePosition(in Vector3 checkDirection, in float checkOffset) + { + var tempTarget = CurrentPosition(); + SetZeroOnDirection(ref tempTarget, checkDirection); + tempTarget += (checkDirection * checkOffset); + return DeviceHelper.IsSamePosition(CurrentPosition(), tempTarget); + } + + public static void SetZeroOnDirection(ref Vector3 target, in Vector3 direction) + { + if (direction.Equals(Vector3.left) || direction.Equals(Vector3.right)) + { + target.x = 0; + } + else if (direction.Equals(Vector3.up) || direction.Equals(Vector3.down)) + { + target.y = 0; + } + else if (direction.Equals(Vector3.forward) || direction.Equals(Vector3.back)) + { + target.z = 0; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Modules/Actuator.cs.meta b/Assets/Scripts/Devices/Modules/Actuator.cs.meta new file mode 100644 index 00000000..2e11a0ed --- /dev/null +++ b/Assets/Scripts/Devices/Modules/Actuator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a053f37dec2632bc2aa1d55e1837f7a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Modules/DoorsControl.cs b/Assets/Scripts/Devices/Modules/DoorsControl.cs new file mode 100644 index 00000000..88be4e27 --- /dev/null +++ b/Assets/Scripts/Devices/Modules/DoorsControl.cs @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using UnityEngine; + +public class DoorsControl : MonoBehaviour +{ + private Actuator doorLeft = null; + private Actuator doorRight = null; + + private Vector3 closedDoorPositionLeft = Vector3.zero; + private Vector3 closedDoorPositionRight = Vector3.zero; + private Vector3 openedDoorPositionLeft = Vector3.zero; + private Vector3 openedDoorPositionRight = Vector3.zero; + + private Vector3 doorTargetPositionLeft = Vector3.zero; + private Vector3 doorTargetPositionRight = Vector3.zero; + + public float speed = 0.1f; + public float openOffset = 1; + + public DoorsControl() + { + doorLeft = new Actuator(); + doorRight = new Actuator(); + } + + void Start() + { + doorLeft.SetMovingType(Actuator.MovingType.MoveTowards); + doorLeft.SetMaxSpeed(speed); + doorRight.SetMovingType(Actuator.MovingType.MoveTowards); + doorRight.SetMaxSpeed(speed); + } + + public void SetLeftDoor(in Transform targetTransform) + { + doorLeft.SetTarget(targetTransform); + + if (targetTransform == null) + { + closedDoorPositionLeft = Vector3.zero; + openedDoorPositionLeft = Vector3.zero; + } + else + { + closedDoorPositionLeft = doorLeft.CurrentPosition(); + openedDoorPositionLeft = Vector3.right * openOffset; + } + } + + public void SetRightDoor(in Transform targetTransform) + { + doorRight.SetTarget(targetTransform); + + if (targetTransform == null) + { + closedDoorPositionRight = Vector3.zero; + openedDoorPositionRight = Vector3.zero; + } + else + { + closedDoorPositionRight = doorRight.CurrentPosition(); + openedDoorPositionRight = Vector3.left * openOffset; + } + } + + public Vector3 GetLeftDoorPosition() + { + return doorLeft.CurrentPosition(true); + } + + public Vector3 GetRightDoorPosition() + { + return doorRight.CurrentPosition(true); + } + + public void Open() + { + doorLeft.SetTargetPosition(Vector3.right, openOffset); + doorRight.SetTargetPosition(Vector3.left, openOffset); + + if (IsClosed() && !IsMoving()) + { + StartCoroutine(MoveTo()); + } + } + + public void Close() + { + doorLeft.SetTargetPosition(Vector3.left, openOffset, true); + doorRight.SetTargetPosition(Vector3.right, openOffset, true); + + if (IsOpened() && !IsMoving()) + { + StartCoroutine(MoveTo()); + } + } + + + public bool IsOpened() + { + if (doorLeft.IsSamePosition(openedDoorPositionLeft) && doorRight.IsSamePosition(openedDoorPositionRight)) + { + return true; + } + + return false; + } + + public bool IsClosed() + { + if (doorLeft.IsSamePosition(closedDoorPositionLeft) && doorRight.IsSamePosition(closedDoorPositionRight)) + { + return true; + } + + return false; + } + + public bool IsMoving() + { + if (doorLeft.IsMoving || doorRight.IsMoving) + { + return true; + } + + return false; + } + + private IEnumerator MoveTo() + { + var waitForFixedUpdate = new WaitForFixedUpdate(); + + // Debug.Log(name + "::" + doorTargetPositionLeft.ToString("F5")); + // Debug.Log(name + "::" + doorTargetPositionRight.ToString("F5")); + + do + { + doorLeft.Drive(); + doorRight.Drive(); + + yield return waitForFixedUpdate; + + } while (doorLeft.IsMoving || doorRight.IsMoving); + } + +// #if UNITY_EDITOR +// // just for test +// void Update() +// { +// if (Input.GetKeyUp(KeyCode.I)) +// { +// Close(); +// } +// else if (Input.GetKeyUp(KeyCode.O)) +// { +// Open(); +// } +// } +// #endif +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Modules/DoorsControl.cs.meta b/Assets/Scripts/Devices/Modules/DoorsControl.cs.meta new file mode 100644 index 00000000..238e4a00 --- /dev/null +++ b/Assets/Scripts/Devices/Modules/DoorsControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2013364ccc30efe41beb4aa6f8e046a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Modules/ElevatorControl.cs b/Assets/Scripts/Devices/Modules/ElevatorControl.cs new file mode 100644 index 00000000..040533ce --- /dev/null +++ b/Assets/Scripts/Devices/Modules/ElevatorControl.cs @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using UnityEngine; + +public class ElevatorControl : MonoBehaviour +{ + public LiftControl liftControl; + public DoorsControl doorsControl; + public DoorsControl outsideDoorsControl; + + public const float outsideDoorDistance = 0.10f; + public string doorLinkNameLeft = string.Empty; + public string doorLinkNameRight = string.Empty; + + public string outsideDoorLinkNameLeft = string.Empty; + public string outsideDoorLinkNameRight = string.Empty; + + public float doorAutoClosingTimer = 0; + private float currentElevatorHeight = 0; + private Coroutine runningDoorAutoClosing = null; + + public float Height + { + get => currentElevatorHeight; + set + { + var elevatorPosition = transform.position; + elevatorPosition.y = value; + transform.position = elevatorPosition; + } + } + + void Awake() + { + liftControl = gameObject.AddComponent(); + doorsControl = gameObject.AddComponent(); + outsideDoorsControl = gameObject.AddComponent(); + } + + void Start() + { + liftControl.SetFinishedEventListener(FindAndSetOutsideDoor); + + // find elevator door inside + foreach (var link in GetComponentsInChildren()) + { + if (link.name.Equals(doorLinkNameLeft)) + { + doorsControl.SetLeftDoor(link.transform); + } + else if (link.name.Equals(doorLinkNameRight)) + { + doorsControl.SetRightDoor(link.transform); + } + } + } + + void Update() + { + currentElevatorHeight = transform.position.y; + } + + public bool IsDoorOpened() + { + return doorsControl.IsOpened(); + } + + public void OpenDoor() + { + // find outside door + FindAndSetOutsideDoor(); + + doorsControl.Open(); + + // start Auto Closing doodr + StopAutoClosingDoor(); + runningDoorAutoClosing = StartCoroutine(AutoClosingDoor()); + + // control outside door + outsideDoorsControl.Open(); + } + + public void CloseDoor() + { + doorsControl.Close(); + + // control outside door + outsideDoorsControl.Close(); + + // stop Auto Closing + StopAutoClosingDoor(); + } + + private void StopAutoClosingDoor() + { + if (runningDoorAutoClosing != null) + { + StopCoroutine(runningDoorAutoClosing); + runningDoorAutoClosing = null; + } + } + + private IEnumerator AutoClosingDoor() + { + var waitForFixedUpdate = new WaitForFixedUpdate(); + + var doorAutoClosingTimeElapsed = 0f; + while (doorAutoClosingTimeElapsed < doorAutoClosingTimer) + { + doorAutoClosingTimeElapsed += Time.deltaTime; + yield return waitForFixedUpdate; + } + + // Debug.LogWarning("Close door automatically"); + + CloseDoor(); + } + + public void FindAndSetOutsideDoor() + { + var elevatorSystemObject = transform.parent.gameObject; + foreach (var link in elevatorSystemObject.GetComponentsInChildren()) + { + // find only nearset object + var leftDoorDistance = Vector3.Distance(link.transform.position, doorsControl.GetLeftDoorPosition()); + var rightDoorDistance = Vector3.Distance(link.transform.position, doorsControl.GetRightDoorPosition()); + + if ((leftDoorDistance < outsideDoorDistance) && link.name.Equals(outsideDoorLinkNameLeft)) + { + outsideDoorsControl.SetLeftDoor(link.transform); + } + else if ((rightDoorDistance < outsideDoorDistance) && link.name.Equals(outsideDoorLinkNameRight)) + { + outsideDoorsControl.SetRightDoor(link.transform); + } + } + } + + public void UnsetOutsideDoor() + { + outsideDoorsControl.SetLeftDoor(null); + outsideDoorsControl.SetRightDoor(null); + } + + public bool IsDoorClosed() + { + return (doorsControl.IsClosed() && outsideDoorsControl.IsClosed()) ? true : false; + } + + public void MoveTo(in float height) + { + UnsetOutsideDoor(); + + liftControl.MoveTo(height); + } + + public bool IsMoving() + { + return liftControl.IsMoving; + } + + public bool IsArrived(in float height) + { + if (liftControl.IsMoving) + { + return false; + } + + return DeviceHelper.IsSamePosition(currentElevatorHeight, height); + } + +// #if UNITY_EDITOR +// // just for test +// void Update() +// { +// if (IsDoorOpened() && Input.GetKeyUp(KeyCode.K)) +// { +// CloseDoor(); +// } +// else if (IsDoorClosed() && Input.GetKeyUp(KeyCode.L)) +// { +// OpenDoor(); +// } + +// if (!liftControl.IsMoving && IsDoorClosed()) +// { +// if (Input.GetKeyUp(KeyCode.U)) +// { +// MoveTo(600); +// } +// else if (Input.GetKeyUp(KeyCode.J)) +// { +// MoveTo(-600); +// } +// } +// } +// #endif +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Modules/ElevatorControl.cs.meta b/Assets/Scripts/Devices/Modules/ElevatorControl.cs.meta new file mode 100644 index 00000000..6f71151d --- /dev/null +++ b/Assets/Scripts/Devices/Modules/ElevatorControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1378a7f3529d5afb87a8d06b6164853 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Modules/LiftControl.cs b/Assets/Scripts/Devices/Modules/LiftControl.cs new file mode 100644 index 00000000..8c703e99 --- /dev/null +++ b/Assets/Scripts/Devices/Modules/LiftControl.cs @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; + +public class LiftControl : MonoBehaviour +{ + private Actuator lift; + + private HashSet hashsetAllTopModels; + private HashSet hashsetLiftingObjects; + + private UnityEvent finishedLiftingEvent; + private GameObject rootModel = null; + private Transform rootModelTransform = null; + + public string floorColliderName = string.Empty; + private MeshCollider floorCollider = null; + private Vector3 targetPosition = Vector3.zero; + + public float speed = 1; + public bool IsMoving => lift.IsMoving; + + LiftControl() + { + lift = new Actuator(); + hashsetAllTopModels = new HashSet(); + hashsetLiftingObjects = new HashSet(); + } + + void Awake() + { + lift.SetTarget(transform); + rootModel = GameObject.Find("Models"); + rootModelTransform = rootModel.transform; + finishedLiftingEvent = new UnityEvent(); + } + + void Start() + { + lift.SetMovingType(Actuator.MovingType.SmoothDamp); + lift.SetMaxSpeed(speed); + // Debug.Log(name + "::" + speed); + + FindFloorRegionInLift(); + UpdateTopModels(); + } + + public void SetFinishedEventListener(UnityAction call) + { + finishedLiftingEvent.AddListener(call); + } + + private void FindFloorRegionInLift() + { + foreach (Transform child in transform) + { + if (floorCollider != null) + { + break; + } + + foreach (Transform grandChild in child.transform) + { + if (grandChild.name.Equals(floorColliderName)) + { + floorCollider = grandChild.GetComponent(); + floorCollider.convex = false; + break; + } + } + } + } + + public void UpdateTopModels() + { + if (rootModel == null) + { + Debug.LogError("root model is not assigned yet."); + return; + } + + var allModelPlugins = rootModel.GetComponentsInChildren(); + foreach (var modelPlugin in allModelPlugins) + { + if (modelPlugin.IsTopModel) + { + hashsetAllTopModels.Add(modelPlugin.gameObject); + } + } + } + + private void DetectObjectsToLiftAndLiftIt() + { + hashsetLiftingObjects.Clear(); + foreach (var topModel in hashsetAllTopModels) + { + if (topModel != null) + { + var topModelPosition = topModel.transform.position; + if (floorCollider != null && floorCollider.bounds.Contains(topModelPosition)) + { + hashsetLiftingObjects.Add(topModel); + + topModel.transform.SetParent(transform, true); + } + } + } + } + + private void DropLiftedObjects() + { + // Unlink parenting between lifted objects if arrived at the target floor. + foreach (var obj in hashsetLiftingObjects) + { + if (rootModelTransform != null) + { + obj.transform.SetParent(rootModelTransform, true); + } + } + } + + public void MoveTo(in float targetHeight) + { + if (!lift.IsMoving) + { + DetectObjectsToLiftAndLiftIt(); + + lift.SetTargetPosition(Vector3.up, targetHeight); + StartCoroutine(RunLifting()); + } + } + + private IEnumerator RunLifting() + { + var waitForFixedUpdate = new WaitForFixedUpdate(); + yield return waitForFixedUpdate; + + do + { + yield return waitForFixedUpdate; + lift.Drive(); + + } while(lift.IsMoving); + + DropLiftedObjects(); + + finishedLiftingEvent.Invoke(); + } + +// #if UNITY_EDITOR +// // just for test +// void Update() +// { +// if (!lift.IsMoving) +// { +// if (Input.GetKeyUp(KeyCode.U)) +// { +// MoveTo(600); +// } +// else if (Input.GetKeyUp(KeyCode.J)) +// { +// MoveTo(-600); +// } +// } +// } +// #endif +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Modules/LiftControl.cs.meta b/Assets/Scripts/Devices/Modules/LiftControl.cs.meta new file mode 100644 index 00000000..8cc40bb9 --- /dev/null +++ b/Assets/Scripts/Devices/Modules/LiftControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50325bc0e25027f8cb68e4643b55ae27 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Modules/Motor.cs b/Assets/Scripts/Devices/Modules/Motor.cs new file mode 100644 index 00000000..376f55e5 --- /dev/null +++ b/Assets/Scripts/Devices/Modules/Motor.cs @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using UnityEngine; + +public class Motor +{ + private string name = string.Empty; + private PID pidControl = null; + private HingeJoint joint = null; + private Rigidbody rigidBody = null; + // private Rigidbody topRigidBody = null; + + public Motor(in string name, in HingeJoint targetJoint, in PID pid) + : this(name, targetJoint) + { + SetPID(pid); + } + + public Motor(in string name, in HingeJoint targetJoint) + : this(targetJoint) + { + SetName(name); + } + + public Motor(in HingeJoint targetJoint) + { + joint = targetJoint; + rigidBody = joint.gameObject.GetComponent(); + + // foreach (var modelPlugin in rigidBody.gameObject.GetComponentsInParent()) + // { + // if (modelPlugin.IsTopModel) + // { + // topRigidBody = modelPlugin.gameObject.GetComponent(); + // break; + // } + // } + + targetJoint.useMotor = true; + } + + public Motor(in HingeJoint targetJoint, in PID pid) + : this(targetJoint) + { + SetPID(pid); + } + + public void SetName(in string value) + { + name = value; + } + + public void SetPID(in PID pid) + { + pidControl = pid.Copy(); + } + + public float GetCurrentVelocity() + { + return (joint)? joint.velocity:0; + } + + /// Set Target Velocity with PID control + /// degree per second + public void SetVelocityTarget(in float targetAngularVelocity) + { + if (joint == null) + { + return; + } + + var motor = joint.motor; + float currentVelocity = GetCurrentVelocity(); + float cmdForce = pidControl.Update(targetAngularVelocity, currentVelocity, Time.fixedDeltaTime); + + // Debug.LogFormat("{0} Motor ({1} | {2} => {3}) max({4})", + // name, currentVelocity, targetAngularVelocity, cmdForce, rigidBody.maxAngularVelocity); + + // JointMotor.targetVelocity angular velocity in degrees per second. + motor.targetVelocity = targetAngularVelocity; + motor.force = Mathf.Round(cmdForce); + + if (targetAngularVelocity == 0) + { + pidControl.Reset(); + } + + // Should set the JointMotor value to update + joint.motor = motor; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Modules/Motor.cs.meta b/Assets/Scripts/Devices/Modules/Motor.cs.meta new file mode 100644 index 00000000..a56fda7a --- /dev/null +++ b/Assets/Scripts/Devices/Modules/Motor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb470692b4e424abaaa40aebbc8d8313 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Modules/PID.cs b/Assets/Scripts/Devices/Modules/PID.cs new file mode 100644 index 00000000..7368ee35 --- /dev/null +++ b/Assets/Scripts/Devices/Modules/PID.cs @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System; + +[Serializable] +public class PID +{ + private float pFactor, iFactor, dFactor; + private float integral = 0; + private float lastError = 0; + + public PID(in float pFactor, in float iFactor, in float dFactor) + { + this.pFactor = pFactor; + this.iFactor = iFactor; + this.dFactor = dFactor; + } + + public PID Copy() + { + var newPID = new PID(pFactor, iFactor, dFactor); + return newPID; + } + + public void Reset() + { + integral = 0; + lastError = 0; + } + + public float Update(in float setpoint, in float actual, in float timeFrame) + { + float present = Math.Abs(setpoint - actual); + integral += present * timeFrame; + + float deriv = (present - lastError) / timeFrame; + lastError = present; + + var cmd = present * pFactor + integral * iFactor + deriv * dFactor; + + return Math.Abs(cmd); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Modules/PID.cs.meta b/Assets/Scripts/Devices/Modules/PID.cs.meta new file mode 100644 index 00000000..2bbf2270 --- /dev/null +++ b/Assets/Scripts/Devices/Modules/PID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf7b7db1cd29f43b58f620f0e201b08f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/MultiCamera.cs b/Assets/Scripts/Devices/MultiCamera.cs new file mode 100644 index 00000000..da8481c5 --- /dev/null +++ b/Assets/Scripts/Devices/MultiCamera.cs @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using System.Collections.Generic; +using System; +using Unity.Collections; +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +namespace SensorDevices +{ + public partial class MultiCamera : Device + { + private List cameras = new List(); + + private gazebo.msgs.ImagesStamped imagesStamped; + + private Transform multiCamLink = null; + + public MultiCamera() + { + // Initialize Gazebo Message + imagesStamped = new gazebo.msgs.ImagesStamped(); + imagesStamped.Time = new gazebo.msgs.Time(); + } + + protected override void OnStart() + { + foreach (var cam in cameras) + { + // cam = gameObject.AddComponent(); + // cam.transform.Rotate(Vector3.up, 90.0000000000f); + // cameraLink = transform.parent; + // InitializeMessages(); + } + // if (cam) + // { + // SetupCamera(); + // StartCoroutine(CameraWorker()); + // } + } + + public void AddCamera(in SDF.Camera parameters) + { + var newCamObject = new GameObject(); + newCamObject.name = "Camera::" + parameters.type; + + var newCamTransform = newCamObject.transform; + newCamTransform.position = Vector3.zero; + newCamTransform.rotation = Quaternion.identity; + newCamTransform.localPosition = SDF2Unity.GetPosition(parameters.Pose.Pos); + newCamTransform.localRotation = SDF2Unity.GetRotation(parameters.Pose.Rot); + newCamTransform.SetParent(this.transform, false); + + var newCam = newCamObject.AddComponent(); + newCam.runningDeviceWork = false; + newCam.deviceName = "MultiCamera::" + parameters.name; + newCam.parameters = parameters; + cameras.Add(newCam); + } + + private void InitializeMessages() + { + // var pixelFormat = GetPixelFormat(); + // var depth = GetImageDepth(); + + var image = imagesStamped.Images; + // image.Width = (uint)parameters.image_width; + // image.Height = (uint)parameters.image_height; + // image.PixelFormat = (uint)pixelFormat; + // image.Step = image.Width * depth; + // image.Data = new byte[image.Height * image.Step]; + } + + private void SetupCamera() + { + // var depthShader = Shader.Find("Sensor/DepthShader"); + // depthMaterial = new Material(depthShader); + + // cam.ResetWorldToCameraMatrix(); + // cam.ResetProjectionMatrix(); + + // cam.allowHDR = true; + // cam.allowMSAA = false; + // cam.targetDisplay = 0; + // cam.stereoTargetEye = StereoTargetEyeMask.None; + + // cam.orthographic = false; + // cam.nearClipPlane = (float)parameters.clip.near; + // cam.farClipPlane = (float)parameters.clip.far; + + // var targetRT = new RenderTexture(parameters.image_width, parameters.image_height, 16, RenderTextureFormat.ARGB32, RenderTextureReadWrite.sRGB); + // targetRT.name = "CameraTexture"; + // cam.targetTexture = targetRT; + + // var camHFov = (float)parameters.horizontal_fov * Mathf.Rad2Deg; + // var camVFov = DeviceHelper.HorizontalToVerticalFOV(camHFov, cam.aspect); + // cam.fieldOfView = camVFov; + + // var projMatrix = DeviceHelper.MakeCustomProjectionMatrix(camHFov, camVFov, cam.nearClipPlane, cam.farClipPlane); + + // // // Invert for gazebo msg + // var invertMatrix = Matrix4x4.Scale(new Vector3( 1, -1, 1)); + // cam.projectionMatrix = projMatrix * invertMatrix; + // cam.enabled = false; + // // cam.hideFlags |= HideFlags.NotEditable; + + // camData.AllocateTexture(parameters.image_width, parameters.image_height); + } + + private IEnumerator CameraWorker() + { + while (true) + { + // var oldCulling = GL.invertCulling; + // GL.invertCulling = !oldCulling; + // cam.Render(); + // GL.invertCulling = oldCulling; + // camData.SetTextureData(cam.targetTexture); + + // if (parameters.save_enabled) + // { + // var saveName = name + "_" + Time.time; + // camData.SaveRawImageData(parameters.save_path, saveName); + // // Debug.LogFormat("{0}|{1} captured", parameters.save_path, saveName); + // } + // cam.enabled = false; + + // imageData = camData.GetTextureData(); + + // yield return new WaitForSeconds(UpdatePeriod * adjustCapturingRate); + } + } + + protected override IEnumerator MainDeviceWorker() + { + var sw = new Stopwatch(); + while (true) + { + sw.Restart(); + GenerateMessage(); + sw.Stop(); + + yield return new WaitForSeconds(WaitPeriod((float)sw.Elapsed.TotalSeconds)); + } + } + + protected override void GenerateMessage() + { + var images = imagesStamped.Images; + // if (image.Data.Length == imageData.Length) + // { + // image.Data = imageData; + // } + // // Debug.Log(imagesStamped.Image.Height + "," + imagesStamped.Image.Width); + + DeviceHelper.SetCurrentTime(imagesStamped.Time); + PushData(imagesStamped); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/MultiCamera.cs.meta b/Assets/Scripts/Devices/MultiCamera.cs.meta new file mode 100644 index 00000000..17408f72 --- /dev/null +++ b/Assets/Scripts/Devices/MultiCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70abbbd2a043d18c9932db4bead899e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Devices/Sonar.cs b/Assets/Scripts/Devices/Sonar.cs new file mode 100644 index 00000000..9a913cfa --- /dev/null +++ b/Assets/Scripts/Devices/Sonar.cs @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using System.Collections.Generic; +using System; +using UnityEngine; +using Stopwatch = System.Diagnostics.Stopwatch; + +namespace SensorDevices +{ + public partial class Sonar : Device + { + private gazebo.msgs.SonarStamped sonarStamped = null; + + public string geometry = string.Empty; + + [Range(0, 100)] + public double rangeMin = 0.001f; + + [Range(0, 100)] + public double rangeMax = 0.0f; + + [Range(0, 100)] + public double radius = 0; + + private List meshSensorRegionVertices = new List(); + + private float sensorTimeElapsed = 0.0f; + + private Transform sonarLink = null; + + private float sensorStartOffset = 0; + + Sonar() + { + // Initialize Gazebo Message + sonarStamped = new gazebo.msgs.SonarStamped(); + sonarStamped.Time = new gazebo.msgs.Time(); + sonarStamped.Sonar = new gazebo.msgs.Sonar(); + sonarStamped.Sonar.WorldPose = new gazebo.msgs.Pose(); + sonarStamped.Sonar.WorldPose.Position = new gazebo.msgs.Vector3d(); + sonarStamped.Sonar.WorldPose.Orientation = new gazebo.msgs.Quaternion(); + sonarStamped.Sonar.Contact = new gazebo.msgs.Vector3d(); + } + + protected override void OnStart() + { + deviceName = name; + sonarLink = transform.parent; + + var visualMesh = sonarLink.GetComponentInChildren(); + sensorStartOffset = (visualMesh == null)? 0f:visualMesh.sharedMesh.bounds.max.y; + + // Create a new sensing area + var meshCollider = gameObject.AddComponent(); + + float sensorMeshOffset = 0; + Mesh mesh = null; + if (geometry.Equals("sphere")) + { + mesh = ProceduralMesh.CreateSphere((float)radius); + sensorMeshOffset = (float)radius; + } + else + { + mesh = ProceduralMesh.CreateCone((float)radius, 0, (float)rangeMax, 10); + sensorMeshOffset = (float)rangeMax/2; + } + + TranslateDetectionArea(mesh, 0.001f + sensorStartOffset + sensorMeshOffset); + + meshCollider.sharedMesh = mesh; + meshCollider.convex = true; + meshCollider.isTrigger = true; + + // preserve the vertex points of the sensing area + var localToWorld = sonarLink.localToWorldMatrix; + for (var i = 0; i < meshCollider.sharedMesh.vertices.Length; i++) + { + var targetPoint = meshCollider.sharedMesh.vertices[i]; + var distance = (Vector3.zero - targetPoint).magnitude; + if (distance < (float)rangeMin) + { + continue; + } + + meshSensorRegionVertices.Add(meshCollider.sharedMesh.vertices[i]); + } + + // const MeshColliderCookingOptions cookingOptions + // = MeshColliderCookingOptions.EnableMeshCleaning|MeshColliderCookingOptions.WeldColocatedVertices; + // meshCollider.cookingOptions = cookingOptions; + // meshCollider.hideFlags |= HideFlags.NotEditable; + + InitializeMessages(); + } + + private void TranslateDetectionArea(Mesh mesh, in float offset) + { + var vertices = mesh.vertices; + for (var i = 0; i < vertices.Length; i++) + { + vertices[i].y += offset; + } + mesh.vertices = vertices; + } + + private void InitializeMessages() + { + var sonar = sonarStamped.Sonar; + sonar.Frame = deviceName; + sonar.Radius = radius; + sonar.RangeMin = rangeMin; + sonar.RangeMax = rangeMax; + } + + protected override IEnumerator MainDeviceWorker() + { + var sw = new Stopwatch(); + while (true) + { + sw.Restart(); + GenerateMessage(); + sw.Stop(); + + yield return new WaitForSeconds(WaitPeriod((float)sw.Elapsed.TotalSeconds)); + } + } + + protected override void GenerateMessage() + { + var sonarPosition = sonarLink.position; + var sonarRotation = sonarLink.rotation; + var sonar = sonarStamped.Sonar; + sonar.Frame = deviceName; + DeviceHelper.SetVector3d(sonar.WorldPose.Position, sonarPosition); + DeviceHelper.SetQuaternion(sonar.WorldPose.Orientation, sonarRotation); + + DeviceHelper.SetCurrentTime(sonarStamped.Time); + SetMessageData(sonarStamped); + } + + void OnTriggerStay(Collider other) + { + if (meshSensorRegionVertices.Count == 0) + { + return; + } + + if ((sensorTimeElapsed += Time.fixedDeltaTime) < UpdatePeriod * 2) + { + return; + } + + sensorTimeElapsed = 0.0f; + + var sonar = sonarStamped.Sonar; + var sensorStartPoint = sonarLink.position; + sensorStartPoint.z += sensorStartOffset; + + var detectedRange = (float)rangeMax; + var contactPoint = Vector3.zero; + var contactDirection = Vector3.zero; + var localToWorld = sonarLink.localToWorldMatrix; + + for (var i = 0; i < meshSensorRegionVertices.Count; i++) + { + var targetPoint = localToWorld.MultiplyPoint3x4(meshSensorRegionVertices[i]); + var direction = (targetPoint - sensorStartPoint).normalized; + if (Physics.Raycast(sensorStartPoint, direction, out var hitInfo)) + { + // Debug.DrawRay(sensorStartPoint, direction, Color.magenta, 0.01f); + // Debug.Log("Hit Point of contact: " + hitInfo.point); + var hitPoint = hitInfo.point; + var hitDistance = Vector3.Distance(sensorStartPoint, hitPoint); + if ((hitDistance < detectedRange) && (hitDistance > (float)rangeMin)) + { + // Debug.Log("Hit Point of contact: " + hitInfo.point + "|" + distance.ToString("F4")); + detectedRange = hitDistance; + contactDirection = direction; + contactPoint = hitPoint; + } + } + } + + sonar.Range = detectedRange; + DeviceHelper.SetVector3d(sonar.Contact, contactPoint); + // Debug.Log(other.name + " |Stay| " + "," + detectedRange.ToString("F5") + ", " + contactPoint); + } + + void OnTriggerExit(Collider other) + { + var sonar = sonarStamped.Sonar; + sonar.Range = (float)rangeMax; + DeviceHelper.SetVector3d(sonar.Contact, Vector3.zero); + // Debug.Log(other.name + " |Exit| " + "," + sonar.Range.ToString("F5")); + } + + public float GetDetectedRange() + { + try + { + return (float)sonarStamped.Sonar.Range; + } + catch + { + return float.PositiveInfinity; + } + } + + public Vector3 GetDetectedPoint() + { + try + { + var contactPoint = sonarStamped.Sonar.Contact; + var point = new Vector3((float)contactPoint.X, (float)contactPoint.Z, (float)contactPoint.Y); + return point; + } + catch + { + return Vector3.zero; + } + } + + protected override IEnumerator OnVisualize() + { + const float visualUpdatePeriod = 0.01f; + const float visualDrawDuration = visualUpdatePeriod * 1.01f; + var sensorStartPoint = Vector3.zero; + var waitForSeconds = new WaitForSeconds(visualUpdatePeriod); + + while (true) + { + sensorStartPoint.Set(sonarLink.position.x, sonarLink.position.y, sonarLink.position.z + sensorStartOffset); + + var direction = (GetDetectedPoint() - sensorStartPoint).normalized; + var detectedRange = GetDetectedRange(); + + if (detectedRange < rangeMax && !direction.Equals(Vector3.zero)) + { + Debug.DrawRay(sensorStartPoint, direction * detectedRange, Color.magenta, visualDrawDuration); + } + yield return waitForSeconds; + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Devices/Sonar.cs.meta b/Assets/Scripts/Devices/Sonar.cs.meta new file mode 100644 index 00000000..de25e77e --- /dev/null +++ b/Assets/Scripts/Devices/Sonar.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e285bdfaf2eda13d8be44d8649dbf74f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ModelLoader.cs b/Assets/Scripts/ModelLoader.cs new file mode 100644 index 00000000..38a763ca --- /dev/null +++ b/Assets/Scripts/ModelLoader.cs @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System.Collections; +using System.Collections.Generic; +using System; +using UnityEngine.SceneManagement; +using UnityEngine; +using UnityEditor; + +public class ModelLoader : MonoBehaviour +{ + [Header("Block Loading SDF")] + public bool doNotLoad = false; + + [Header("Pause after load models")] + public bool pauseOnStart = false; + + [Header("Clean all models before load model")] + public bool clearAllOnStart = true; + + [Header("World File")] + private string modelsRootName = "Models"; + private string defaultCameraName = "Main Camera"; + private string followingListName = "FollowingTargetList"; + + public string worldFileName; + + private string filesRootDirectory = string.Empty; + private List modelRootDirectories; + private List worldRootDirectories; + + private GameObject modelsRoot = null; + + private bool isResetting = false; + private bool resetTriggered = false; + + ModelLoader() + { + modelRootDirectories = new List(); + worldRootDirectories= new List(); + } + + private void CleanAllModels() + { + foreach (var child in modelsRoot.GetComponentsInChildren()) + { + // skip root gameobject + if (child.gameObject == modelsRoot) + { + continue; + } + + GameObject.Destroy(child.gameObject, 0.00001f); + } + } + + private void ResetTransform() + { + if (modelsRoot != null) + { + modelsRoot.transform.localRotation = Quaternion.identity; + modelsRoot.transform.localPosition = Vector3.zero; + modelsRoot.transform.localScale = Vector3.one; + } + } + + void Awake() + { +#if UNITY_EDITOR + filesRootDirectory = "../../../SimulatorInstance/gazebo/gazebo/build/Installed/Release/share/gazebo-9/"; + modelRootDirectories.Add("../../../lgrs_resource/assets/models/"); + worldRootDirectories.Add("../../../lgrs_resource/worlds"); +#else + var separator = new char[] {':'}; + filesRootDirectory = Environment.GetEnvironmentVariable("CLOISIM_FILES_PATH"); + var modelPathEnv = Environment.GetEnvironmentVariable("CLOISIM_MODEL_PATH"); + var modelPaths = modelPathEnv.Split(separator, StringSplitOptions.RemoveEmptyEntries); + modelRootDirectories.AddRange(modelPaths); + var worldPathEnv = Environment.GetEnvironmentVariable("CLOISIM_WORLD_PATH"); + var worldPaths = worldPathEnv.Split(separator, StringSplitOptions.RemoveEmptyEntries); + worldRootDirectories.AddRange(worldPaths); +#endif + Application.targetFrameRate = 60; + + modelsRoot = GameObject.Find(modelsRootName); + + ResetTransform(); + } + + void Start() + { + if (clearAllOnStart) + { + CleanAllModels(); + } + + var newWorldFile = GetArgument("-worldFile"); + if (!string.IsNullOrEmpty(newWorldFile)) + { + worldFileName = newWorldFile; + } + + StartCoroutine(LoadSdfModels()); + } + + private IEnumerator LoadSdfModels() + { + // Debug.Log("Hello CLOiSim World!!!!!"); + Debug.Log("World: " + worldFileName); + + // Main models loader + if (!doNotLoad && !string.IsNullOrEmpty(worldFileName)) + { + var sdf = new SDF.Root(); + sdf.SetWorldFileName(worldFileName); + sdf.fileDefaultPath = filesRootDirectory; + sdf.modelDefaultPaths.AddRange(modelRootDirectories); + sdf.worldDefaultPath.AddRange(worldRootDirectories); + + if (sdf.DoParse()) + { + yield return new WaitForSeconds(0.005f); + + var importer = new SDFImporter(); + importer.SetRootObject(modelsRoot); + importer.SetMainCamera(defaultCameraName); + importer.Start(sdf.World()); + } + else + { + Debug.LogError("Parsing failed!!"); + } + } + +#if UNITY_EDITOR + if (pauseOnStart) + { + EditorApplication.isPaused = true; + } +#endif + + // for GUI + var followingListObject = GameObject.Find(followingListName); + var followingTargetList = followingListObject.GetComponent(); + followingTargetList.UpdateList(); + } + + void LateUpdate() + { + if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.R)) + { + resetTriggered = true; + } + + if (resetTriggered && !isResetting) + { + if (Input.GetKey(KeyCode.LeftShift)) + { + // full Reset + isResetting = true; + SceneManager.LoadScene(SceneManager.GetActiveScene().name); + isResetting = false; + } + else + { + resetTriggered = false; + isResetting = true; + StartCoroutine(ResetSimulation()); + } + } + } + + public string TriggerResetService(in string command) + { + // Debug.Log(command); + + if (command.Equals("reset")) + { + if (isResetting) + { + return SimulationService.FAIL; + } + + resetTriggered = true; + + return SimulationService.SUCCESS; + } + + return SimulationService.FAIL; + } + + private IEnumerator ResetSimulation() + { + Debug.LogWarning("Reset positions in simulation!!!"); + + foreach (var plugin in modelsRoot.GetComponentsInChildren()) + { + plugin.Reset(); + } + + foreach (var plugin in modelsRoot.GetComponentsInChildren()) + { + plugin.Reset(); + } + + foreach (var plugin in modelsRoot.GetComponentsInChildren()) + { + plugin.Reset(); + } + + yield return new WaitForSeconds(1); + + Debug.LogWarning("[Done] Reset positions in simulation!!!"); + isResetting = false; + } + + /// + /// Eg: CLOiSim.x86_64 -worldFile gazebo.world + /// read the "-worldFile" command line argument + /// + private static string GetArgument(in string name) + { + var args = Environment.GetCommandLineArgs(); + for (var i = 0; i < args.Length; i++) + { + if (args[i] == name && args.Length > i + 1) + { + return args[i + 1]; + } + } + return null; + } +} \ No newline at end of file diff --git a/Assets/Scripts/ModelLoader.cs.meta b/Assets/Scripts/ModelLoader.cs.meta new file mode 100644 index 00000000..b540ea6b --- /dev/null +++ b/Assets/Scripts/ModelLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b919b529ee3735e1ad02c2e9e0e77e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 200 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Services.meta b/Assets/Scripts/Services.meta new file mode 100644 index 00000000..21df555e --- /dev/null +++ b/Assets/Scripts/Services.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5821282725fec2cc39c83bf1febbb20d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Services/MarkerVisualizerService.cs b/Assets/Scripts/Services/MarkerVisualizerService.cs new file mode 100644 index 00000000..da758f75 --- /dev/null +++ b/Assets/Scripts/Services/MarkerVisualizerService.cs @@ -0,0 +1,473 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using WebSocketSharp; +using WebSocketSharp.Server; +using UnityEngine; +using System.Collections.Generic; +using System.Text; +using System; + +public abstract class MarkerBase +{ + public virtual void Print() + { + } +} + +public abstract class MarkerTypeBase : MarkerBase +{ + [SerializeField] public float size = 0.01f; + [SerializeField] public Vector3 point = Vector3.zero; +} + +[Serializable] +public class MarkerLine: MarkerTypeBase +{ + [SerializeField] public Vector3 endpoint = Vector3.zero; + + public override void Print() + { + Debug.LogFormat("## MarkerLine: {0}, {1}, {2}", size, point, endpoint); + } +} + +[Serializable] +public class MarkerText: MarkerTypeBase, ISerializationCallbackReceiver +{ + public enum TextAlign : ushort {Left = 0, Center, Right}; + + [SerializeField] private string align = string.Empty; + [SerializeField] public string following = string.Empty; + [SerializeField] public string text = string.Empty; + [NonSerialized] public TextAlign textAlign = TextAlign.Left; + + public void OnAfterDeserialize() + { + try + { + textAlign = (TextAlign)Enum.Parse(typeof(TextAlign), align, true); + } + catch (ArgumentException) + { + textAlign = TextAlign.Left; + } + } + + public void OnBeforeSerialize() + { + align = textAlign.ToString().ToLower(); + } + + + public override void Print() + { + Debug.LogFormat("## MarkerText: {0}, {1}, {2}, {3}", size, align, following, point); + } +} + +[Serializable] +public class MarkerBox: MarkerTypeBase +{ + public override void Print() + { + Debug.LogFormat("## MarkerBox: {0}, {1}", size, point); + } +} + +[Serializable] +public class MarkerSphere: MarkerTypeBase +{ + public override void Print() + { + Debug.LogFormat("## MarkerSphere: {0}, {1}", size, point); + } +} + +[Serializable] +public class Marker: MarkerBase, ISerializationCallbackReceiver +{ + [SerializeField] public string group = string.Empty; + [SerializeField] public int id = -1; + [SerializeField] private string type = string.Empty; + [SerializeField] private string color = string.Empty; + + public enum Types : ushort {Unknown = 0, Line, Sphere, Box, Text}; + public enum Colors : ushort + {Unknown = 0, Red, Green, Blue, Gray, Orange, Lime, Pink, Purple, Navy, Aqua, Cyan, Magenta, Yellow, Black}; + + [NonSerialized] public Types markerType = Types.Unknown; + [NonSerialized] public Colors markerColor = Colors.Unknown; + + public void OnAfterDeserialize() + { + try + { + markerType = (Types)Enum.Parse(typeof(Types), type, true); + } + catch (ArgumentException) + { + markerType = Types.Unknown; + } + + try + { + markerColor = (Colors)Enum.Parse(typeof(Colors), color, true); + } + catch (ArgumentException) + { + markerColor = Colors.Unknown; + } + } + + public void OnBeforeSerialize() + { + type = markerType.ToString().ToLower(); + + color = markerColor.ToString().ToLower(); + } + + public string MarkerName() + { + return group + SimulationService.Delimiter + id + SimulationService.Delimiter + type; + } + + public Color GetColor() + { + Color targetColor; + switch (markerColor) + { + case Colors.Red: + targetColor = Color.red; + break; + + case Colors.Green: + targetColor = Color.green; + break; + + case Colors.Blue: + targetColor = Color.blue; + break; + + case Colors.Gray: + targetColor = Color.gray; + break; + + case Colors.Orange: + targetColor = new Color32(254, 161, 0, 1); + break; + + case Colors.Lime: + targetColor = new Color32(166, 254, 0, 1); + break; + + case Colors.Pink: + targetColor = new Color32(232, 0, 254, 1); + break; + + case Colors.Purple: + targetColor = new Color32(143, 0, 254, 1); + break; + + case Colors.Navy: + targetColor = new Color32(60, 0, 254, 1); + break; + + case Colors.Aqua: + targetColor = new Color32(0, 201, 254, 1); + break; + + case Colors.Cyan: + targetColor = Color.cyan; + break; + + case Colors.Magenta: + targetColor = Color.magenta; + break; + + case Colors.Yellow: + targetColor = Color.yellow; + break; + + case Colors.Black: + case Colors.Unknown: + default: + targetColor = Color.black; + break; + } + + targetColor.a = 1.0f; + return targetColor; + } + + public override void Print() + { + Debug.LogFormat("## Marker: {0}, {1}, {2}, {3}", group, id, type, color); + } +} + +[Serializable] +public class MarkerRequest : Marker +{ + [SerializeField] public MarkerLine line = null; + [SerializeField] public MarkerText text = null; + [SerializeField] public MarkerBox box = null; + [SerializeField] public MarkerSphere sphere = null; + + public override void Print() + { + base.Print(); + + switch (markerType) + { + case Types.Line: + line.Print(); + break; + + case Types.Box: + box.Print(); + break; + + case Types.Text: + text.Print(); + break; + + case Types.Sphere: + sphere.Print(); + break; + + case Types.Unknown: + default: + Debug.Log("Unknown marker type!!!"); + break; + } + } +} + +[Serializable] +public class MarkerResponseLine : Marker +{ + [SerializeField] public MarkerLine marker = null; + + public override void Print() + { + base.Print(); + marker.Print(); + } +} + +[Serializable] +public class MarkerResponseText : Marker +{ + [SerializeField] public MarkerText marker = null; + + public override void Print() + { + base.Print(); + marker.Print(); + } +} + +[Serializable] +public class MarkerResponseSphere : Marker +{ + [SerializeField] public MarkerSphere marker = null; + + public override void Print() + { + base.Print(); + marker.Print(); + } +} + +[Serializable] +public class MarkerResponseBox : Marker +{ + [SerializeField] public MarkerBox marker = null; + + public override void Print() + { + base.Print(); + marker.Print(); + } +} + +[Serializable] +public class MarkerFilter +{ + [SerializeField] public string group = string.Empty; + [SerializeField] public int id = -1; + [SerializeField] public string type = string.Empty; + + public bool IsEmpty() + { + if (string.IsNullOrEmpty(group) && id == -1 && string.IsNullOrEmpty(type)) + { + return true; + } + + return false; + } +} + +[Serializable] +public class VisualMarkerRequest : MarkerBase, ISerializationCallbackReceiver +{ + [SerializeField] public string command = string.Empty; + [SerializeField] public List markers = null; + [SerializeField] public MarkerFilter filter = null; + + public enum MarkerCommands : ushort {Unknown = 0, Add, Modify, Remove, List}; + [NonSerialized] public MarkerCommands markerCommand = MarkerCommands.Unknown; + + public void OnAfterDeserialize() + { + try { + // Debug.Log(command); + markerCommand = (MarkerCommands)Enum.Parse(typeof(MarkerCommands), command, true); + } + catch (ArgumentException) + { + // Debug.Log("X" + command); + markerCommand = MarkerCommands.Unknown; + } + } + + public void OnBeforeSerialize() + { + command = markerCommand.ToString().ToLower(); + } + + public override void Print() + { + Debug.Log("===================================="); + Debug.LogFormat("## VisualMarkers: {0}", command); + foreach (var marker in markers) + { + marker.Print(); + } + Debug.Log("===================================="); + } +} + +[Serializable] +public class VisualMarkerResponse : MarkerBase +{ + [SerializeField] public string command = string.Empty; + [SerializeField] public string result = string.Empty; + + [SerializeField] public List lines = null; + [SerializeField] public List texts = null; + [SerializeField] public List boxes = null; + [SerializeField] public List spheres = null; + + public VisualMarkerResponse() + { + // lines = new List>(); + // texts = new List>(); + // boxes = new List>(); + // spheres = new List>(); + } + + public override void Print() + { + Debug.LogFormat("## VisualMarkers: {0}, {1}", command, result); + + if (lines != null) + { + foreach (var line in lines) + { + line.Print(); + } + } + + if (texts != null) + { + foreach (var text in texts) + { + text.Print(); + } + } + + if (boxes != null) + { + foreach (var box in boxes) + { + box.Print(); + } + } + + if (spheres != null) + { + foreach (var sphere in spheres) + { + sphere.Print(); + } + } + } +} + +public class MarkerVisualizerService : WebSocketBehavior +{ + private MarkerVisualizer markerVisualizer = null; + + public MarkerVisualizerService(in MarkerVisualizer target) + { + markerVisualizer = target; + markerVisualizer.RegisterResponseAction(SendResponse); + } + + protected override void OnOpen() + { + Debug.Log("Open"); + } + + protected override void OnClose(CloseEventArgs e) + { + Debug.LogFormat("Close({0}), {1}", e.Code, e.Reason); + } + + protected override void OnMessage(MessageEventArgs e) + { + if (e.RawData.Length == 0 || e.IsPing) + { + // Debug.LogFormat("length:{0}, {1}", e.RawData.Length, e.IsPing); + return; + } + + var request = JsonUtility.FromJson(e.Data); + request.Print(); + + var isSuccessful = markerVisualizer.PushRequsetMarkers(request); + + if (!isSuccessful) + { + SendResponse(); + } + } + + protected override void OnError(ErrorEventArgs e) + { + Debug.LogFormat("{0}::OnError : {1}", GetType().Name, e.Message); + Sessions.CloseSession(ID); + } + + void SendResponse() + { + var response = markerVisualizer.GetResponseMarkers(); + var responseJsonData = JsonUtility.ToJson(response, false); + response.Print(); + + StringBuilder sb = new StringBuilder(responseJsonData); + // Debug.Log(responseJsonData); + sb.Replace(@",""lines"":[]", ""); + sb.Replace(@",""texts"":[]", ""); + sb.Replace(@",""boxes"":[]", ""); + sb.Replace(@",""spheres"":[]", ""); + // Debug.Log(sb.ToString()); + Send(sb.ToString()); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Services/MarkerVisualizerService.cs.meta b/Assets/Scripts/Services/MarkerVisualizerService.cs.meta new file mode 100644 index 00000000..0330ec80 --- /dev/null +++ b/Assets/Scripts/Services/MarkerVisualizerService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d916e8a9585d5075b6cf741cefbaea5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Services/SimulationControlService.cs b/Assets/Scripts/Services/SimulationControlService.cs new file mode 100644 index 00000000..51a785b1 --- /dev/null +++ b/Assets/Scripts/Services/SimulationControlService.cs @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2020 LG Electronics Inc. + * + * SPDX-License-Identifier: MIT + */ + +using System; +using WebSocketSharp; +using WebSocketSharp.Server; +using UnityEngine; + +[Serializable] +public class SimulationControlRequest +{ + [SerializeField] public string command = string.Empty; + + public void Print() + { + Debug.LogFormat("## {0}: {1}", this.GetType().Name, command); + } +} + +[Serializable] +public class SimulationControlResponse +{ + [SerializeField] public string command = string.Empty; + [SerializeField] public string result = string.Empty; + + public void Print() + { + Debug.LogFormat("## {0}: {1}, {2}", this.GetType().Name, command, result); + } +} + +public class SimulationControlService : WebSocketBehavior +{ + private ModelLoader targetComponent = null; + + public SimulationControlService(in ModelLoader target) + { + targetComponent = target; + } + + protected override void OnOpen() + { + Debug.Log("Open SimulationControlService"); + } + + protected override void OnClose(CloseEventArgs e) + { + Sessions.Sweep(); + Debug.LogFormat("Close SimulationControlService({0}), {1}", e.Code, e.Reason); + } + + protected override void OnMessage(MessageEventArgs e) + { + if (e.RawData.Length == 0 || e.IsPing) + { + // Debug.LogFormat("length:{0}, {1}", e.RawData.Length, e.IsPing); + return; + } + + var request = JsonUtility.FromJson(e.Data); + request.Print(); + + var result = targetComponent.TriggerResetService(request.command); + + GenerateResponse(request, result, out var response); + + var responseJsonData = JsonUtility.ToJson(response, true); + Send(responseJsonData); + } + + protected override void OnError(ErrorEventArgs e) + { + Debug.LogFormat("{0}::OnError : {1}", GetType().Name, e.Message); + } + + private void GenerateResponse(in SimulationControlRequest requeset, in string result, out SimulationControlResponse output) + { + output = new SimulationControlResponse(); + output.command = requeset.command; + output.result = result; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Services/SimulationControlService.cs.meta b/Assets/Scripts/Services/SimulationControlService.cs.meta new file mode 100644 index 00000000..56c07d52 --- /dev/null +++ b/Assets/Scripts/Services/SimulationControlService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a3039f4ab336faa39f8307c0dc26c50 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools.meta b/Assets/Scripts/Tools.meta new file mode 100644 index 00000000..333fa719 --- /dev/null +++ b/Assets/Scripts/Tools.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d3b4d8de99fcd8dd3a7176b1c97137e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh.meta b/Assets/Scripts/Tools/Mesh.meta new file mode 100644 index 00000000..39dbde49 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f8a9a48127e9caa995e3a431bae07a6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport.meta b/Assets/Scripts/Tools/Mesh/OBJImport.meta new file mode 100644 index 00000000..d4dd7bb9 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1111753a5ba12464986b0ed666cf8208 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/CharWordReader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/CharWordReader.cs new file mode 100644 index 00000000..24d51c43 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/CharWordReader.cs @@ -0,0 +1,183 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System.IO; +using System.Text; + +namespace Dummiesman { + public class CharWordReader { + public char[] word; + public int wordSize; + public bool endReached; + + private StreamReader reader; + private int bufferSize; + private char[] buffer; + + public char currentChar; + private int currentPosition = 0; + private int maxPosition = 0; + + public CharWordReader(StreamReader reader, int bufferSize) { + this.reader = reader; + this.bufferSize = bufferSize; + + this.buffer = new char[this.bufferSize]; + this.word = new char[this.bufferSize]; + + this.MoveNext(); + } + + public void SkipWhitespaces() { + while (char.IsWhiteSpace(this.currentChar)) { + this.MoveNext(); + } + } + + public void SkipWhitespaces(out bool newLinePassed) { + newLinePassed = false; + while (char.IsWhiteSpace(this.currentChar)) { + if (this.currentChar == '\r' || this.currentChar == '\n') { + newLinePassed = true; + } + this.MoveNext(); + } + } + + public void SkipUntilNewLine() { + while (this.currentChar != char.MinValue && this.currentChar != '\n' && this.currentChar != '\r') { + this.MoveNext(); + } + this.SkipNewLineSymbols(); + } + + public void ReadUntilWhiteSpace() { + this.wordSize = 0; + while (this.currentChar != char.MinValue && char.IsWhiteSpace(this.currentChar) == false) { + this.word[this.wordSize] = this.currentChar; + this.wordSize++; + this.MoveNext(); + } + } + + public void ReadUntilNewLine() { + this.wordSize = 0; + while (this.currentChar != char.MinValue && this.currentChar != '\n' && this.currentChar != '\r') { + this.word[this.wordSize] = this.currentChar; + this.wordSize++; + this.MoveNext(); + } + this.SkipNewLineSymbols(); + } + + public bool Is(string other) { + if (other.Length != this.wordSize) { + return false; + } + + for (int i=0; i= this.wordSize - 1) { + return string.Empty; + } + return new string(this.word, startIndex, this.wordSize - startIndex); + } + + public Vector3 ReadVector() { + this.SkipWhitespaces(); + float x = this.ReadFloat(); + this.SkipWhitespaces(); + float y = this.ReadFloat(); + this.SkipWhitespaces(out var newLinePassed); + float z = 0f; + if (newLinePassed == false) { + z = this.ReadFloat(); + } + return new Vector3(x, y, z); + } + + public int ReadInt() { + int result = 0; + bool isNegative = this.currentChar == '-'; + if (isNegative == true) { + this.MoveNext(); + } + + while (this.currentChar >= '0' && this.currentChar <= '9') { + var digit = this.currentChar - '0'; + result = result * 10 + digit; + this.MoveNext(); + } + + return (isNegative == true) ? -result : result; + } + + public float ReadFloat() { + bool isNegative = this.currentChar == '-'; + if (isNegative) { + this.MoveNext(); + } + + var num = (float)this.ReadInt(); + if (this.currentChar == '.' || this.currentChar == ',') { + this.MoveNext(); + num += this.ReadFloatEnd(); + + if (this.currentChar == 'e' || this.currentChar == 'E') { + this.MoveNext(); + var exp = this.ReadInt(); + num = num * Mathf.Pow(10f, exp); + } + } + if (isNegative == true) { + num = -num; + } + + return num; + } + + private float ReadFloatEnd() { + float result = 0f; + + var exp = 0.1f; + while (this.currentChar >= '0' && this.currentChar <= '9') { + var digit = this.currentChar - '0'; + result += digit * exp; + + exp *= 0.1f; + + this.MoveNext(); + } + + return result; + } + + private void SkipNewLineSymbols() { + while (this.currentChar == '\n' || this.currentChar == '\r') { + this.MoveNext(); + } + } + + public void MoveNext() { + this.currentPosition++; + if (this.currentPosition >= this.maxPosition) { + if (this.reader.EndOfStream == true) { + this.currentChar = char.MinValue; + this.endReached = true; + return; + } + + this.currentPosition = 0; + this.maxPosition = this.reader.Read(this.buffer, 0, this.bufferSize); + } + this.currentChar = this.buffer[this.currentPosition]; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/CharWordReader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/CharWordReader.cs.meta new file mode 100644 index 00000000..7f70f1ea --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/CharWordReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37ed5e34a98d98669ac1a63bf547afa3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/MTLLoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/MTLLoader.cs new file mode 100644 index 00000000..4f5a314e --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/MTLLoader.cs @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2019 Dummiesman + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. +*/ + +using Dummiesman; +using System.Collections.Generic; +using System.IO; +using UnityEngine; + +public class MTLLoader { + public List SearchPaths = new List() { "%FileName%_Textures", string.Empty}; + + private FileInfo _objFileInfo = null; + + /// + /// The texture loading function. Overridable for stream loading purposes. + /// + /// The path supplied by the OBJ file, converted to OS path seperation + /// Whether the loader is requesting we convert this into a normal map + /// Texture2D if found, or NULL if missing + public virtual Texture2D TextureLoadFunction(string path, bool isNormalMap) + { + //find it + foreach (var searchPath in SearchPaths) + { + //replace varaibles and combine path + string processedPath = (_objFileInfo != null) ? searchPath.Replace("%FileName%", Path.GetFileNameWithoutExtension(_objFileInfo.Name)) + : searchPath; + string filePath = Path.Combine(processedPath, path); + + //return if eists + if (File.Exists(filePath)) + { + var tex = ImageLoader.LoadTexture(filePath); + + if(isNormalMap) + tex = ImageUtils.ConvertToNormalMap(tex); + + return tex; + } + } + + //not found + return null; + } + + private Texture2D TryLoadTexture(string texturePath, bool normalMap = false) + { + //swap directory seperator char + texturePath = texturePath.Replace('\\', Path.DirectorySeparatorChar); + texturePath = texturePath.Replace('/', Path.DirectorySeparatorChar); + + return TextureLoadFunction(texturePath, normalMap); + } + + private int GetArgValueCount(string arg) + { + switch (arg) + { + case "-bm": + case "-clamp": + case "-blendu": + case "-blendv": + case "-imfchan": + case "-texres": + return 1; + case "-mm": + return 2; + case "-o": + case "-s": + case "-t": + return 3; + } + return -1; + } + + private int GetTexNameIndex(string[] components) + { + for(int i=1; i < components.Length; i++) + { + var cmpSkip = GetArgValueCount(components[i]); + if(cmpSkip < 0) + { + return i; + } + i += cmpSkip; + } + return -1; + } + + private float GetArgValue(string[] components, string arg, float fallback = 1f) + { + string argLower = arg.ToLower(); + for(int i=1; i < components.Length - 1; i++) + { + var cmp = components[i].ToLower(); + if(argLower == cmp) + { + return OBJLoaderHelper.FastFloatParse(components[i+1]); + } + } + return fallback; + } + + private string GetTexPathFromMapStatement(string processedLine, string[] splitLine) + { + int texNameCmpIdx = GetTexNameIndex(splitLine); + if(texNameCmpIdx < 0) + { + Debug.LogError($"texNameCmpIdx < 0 on line {processedLine}. Texture not loaded."); + return null; + } + + int texNameIdx = processedLine.IndexOf(splitLine[texNameCmpIdx]); + string texturePath = processedLine.Substring(texNameIdx); + + return texturePath; + } + + /// + /// Loads a *.mtl file + /// + /// The input stream from the MTL file + /// Dictionary containing loaded materials + public Dictionary Load(Stream input) + { + var inputReader = new StreamReader(input); + var reader = new StringReader(inputReader.ReadToEnd()); + + Dictionary mtlDict = new Dictionary(); + Material currentMaterial = null; + + for (string line = reader.ReadLine(); line != null; line = reader.ReadLine()) + { + if (string.IsNullOrWhiteSpace(line)) + continue; + + string processedLine = line.Clean(); + string[] splitLine = processedLine.Split(' '); + + //blank or comment + if (splitLine.Length < 2 || processedLine[0] == '#') + continue; + + //newmtl + if (splitLine[0] == "newmtl") + { + string materialName = processedLine.Substring(7); + + var newMtl = new Material(Shader.Find("Standard (Specular setup)")) { name = materialName }; + mtlDict[materialName] = newMtl; + currentMaterial = newMtl; + + continue; + } + + //anything past here requires a material instance + if (currentMaterial == null) + continue; + + //diffuse color + if (splitLine[0] == "Kd" || splitLine[0] == "kd") + { + var currentColor = currentMaterial.GetColor("_Color"); + var kdColor = OBJLoaderHelper.ColorFromStrArray(splitLine); + + currentMaterial.SetColor("_Color", new Color(kdColor.r, kdColor.g, kdColor.b, currentColor.a)); + continue; + } + + //diffuse map + if (splitLine[0] == "map_Kd" || splitLine[0] == "map_kd") + { + string texturePath = GetTexPathFromMapStatement(processedLine, splitLine); + if(texturePath == null) + { + continue; //invalid args or sth + } + + var KdTexture = TryLoadTexture(texturePath); + currentMaterial.SetTexture("_MainTex", KdTexture); + + //set transparent mode if the texture has transparency + if(KdTexture != null && (KdTexture.format == TextureFormat.DXT5 || KdTexture.format == TextureFormat.ARGB32)) + { + OBJLoaderHelper.EnableMaterialTransparency(currentMaterial); + } + + //flip texture if this is a dds + if(Path.GetExtension(texturePath).ToLower() == ".dds") + { + currentMaterial.mainTextureScale = new Vector2(1f, -1f); + } + + continue; + } + + //bump map + if (splitLine[0] == "map_Bump" || splitLine[0] == "map_bump") + { + string texturePath = GetTexPathFromMapStatement(processedLine, splitLine); + if(texturePath == null) + { + continue; //invalid args or sth + } + + var bumpTexture = TryLoadTexture(texturePath, true); + float bumpScale = GetArgValue(splitLine, "-bm", 1.0f); + + if (bumpTexture != null) { + currentMaterial.SetTexture("_BumpMap", bumpTexture); + currentMaterial.SetFloat("_BumpScale", bumpScale); + currentMaterial.EnableKeyword("_NORMALMAP"); + } + + continue; + } + + //specular color + if (splitLine[0] == "Ks" || splitLine[0] == "ks") + { + currentMaterial.SetColor("_SpecColor", OBJLoaderHelper.ColorFromStrArray(splitLine)); + continue; + } + + //emission color + if (splitLine[0] == "Ka" || splitLine[0] == "ka") + { + currentMaterial.SetColor("_EmissionColor", OBJLoaderHelper.ColorFromStrArray(splitLine, 0.05f)); + currentMaterial.EnableKeyword("_EMISSION"); + continue; + } + + //emission map + if (splitLine[0] == "map_Ka" || splitLine[0] == "map_ka") + { + string texturePath = GetTexPathFromMapStatement(processedLine, splitLine); + if(texturePath == null) + { + continue; //invalid args or sth + } + + currentMaterial.SetTexture("_EmissionMap", TryLoadTexture(texturePath)); + continue; + } + + //alpha + if (splitLine[0] == "d" || splitLine[0] == "Tr") + { + float visibility = OBJLoaderHelper.FastFloatParse(splitLine[1]); + + //tr statement is just d inverted + if(splitLine[0] == "Tr") + visibility = 1f - visibility; + + if(visibility < (1f - Mathf.Epsilon)) + { + var currentColor = currentMaterial.GetColor("_Color"); + + currentColor.a = visibility; + currentMaterial.SetColor("_Color", currentColor); + + OBJLoaderHelper.EnableMaterialTransparency(currentMaterial); + } + continue; + } + + //glossiness + if (splitLine[0] == "Ns" || splitLine[0] == "ns") + { + float Ns = OBJLoaderHelper.FastFloatParse(splitLine[1]); + Ns = (Ns / 1000f); + currentMaterial.SetFloat("_Glossiness", Ns); + } + } + + //return our dict + return mtlDict; + } + + /// + /// Loads a *.mtl file + /// + /// The path to the MTL file + /// Dictionary containing loaded materials + public Dictionary Load(string path) + { + _objFileInfo = new FileInfo(path); //get file info + SearchPaths.Add(_objFileInfo.Directory.FullName); //add root path to search dir + SearchPaths.Add(_objFileInfo.Directory.FullName + "/../materials"); + SearchPaths.Add(_objFileInfo.Directory.FullName + "/../materials/textures"); + + using (var fs = new FileStream(path, FileMode.Open)) + { + return Load(fs); //actually load + } + + } +} diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/MTLLoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/MTLLoader.cs.meta new file mode 100644 index 00000000..b0c037ea --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/MTLLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 11b3883c0720fb8409b86b54877b58ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoader.cs new file mode 100644 index 00000000..a7881dd8 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoader.cs @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2019 Dummiesman + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. +*/ + +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using System; +using Dummiesman; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace Dummiesman +{ + public enum SplitMode { + None, + Object, + Material + } + + public class OBJLoader + { + //options + /// + /// Determines how objects will be created + /// + public SplitMode SplitMode = SplitMode.Object; + + //global lists, accessed by objobjectbuilder + internal List Vertices = new List(); + internal List Normals = new List(); + internal List UVs = new List(); + + //materials, accessed by objobjectbuilder + internal Dictionary Materials; + + //file info for files loaded from file path, used for GameObject naming and MTL finding + private FileInfo _objInfo; + +#if UNITY_EDITOR + [MenuItem("GameObject/Import From OBJ")] + static void ObjLoadMenu() + { + string pth = EditorUtility.OpenFilePanel("Import OBJ", "", "obj"); + if (!string.IsNullOrEmpty(pth)) + { + System.Diagnostics.Stopwatch s = new System.Diagnostics.Stopwatch(); + s.Start(); + + var loader = new OBJLoader + { + SplitMode = SplitMode.Object, + }; + loader.Load(pth); + + Debug.Log($"OBJ import time: {s.ElapsedMilliseconds}ms"); + s.Stop(); + } + } +#endif + + /// + /// Helper function to load mtllib statements + /// + /// + private void LoadMaterialLibrary(string mtlLibPath) + { + if (_objInfo != null) + { + if (File.Exists(Path.Combine(_objInfo.Directory.FullName, mtlLibPath))) + { + Materials = new MTLLoader().Load(Path.Combine(_objInfo.Directory.FullName, mtlLibPath)); + return; + } + } + + if (File.Exists(mtlLibPath)) + { + Materials = new MTLLoader().Load(mtlLibPath); + return; + } + } + + /// + /// Load an OBJ file from a stream. No materials will be loaded, and will instead be supplemented by a blank white material. + /// + /// Input OBJ stream + /// Returns a GameObject represeting the OBJ file, with each imported object as a child. + public GameObject Load(Stream input) + { + var reader = new StreamReader(input); + //var reader = new StringReader(inputReader.ReadToEnd()); + + Dictionary builderDict = new Dictionary(); + OBJObjectBuilder currentBuilder = null; + string currentMaterial = "default"; + + //lists for face data + //prevents excess GC + List vertexIndices = new List(); + List normalIndices = new List(); + List uvIndices = new List(); + + //helper func + Action setCurrentObjectFunc = (string objectName) => + { + if (!builderDict.TryGetValue(objectName, out currentBuilder)) + { + currentBuilder = new OBJObjectBuilder(objectName, this); + builderDict[objectName] = currentBuilder; + } + }; + + //create default object + setCurrentObjectFunc.Invoke("default"); + + //var buffer = new DoubleBuffer(reader, 256 * 1024); + var buffer = new CharWordReader(reader, 4 * 1024); + + //do the reading + while (true) + { + buffer.SkipWhitespaces(); + + if (buffer.endReached == true) { + break; + } + + buffer.ReadUntilWhiteSpace(); + + //comment or blank + if (buffer.Is("#")) + { + buffer.SkipUntilNewLine(); + continue; + } + + if (Materials == null && buffer.Is("mtllib")) { + buffer.SkipWhitespaces(); + buffer.ReadUntilNewLine(); + string mtlLibPath = buffer.GetString(); + LoadMaterialLibrary(mtlLibPath); + continue; + } + + if (buffer.Is("v")) { + Vertices.Add(buffer.ReadVector()); + continue; + } + + //normal + if (buffer.Is("vn")) { + Normals.Add(buffer.ReadVector()); + continue; + } + + //uv + if (buffer.Is("vt")) { + UVs.Add(buffer.ReadVector()); + continue; + } + + //new material + if (buffer.Is("usemtl")) { + buffer.SkipWhitespaces(); + buffer.ReadUntilNewLine(); + string materialName = buffer.GetString(); + currentMaterial = materialName; + + if(SplitMode == SplitMode.Material) + { + setCurrentObjectFunc.Invoke(materialName); + } + continue; + } + + //new object + if ((buffer.Is("o") || buffer.Is("g")) && SplitMode == SplitMode.Object) { + buffer.ReadUntilNewLine(); + string objectName = buffer.GetString(1); + setCurrentObjectFunc.Invoke(objectName); + continue; + } + + //face data (the fun part) + if (buffer.Is("f")) + { + //loop through indices + while (true) + { + bool newLinePassed; + buffer.SkipWhitespaces(out newLinePassed); + if (newLinePassed == true) { + break; + } + + int vertexIndex = int.MinValue; + int normalIndex = int.MinValue; + int uvIndex = int.MinValue; + + vertexIndex = buffer.ReadInt(); + if (buffer.currentChar == '/') { + buffer.MoveNext(); + if (buffer.currentChar != '/') { + uvIndex = buffer.ReadInt(); + } + if (buffer.currentChar == '/') { + buffer.MoveNext(); + normalIndex = buffer.ReadInt(); + } + } + + //"postprocess" indices + if (vertexIndex > int.MinValue) + { + if (vertexIndex < 0) + vertexIndex = Vertices.Count - vertexIndex; + vertexIndex--; + } + if (normalIndex > int.MinValue) + { + if (normalIndex < 0) + normalIndex = Normals.Count - normalIndex; + normalIndex--; + } + if (uvIndex > int.MinValue) + { + if (uvIndex < 0) + uvIndex = UVs.Count - uvIndex; + uvIndex--; + } + + //set array values + vertexIndices.Add(vertexIndex); + normalIndices.Add(normalIndex); + uvIndices.Add(uvIndex); + } + + //push to builder + currentBuilder.PushFace(currentMaterial, vertexIndices, normalIndices, uvIndices); + + //clear lists + vertexIndices.Clear(); + normalIndices.Clear(); + uvIndices.Clear(); + + continue; + } + + buffer.SkipUntilNewLine(); + } + + //finally, put it all together + GameObject obj = new GameObject(_objInfo != null ? Path.GetFileNameWithoutExtension(_objInfo.Name) : "WavefrontObject"); + obj.transform.localScale = new Vector3(-1f, 1f, 1f); + + foreach (var builder in builderDict) + { + //empty object + if (builder.Value.PushedFaceCount == 0) + continue; + + var builtObj = builder.Value.Build(); + builtObj.transform.SetParent(obj.transform, false); + } + + return obj; + } + + /// + /// Load an OBJ and MTL file from a stream. + /// + /// Input OBJ stream + /// /// Input MTL stream + /// Returns a GameObject represeting the OBJ file, with each imported object as a child. + public GameObject Load(Stream input, Stream mtlInput) + { + var mtlLoader = new MTLLoader(); + Materials = mtlLoader.Load(mtlInput); + + return Load(input); + } + + /// + /// Load an OBJ and MTL file from a file path. + /// + /// Input OBJ path + /// /// Input MTL path + /// Returns a GameObject represeting the OBJ file, with each imported object as a child. + public GameObject Load(string path, string mtlPath) + { + _objInfo = new FileInfo(path); + + if (!string.IsNullOrEmpty(mtlPath) && File.Exists(mtlPath)) + { + var mtlLoader = new MTLLoader(); + Materials = mtlLoader.Load(mtlPath); + + using (var fs = new FileStream(path, FileMode.Open)) + { + return Load(fs); + } + } + else + { + using (var fs = new FileStream(path, FileMode.Open)) + { + return Load(fs); + } + } + } + + /// + /// Load an OBJ file from a file path. This function will also attempt to load the MTL defined in the OBJ file. + /// + /// Input OBJ path + /// Returns a GameObject represeting the OBJ file, with each imported object as a child. + public GameObject Load(string path) + { + return Load(path, null); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoader.cs.meta new file mode 100644 index 00000000..b08902fe --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9951190d0789ee64599dc374c1f81ce5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoaderHelper.cs b/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoaderHelper.cs new file mode 100644 index 00000000..127d1903 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoaderHelper.cs @@ -0,0 +1,103 @@ +using System.Globalization; +using UnityEngine; + +namespace Dummiesman +{ + public static class OBJLoaderHelper + { + /// + /// Enables transparency mode on standard materials + /// + public static void EnableMaterialTransparency(Material mtl) + { + mtl.SetFloat("_Mode", 3f); + mtl.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); + mtl.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); + mtl.SetInt("_ZWrite", 0); + mtl.DisableKeyword("_ALPHATEST_ON"); + mtl.EnableKeyword("_ALPHABLEND_ON"); + mtl.DisableKeyword("_ALPHAPREMULTIPLY_ON"); + mtl.renderQueue = 3000; + } + + /// + /// Modified from https://codereview.stackexchange.com/a/76891. Faster than float.Parse + /// + public static float FastFloatParse(string input) + { + if (input.Contains("e") || input.Contains("E")) + return float.Parse(input, CultureInfo.InvariantCulture); + + float result = 0; + int pos = 0; + int len = input.Length; + + if (len == 0) return float.NaN; + char c = input[0]; + float sign = 1; + if (c == '-') + { + sign = -1; + ++pos; + if (pos >= len) return float.NaN; + } + + while (true) // breaks inside on pos >= len or non-digit character + { + if (pos >= len) return sign * result; + c = input[pos++]; + if (c < '0' || c > '9') break; + result = (result * 10.0f) + (c - '0'); + } + + if (c != '.' && c != ',') return float.NaN; + float exp = 0.1f; + while (pos < len) + { + c = input[pos++]; + if (c < '0' || c > '9') return float.NaN; + result += (c - '0') * exp; + exp *= 0.1f; + } + return sign * result; + } + + /// + /// Modified from http://cc.davelozinski.com/c-sharp/fastest-way-to-convert-a-string-to-an-int. Faster than int.Parse + /// + public static int FastIntParse(string input) + { + int result = 0; + bool isNegative = (input[0] == '-'); + + for (int i = (isNegative) ? 1 : 0; i < input.Length; i++) + result = result * 10 + (input[i] - '0'); + return (isNegative) ? -result : result; + } + + public static Material CreateNullMaterial() + { + return new Material(Shader.Find("Standard (Specular setup)")); + } + + public static Vector3 VectorFromStrArray(string[] cmps) + { + float x = FastFloatParse(cmps[1]); + float y = FastFloatParse(cmps[2]); + if (cmps.Length == 4) + { + float z = FastFloatParse(cmps[3]); + return new Vector3(x, y, z); + } + return new Vector2(x, y); + } + + public static Color ColorFromStrArray(string[] cmps, float scalar = 1.0f) + { + float Kr = FastFloatParse(cmps[1]) * scalar; + float Kg = FastFloatParse(cmps[2]) * scalar; + float Kb = FastFloatParse(cmps[3]) * scalar; + return new Color(Kr, Kg, Kb); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoaderHelper.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoaderHelper.cs.meta new file mode 100644 index 00000000..360a23c4 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/OBJLoaderHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6083f989375f6104aafb31a9e82ee153 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs b/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs new file mode 100644 index 00000000..bc8b55d2 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2019 Dummiesman + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. +*/ + +using Dummiesman; +using System.Collections.Generic; +using UnityEngine; + +namespace Dummiesman { +public class OBJObjectBuilder { + // + public int PushedFaceCount { get; private set; } = 0; + + //stuff passed in by ctor + private OBJLoader _loader; + private string _name; + + private Dictionary _globalIndexRemap = new Dictionary(); + private Dictionary> _materialIndices = new Dictionary>(); + private List _currentIndexList; + private string _lastMaterial = null; + + //our local vert/normal/uv + private List _vertices = new List(); + private List _normals = new List(); + private List _uvs = new List(); + + //this will be set if the model has no normals or missing normal info + private bool recalculateNormals = false; + + /// + /// Loop hasher helper class + /// + private class ObjLoopHash { + public int vertexIndex; + public int normalIndex; + public int uvIndex; + + public override bool Equals(object obj) { + if (!(obj is ObjLoopHash)) + return false; + + var hash = obj as ObjLoopHash; + return (hash.vertexIndex == vertexIndex) && (hash.uvIndex == uvIndex) && (hash.normalIndex == normalIndex); + } + + public override int GetHashCode() { + int hc = 3; + hc = unchecked(hc * 314159 + vertexIndex); + hc = unchecked(hc * 314159 + normalIndex); + hc = unchecked(hc * 314159 + uvIndex); + return hc; + } + } + + public GameObject Build() { + var go = new GameObject(_name); + + //add meshrenderer + var mr = go.AddComponent(); + int submesh = 0; + + + //locate the material for each submesh + Material[] materialArray = new Material[_materialIndices.Count]; + foreach (var kvp in _materialIndices) { + Material material = null; + if (_loader.Materials == null) { + material = OBJLoaderHelper.CreateNullMaterial(); + material.name = kvp.Key; + } else { + if (!_loader.Materials.TryGetValue(kvp.Key, out material)) { + material = OBJLoaderHelper.CreateNullMaterial(); + material.name = kvp.Key; + _loader.Materials[kvp.Key] = material; + } + } + materialArray[submesh] = material; + submesh++; + } + mr.sharedMaterials = materialArray; + + //add meshfilter + var mf = go.AddComponent(); + submesh = 0; + + var msh = new Mesh() { + name = _name, + indexFormat = (_vertices.Count > 65535) ? UnityEngine.Rendering.IndexFormat.UInt32 : UnityEngine.Rendering.IndexFormat.UInt16, + subMeshCount = _materialIndices.Count + }; + + //set vertex data + msh.SetVertices(_vertices); + msh.SetNormals(_normals); + msh.SetUVs(0, _uvs); + + //set faces + foreach (var kvp in _materialIndices) { + msh.SetTriangles(kvp.Value, submesh); + submesh++; + } + + //recalculations + if (recalculateNormals) + msh.RecalculateNormals(); + msh.RecalculateTangents(); + msh.RecalculateBounds(); + + mf.sharedMesh = msh; + + // + return go; + } + + public void SetMaterial(string name) { + if (!_materialIndices.TryGetValue(name, out _currentIndexList)) + { + _currentIndexList = new List(); + _materialIndices[name] = _currentIndexList; + } + } + + + public void PushFace(string material, List vertexIndices, List normalIndices, List uvIndices) { + //invalid face size? + if (vertexIndices.Count < 3) { + return; + } + + //set material + if (material != _lastMaterial) { + SetMaterial(material); + _lastMaterial = material; + } + + //remap + int[] indexRemap = new int[vertexIndices.Count]; + for (int i = 0; i < vertexIndices.Count; i++) { + int vertexIndex = vertexIndices[i]; + int normalIndex = normalIndices[i]; + int uvIndex = uvIndices[i]; + + var hashObj = new ObjLoopHash() { + vertexIndex = vertexIndex, + normalIndex = normalIndex, + uvIndex = uvIndex + }; + int remap = -1; + + if (!_globalIndexRemap.TryGetValue(hashObj, out remap)) { + //add to dict + _globalIndexRemap.Add(hashObj, _vertices.Count); + remap = _vertices.Count; + + //add new verts and what not + _vertices.Add((vertexIndex >= 0 && vertexIndex < _loader.Vertices.Count) ? _loader.Vertices[vertexIndex] : Vector3.zero); + _normals.Add((normalIndex >= 0 && normalIndex < _loader.Normals.Count) ? _loader.Normals[normalIndex] : Vector3.zero); + _uvs.Add((uvIndex >= 0 && uvIndex < _loader.UVs.Count) ? _loader.UVs[uvIndex] : Vector2.zero); + + //mark recalc flag + if (normalIndex < 0) + recalculateNormals = true; + } + + indexRemap[i] = remap; + } + + + //add face to our mesh list + if (indexRemap.Length == 3) { + _currentIndexList.AddRange(new int[] { indexRemap[0], indexRemap[1], indexRemap[2] }); + } else if (indexRemap.Length == 4) { + _currentIndexList.AddRange(new int[] { indexRemap[0], indexRemap[1], indexRemap[2] }); + _currentIndexList.AddRange(new int[] { indexRemap[2], indexRemap[3], indexRemap[0] }); + } else if (indexRemap.Length > 4) { + for (int i = indexRemap.Length - 1; i >= 2; i--) { + _currentIndexList.AddRange(new int[] { indexRemap[0], indexRemap[i - 1], indexRemap[i] }); + } + } + + PushedFaceCount++; + } + + public OBJObjectBuilder(string name, OBJLoader loader) { + _name = name; + _loader = loader; + } +} +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs.meta new file mode 100644 index 00000000..7e0d5b8e --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/OBJObjectBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8242329223027ef40a531fc4dc2efd1c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML b/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML new file mode 100644 index 00000000..0ae5c5cc --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML @@ -0,0 +1,26 @@ + + + + + Dummiesman OBJ Importer Readme + + + +

Dummiesman's OBJ Importer

+

Works during runtime*, and in editor! A couple of code samples are provided in the Samples folder.

+
+

*Runtime Import Note

+

You must go to the "Graphics" tab in your project, and add "Standard (Specular Setup)" to the always included shaders. This will make your next build take a while.

+
+

Features

+
    +
  • Material file loading
  • +
  • Runtime texture library supporting BMP, TGA, JPG, PNG, DDS, and CRN textures.
  • +
  • Decent import speed (~750k triangles in about 10 seconds)
  • +
  • Support for loading obj and mtl from stream, as well as overridable callback for texture loads
  • +
  • Works in editor, and during runtime
  • +
  • Loads triangles, quads, and ngons
  • +
+ + + \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML.meta b/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML.meta new file mode 100644 index 00000000..038ce58c --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/README.HTML.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 127e58e7a0d489046a128e511967dea8 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples.meta new file mode 100644 index 00000000..7fd13e80 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e292531b556307479437e7763c8b31f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs new file mode 100644 index 00000000..53f107e3 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs @@ -0,0 +1,36 @@ +using Dummiesman; +using System.IO; +using UnityEngine; + +public class ObjFromFile : MonoBehaviour +{ + string objPath = string.Empty; + string error = string.Empty; + GameObject loadedObject; + + void OnGUI() { + objPath = GUI.TextField(new Rect(0, 0, 256, 32), objPath); + + GUI.Label(new Rect(0, 0, 256, 32), "Obj Path:"); + if(GUI.Button(new Rect(256, 32, 64, 32), "Load File")) + { + //file path + if (!File.Exists(objPath)) + { + error = "File doesn't exist."; + }else{ + if(loadedObject != null) + Destroy(loadedObject); + loadedObject = new OBJLoader().Load(objPath); + error = string.Empty; + } + } + + if(!string.IsNullOrWhiteSpace(error)) + { + GUI.color = Color.red; + GUI.Box(new Rect(0, 64, 256 + 64, 32), error); + GUI.color = Color.white; + } + } +} diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs.meta new file mode 100644 index 00000000..be79067f --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e668e28abcfb0ae439f4ead584aba85b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity new file mode 100644 index 00000000..62a52b16 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity @@ -0,0 +1,298 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 10 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1373862594 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1373862596} + - component: {fileID: 1373862595} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1373862595 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1373862594} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1373862596 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1373862594} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1374413049 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1374413051} + - component: {fileID: 1374413050} + m_Layer: 0 + m_Name: Scripts + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1374413050 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1374413049} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e668e28abcfb0ae439f4ead584aba85b, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1374413051 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1374413049} + 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: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1513737669 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1513737672} + - component: {fileID: 1513737671} + - component: {fileID: 1513737670} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1513737670 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1513737669} + m_Enabled: 1 +--- !u!20 &1513737671 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1513737669} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1513737672 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1513737669} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity.meta new file mode 100644 index 00000000..d03aba45 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromFile.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e96535515ee47d04589da7981f6650a2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs new file mode 100644 index 00000000..cc87cd13 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs @@ -0,0 +1,22 @@ +using Dummiesman; +using System.IO; +using System.Text; +using UnityEngine; +using UnityEngine.Networking; + +public class ObjFromStream : MonoBehaviour +{ + void Start() + { + var request = new UnityWebRequest(); + var webRequest = UnityWebRequest.Get("https://people.sc.fsu.edu/~jburkardt/data/obj/lamp.obj"); + while (!webRequest.isDone) + { + System.Threading.Thread.Sleep(1); + } + + //create stream and load + var textStream = new MemoryStream(Encoding.UTF8.GetBytes(webRequest.downloadHandler.text)); + var loadedObj = new OBJLoader().Load(textStream); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs.meta new file mode 100644 index 00000000..85de4fac --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: daba88a30f38f3f4d8df0d146acfcd08 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity new file mode 100644 index 00000000..bf75125a --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity @@ -0,0 +1,298 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 10 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &167273857 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 167273859} + - component: {fileID: 167273858} + m_Layer: 0 + m_Name: Scripts + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &167273858 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 167273857} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: daba88a30f38f3f4d8df0d146acfcd08, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &167273859 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 167273857} + 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: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &560136681 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 560136683} + - component: {fileID: 560136682} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &560136682 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 560136681} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &560136683 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 560136681} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &2142185484 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2142185487} + - component: {fileID: 2142185486} + - component: {fileID: 2142185485} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &2142185485 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2142185484} + m_Enabled: 1 +--- !u!20 &2142185486 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2142185484} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &2142185487 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2142185484} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity.meta b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity.meta new file mode 100644 index 00000000..970029f2 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/Samples/ObjFromStream.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0f928d9ce1b64b94f9b3d349956f8cd3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs b/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs new file mode 100644 index 00000000..b137e349 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs @@ -0,0 +1,13 @@ +namespace Dummiesman +{ + public static class StringExtensions + { + public static string Clean(this string str) + { + string rstr = str.Replace('\t', ' '); + while (rstr.Contains(" ")) + rstr = rstr.Replace(" ", " "); + return rstr.Trim(); + } + } +} diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs.meta new file mode 100644 index 00000000..edbe614f --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/StringExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ef7489c6f646f4448ffe979ea9857da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader.meta new file mode 100644 index 00000000..de80f2cb --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce592b27d670b994b8150b9ddd9fa341 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs new file mode 100644 index 00000000..ea18980f --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs @@ -0,0 +1,560 @@ +#region License and Information +/***** +* +* BMPLoader.cs +* +* This is a simple implementation of a BMP file loader for Unity3D. +* Formats it should support are: +* - 1 bit monochrome indexed +* - 2-8 bit indexed +* - 16 / 24 / 32 bit color (including "BI_BITFIELDS") +* - RLE-4 and RLE-8 support has been added. +* +* Unless the type is "BI_ALPHABITFIELDS" the loader does not interpret alpha +* values by default, however you can set the "ReadPaletteAlpha" setting to +* true to interpret the 4th (usually "00") value as alpha for indexed images. +* You can also set "ForceAlphaReadWhenPossible" to true so it will interpret +* the "left over" bits as alpha if there are any. It will also force to read +* alpha from a palette if it's an indexed image, just like "ReadPaletteAlpha". +* +* It's not tested well to the bone, so there might be some errors somewhere. +* However I tested it with 4 different images created with MS Paint +* (1bit, 4bit, 8bit, 24bit) as those are the only formats supported. +* +* 2017.02.05 - first version +* 2017.03.06 - Added RLE4 / RLE8 support +* +* Copyright (c) 2017 Markus Göbel (Bunny83) +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to +* deal in the Software without restriction, including without limitation the +* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +* sell copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +*****/ +#endregion License and Information +using UnityEngine; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System; + +namespace B83.Image.BMP +{ + public enum BMPComressionMode : int + { + BI_RGB = 0x00, + BI_RLE8 = 0x01, + BI_RLE4 = 0x02, + BI_BITFIELDS = 0x03, + BI_JPEG = 0x04, + BI_PNG = 0x05, + BI_ALPHABITFIELDS = 0x06, + + BI_CMYK = 0x0B, + BI_CMYKRLE8 = 0x0C, + BI_CMYKRLE4 = 0x0D, + + } + public struct BMPFileHeader + { + public ushort magic; // "BM" + public uint filesize; + public uint reserved; + public uint offset; + } + public struct BitmapInfoHeader + { + public uint size; + public int width; + public int height; + public ushort nColorPlanes; // always 1 + public ushort nBitsPerPixel; // [1,4,8,16,24,32] + public BMPComressionMode compressionMethod; + public uint rawImageSize; // can be "0" + public int xPPM; + public int yPPM; + public uint nPaletteColors; + public uint nImportantColors; + + public int absWidth { get { return Mathf.Abs(width); } } + public int absHeight { get { return Mathf.Abs(height); } } + + } + + public class BMPImage + { + public BMPFileHeader header; + public BitmapInfoHeader info; + public uint rMask = 0x00FF0000; + public uint gMask = 0x0000FF00; + public uint bMask = 0x000000FF; + public uint aMask = 0x00000000; + public List palette; + public Color32[] imageData; + public Texture2D ToTexture2D() + { + var tex = new Texture2D(info.absWidth, info.absHeight); + tex.SetPixels32(imageData); + tex.Apply(); + return tex; + } + } + + + public class BMPLoader + { + const ushort MAGIC = 0x4D42; // "BM" little endian + public bool ReadPaletteAlpha = false; + public bool ForceAlphaReadWhenPossible = false; + + public BMPImage LoadBMP(string aFileName) + { + using (var file = File.OpenRead(aFileName)) + return LoadBMP(file); + } + public BMPImage LoadBMP(byte[] aData) + { + using (var stream = new MemoryStream(aData)) + return LoadBMP(stream); + } + + public BMPImage LoadBMP(Stream aData) + { + using (var reader = new BinaryReader(aData)) + return LoadBMP(reader); + + } + public BMPImage LoadBMP(BinaryReader aReader) + { + BMPImage bmp = new BMPImage(); + if (!ReadFileHeader(aReader, ref bmp.header)) + { + Debug.LogError("Not a BMP file"); + return null; + } + if (!ReadInfoHeader(aReader, ref bmp.info)) + { + Debug.LogError("Unsupported header format"); + return null; + } + if (bmp.info.compressionMethod != BMPComressionMode.BI_RGB + && bmp.info.compressionMethod != BMPComressionMode.BI_BITFIELDS + && bmp.info.compressionMethod != BMPComressionMode.BI_ALPHABITFIELDS + && bmp.info.compressionMethod != BMPComressionMode.BI_RLE4 + && bmp.info.compressionMethod != BMPComressionMode.BI_RLE8 + ) + { + Debug.LogError("Unsupported image format: " + bmp.info.compressionMethod); + return null; + } + long offset = 14 + bmp.info.size; + aReader.BaseStream.Seek(offset, SeekOrigin.Begin); + if (bmp.info.nBitsPerPixel < 24) + { + bmp.rMask = 0x00007C00; + bmp.gMask = 0x000003E0; + bmp.bMask = 0x0000001F; + } + + if (bmp.info.compressionMethod == BMPComressionMode.BI_BITFIELDS || bmp.info.compressionMethod == BMPComressionMode.BI_ALPHABITFIELDS) + { + bmp.rMask = aReader.ReadUInt32(); + bmp.gMask = aReader.ReadUInt32(); + bmp.bMask = aReader.ReadUInt32(); + } + if (ForceAlphaReadWhenPossible) + bmp.aMask = GetMask(bmp.info.nBitsPerPixel) ^ (bmp.rMask | bmp.gMask | bmp.bMask); + + if (bmp.info.compressionMethod == BMPComressionMode.BI_ALPHABITFIELDS) + bmp.aMask = aReader.ReadUInt32(); + + if (bmp.info.nPaletteColors > 0 || bmp.info.nBitsPerPixel <= 8) + bmp.palette = ReadPalette(aReader, bmp, ReadPaletteAlpha || ForceAlphaReadWhenPossible); + + + aReader.BaseStream.Seek(bmp.header.offset, SeekOrigin.Begin); + bool uncompressed = bmp.info.compressionMethod == BMPComressionMode.BI_RGB || + bmp.info.compressionMethod == BMPComressionMode.BI_BITFIELDS || + bmp.info.compressionMethod == BMPComressionMode.BI_ALPHABITFIELDS; + if (bmp.info.nBitsPerPixel == 32 && uncompressed) + Read32BitImage(aReader, bmp); + else if (bmp.info.nBitsPerPixel == 24 && uncompressed) + Read24BitImage(aReader, bmp); + else if (bmp.info.nBitsPerPixel == 16 && uncompressed) + Read16BitImage(aReader, bmp); + else if (bmp.info.compressionMethod == BMPComressionMode.BI_RLE4 && bmp.info.nBitsPerPixel == 4 && bmp.palette != null) + ReadIndexedImageRLE4(aReader, bmp); + else if (bmp.info.compressionMethod == BMPComressionMode.BI_RLE8 && bmp.info.nBitsPerPixel == 8 && bmp.palette != null) + ReadIndexedImageRLE8(aReader, bmp); + else if (uncompressed && bmp.info.nBitsPerPixel <= 8 && bmp.palette != null) + ReadIndexedImage(aReader, bmp); + else + { + Debug.LogError("Unsupported file format: " + bmp.info.compressionMethod + " BPP: " + bmp.info.nBitsPerPixel); + return null; + } + return bmp; + } + + + private static void Read32BitImage(BinaryReader aReader, BMPImage bmp) + { + int w = Mathf.Abs(bmp.info.width); + int h = Mathf.Abs(bmp.info.height); + Color32[] data = bmp.imageData = new Color32[w * h]; + if (aReader.BaseStream.Position + w * h * 4 > aReader.BaseStream.Length) + { + Debug.LogError("Unexpected end of file."); + return; + } + int shiftR = GetShiftCount(bmp.rMask); + int shiftG = GetShiftCount(bmp.gMask); + int shiftB = GetShiftCount(bmp.bMask); + int shiftA = GetShiftCount(bmp.aMask); + byte a = 255; + for (int i = 0; i < data.Length; i++) + { + uint v = aReader.ReadUInt32(); + byte r = (byte)((v & bmp.rMask) >> shiftR); + byte g = (byte)((v & bmp.gMask) >> shiftG); + byte b = (byte)((v & bmp.bMask) >> shiftB); + if (bmp.bMask != 0) + a = (byte)((v & bmp.aMask) >> shiftA); + data[i] = new Color32(r, g, b, a); + } + } + + + private static void Read24BitImage(BinaryReader aReader, BMPImage bmp) + { + int w = Mathf.Abs(bmp.info.width); + int h = Mathf.Abs(bmp.info.height); + int rowLength = ((24 * w + 31) / 32) * 4; + int count = rowLength * h; + int pad = rowLength - w * 3; + Color32[] data = bmp.imageData = new Color32[w * h]; + if (aReader.BaseStream.Position + count > aReader.BaseStream.Length) + { + Debug.LogError("Unexpected end of file. (Have " + (aReader.BaseStream.Position + count) + " bytes, expected " + aReader.BaseStream.Length + " bytes)"); + return; + } + int shiftR = GetShiftCount(bmp.rMask); + int shiftG = GetShiftCount(bmp.gMask); + int shiftB = GetShiftCount(bmp.bMask); + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + uint v = aReader.ReadByte() | ((uint)aReader.ReadByte() << 8) | ((uint)aReader.ReadByte() << 16); + byte r = (byte)((v & bmp.rMask) >> shiftR); + byte g = (byte)((v & bmp.gMask) >> shiftG); + byte b = (byte)((v & bmp.bMask) >> shiftB); + data[x + y * w] = new Color32(r, g, b, 255); + } + for (int i = 0; i < pad; i++) + aReader.ReadByte(); + } + } + + private static void Read16BitImage(BinaryReader aReader, BMPImage bmp) + { + int w = Mathf.Abs(bmp.info.width); + int h = Mathf.Abs(bmp.info.height); + int rowLength = ((16 * w + 31) / 32) * 4; + int count = rowLength * h; + int pad = rowLength - w * 2; + Color32[] data = bmp.imageData = new Color32[w * h]; + if (aReader.BaseStream.Position + count > aReader.BaseStream.Length) + { + Debug.LogError("Unexpected end of file. (Have " + (aReader.BaseStream.Position + count) + " bytes, expected " + aReader.BaseStream.Length + " bytes)"); + return; + } + int shiftR = GetShiftCount(bmp.rMask); + int shiftG = GetShiftCount(bmp.gMask); + int shiftB = GetShiftCount(bmp.bMask); + int shiftA = GetShiftCount(bmp.aMask); + byte a = 255; + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + uint v = aReader.ReadByte() | ((uint)aReader.ReadByte() << 8); + byte r = (byte)((v & bmp.rMask) >> shiftR); + byte g = (byte)((v & bmp.gMask) >> shiftG); + byte b = (byte)((v & bmp.bMask) >> shiftB); + if (bmp.aMask != 0) + a = (byte)((v & bmp.aMask) >> shiftA); + data[x + y * w] = new Color32(r, g, b, a); + } + for (int i = 0; i < pad; i++) + aReader.ReadByte(); + } + } + + private static void ReadIndexedImage(BinaryReader aReader, BMPImage bmp) + { + int w = Mathf.Abs(bmp.info.width); + int h = Mathf.Abs(bmp.info.height); + int bitCount = bmp.info.nBitsPerPixel; + int rowLength = ((bitCount * w + 31) / 32) * 4; + int count = rowLength * h; + int pad = rowLength - (w * bitCount + 7) / 8; + Color32[] data = bmp.imageData = new Color32[w * h]; + if (aReader.BaseStream.Position + count > aReader.BaseStream.Length) + { + Debug.LogError("Unexpected end of file. (Have " + (aReader.BaseStream.Position + count) + " bytes, expected " + aReader.BaseStream.Length + " bytes)"); + return; + } + BitStreamReader bitReader = new BitStreamReader(aReader); + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + int v = (int)bitReader.ReadBits(bitCount); + if (v >= bmp.palette.Count) + { + Debug.LogError("Indexed bitmap has indices greater than it's color palette"); + return; + } + data[x + y * w] = bmp.palette[v]; + } + bitReader.Flush(); + for (int i = 0; i < pad; i++) + aReader.ReadByte(); + } + } + private static void ReadIndexedImageRLE4(BinaryReader aReader, BMPImage bmp) + { + int w = Mathf.Abs(bmp.info.width); + int h = Mathf.Abs(bmp.info.height); + Color32[] data = bmp.imageData = new Color32[w * h]; + int x = 0; + int y = 0; + int yOffset = 0; + while (aReader.BaseStream.Position < aReader.BaseStream.Length - 1) + { + int count = (int)aReader.ReadByte(); + byte d = aReader.ReadByte(); + if (count > 0) + { + for (int i = (count / 2); i > 0; i--) + { + data[x++ + yOffset] = bmp.palette[(d >> 4) & 0x0F]; + data[x++ + yOffset] = bmp.palette[d & 0x0F]; + } + if ((count & 0x01) > 0) + { + data[x++ + yOffset] = bmp.palette[(d >> 4) & 0x0F]; + } + } + else + { + if (d == 0) + { + x = 0; + y += 1; + yOffset = y * w; + } + else if (d == 1) + { + break; + } + else if (d == 2) + { + x += aReader.ReadByte(); + y += aReader.ReadByte(); + yOffset = y * w; + } + else + { + for (int i = (d / 2); i > 0; i--) + { + byte d2 = aReader.ReadByte(); + data[x++ + yOffset] = bmp.palette[(d2 >> 4) & 0x0F]; + data[x++ + yOffset] = bmp.palette[d2 & 0x0F]; + } + if ((d & 0x01) > 0) + { + data[x++ + yOffset] = bmp.palette[(aReader.ReadByte() >> 4) & 0x0F]; + } + if ((((d - 1) / 2) & 1) == 0) + { + aReader.ReadByte(); // padding (word alignment) + } + } + } + } + } + private static void ReadIndexedImageRLE8(BinaryReader aReader, BMPImage bmp) + { + int w = Mathf.Abs(bmp.info.width); + int h = Mathf.Abs(bmp.info.height); + Color32[] data = bmp.imageData = new Color32[w * h]; + int x = 0; + int y = 0; + int yOffset = 0; + while (aReader.BaseStream.Position < aReader.BaseStream.Length - 1) + { + int count = (int)aReader.ReadByte(); + byte d = aReader.ReadByte(); + if (count > 0) + { + for (int i = count; i > 0; i--) + { + data[x++ + yOffset] = bmp.palette[d]; + } + } + else + { + if (d == 0) + { + x = 0; + y += 1; + yOffset = y * w; + } + else if (d == 1) + { + break; + } + else if (d == 2) + { + x += aReader.ReadByte(); + y += aReader.ReadByte(); + yOffset = y * w; + } + else + { + for (int i = d; i > 0; i--) + { + data[x++ + yOffset] = bmp.palette[aReader.ReadByte()]; + } + if ((d & 0x01) > 0) + { + aReader.ReadByte(); // padding (word alignment) + } + } + } + } + } + private static int GetShiftCount(uint mask) + { + for (int i = 0; i < 32; i++) + { + if ((mask & 0x01) > 0) + return i; + mask >>= 1; + } + return -1; + } + private static uint GetMask(int bitCount) + { + uint mask = 0; + for (int i = 0; i < bitCount; i++) + { + mask <<= 1; + mask |= 0x01; + } + return mask; + } + private static bool ReadFileHeader(BinaryReader aReader, ref BMPFileHeader aFileHeader) + { + aFileHeader.magic = aReader.ReadUInt16(); + if (aFileHeader.magic != MAGIC) + return false; + aFileHeader.filesize = aReader.ReadUInt32(); + aFileHeader.reserved = aReader.ReadUInt32(); + aFileHeader.offset = aReader.ReadUInt32(); + return true; + } + private static bool ReadInfoHeader(BinaryReader aReader, ref BitmapInfoHeader aHeader) + { + aHeader.size = aReader.ReadUInt32(); + if (aHeader.size < 40) + return false; + aHeader.width = aReader.ReadInt32(); + aHeader.height = aReader.ReadInt32(); + aHeader.nColorPlanes = aReader.ReadUInt16(); + aHeader.nBitsPerPixel = aReader.ReadUInt16(); + aHeader.compressionMethod = (BMPComressionMode)aReader.ReadInt32(); + aHeader.rawImageSize = aReader.ReadUInt32(); + aHeader.xPPM = aReader.ReadInt32(); + aHeader.yPPM = aReader.ReadInt32(); + aHeader.nPaletteColors = aReader.ReadUInt32(); + aHeader.nImportantColors = aReader.ReadUInt32(); + int pad = (int)aHeader.size - 40; + if (pad > 0) + aReader.ReadBytes(pad); + return true; + } + public static List ReadPalette(BinaryReader aReader, BMPImage aBmp, bool aReadAlpha) + { + uint count = aBmp.info.nPaletteColors; + if (count == 0u) + count = 1u << aBmp.info.nBitsPerPixel; + var palette = new List((int)count); + for (int i = 0; i < count; i++) + { + byte b = aReader.ReadByte(); + byte g = aReader.ReadByte(); + byte r = aReader.ReadByte(); + byte a = aReader.ReadByte(); + if (!aReadAlpha) + a = 255; + palette.Add(new Color32(r, g, b, a)); + } + return palette; + } + + } + public class BitStreamReader + { + BinaryReader m_Reader; + byte m_Data = 0; + int m_Bits = 0; + + public BitStreamReader(BinaryReader aReader) + { + m_Reader = aReader; + } + public BitStreamReader(Stream aStream) : this(new BinaryReader(aStream)) { } + + public byte ReadBit() + { + if (m_Bits <= 0) + { + m_Data = m_Reader.ReadByte(); + m_Bits = 8; + } + return (byte)((m_Data >> --m_Bits) & 1); + } + + public ulong ReadBits(int aCount) + { + ulong val = 0UL; + if (aCount <= 0 || aCount > 32) + throw new System.ArgumentOutOfRangeException("aCount", "aCount must be between 1 and 32 inclusive"); + for (int i = aCount - 1; i >= 0; i--) + val |= ((ulong)ReadBit() << i); + return val; + } + public void Flush() + { + m_Data = 0; + m_Bits = 0; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs.meta new file mode 100644 index 00000000..f8c815ce --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BMPLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27d41db6b761bbb4a989566820e47137 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs new file mode 100644 index 00000000..44fc91e7 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; + +namespace Dummiesman +{ + public static class BinaryExtensions + { + public static Color32 ReadColor32RGBR(this BinaryReader r) + { + var bytes = r.ReadBytes(4); + return new Color32(bytes[0], bytes[1], bytes[2], 255); + } + + public static Color32 ReadColor32RGBA(this BinaryReader r) + { + var bytes = r.ReadBytes(4); + return new Color32(bytes[0], bytes[1], bytes[2], bytes[3]); + } + + public static Color32 ReadColor32RGB(this BinaryReader r) + { + var bytes = r.ReadBytes(3); + return new Color32(bytes[0], bytes[1], bytes[2], 255); + } + + public static Color32 ReadColor32BGR(this BinaryReader r) + { + var bytes = r.ReadBytes(3); + return new Color32(bytes[2], bytes[1], bytes[0], 255); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs.meta new file mode 100644 index 00000000..0e891010 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/BinaryExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b61b2ce827ad8842a6812f45f25aaa1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs new file mode 100644 index 00000000..fd0de3a2 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Dummiesman.Extensions +{ + public static class ColorExtensions + { + public static Color FlipRB(this Color color) + { + return new Color(color.b, color.g, color.r, color.a); + } + + public static Color32 FlipRB(this Color32 color) + { + return new Color32(color.b, color.g, color.r, color.a); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs.meta new file mode 100644 index 00000000..6309c284 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ColorExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8034e4bf991d15a4b88970b534ce4a0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs new file mode 100644 index 00000000..3fb04e3d --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEngine; + +namespace Dummiesman +{ + public static class DDSLoader + { + public static Texture2D Load(Stream ddsStream) + { + byte[] buffer = new byte[ddsStream.Length]; + ddsStream.Read(buffer, 0, (int)ddsStream.Length); + return Load(buffer); + } + + public static Texture2D Load(string ddsPath) + { + return Load(File.ReadAllBytes(ddsPath)); + } + + public static Texture2D Load(byte[] ddsBytes) + { + try + { + + //do size check + byte ddsSizeCheck = ddsBytes[4]; + if (ddsSizeCheck != 124) + throw new System.Exception("Invalid DDS header. Structure length is incrrrect."); //this header byte should be 124 for DDS image files + + //verify we have a readable tex + byte DXTType = ddsBytes[87]; + if (DXTType != 49 && DXTType != 53) + throw new System.Exception("Cannot load DDS due to an unsupported pixel format. Needs to be DXT1 or DXT5."); + + int height = ddsBytes[13] * 256 + ddsBytes[12]; + int width = ddsBytes[17] * 256 + ddsBytes[16]; + bool mipmaps = ddsBytes[28] > 0; + TextureFormat textureFormat = DXTType == 49 ? TextureFormat.DXT1 : TextureFormat.DXT5; + + int DDS_HEADER_SIZE = 128; + byte[] dxtBytes = new byte[ddsBytes.Length - DDS_HEADER_SIZE]; + Buffer.BlockCopy(ddsBytes, DDS_HEADER_SIZE, dxtBytes, 0, ddsBytes.Length - DDS_HEADER_SIZE); + + Texture2D texture = new Texture2D(width, height, textureFormat, mipmaps); + texture.LoadRawTextureData(dxtBytes); + texture.Apply(); + + return texture; + } + catch (System.Exception ex) + { + throw new Exception("An error occured while loading DirectDraw Surface: " + ex.Message); + } + } + } +} diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs.meta new file mode 100644 index 00000000..351c9ab9 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/DDSLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f9e65e68712e0f41aae633289ab739e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs new file mode 100644 index 00000000..cf41e651 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs @@ -0,0 +1,158 @@ +/* + * Created by Dummiesman 2013-2019 + * Thanks to mikezila for improving the initial TGA loading code +*/ + +using System; +using UnityEngine; +using System.Collections; +using System.IO; +using B83.Image.BMP; + +namespace Dummiesman +{ + public class ImageLoader + { + /// + /// Converts a DirectX normal map to Unitys expected format + /// + /// Texture to convert + public static void SetNormalMap(ref Texture2D tex) + { + Color[] pixels = tex.GetPixels(); + for (int i = 0; i < pixels.Length; i++) + { + Color temp = pixels[i]; + temp.r = pixels[i].g; + temp.a = pixels[i].r; + pixels[i] = temp; + } + tex.SetPixels(pixels); + tex.Apply(true); + } + + public enum TextureFormat + { + DDS, + TGA, + BMP, + PNG, + JPG, + CRN + } + + + /// + /// Loads a texture from a stream + /// + /// The stream + /// The format **NOT UNITYENGINE.TEXTUREFORMAT** + /// + public static Texture2D LoadTexture(Stream stream, TextureFormat format) + { + if (format == TextureFormat.BMP) + { + return new BMPLoader().LoadBMP(stream).ToTexture2D(); + } + else if (format == TextureFormat.DDS) + { + return DDSLoader.Load(stream); + } + else if (format == TextureFormat.JPG || format == TextureFormat.PNG) + { + byte[] buffer = new byte[stream.Length]; + stream.Read(buffer, 0, (int)stream.Length); + + Texture2D texture = new Texture2D(1, 1); + texture.LoadImage(buffer); + return texture; + } + else if (format == TextureFormat.TGA) + { + return TGALoader.Load(stream); + } + else + { + return null; + } + } + + + /// + /// Loads a texture from a file + /// + /// + /// + /// + public static Texture2D LoadTexture(string fn) + { + if (!File.Exists(fn)) + return null; + + var textureBytes = File.ReadAllBytes(fn); + string ext = Path.GetExtension(fn).ToLower(); + string name = Path.GetFileName(fn); + Texture2D returnTex = null; + + switch (ext) + { + case ".png": + case ".jpg": + case ".jpeg": + returnTex = new Texture2D(1, 1); + returnTex.LoadImage(textureBytes); + break; + case ".dds": + returnTex = DDSLoader.Load(textureBytes); + break; + case ".tga": + returnTex = TGALoader.Load(textureBytes); + break; + case ".bmp": + returnTex = new BMPLoader().LoadBMP(textureBytes).ToTexture2D(); + break; + case ".crn": + byte[] crnBytes = textureBytes; + ushort crnWidth = System.BitConverter.ToUInt16(new byte[2] { crnBytes[13], crnBytes[12] }, 0); + ushort crnHeight = System.BitConverter.ToUInt16(new byte[2] { crnBytes[15], crnBytes[14] }, 0); + byte crnFormatByte = crnBytes[18]; + + var crnTextureFormat = UnityEngine.TextureFormat.RGB24; + if (crnFormatByte == 0) + { + crnTextureFormat = UnityEngine.TextureFormat.DXT1Crunched; + }else if(crnFormatByte == 2) + { + crnTextureFormat = UnityEngine.TextureFormat.DXT5Crunched; + } + else if(crnFormatByte == 12) + { + crnTextureFormat = UnityEngine.TextureFormat.ETC2_RGBA8Crunched; + } + else + { + Debug.LogError("Could not load crunched texture " + name + " because its format is not supported (" + crnFormatByte + "): " + fn); + break; + } + + returnTex = new Texture2D(crnWidth, crnHeight, crnTextureFormat, true); + returnTex.LoadRawTextureData(crnBytes); + returnTex.Apply(true); + + break; + default: + Debug.LogError("Could not load texture " + name + " because its format is not supported : " + fn); + break; + } + + if (returnTex != null) + { + returnTex = ImageLoaderHelper.VerifyFormat(returnTex); + returnTex.name = Path.GetFileNameWithoutExtension(fn); + } + + return returnTex; + } + + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs.meta new file mode 100644 index 00000000..7fb46d07 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 075edea996ccdd6489ad5e1197dd3f67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs new file mode 100644 index 00000000..01b69e2f --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace Dummiesman +{ + public class ImageLoaderHelper + { + /// + /// Verifies that a 32bpp texture is actuall 32bpp + /// + /// The verified texture + public static Texture2D VerifyFormat(Texture2D tex) + { + if (tex.format != UnityEngine.TextureFormat.ARGB32 && tex.format != UnityEngine.TextureFormat.RGBA32 && tex.format != UnityEngine.TextureFormat.DXT5) + return tex; + + //get pixels + var pixels = tex.GetPixels32(); + bool validFormat = false; + + //check each pixel alpha + foreach(var px in pixels) + { + if(px.a < 255) + { + validFormat = true; + break; + } + } + + //if it's not a valid format return a new 24bpp image + if (!validFormat) + { + var tex24 = new Texture2D(tex.width, tex.height, UnityEngine.TextureFormat.RGB24, tex.mipmapCount > 0); + tex24.SetPixels32(pixels); + tex24.Apply(true); + return tex24; + } + + //return original if valid + return tex; + } + + /// + /// A cluster for creating arrays of Unity Color + /// + /// + /// + /// + /// + public static void FillPixelArray(Color32[] fillArray, byte[] pixelData, int bytesPerPixel, bool bgra = false) + { + //special case for TGA :( + if (bgra) + { + if (bytesPerPixel == 4) + { + for (int i = 0; i < fillArray.Length; i++) + { + int bi = i * bytesPerPixel; + fillArray[i] = new Color32(pixelData[bi + 2], pixelData[bi + 1], pixelData[bi], pixelData[bi + 3]); + } + } + else + { + //24 bit BGR to Color32 (RGBA) + //this is faster than safe code + for (int i = 0; i < fillArray.Length; i++) + { + fillArray[i].r = pixelData[(i * 3) + 2]; + fillArray[i].g = pixelData[(i * 3) + 1]; + fillArray[i].b = pixelData[(i * 3) + 0]; + } + } + } + else + { + if (bytesPerPixel == 4) + { + for (int i = 0; i < fillArray.Length; i++) + { + fillArray[i].r = pixelData[i * 4]; + fillArray[i].g = pixelData[(i * 4) + 1]; + fillArray[i].b = pixelData[(i * 4) + 2]; + fillArray[i].a = pixelData[(i * 4) + 3]; + } + } + else + { + //with RGB we can't! :( + int bi = 0; + for (int i = 0; i < fillArray.Length; i++) + { + fillArray[i].r = pixelData[bi++]; + fillArray[i].g = pixelData[bi++]; + fillArray[i].b = pixelData[bi++]; + fillArray[i].a = 255; + } + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs.meta new file mode 100644 index 00000000..c0538673 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageLoaderHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8658e22fc9a3c94ab5d8c6460812b69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs new file mode 100644 index 00000000..136d260b --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs @@ -0,0 +1,35 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Dummiesman +{ + public static class ImageUtils + { + public static Texture2D ConvertToNormalMap(Texture2D tex) + { + Texture2D returnTex = tex; + if(tex.format != TextureFormat.RGBA32 && tex.format != TextureFormat.ARGB32) + { + returnTex = new Texture2D(tex.width, tex.height, TextureFormat.RGBA32, true); + } + + Color[] pixels = tex.GetPixels(); + for (int i = 0; i < pixels.Length; i++) + { + Color temp = pixels[i]; + temp.a = pixels[i].r; + temp.r = 0f; + temp.g = pixels[i].g; + temp.b = 0f; + pixels[i] = temp; + } + + returnTex.SetPixels(pixels); + returnTex.Apply(true); + return returnTex; + } + + } +} + diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs.meta new file mode 100644 index 00000000..13bbb3db --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/ImageUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 594f0c9c36902bc4aa1e6fd12ae28fd0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs new file mode 100644 index 00000000..c4d351d4 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs @@ -0,0 +1,127 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System.IO; +using System; +using Dummiesman.Extensions; +using System.Runtime.InteropServices; + +namespace Dummiesman +{ + public class TGALoader + { + private static int GetBits(byte b, int offset, int count) + { + return (b >> offset) & ((1 << count) - 1); + } + + private static Color32[] LoadRawTGAData(BinaryReader r, int bitDepth, int width, int height) + { + Color32[] pulledColors = new Color32[width * height]; + + byte[] colorData = r.ReadBytes(width * height * (bitDepth / 8)); + ImageLoaderHelper.FillPixelArray(pulledColors, colorData, (bitDepth / 8), true); + + return pulledColors; + } + + private static Color32[] LoadRLETGAData(BinaryReader r, int bitDepth, int width, int height) + { + Color32[] pulledColors = new Color32[width * height]; + int pulledColorCount = 0; + + while (pulledColorCount < pulledColors.Length) + { + byte rlePacket = r.ReadByte(); + int RLEPacketType = GetBits(rlePacket, 7, 1); + int RLEPixelCount = GetBits(rlePacket, 0, 7) + 1; + + + if (RLEPacketType == 0) + { + //raw packet + for (int i = 0; i < RLEPixelCount; i++) + { + var color = (bitDepth == 32) ? r.ReadColor32RGBA().FlipRB() : r.ReadColor32RGB().FlipRB(); + pulledColors[i + pulledColorCount] = color; + } + + } + else + { + //rle packet + var color = (bitDepth == 32) ? r.ReadColor32RGBA().FlipRB() : r.ReadColor32RGB().FlipRB(); + + for (int i = 0; i < RLEPixelCount; i++) + { + pulledColors[i + pulledColorCount] = color; + } + } + + pulledColorCount += RLEPixelCount; + } + + return pulledColors; + } + + public static Texture2D Load(string fileName) + { + using (var imageFile = File.OpenRead(fileName)) + { + return Load(imageFile); + } + } + + public static Texture2D Load(byte[] bytes) + { + using (var ms = new MemoryStream(bytes)) + { + return Load(ms); + } + } + + public static Texture2D Load(Stream TGAStream) + { + + using (BinaryReader r = new BinaryReader(TGAStream)) + { + // Skip some header info we don't care about. + r.BaseStream.Seek(2, SeekOrigin.Begin); + + byte imageType = r.ReadByte(); + if (imageType != 10 && imageType != 2) + { + Debug.LogError($"Unsupported targa image type. ({imageType})"); + return null; + } + + //Skip right to some more data we need + r.BaseStream.Seek(12, SeekOrigin.Begin); + + short width = r.ReadInt16(); + short height = r.ReadInt16(); + int bitDepth = r.ReadByte(); + + if (bitDepth < 24) + throw new Exception("Tried to load TGA with unsupported bit depth"); + + // Skip a byte of header information we don't care about. + r.BaseStream.Seek(1, SeekOrigin.Current); + + Texture2D tex = new Texture2D(width, height, (bitDepth == 24) ? TextureFormat.RGB24 : TextureFormat.ARGB32, true); + if (imageType == 2) + { + tex.SetPixels32(LoadRawTGAData(r, bitDepth, width, height)); + } + else + { + tex.SetPixels32(LoadRLETGAData(r, bitDepth, width, height)); + } + + tex.Apply(); + return tex; + + } + } + } +} diff --git a/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs.meta b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs.meta new file mode 100644 index 00000000..3c90b240 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/OBJImport/TextureLoader/TGALoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b682979498a095418396a690d23c0b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs b/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs new file mode 100644 index 00000000..004fc338 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs @@ -0,0 +1,482 @@ +using System; +using UnityEngine; + +/// https://wiki.unity3d.com/index.php/ProceduralPrimitives +public class ProceduralMesh +{ + public static Mesh CreateBox(in float length = 1f, in float width = 1f, in float height = 1f) + { + Mesh mesh = new Mesh(); + mesh.Clear(); + mesh.name = "Box"; + + #region Vertices + var p0 = new Vector3(-length * .5f, -width * .5f, height * .5f); + var p1 = new Vector3(length * .5f, -width * .5f, height * .5f); + var p2 = new Vector3(length * .5f, -width * .5f, -height * .5f); + var p3 = new Vector3(-length * .5f, -width * .5f, -height * .5f); + + var p4 = new Vector3(-length * .5f, width * .5f, height * .5f); + var p5 = new Vector3(length * .5f, width * .5f, height * .5f); + var p6 = new Vector3(length * .5f, width * .5f, -height * .5f); + var p7 = new Vector3(-length * .5f, width * .5f, -height * .5f); + + Vector3[] vertices = new Vector3[] + { + p0, p1, p2, p3, // Bottom + p7, p4, p0, p3, // Left + p4, p5, p1, p0, // Front + p6, p7, p3, p2, // Back + p5, p6, p2, p1, // Right + p7, p6, p5, p4 // Top + }; + #endregion + + #region Normales + var up = Vector3.up; + var down = Vector3.down; + var front = Vector3.forward; + var back = Vector3.back; + var left = Vector3.left; + var right = Vector3.right; + + Vector3[] normales = new Vector3[] + { + down, down, down, down, // Bottom + left, left, left, left, // Left + front, front, front, front, // Front + back, back, back, back, // Back + right, right, right, right, // Right + up, up, up, up // Top + }; + #endregion + + #region UVs + Vector2 _00 = new Vector2(0f, 0f); + Vector2 _10 = new Vector2(1f, 0f); + Vector2 _01 = new Vector2(0f, 1f); + Vector2 _11 = new Vector2(1f, 1f); + + Vector2[] uvs = new Vector2[] + { + _11, _01, _00, _10, // Bottom + _11, _01, _00, _10, // Left + _11, _01, _00, _10, // Front + _11, _01, _00, _10, // Back + _11, _01, _00, _10, // Right + _11, _01, _00, _10, // Top + }; + #endregion + + #region Triangles + int[] triangles = new int[] + { + // Bottom + 3, 1, 0, + 3, 2, 1, + + // Left + 3 + 4 * 1, 1 + 4 * 1, 0 + 4 * 1, + 3 + 4 * 1, 2 + 4 * 1, 1 + 4 * 1, + + // Front + 3 + 4 * 2, 1 + 4 * 2, 0 + 4 * 2, + 3 + 4 * 2, 2 + 4 * 2, 1 + 4 * 2, + + // Back + 3 + 4 * 3, 1 + 4 * 3, 0 + 4 * 3, + 3 + 4 * 3, 2 + 4 * 3, 1 + 4 * 3, + + // Right + 3 + 4 * 4, 1 + 4 * 4, 0 + 4 * 4, + 3 + 4 * 4, 2 + 4 * 4, 1 + 4 * 4, + + // Top + 3 + 4 * 5, 1 + 4 * 5, 0 + 4 * 5, + 3 + 4 * 5, 2 + 4 * 5, 1 + 4 * 5, + }; + #endregion + + mesh.vertices = vertices; + mesh.normals = normales; + mesh.uv = uvs; + mesh.triangles = triangles; + + mesh.RecalculateBounds(); + mesh.Optimize(); + + return mesh; + } + + public static Mesh CreateCylinder(in float radius = 1f, in float height = 1f, in int nbSides = 36) + { + return CreateCone(radius, radius, height, nbSides); + } + + public static Mesh CreateCone(in float topRadius = .01f, in float bottomRadius = 0.5f, in float height = 1f, in int nbSides = 18) + { + Mesh mesh = new Mesh(); + mesh.Clear(); + mesh.name = (topRadius.Equals(bottomRadius)) ? "Cylinder" : "Cone"; + + float heightHalf = height / 2; + const int nbHeightSeg = 1; // Not implemented yet + + int nbVerticesCap = nbSides + 1; + + #region Vertices + // bottom + top + sides + Vector3[] vertices = new Vector3[nbVerticesCap + nbVerticesCap + nbSides * nbHeightSeg * 2 + 2]; + int vert = 0; + float _2pi = Mathf.PI * 2f; + + // Bottom cap + vertices[vert++] = new Vector3(0f, -heightHalf, 0f); + while (vert <= nbSides) + { + float rad = (float)vert / nbSides * _2pi; + vertices[vert] = new Vector3(Mathf.Cos(rad) * bottomRadius, -heightHalf, Mathf.Sin(rad) * bottomRadius); + vert++; + } + + // Top cap + vertices[vert++] = new Vector3(0f, heightHalf, 0f); + while (vert <= nbSides * 2 + 1) + { + float rad = (float)(vert - nbSides - 1) / nbSides * _2pi; + vertices[vert] = new Vector3(Mathf.Cos(rad) * topRadius, heightHalf, Mathf.Sin(rad) * topRadius); + vert++; + } + + // Sides + int v = 0; + while (vert <= vertices.Length - 4) + { + float rad = (float)v / nbSides * _2pi; + vertices[vert] = new Vector3(Mathf.Cos(rad) * topRadius, heightHalf, Mathf.Sin(rad) * topRadius); + vertices[vert + 1] = new Vector3(Mathf.Cos(rad) * bottomRadius, -heightHalf, Mathf.Sin(rad) * bottomRadius); + vert += 2; + v++; + } + vertices[vert] = vertices[nbSides * 2 + 2]; + vertices[vert + 1] = vertices[nbSides * 2 + 3]; + #endregion + + #region Normales + + // bottom + top + sides + Vector3[] normales = new Vector3[vertices.Length]; + vert = 0; + + // Bottom cap + while (vert <= nbSides) + { + normales[vert++] = Vector3.down; + } + + // Top cap + while (vert <= nbSides * 2 + 1) + { + normales[vert++] = Vector3.up; + } + + // Sides + v = 0; + while (vert <= vertices.Length - 4) + { + float rad = (float)v / nbSides * _2pi; + float cos = Mathf.Cos(rad); + float sin = Mathf.Sin(rad); + + normales[vert] = new Vector3(cos, 0f, sin); + normales[vert + 1] = normales[vert]; + + vert += 2; + v++; + } + normales[vert] = normales[nbSides * 2 + 2]; + normales[vert + 1] = normales[nbSides * 2 + 3]; + #endregion + + #region UVs + Vector2[] uvs = new Vector2[vertices.Length]; + + // Bottom cap + int u = 0; + uvs[u++] = new Vector2(0.5f, 0.5f); + while (u <= nbSides) + { + float rad = (float)u / nbSides * _2pi; + uvs[u] = new Vector2(Mathf.Cos(rad) * .5f + .5f, Mathf.Sin(rad) * .5f + .5f); + u++; + } + + // Top cap + uvs[u++] = new Vector2(0.5f, 0.5f); + while (u <= nbSides * 2 + 1) + { + float rad = (float)u / nbSides * _2pi; + uvs[u] = new Vector2(Mathf.Cos(rad) * .5f + .5f, Mathf.Sin(rad) * .5f + .5f); + u++; + } + + // Sides + int u_sides = 0; + while (u <= uvs.Length - 4) + { + float t = (float)u_sides / nbSides; + uvs[u] = new Vector3(t, 1f); + uvs[u + 1] = new Vector3(t, 0f); + u += 2; + u_sides++; + } + uvs[u] = new Vector2(1f, 1f); + uvs[u + 1] = new Vector2(1f, 0f); + #endregion + + #region Triangles + int nbTriangles = nbSides + nbSides + nbSides * 2; + int[] triangles = new int[nbTriangles * 3 + 3]; + + // Bottom cap + int tri = 0; + int i = 0; + while (tri < nbSides - 1) + { + triangles[i] = 0; + triangles[i + 1] = tri + 1; + triangles[i + 2] = tri + 2; + tri++; + i += 3; + } + triangles[i] = 0; + triangles[i + 1] = tri + 1; + triangles[i + 2] = 1; + tri++; + i += 3; + + // Top cap + //tri++; + while (tri < nbSides * 2) + { + triangles[i] = tri + 2; + triangles[i + 1] = tri + 1; + triangles[i + 2] = nbVerticesCap; + tri++; + i += 3; + } + + triangles[i] = nbVerticesCap + 1; + triangles[i + 1] = tri + 1; + triangles[i + 2] = nbVerticesCap; + tri++; + i += 3; + tri++; + + // Sides + while (tri <= nbTriangles) + { + triangles[i] = tri + 2; + triangles[i + 1] = tri + 1; + triangles[i + 2] = tri + 0; + tri++; + i += 3; + + triangles[i] = tri + 1; + triangles[i + 1] = tri + 2; + triangles[i + 2] = tri + 0; + tri++; + i += 3; + } + #endregion + + mesh.vertices = vertices; + mesh.normals = normales; + mesh.uv = uvs; + mesh.triangles = triangles; + + mesh.RecalculateTangents(); + mesh.RecalculateBounds(); + mesh.RecalculateNormals(); + mesh.Optimize(); + + return mesh; + } + + + // Longitude ||| + // Latitude --- + public static Mesh CreateSphere(in float radius = 1f, int nbLong = 24, int nbLat = 16) + { + Mesh mesh = new Mesh(); + mesh.Clear(); + mesh.name = "Sphere"; + + #region Vertices + Vector3[] vertices = new Vector3[(nbLong + 1) * nbLat + 2]; + float _pi = Mathf.PI; + float _2pi = _pi * 2f; + + vertices[0] = Vector3.up * radius; + for (int lat = 0; lat < nbLat; lat++) + { + float a1 = _pi * (float)(lat + 1) / (nbLat + 1); + float sin1 = Mathf.Sin(a1); + float cos1 = Mathf.Cos(a1); + + for (int lon = 0; lon <= nbLong; lon++) + { + float a2 = _2pi * (float)(lon == nbLong ? 0 : lon) / nbLong; + float sin2 = Mathf.Sin(a2); + float cos2 = Mathf.Cos(a2); + + vertices[lon + lat * (nbLong + 1) + 1] = new Vector3(sin1 * cos2, cos1, sin1 * sin2) * radius; + } + } + vertices[vertices.Length - 1] = Vector3.up * -radius; + #endregion + + #region Normales + Vector3[] normales = new Vector3[vertices.Length]; + for (int n = 0; n < vertices.Length; n++) + normales[n] = vertices[n].normalized; + #endregion + + #region UVs + Vector2[] uvs = new Vector2[vertices.Length]; + uvs[0] = Vector2.up; + uvs[uvs.Length - 1] = Vector2.zero; + for (int lat = 0; lat < nbLat; lat++) + for (int lon = 0; lon <= nbLong; lon++) + uvs[lon + lat * (nbLong + 1) + 1] = new Vector2((float)lon / nbLong, 1f - (float)(lat + 1) / (nbLat + 1)); + #endregion + + #region Triangles + int nbFaces = vertices.Length; + int nbTriangles = nbFaces * 2; + int nbIndexes = nbTriangles * 3; + int[] triangles = new int[nbIndexes]; + + //Top Cap + int i = 0; + for (int lon = 0; lon < nbLong; lon++) + { + triangles[i++] = lon + 2; + triangles[i++] = lon + 1; + triangles[i++] = 0; + } + + //Middle + for (int lat = 0; lat < nbLat - 1; lat++) + { + for (int lon = 0; lon < nbLong; lon++) + { + int current = lon + lat * (nbLong + 1) + 1; + int next = current + nbLong + 1; + + triangles[i++] = current; + triangles[i++] = current + 1; + triangles[i++] = next + 1; + + triangles[i++] = current; + triangles[i++] = next + 1; + triangles[i++] = next; + } + } + + //Bottom Cap + for (int lon = 0; lon < nbLong; lon++) + { + triangles[i++] = vertices.Length - 1; + triangles[i++] = vertices.Length - (lon + 2) - 1; + triangles[i++] = vertices.Length - (lon + 1) - 1; + } + #endregion + + mesh.vertices = vertices; + mesh.normals = normales; + mesh.uv = uvs; + mesh.triangles = triangles; + + mesh.RecalculateBounds(); + mesh.Optimize(); + + return mesh; + } + + // 2 minimum + public static Mesh CreatePlane(in float length = 1f, in float width = 1f, Vector3 normal = default(Vector3), in int resX = 2, in int resZ = 2) + { + if (normal.Equals(default(Vector3))) + { + normal = Vector3.up; + } + + Mesh mesh = new Mesh(); + mesh.Clear(); + mesh.name = "Plane"; + + #region Vertices + Vector3[] vertices = new Vector3[resX * resZ]; + for (int z = 0; z < resZ; z++) + { + // [ -length / 2, length / 2 ] + float zPos = ((float)z / (resZ - 1) - .5f) * length; + for (int x = 0; x < resX; x++) + { + // [ -width / 2, width / 2 ] + float xPos = ((float)x / (resX - 1) - .5f) * width; + vertices[x + z * resX] = new Vector3(xPos, 0f, zPos); + } + } + #endregion + + #region Normales + Vector3[] normales = new Vector3[vertices.Length]; + for (int n = 0; n < normales.Length; n++) + { + normales[n] = normal; + } + #endregion + + #region UVs + Vector2[] uvs = new Vector2[vertices.Length]; + for (int v = 0; v < resZ; v++) + { + for (int u = 0; u < resX; u++) + { + uvs[u + v * resX] = new Vector2((float)u / (resX - 1), (float)v / (resZ - 1)); + } + } + #endregion + + #region Triangles + int nbFaces = (resX - 1) * (resZ - 1); + int[] triangles = new int[nbFaces * 6]; + int t = 0; + for (int face = 0; face < nbFaces; face++) + { + // Retrieve lower left corner from face ind + int i = face % (resX - 1) + (face / (resZ - 1) * resX); + + triangles[t++] = i + resX; + triangles[t++] = i + 1; + triangles[t++] = i; + + triangles[t++] = i + resX; + triangles[t++] = i + resX + 1; + triangles[t++] = i + 1; + } + #endregion + + mesh.vertices = vertices; + mesh.normals = normales; + mesh.uv = uvs; + mesh.triangles = triangles; + + mesh.RecalculateBounds(); + mesh.Optimize(); + + return mesh; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs.meta b/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs.meta new file mode 100644 index 00000000..2631f85d --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/ProdeceduralMesh.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68fa5e4aa376d85a0af3e8514de3520f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl.meta b/Assets/Scripts/Tools/Mesh/pb_Stl.meta new file mode 100644 index 00000000..9c5d87fc --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: beaaceb919c9d2dc38b2515abc839126 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime.meta new file mode 100644 index 00000000..9b9554e6 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1cccb3810f8a73e46a1b2ce0f80f981c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs new file mode 100644 index 00000000..4d569a76 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs @@ -0,0 +1,284 @@ +using UnityEngine; +using System.Linq; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Parabox.Stl +{ + public static class Exporter + { + /// + /// Export a hierarchy of GameObjects to path with file type. + /// + /// + /// + /// + /// + public static bool Export(string path, GameObject[] gameObjects, FileType type) + { + Mesh[] meshes = CreateWorldSpaceMeshesWithTransforms(gameObjects.Select(x => x.transform).ToArray()); + bool success = false; + + if(meshes != null && meshes.Length > 0) + { + if(!string.IsNullOrEmpty(path)) + success = Exporter.WriteFile(path, meshes, type); + } + + for(int i = 0; meshes != null && i < meshes.Length; i++) + Object.DestroyImmediate(meshes[i]); + + return success; + } + + /** + * Extracts a list of mesh values with their relative transformations intact. + */ + private static Mesh[] CreateWorldSpaceMeshesWithTransforms(IList transforms) + { + if(transforms == null || transforms.Count < 1) + return null; + + // move root node to center of selection + Vector3 p = Vector3.zero; + + for(int i = 0; i < transforms.Count; i++) + p += transforms[i].position; + Vector3 mesh_center = p / (float) transforms.Count; + + GameObject root = new GameObject(); + root.name = "ROOT"; + root.transform.position = mesh_center; + + // copy all transforms to new root gameobject + foreach(Transform t in transforms) + { + GameObject go = (GameObject) GameObject.Instantiate(t.gameObject); + go.transform.SetParent(t.parent, false); + go.transform.SetParent(root.transform, true); + } + + // move root to 0,0,0 so mesh transformations are relative to origin + root.transform.position = Vector3.zero; + + // create new meshes by iterating the root node and transforming vertex & normal + // values (ignoring all other mesh attributes since STL doesn't care about them) + List mfs = root.GetComponentsInChildren().Where(x => x.sharedMesh != null).ToList(); + int meshCount = mfs.Count; + Mesh[] meshes = new Mesh[meshCount]; + + for(int i = 0; i < meshCount; i++) + { + Transform t = mfs[i].transform; + + Vector3[] v = mfs[i].sharedMesh.vertices; + Vector3[] n = mfs[i].sharedMesh.normals; + + for(int it = 0; it < v.Length; it++) + { + v[it] = t.TransformPoint(v[it]); + n[it] = t.TransformDirection(n[it]); + } + + Mesh m = new Mesh(); + + m.name = mfs[i].name; + m.vertices = v; + m.normals = n; + m.triangles = mfs[i].sharedMesh.triangles; + + meshes[i] = m; + } + + // Cleanup + GameObject.DestroyImmediate(root); + + return meshes; + } + + /// + /// Write a mesh file to STL format. + /// + /// + /// + /// + /// + /// + public static bool WriteFile(string path, Mesh mesh, FileType type = FileType.Ascii, bool convertToRightHandedCoordinates = true) + { + return WriteFile(path, new Mesh[] { mesh }, type, convertToRightHandedCoordinates); + } + + /** + * Write a collection of mesh assets to an STL file. + * No transformations are performed on meshes in this method. + * Eg, if you want to export a set of a meshes in a transform + * hierarchy the meshes should be transformed prior to this call. + * + * string path - Where to write the file. + * IList meshes - The mesh assets to write. + * FileType type - How to format the file (in ASCII or binary). + */ + public static bool WriteFile(string path, IList meshes, FileType type = FileType.Ascii, bool convertToRightHandedCoordinates = true) + { + try + { + switch(type) + { + case FileType.Binary: + { + // http://paulbourke.net/dataformats/stl/ + // http://www.fabbers.com/tech/STL_Format + using (BinaryWriter writer = new BinaryWriter(File.Open(path, FileMode.Create), new ASCIIEncoding())) + { + // 80 byte header + writer.Write(new byte[80]); + + uint totalTriangleCount = (uint) (meshes.Sum(x => x.triangles.Length) / 3); + + // unsigned long facet count (4 bytes) + writer.Write( totalTriangleCount ); + + foreach(Mesh mesh in meshes) + { + Vector3[] v = mesh.vertices; + Vector3[] n = mesh.normals; + + if(convertToRightHandedCoordinates) + { + for(int i = 0, c = v.Length; i < c; i++) + { + v[i] = Stl.ToCoordinateSpace(v[i], CoordinateSpace.Right); + n[i] = Stl.ToCoordinateSpace(n[i], CoordinateSpace.Right); + } + } + + int[] t = mesh.triangles; + int triangleCount = t.Length; + if(convertToRightHandedCoordinates) + System.Array.Reverse(t); + + for(int i = 0; i < triangleCount; i += 3) + { + int a = t[i], b = t[i+1], c = t[i+2]; + + Vector3 avg = AvgNrm(n[a], n[b], n[c]); + + writer.Write(avg.x); + writer.Write(avg.y); + writer.Write(avg.z); + + writer.Write(v[a].x); + writer.Write(v[a].y); + writer.Write(v[a].z); + + writer.Write(v[b].x); + writer.Write(v[b].y); + writer.Write(v[b].z); + + writer.Write(v[c].x); + writer.Write(v[c].y); + writer.Write(v[c].z); + + // specification says attribute byte count should be set to 0. + writer.Write( (ushort)0 ); + } + } + } + } + break; + + default: + string model = WriteString(meshes); + File.WriteAllText(path, model); + break; + } + } + catch(System.Exception e) + { + UnityEngine.Debug.LogError(e.ToString()); + return false; + } + + return true; + } + + /** + * Write a Unity mesh to an ASCII STL string. + */ + public static string WriteString(Mesh mesh, bool convertToRightHandedCoordinates = true) + { + return WriteString(new Mesh[] { mesh }, convertToRightHandedCoordinates); + } + + /** + * Write a set of meshes to an ASCII string in STL format. + */ + public static string WriteString(IList meshes, bool convertToRightHandedCoordinates = true) + { + StringBuilder sb = new StringBuilder(); + + string name = meshes.Count == 1 ? meshes[0].name : "Composite Mesh"; + + sb.AppendLine(string.Format("solid {0}", name)); + + foreach(Mesh mesh in meshes) + { + Vector3[] v = mesh.vertices; + Vector3[] n = mesh.normals; + int[] t = mesh.triangles; + + if(convertToRightHandedCoordinates) + { + for(int i = 0, c = v.Length; i < c; i++) + { + v[i] = Stl.ToCoordinateSpace(v[i], CoordinateSpace.Right); + n[i] = Stl.ToCoordinateSpace(n[i], CoordinateSpace.Right); + } + + System.Array.Reverse(t); + } + + int triLen = t.Length; + + for(int i = 0; i < triLen; i+=3) + { + int a = t[i]; + int b = t[i+1]; + int c = t[i+2]; + + Vector3 nrm = AvgNrm(n[a], n[b], n[c]); + + sb.AppendLine(string.Format("facet normal {0} {1} {2}", nrm.x, nrm.y, nrm.z)); + + sb.AppendLine("outer loop"); + + sb.AppendLine(string.Format("\tvertex {0} {1} {2}", v[a].x, v[a].y, v[a].z)); + sb.AppendLine(string.Format("\tvertex {0} {1} {2}", v[b].x, v[b].y, v[b].z)); + sb.AppendLine(string.Format("\tvertex {0} {1} {2}", v[c].x, v[c].y, v[c].z)); + + sb.AppendLine("endloop"); + + sb.AppendLine("endfacet"); + } + } + + sb.AppendLine(string.Format("endsolid {0}", name)); + + return sb.ToString(); + } + + /** + * Average of 3 vectors. + */ + private static Vector3 AvgNrm(Vector3 a, Vector3 b, Vector3 c) + { + return new Vector3( + (a.x + b.x + c.x) / 3f, + (a.y + b.y + c.y) / 3f, + (a.z + b.z + c.z) / 3f ); + } + + } +} diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs.meta new file mode 100644 index 00000000..2e03424d --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Exporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec710640803d78441963c0f7a8c785e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs new file mode 100644 index 00000000..3aef5f55 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs @@ -0,0 +1,453 @@ +using System; +using UnityEngine; +using System.Collections.Generic; +using System.Linq; +using System.IO; +using System.Text; +using UnityEngine.Rendering; + +namespace Parabox.Stl +{ + /// + /// Import mesh assets from an STL file. + /// + public static class Importer + { + const int MaxFacetsPerMesh16 = UInt16.MaxValue / 3; + const int MaxFacetsPerMesh32 = int.MaxValue / 3; + + struct Facet + { + public Vector3 normal; + public Vector3 a, b, c; + + public Facet(Vector3 normal, Vector3 a, Vector3 b, Vector3 c) + { + this.normal = normal; + this.a = a; + this.b = b; + this.c = c; + } + + public override string ToString() + { + return string.Format("{0:F2}: {1:F2}, {2:F2}, {3:F2}", normal, a, b, c); + } + } + + /// + /// Import an STL file. + /// + /// The path to load STL file from. + /// + public static Mesh[] Import(string path, CoordinateSpace space = CoordinateSpace.Right, UpAxis axis = UpAxis.Y, bool smooth = false, IndexFormat indexFormat = IndexFormat.UInt16) + { + IEnumerable facets = null; + + if( IsBinary(path) ) + { + try + { + facets = ImportBinary(path); + } + catch(System.Exception e) + { + UnityEngine.Debug.LogWarning(string.Format("Failed importing mesh at path {0}.\n{1}", path, e.ToString())); + return null; + } + } + else + { + facets = ImportAscii(path); + } + + if(smooth) + return ImportSmoothNormals(facets, space, axis, indexFormat); + + return ImportHardNormals(facets, space, axis, indexFormat); + } + + static IEnumerable ImportBinary(string path) + { + Facet[] facets; + + using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) + { + using (BinaryReader br = new BinaryReader(fs, new ASCIIEncoding())) + { + // read header + br.ReadBytes(80); + + uint facetCount = br.ReadUInt32(); + facets = new Facet[facetCount]; + + for(uint i = 0; i < facetCount; i++) + facets[i] = br.GetFacet(); + } + } + + return facets; + } + + static Facet GetFacet(this BinaryReader binaryReader) + { + Facet facet = new Facet( + binaryReader.GetVector3(), // Normal + binaryReader.GetVector3(), // A + binaryReader.GetVector3(), // B + binaryReader.GetVector3() // C + ); + + binaryReader.ReadUInt16(); // padding + + return facet; + } + + static Vector3 GetVector3(this BinaryReader binaryReader) + { + return new Vector3( + binaryReader.ReadSingle(), + binaryReader.ReadSingle(), + binaryReader.ReadSingle() ); + } + + const int SOLID = 1; + const int FACET = 2; + const int OUTER = 3; + const int VERTEX = 4; + const int ENDLOOP = 5; + const int ENDFACET = 6; + const int ENDSOLID = 7; + const int EMPTY = 0; + + static int ReadState(string line) + { + if(line.StartsWith("solid")) + return SOLID; + else if(line.StartsWith("facet")) + return FACET; + else if(line.StartsWith("outer")) + return OUTER; + else if(line.StartsWith("vertex")) + return VERTEX; + else if(line.StartsWith("endloop")) + return ENDLOOP; + else if(line.StartsWith("endfacet")) + return ENDFACET; + else if(line.StartsWith("endsolid")) + return ENDSOLID; + else + return EMPTY; + } + + static IEnumerable ImportAscii(string path) + { + List facets = new List(); + + using(StreamReader sr = new StreamReader(path)) + { + string line; + int state = EMPTY, vertex = 0; + Vector3 normal = Vector3.zero; + Vector3 a = Vector3.zero, b = Vector3.zero, c = Vector3.zero; + bool exit = false; + + while(sr.Peek() > 0 && !exit) + { + line = sr.ReadLine().Trim(); + state = ReadState(line); + + switch(state) + { + case SOLID: + continue; + + case FACET: + normal = StringToVec3(line.Replace("facet normal ", "")); + break; + + case OUTER: + vertex = 0; + break; + + case VERTEX: + // maintain counter-clockwise orientation of vertices: + if (vertex == 0) + a = StringToVec3(line.Replace("vertex ", "")); + else if(vertex == 2) + c = StringToVec3(line.Replace("vertex ", "")); + else if (vertex == 1) + b = StringToVec3(line.Replace("vertex ", "")); + vertex++; + break; + + case ENDLOOP: + break; + + case ENDFACET: + facets.Add(new Facet(normal, a, b, c)); + break; + + case ENDSOLID: + exit = true; + break; + + case EMPTY: + default: + break; + + } + } + } + + return facets; + } + + static Vector3 StringToVec3(string str) + { + string[] split = str.Trim().Split(null); + Vector3 v = new Vector3(); + + float.TryParse(split[0], out v.x); + float.TryParse(split[1], out v.y); + float.TryParse(split[2], out v.z); + + return v; + } + + /// + /// Determine whether this file is a binary stl format or not. + /// + /// + /// + static bool IsBinary(string path) + { + // http://stackoverflow.com/questions/968935/compare-binary-files-in-c-sharp + FileInfo file = new FileInfo(path); + + if(file.Length < 130) + return false; + + var isBinary = false; + + using(FileStream f0 = file.OpenRead()) + { + using(BufferedStream bs0 = new BufferedStream(f0)) + { + for(long i = 0; i < 80; i++) + { + var readByte = bs0.ReadByte(); + if (readByte == 0x0) + { + isBinary = true; + break; + } + } + } + } + + if (!isBinary) + { + using (FileStream f0 = file.OpenRead()) + { + using (BufferedStream bs0 = new BufferedStream(f0)) + { + var byteArray = new byte[6]; + + for (var i = 0; i < 6; i++) + { + byteArray[i] = (byte)bs0.ReadByte(); + } + + var text = Encoding.UTF8.GetString(byteArray); + isBinary = text != "solid "; + } + } + } + + return isBinary; + } + + static Mesh[] ImportSmoothNormals(IEnumerable faces, CoordinateSpace modelCoordinateSpace, UpAxis modelUpAxis, IndexFormat indexFormat) + { + var facets = faces as Facet[] ?? faces.ToArray(); + int maxVertexCount = indexFormat == IndexFormat.UInt32 ? MaxFacetsPerMesh32 * 3 : MaxFacetsPerMesh16 * 3; + int triangleCount = facets.Length * 3; + + Dictionary smoothNormals = new Dictionary(triangleCount / 2); + + // In case meshes are split, we need to calculate smooth normals first + foreach(var face in faces) + { + var x = (StlVector3) face.a; + var y = (StlVector3) face.b; + var z = (StlVector3) face.c; + var normal = face.normal; + + if(smoothNormals.ContainsKey(x)) + smoothNormals[x] += normal; + else + smoothNormals.Add(x, normal); + + if(smoothNormals.ContainsKey(y)) + smoothNormals[y] += normal; + else + smoothNormals.Add(y, normal); + + if(smoothNormals.ContainsKey(z)) + smoothNormals[z] += normal; + else + smoothNormals.Add(z, normal); + } + + List meshes = new List(); + + List pos = new List(Math.Min(maxVertexCount, triangleCount)); + List nrm = new List(Math.Min(maxVertexCount, triangleCount)); + List tri = new List(triangleCount); + Dictionary map = new Dictionary(); + int vertex = 0; + Vector3[] points = new Vector3[3]; + + foreach(var face in facets) + { + if(vertex + 3 > maxVertexCount) + { + var mesh = new Mesh + { + vertices = pos.ToArray(), + normals = nrm.ToArray(), + indexFormat = indexFormat + }; + if(modelCoordinateSpace == CoordinateSpace.Right) + tri.Reverse(); + mesh.triangles = tri.ToArray(); + meshes.Add(mesh); + + vertex = 0; + + pos.Clear(); + nrm.Clear(); + tri.Clear(); + map.Clear(); + } + + points[0] = face.a; + points[1] = face.b; + points[2] = face.c; + + for(int i = 0; i < 3; i++) + { + int index = -1; + var hash = (StlVector3) points[i]; + + if(!map.TryGetValue(hash, out index)) + { + if(modelCoordinateSpace == CoordinateSpace.Right) + { + pos.Add(Stl.ToCoordinateSpace(points[i], CoordinateSpace.Left)); + nrm.Add(Stl.ToCoordinateSpace(smoothNormals[hash].normalized, CoordinateSpace.Left)); + } + else + { + pos.Add(points[i]); + nrm.Add(smoothNormals[hash].normalized); + } + + tri.Add(vertex); + map.Add(hash, vertex++); + } + else + { + tri.Add(index); + } + } + } + + if(vertex > 0) + { + var mesh = new Mesh + { + vertices = pos.ToArray(), + normals = nrm.ToArray(), + indexFormat = indexFormat + }; + if(modelCoordinateSpace == CoordinateSpace.Right) + tri.Reverse(); + mesh.triangles = tri.ToArray(); + meshes.Add(mesh); + + vertex = 0; + + pos.Clear(); + nrm.Clear(); + tri.Clear(); + map.Clear(); + } + + return meshes.ToArray(); + } + + static Mesh[] ImportHardNormals(IEnumerable faces, CoordinateSpace modelCoordinateSpace, UpAxis modelUpAxis, IndexFormat indexFormat) + { + var facets = faces as Facet[] ?? faces.ToArray(); + int faceCount = facets.Length, f = 0; + int maxFacetsPerMesh = indexFormat == IndexFormat.UInt32 ? MaxFacetsPerMesh32 : MaxFacetsPerMesh16; + int maxVertexCount = maxFacetsPerMesh * 3; + Mesh[] meshes = new Mesh[faceCount / maxFacetsPerMesh + 1]; + + for(int meshIndex = 0; meshIndex < meshes.Length; meshIndex++) + { + int len = System.Math.Min(maxVertexCount, (faceCount - f) * 3); + Vector3[] v = new Vector3[len]; + Vector3[] n = new Vector3[len]; + int[] t = new int[len]; + + for(int it = 0; it < len; it += 3) + { + v[it ] = facets[f].a; + v[it+1] = facets[f].b; + v[it+2] = facets[f].c; + + n[it ] = facets[f].normal; + n[it+1] = facets[f].normal; + n[it+2] = facets[f].normal; + + t[it ] = it+0; + t[it+1] = it+1; + t[it+2] = it+2; + + f++; + } + + if(modelCoordinateSpace == CoordinateSpace.Right) + { + for(int i = 0; i < len; i+=3) + { + v[i+0] = Stl.ToCoordinateSpace(v[i+0], CoordinateSpace.Left); + v[i+1] = Stl.ToCoordinateSpace(v[i+1], CoordinateSpace.Left); + v[i+2] = Stl.ToCoordinateSpace(v[i+2], CoordinateSpace.Left); + + n[i+0] = Stl.ToCoordinateSpace(n[i+0], CoordinateSpace.Left); + n[i+1] = Stl.ToCoordinateSpace(n[i+1], CoordinateSpace.Left); + n[i+2] = Stl.ToCoordinateSpace(n[i+2], CoordinateSpace.Left); + + var a = t[i+2]; + t[i+2] = t[i]; + t[i] = a; + } + } + + meshes[meshIndex] = new Mesh + { + vertices = v, + normals = n, + triangles = t, + indexFormat = indexFormat + }; + } + + return meshes; + } + } +} diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs.meta new file mode 100644 index 00000000..2dcbd47d --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Importer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4efeb3b2f650e5846b8045c87bc926dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef new file mode 100644 index 00000000..5becfb83 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef @@ -0,0 +1,3 @@ +{ + "name": "Parabox.Stl" +} diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef.meta new file mode 100644 index 00000000..72152bcb --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Parabox.Stl.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9b7ce3d640f39a041a869094036c2d6a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs new file mode 100644 index 00000000..392e8fbe --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using UnityEngine; +using System.Linq; + +namespace Parabox.Stl +{ + /// + /// Describes the file format of an STL file. + /// + public enum FileType + { + Ascii, + Binary + }; + + public enum CoordinateSpace + { + Left, + Right + } + + public enum UpAxis + { + X, + Y, + Z + } + + /// + /// Export STL files from Unity mesh assets. + /// + static class Stl + { + public static Vector3 ToCoordinateSpace(Vector3 point, CoordinateSpace space) + { + if(space == CoordinateSpace.Left) + return new Vector3(-point.y, point.z, point.x); + + return new Vector3(point.z, -point.x, point.y); + } + } +} diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs.meta new file mode 100644 index 00000000..33f0bce7 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/Stl.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a44dcd146114dcc4788da87039761764 +timeCreated: 1464184910 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs new file mode 100644 index 00000000..7855afa7 --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs @@ -0,0 +1,78 @@ +using System; +using UnityEngine; + +namespace Parabox.Stl +{ + struct StlVector3 : IEquatable + { + const float k_Resolution = 10000f; + + public float x; + public float y; + public float z; + + public StlVector3(Vector3 v) + { + x = v.x; + y = v.y; + z = v.z; + } + + public StlVector3(float x, float y, float z) + { + this.x = x; + this.y = y; + this.z = z; + } + + public static explicit operator Vector3(StlVector3 vec) + { + return new Vector3(vec.x, vec.y, vec.z); + } + + public static explicit operator StlVector3(Vector3 vec) + { + return new StlVector3(vec); + } + + public bool Equals(StlVector3 other) + { + return Mathf.Approximately(x, other.x) + && Mathf.Approximately(y, other.y) + && Mathf.Approximately(z, other.z); + } + + public override bool Equals(object obj) + { + if (obj == null || !(obj is StlVector3)) + return false; + + return Equals((StlVector3) obj); + } + + public override int GetHashCode() + { + // https://stackoverflow.com/questions/720177/default-implementation-for-object-gethashcode/720282#720282 + unchecked + { + int hash = 27; + + hash = (13 * hash) + (x * k_Resolution).GetHashCode(); + hash = (13 * hash) + (y * k_Resolution).GetHashCode(); + hash = (13 * hash) + (z * k_Resolution).GetHashCode(); + + return hash; + } + } + + public static bool operator == (StlVector3 a, StlVector3 b) + { + return a.Equals(b); + } + + public static bool operator != (StlVector3 a, StlVector3 b) + { + return ! a.Equals(b); + } + } +} diff --git a/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs.meta b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs.meta new file mode 100644 index 00000000..af53d39b --- /dev/null +++ b/Assets/Scripts/Tools/Mesh/pb_Stl/Runtime/VectorHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1858776d2fc235c47a2df8e4af996d0a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages.meta b/Assets/Scripts/Tools/ProtobufMessages.meta new file mode 100644 index 00000000..d083cb4d --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 466f9501a55259cfdaebc32bb070d52a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs b/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs new file mode 100644 index 00000000..50857c71 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs @@ -0,0 +1,34 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: altimeter.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Altimeter : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"time", IsRequired = true)] + public Time Time { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"vertical_position", IsRequired = true)] + public double VerticalPosition { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"vertical_velocity", IsRequired = true)] + public double VerticalVelocity { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"vertical_reference", IsRequired = true)] + public double VerticalReference { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs.meta new file mode 100644 index 00000000..860b12d5 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/altimeter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fbed1cf2816a07c398e84ab38eeb516a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/any.cs b/Assets/Scripts/Tools/ProtobufMessages/any.cs new file mode 100644 index 00000000..1534cd55 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/any.cs @@ -0,0 +1,106 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: any.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Any : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"type", IsRequired = true)] + public ValueType Type { get; set; } = ValueType.None; + + [global::ProtoBuf.ProtoMember(2, Name = @"double_value")] + public double DoubleValue + { + get { return __pbn__DoubleValue.GetValueOrDefault(); } + set { __pbn__DoubleValue = value; } + } + public bool ShouldSerializeDoubleValue() => __pbn__DoubleValue != null; + public void ResetDoubleValue() => __pbn__DoubleValue = null; + private double? __pbn__DoubleValue; + + [global::ProtoBuf.ProtoMember(3, Name = @"int_value")] + public int IntValue + { + get { return __pbn__IntValue.GetValueOrDefault(); } + set { __pbn__IntValue = value; } + } + public bool ShouldSerializeIntValue() => __pbn__IntValue != null; + public void ResetIntValue() => __pbn__IntValue = null; + private int? __pbn__IntValue; + + [global::ProtoBuf.ProtoMember(4, Name = @"string_value")] + [global::System.ComponentModel.DefaultValue("")] + public string StringValue + { + get { return __pbn__StringValue ?? ""; } + set { __pbn__StringValue = value; } + } + public bool ShouldSerializeStringValue() => __pbn__StringValue != null; + public void ResetStringValue() => __pbn__StringValue = null; + private string __pbn__StringValue; + + [global::ProtoBuf.ProtoMember(5, Name = @"bool_value")] + public bool BoolValue + { + get { return __pbn__BoolValue.GetValueOrDefault(); } + set { __pbn__BoolValue = value; } + } + public bool ShouldSerializeBoolValue() => __pbn__BoolValue != null; + public void ResetBoolValue() => __pbn__BoolValue = null; + private bool? __pbn__BoolValue; + + [global::ProtoBuf.ProtoMember(6, Name = @"vector3d_value")] + public Vector3d Vector3dValue { get; set; } + + [global::ProtoBuf.ProtoMember(7, Name = @"color_value")] + public Color ColorValue { get; set; } + + [global::ProtoBuf.ProtoMember(8, Name = @"pose3d_value")] + public Pose Pose3dValue { get; set; } + + [global::ProtoBuf.ProtoMember(9, Name = @"quaternion_value")] + public Quaternion QuaternionValue { get; set; } + + [global::ProtoBuf.ProtoMember(10, Name = @"time_value")] + public Time TimeValue { get; set; } + + [global::ProtoBuf.ProtoContract()] + public enum ValueType + { + [global::ProtoBuf.ProtoEnum(Name = @"NONE")] + None = 1, + [global::ProtoBuf.ProtoEnum(Name = @"DOUBLE")] + Double = 2, + [global::ProtoBuf.ProtoEnum(Name = @"INT32")] + Int32 = 3, + [global::ProtoBuf.ProtoEnum(Name = @"STRING")] + String = 4, + [global::ProtoBuf.ProtoEnum(Name = @"BOOLEAN")] + Boolean = 5, + [global::ProtoBuf.ProtoEnum(Name = @"VECTOR3D")] + Vector3d = 6, + [global::ProtoBuf.ProtoEnum(Name = @"COLOR")] + Color = 7, + [global::ProtoBuf.ProtoEnum(Name = @"POSE3D")] + Pose3d = 8, + [global::ProtoBuf.ProtoEnum(Name = @"QUATERNIOND")] + Quaterniond = 9, + [global::ProtoBuf.ProtoEnum(Name = @"TIME")] + Time = 10, + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/any.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/any.cs.meta new file mode 100644 index 00000000..12a82c16 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/any.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b8b0078d2e89fe3dbf96312d878fda2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs b/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs new file mode 100644 index 00000000..0f5aa78c --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs @@ -0,0 +1,80 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: atmosphere.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Atmosphere : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1)] + [global::System.ComponentModel.DefaultValue(Type.Adiabatic)] + public Type type + { + get { return __pbn__type ?? Type.Adiabatic; } + set { __pbn__type = value; } + } + public bool ShouldSerializetype() => __pbn__type != null; + public void Resettype() => __pbn__type = null; + private Type? __pbn__type; + + [global::ProtoBuf.ProtoMember(2, Name = @"temperature")] + public double Temperature + { + get { return __pbn__Temperature.GetValueOrDefault(); } + set { __pbn__Temperature = value; } + } + public bool ShouldSerializeTemperature() => __pbn__Temperature != null; + public void ResetTemperature() => __pbn__Temperature = null; + private double? __pbn__Temperature; + + [global::ProtoBuf.ProtoMember(3, Name = @"pressure")] + public double Pressure + { + get { return __pbn__Pressure.GetValueOrDefault(); } + set { __pbn__Pressure = value; } + } + public bool ShouldSerializePressure() => __pbn__Pressure != null; + public void ResetPressure() => __pbn__Pressure = null; + private double? __pbn__Pressure; + + [global::ProtoBuf.ProtoMember(4, Name = @"mass_density")] + public double MassDensity + { + get { return __pbn__MassDensity.GetValueOrDefault(); } + set { __pbn__MassDensity = value; } + } + public bool ShouldSerializeMassDensity() => __pbn__MassDensity != null; + public void ResetMassDensity() => __pbn__MassDensity = null; + private double? __pbn__MassDensity; + + [global::ProtoBuf.ProtoMember(5, Name = @"enable_atmosphere")] + public bool EnableAtmosphere + { + get { return __pbn__EnableAtmosphere.GetValueOrDefault(); } + set { __pbn__EnableAtmosphere = value; } + } + public bool ShouldSerializeEnableAtmosphere() => __pbn__EnableAtmosphere != null; + public void ResetEnableAtmosphere() => __pbn__EnableAtmosphere = null; + private bool? __pbn__EnableAtmosphere; + + [global::ProtoBuf.ProtoContract()] + public enum Type + { + [global::ProtoBuf.ProtoEnum(Name = @"ADIABATIC")] + Adiabatic = 1, + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs.meta new file mode 100644 index 00000000..289ba5d6 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/atmosphere.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5476898ad9c12ea5b8bacbfce9eb9891 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/axis.cs b/Assets/Scripts/Tools/ProtobufMessages/axis.cs new file mode 100644 index 00000000..f5e1df35 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/axis.cs @@ -0,0 +1,46 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: axis.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Axis : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"xyz", IsRequired = true)] + public Vector3d Xyz { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"limit_lower", IsRequired = true)] + public double LimitLower { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"limit_upper", IsRequired = true)] + public double LimitUpper { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"limit_effort", IsRequired = true)] + public double LimitEffort { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"limit_velocity", IsRequired = true)] + public double LimitVelocity { get; set; } + + [global::ProtoBuf.ProtoMember(6, Name = @"damping", IsRequired = true)] + public double Damping { get; set; } + + [global::ProtoBuf.ProtoMember(7, Name = @"friction", IsRequired = true)] + public double Friction { get; set; } + + [global::ProtoBuf.ProtoMember(8, Name = @"use_parent_model_frame", IsRequired = true)] + public bool UseParentModelFrame { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/axis.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/axis.cs.meta new file mode 100644 index 00000000..ac4214b0 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/axis.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a05042748cac083dbcb2c215fd8be64 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/battery.cs b/Assets/Scripts/Tools/ProtobufMessages/battery.cs new file mode 100644 index 00000000..5af66685 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/battery.cs @@ -0,0 +1,28 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: battery.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Battery : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)] + public string Name { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"voltage", IsRequired = true)] + public double Voltage { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/battery.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/battery.cs.meta new file mode 100644 index 00000000..0b1bf40a --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/battery.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5f83e56363adb6b62b2ad4c6b2e03d67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs b/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs new file mode 100644 index 00000000..50353728 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs @@ -0,0 +1,25 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: boxgeom.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class BoxGeom : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"size", IsRequired = true)] + public Vector3d Size { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs.meta new file mode 100644 index 00000000..2f4b819e --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/boxgeom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4990d81b9ffc20489b3bd558fe7511b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs b/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs new file mode 100644 index 00000000..fdc7fa37 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs @@ -0,0 +1,33 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: camera_cmd.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class CameraCmd : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"follow_model")] + [global::System.ComponentModel.DefaultValue("")] + public string FollowModel + { + get { return __pbn__FollowModel ?? ""; } + set { __pbn__FollowModel = value; } + } + public bool ShouldSerializeFollowModel() => __pbn__FollowModel != null; + public void ResetFollowModel() => __pbn__FollowModel = null; + private string __pbn__FollowModel; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs.meta new file mode 100644 index 00000000..e6797762 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/camera_cmd.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b23902bf0e56e02195ea48489d6509a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs b/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs new file mode 100644 index 00000000..facadc03 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs @@ -0,0 +1,116 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: camera_lens.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class CameraLens : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"type", IsRequired = true)] + public string Type { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"c1")] + public double C1 + { + get { return __pbn__C1.GetValueOrDefault(); } + set { __pbn__C1 = value; } + } + public bool ShouldSerializeC1() => __pbn__C1 != null; + public void ResetC1() => __pbn__C1 = null; + private double? __pbn__C1; + + [global::ProtoBuf.ProtoMember(3, Name = @"c2")] + public double C2 + { + get { return __pbn__C2.GetValueOrDefault(); } + set { __pbn__C2 = value; } + } + public bool ShouldSerializeC2() => __pbn__C2 != null; + public void ResetC2() => __pbn__C2 = null; + private double? __pbn__C2; + + [global::ProtoBuf.ProtoMember(4, Name = @"c3")] + public double C3 + { + get { return __pbn__C3.GetValueOrDefault(); } + set { __pbn__C3 = value; } + } + public bool ShouldSerializeC3() => __pbn__C3 != null; + public void ResetC3() => __pbn__C3 = null; + private double? __pbn__C3; + + [global::ProtoBuf.ProtoMember(5, Name = @"f")] + public double F + { + get { return __pbn__F.GetValueOrDefault(); } + set { __pbn__F = value; } + } + public bool ShouldSerializeF() => __pbn__F != null; + public void ResetF() => __pbn__F = null; + private double? __pbn__F; + + [global::ProtoBuf.ProtoMember(6, Name = @"fun")] + [global::System.ComponentModel.DefaultValue("")] + public string Fun + { + get { return __pbn__Fun ?? ""; } + set { __pbn__Fun = value; } + } + public bool ShouldSerializeFun() => __pbn__Fun != null; + public void ResetFun() => __pbn__Fun = null; + private string __pbn__Fun; + + [global::ProtoBuf.ProtoMember(7, Name = @"scale_to_hfov")] + public bool ScaleToHfov + { + get { return __pbn__ScaleToHfov.GetValueOrDefault(); } + set { __pbn__ScaleToHfov = value; } + } + public bool ShouldSerializeScaleToHfov() => __pbn__ScaleToHfov != null; + public void ResetScaleToHfov() => __pbn__ScaleToHfov = null; + private bool? __pbn__ScaleToHfov; + + [global::ProtoBuf.ProtoMember(8, Name = @"cutoff_angle")] + public double CutoffAngle + { + get { return __pbn__CutoffAngle.GetValueOrDefault(); } + set { __pbn__CutoffAngle = value; } + } + public bool ShouldSerializeCutoffAngle() => __pbn__CutoffAngle != null; + public void ResetCutoffAngle() => __pbn__CutoffAngle = null; + private double? __pbn__CutoffAngle; + + [global::ProtoBuf.ProtoMember(9, Name = @"hfov")] + public double Hfov + { + get { return __pbn__Hfov.GetValueOrDefault(); } + set { __pbn__Hfov = value; } + } + public bool ShouldSerializeHfov() => __pbn__Hfov != null; + public void ResetHfov() => __pbn__Hfov = null; + private double? __pbn__Hfov; + + [global::ProtoBuf.ProtoMember(10, Name = @"env_texture_size")] + public int EnvTextureSize + { + get { return __pbn__EnvTextureSize.GetValueOrDefault(); } + set { __pbn__EnvTextureSize = value; } + } + public bool ShouldSerializeEnvTextureSize() => __pbn__EnvTextureSize != null; + public void ResetEnvTextureSize() => __pbn__EnvTextureSize = null; + private int? __pbn__EnvTextureSize; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs.meta new file mode 100644 index 00000000..c3b618c8 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/camera_lens.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab652625fdc66604fa9691f5936a2fdd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs b/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs new file mode 100644 index 00000000..796fea9a --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs @@ -0,0 +1,90 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: camerasensor.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class CameraSensor : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"horizontal_fov")] + public double HorizontalFov + { + get { return __pbn__HorizontalFov.GetValueOrDefault(); } + set { __pbn__HorizontalFov = value; } + } + public bool ShouldSerializeHorizontalFov() => __pbn__HorizontalFov != null; + public void ResetHorizontalFov() => __pbn__HorizontalFov = null; + private double? __pbn__HorizontalFov; + + [global::ProtoBuf.ProtoMember(2, Name = @"image_size")] + public Vector2d ImageSize { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"image_format")] + [global::System.ComponentModel.DefaultValue("")] + public string ImageFormat + { + get { return __pbn__ImageFormat ?? ""; } + set { __pbn__ImageFormat = value; } + } + public bool ShouldSerializeImageFormat() => __pbn__ImageFormat != null; + public void ResetImageFormat() => __pbn__ImageFormat = null; + private string __pbn__ImageFormat; + + [global::ProtoBuf.ProtoMember(4, Name = @"near_clip")] + public double NearClip + { + get { return __pbn__NearClip.GetValueOrDefault(); } + set { __pbn__NearClip = value; } + } + public bool ShouldSerializeNearClip() => __pbn__NearClip != null; + public void ResetNearClip() => __pbn__NearClip = null; + private double? __pbn__NearClip; + + [global::ProtoBuf.ProtoMember(5, Name = @"far_clip")] + public double FarClip + { + get { return __pbn__FarClip.GetValueOrDefault(); } + set { __pbn__FarClip = value; } + } + public bool ShouldSerializeFarClip() => __pbn__FarClip != null; + public void ResetFarClip() => __pbn__FarClip = null; + private double? __pbn__FarClip; + + [global::ProtoBuf.ProtoMember(6, Name = @"save_enabled")] + public bool SaveEnabled + { + get { return __pbn__SaveEnabled.GetValueOrDefault(); } + set { __pbn__SaveEnabled = value; } + } + public bool ShouldSerializeSaveEnabled() => __pbn__SaveEnabled != null; + public void ResetSaveEnabled() => __pbn__SaveEnabled = null; + private bool? __pbn__SaveEnabled; + + [global::ProtoBuf.ProtoMember(7, Name = @"save_path")] + [global::System.ComponentModel.DefaultValue("")] + public string SavePath + { + get { return __pbn__SavePath ?? ""; } + set { __pbn__SavePath = value; } + } + public bool ShouldSerializeSavePath() => __pbn__SavePath != null; + public void ResetSavePath() => __pbn__SavePath = null; + private string __pbn__SavePath; + + [global::ProtoBuf.ProtoMember(8, Name = @"distortion")] + public Distortion Distortion { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs.meta new file mode 100644 index 00000000..9c2de6db --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/camerasensor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bbce56d9c5b661ee0a134da7d639f523 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/cessna.cs b/Assets/Scripts/Tools/ProtobufMessages/cessna.cs new file mode 100644 index 00000000..8a8065c3 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/cessna.cs @@ -0,0 +1,162 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: cessna.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Cessna : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"propeller_speed")] + public float PropellerSpeed + { + get { return __pbn__PropellerSpeed.GetValueOrDefault(); } + set { __pbn__PropellerSpeed = value; } + } + public bool ShouldSerializePropellerSpeed() => __pbn__PropellerSpeed != null; + public void ResetPropellerSpeed() => __pbn__PropellerSpeed = null; + private float? __pbn__PropellerSpeed; + + [global::ProtoBuf.ProtoMember(2, Name = @"left_aileron")] + public float LeftAileron + { + get { return __pbn__LeftAileron.GetValueOrDefault(); } + set { __pbn__LeftAileron = value; } + } + public bool ShouldSerializeLeftAileron() => __pbn__LeftAileron != null; + public void ResetLeftAileron() => __pbn__LeftAileron = null; + private float? __pbn__LeftAileron; + + [global::ProtoBuf.ProtoMember(3, Name = @"left_flap")] + public float LeftFlap + { + get { return __pbn__LeftFlap.GetValueOrDefault(); } + set { __pbn__LeftFlap = value; } + } + public bool ShouldSerializeLeftFlap() => __pbn__LeftFlap != null; + public void ResetLeftFlap() => __pbn__LeftFlap = null; + private float? __pbn__LeftFlap; + + [global::ProtoBuf.ProtoMember(4, Name = @"right_aileron")] + public float RightAileron + { + get { return __pbn__RightAileron.GetValueOrDefault(); } + set { __pbn__RightAileron = value; } + } + public bool ShouldSerializeRightAileron() => __pbn__RightAileron != null; + public void ResetRightAileron() => __pbn__RightAileron = null; + private float? __pbn__RightAileron; + + [global::ProtoBuf.ProtoMember(5, Name = @"right_flap")] + public float RightFlap + { + get { return __pbn__RightFlap.GetValueOrDefault(); } + set { __pbn__RightFlap = value; } + } + public bool ShouldSerializeRightFlap() => __pbn__RightFlap != null; + public void ResetRightFlap() => __pbn__RightFlap = null; + private float? __pbn__RightFlap; + + [global::ProtoBuf.ProtoMember(6, Name = @"elevators")] + public float Elevators + { + get { return __pbn__Elevators.GetValueOrDefault(); } + set { __pbn__Elevators = value; } + } + public bool ShouldSerializeElevators() => __pbn__Elevators != null; + public void ResetElevators() => __pbn__Elevators = null; + private float? __pbn__Elevators; + + [global::ProtoBuf.ProtoMember(7, Name = @"rudder")] + public float Rudder + { + get { return __pbn__Rudder.GetValueOrDefault(); } + set { __pbn__Rudder = value; } + } + public bool ShouldSerializeRudder() => __pbn__Rudder != null; + public void ResetRudder() => __pbn__Rudder = null; + private float? __pbn__Rudder; + + [global::ProtoBuf.ProtoMember(8, Name = @"cmd_propeller_speed")] + public float CmdPropellerSpeed + { + get { return __pbn__CmdPropellerSpeed.GetValueOrDefault(); } + set { __pbn__CmdPropellerSpeed = value; } + } + public bool ShouldSerializeCmdPropellerSpeed() => __pbn__CmdPropellerSpeed != null; + public void ResetCmdPropellerSpeed() => __pbn__CmdPropellerSpeed = null; + private float? __pbn__CmdPropellerSpeed; + + [global::ProtoBuf.ProtoMember(9, Name = @"cmd_left_aileron")] + public float CmdLeftAileron + { + get { return __pbn__CmdLeftAileron.GetValueOrDefault(); } + set { __pbn__CmdLeftAileron = value; } + } + public bool ShouldSerializeCmdLeftAileron() => __pbn__CmdLeftAileron != null; + public void ResetCmdLeftAileron() => __pbn__CmdLeftAileron = null; + private float? __pbn__CmdLeftAileron; + + [global::ProtoBuf.ProtoMember(10, Name = @"cmd_left_flap")] + public float CmdLeftFlap + { + get { return __pbn__CmdLeftFlap.GetValueOrDefault(); } + set { __pbn__CmdLeftFlap = value; } + } + public bool ShouldSerializeCmdLeftFlap() => __pbn__CmdLeftFlap != null; + public void ResetCmdLeftFlap() => __pbn__CmdLeftFlap = null; + private float? __pbn__CmdLeftFlap; + + [global::ProtoBuf.ProtoMember(11, Name = @"cmd_right_aileron")] + public float CmdRightAileron + { + get { return __pbn__CmdRightAileron.GetValueOrDefault(); } + set { __pbn__CmdRightAileron = value; } + } + public bool ShouldSerializeCmdRightAileron() => __pbn__CmdRightAileron != null; + public void ResetCmdRightAileron() => __pbn__CmdRightAileron = null; + private float? __pbn__CmdRightAileron; + + [global::ProtoBuf.ProtoMember(12, Name = @"cmd_right_flap")] + public float CmdRightFlap + { + get { return __pbn__CmdRightFlap.GetValueOrDefault(); } + set { __pbn__CmdRightFlap = value; } + } + public bool ShouldSerializeCmdRightFlap() => __pbn__CmdRightFlap != null; + public void ResetCmdRightFlap() => __pbn__CmdRightFlap = null; + private float? __pbn__CmdRightFlap; + + [global::ProtoBuf.ProtoMember(13, Name = @"cmd_elevators")] + public float CmdElevators + { + get { return __pbn__CmdElevators.GetValueOrDefault(); } + set { __pbn__CmdElevators = value; } + } + public bool ShouldSerializeCmdElevators() => __pbn__CmdElevators != null; + public void ResetCmdElevators() => __pbn__CmdElevators = null; + private float? __pbn__CmdElevators; + + [global::ProtoBuf.ProtoMember(14, Name = @"cmd_rudder")] + public float CmdRudder + { + get { return __pbn__CmdRudder.GetValueOrDefault(); } + set { __pbn__CmdRudder = value; } + } + public bool ShouldSerializeCmdRudder() => __pbn__CmdRudder != null; + public void ResetCmdRudder() => __pbn__CmdRudder = null; + private float? __pbn__CmdRudder; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/cessna.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/cessna.cs.meta new file mode 100644 index 00000000..bc07b8f7 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/cessna.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a1ade083667cfddd83087604dc3278c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/collision.cs b/Assets/Scripts/Tools/ProtobufMessages/collision.cs new file mode 100644 index 00000000..03621b12 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/collision.cs @@ -0,0 +1,60 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: collision.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Collision : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"id", IsRequired = true)] + public uint Id { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"name", IsRequired = true)] + public string Name { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"laser_retro")] + public double LaserRetro + { + get { return __pbn__LaserRetro.GetValueOrDefault(); } + set { __pbn__LaserRetro = value; } + } + public bool ShouldSerializeLaserRetro() => __pbn__LaserRetro != null; + public void ResetLaserRetro() => __pbn__LaserRetro = null; + private double? __pbn__LaserRetro; + + [global::ProtoBuf.ProtoMember(4, Name = @"max_contacts")] + public double MaxContacts + { + get { return __pbn__MaxContacts.GetValueOrDefault(); } + set { __pbn__MaxContacts = value; } + } + public bool ShouldSerializeMaxContacts() => __pbn__MaxContacts != null; + public void ResetMaxContacts() => __pbn__MaxContacts = null; + private double? __pbn__MaxContacts; + + [global::ProtoBuf.ProtoMember(5, Name = @"pose")] + public Pose Pose { get; set; } + + [global::ProtoBuf.ProtoMember(6, Name = @"geometry")] + public Geometry Geometry { get; set; } + + [global::ProtoBuf.ProtoMember(7, Name = @"surface")] + public Surface Surface { get; set; } + + [global::ProtoBuf.ProtoMember(8, Name = @"visual")] + public global::System.Collections.Generic.List Visuals { get; } = new global::System.Collections.Generic.List(); + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/collision.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/collision.cs.meta new file mode 100644 index 00000000..190eaf8b --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/collision.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a9c2f7528390e0b1fb50cadd24611648 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/color.cs b/Assets/Scripts/Tools/ProtobufMessages/color.cs new file mode 100644 index 00000000..0d776894 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/color.cs @@ -0,0 +1,42 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: color.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Color : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(2, Name = @"r", IsRequired = true)] + public float R { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"g", IsRequired = true)] + public float G { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"b", IsRequired = true)] + public float B { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"a")] + [global::System.ComponentModel.DefaultValue(1)] + public float A + { + get { return __pbn__A ?? 1; } + set { __pbn__A = value; } + } + public bool ShouldSerializeA() => __pbn__A != null; + public void ResetA() => __pbn__A = null; + private float? __pbn__A; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/color.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/color.cs.meta new file mode 100644 index 00000000..1fb6ac92 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/color.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a1e6a85d446a833ebe16be8cead9e20 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/contact.cs b/Assets/Scripts/Tools/ProtobufMessages/contact.cs new file mode 100644 index 00000000..f96f597c --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/contact.cs @@ -0,0 +1,46 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: contact.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Contact : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"collision1", IsRequired = true)] + public string Collision1 { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"collision2", IsRequired = true)] + public string Collision2 { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"position")] + public global::System.Collections.Generic.List Positions { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(4, Name = @"normal")] + public global::System.Collections.Generic.List Normals { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(5, Name = @"depth")] + public double[] Depths { get; set; } + + [global::ProtoBuf.ProtoMember(6, Name = @"wrench")] + public global::System.Collections.Generic.List Wrenchs { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(7, Name = @"time", IsRequired = true)] + public Time Time { get; set; } + + [global::ProtoBuf.ProtoMember(8, Name = @"world", IsRequired = true)] + public string World { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/contact.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/contact.cs.meta new file mode 100644 index 00000000..8a991209 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/contact.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b0dd2d6c5975ed00b3de9335515cef7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/contacts.cs b/Assets/Scripts/Tools/ProtobufMessages/contacts.cs new file mode 100644 index 00000000..f28f1b22 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/contacts.cs @@ -0,0 +1,28 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: contacts.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Contacts : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1)] + public global::System.Collections.Generic.List contact { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(2, Name = @"time", IsRequired = true)] + public Time Time { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/contacts.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/contacts.cs.meta new file mode 100644 index 00000000..a93aa0f6 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/contacts.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 006e74c7d4f5e4a57a20e8f9a7e85f28 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs b/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs new file mode 100644 index 00000000..61189d17 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs @@ -0,0 +1,33 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: contactsensor.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class ContactSensor : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"collision_name")] + [global::System.ComponentModel.DefaultValue("")] + public string CollisionName + { + get { return __pbn__CollisionName ?? ""; } + set { __pbn__CollisionName = value; } + } + public bool ShouldSerializeCollisionName() => __pbn__CollisionName != null; + public void ResetCollisionName() => __pbn__CollisionName = null; + private string __pbn__CollisionName; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs.meta new file mode 100644 index 00000000..73db51e3 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/contactsensor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2cf01c1c0849d59e6bc2d260754f5882 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs b/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs new file mode 100644 index 00000000..8571aeda --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs @@ -0,0 +1,28 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: cylindergeom.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class CylinderGeom : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"radius", IsRequired = true)] + public double Radius { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"length", IsRequired = true)] + public double Length { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs.meta new file mode 100644 index 00000000..4794fbf4 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/cylindergeom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a9153f1e0b02f04eb98e82b8562980c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/density.cs b/Assets/Scripts/Tools/ProtobufMessages/density.cs new file mode 100644 index 00000000..52d49e6e --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/density.cs @@ -0,0 +1,25 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: density.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Density : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, IsRequired = true)] + public double density { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/density.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/density.cs.meta new file mode 100644 index 00000000..2bc97833 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/density.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ffd7c07fe09cb9a66bc9f36ae69ac6e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs b/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs new file mode 100644 index 00000000..6f7d6c58 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs @@ -0,0 +1,52 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: diagnostics.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Diagnostics : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"time")] + public global::System.Collections.Generic.List Times { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(2, Name = @"real_time", IsRequired = true)] + public Time RealTime { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"sim_time", IsRequired = true)] + public Time SimTime { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"real_time_factor", IsRequired = true)] + public double RealTimeFactor { get; set; } + + [global::ProtoBuf.ProtoContract()] + public partial class DiagTime : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)] + public string Name { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"elapsed", IsRequired = true)] + public Time Elapsed { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"wall", IsRequired = true)] + public Time Wall { get; set; } + + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs.meta new file mode 100644 index 00000000..5581b06d --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/diagnostics.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9d2cb1afd27bc7e48be4af41092b6df1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/distortion.cs b/Assets/Scripts/Tools/ProtobufMessages/distortion.cs new file mode 100644 index 00000000..0eb93dbb --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/distortion.cs @@ -0,0 +1,75 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: distortion.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Distortion : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"center")] + public Vector2d Center { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"k1")] + public double K1 + { + get { return __pbn__K1.GetValueOrDefault(); } + set { __pbn__K1 = value; } + } + public bool ShouldSerializeK1() => __pbn__K1 != null; + public void ResetK1() => __pbn__K1 = null; + private double? __pbn__K1; + + [global::ProtoBuf.ProtoMember(3, Name = @"k2")] + public double K2 + { + get { return __pbn__K2.GetValueOrDefault(); } + set { __pbn__K2 = value; } + } + public bool ShouldSerializeK2() => __pbn__K2 != null; + public void ResetK2() => __pbn__K2 = null; + private double? __pbn__K2; + + [global::ProtoBuf.ProtoMember(4, Name = @"k3")] + public double K3 + { + get { return __pbn__K3.GetValueOrDefault(); } + set { __pbn__K3 = value; } + } + public bool ShouldSerializeK3() => __pbn__K3 != null; + public void ResetK3() => __pbn__K3 = null; + private double? __pbn__K3; + + [global::ProtoBuf.ProtoMember(5, Name = @"p1")] + public double P1 + { + get { return __pbn__P1.GetValueOrDefault(); } + set { __pbn__P1 = value; } + } + public bool ShouldSerializeP1() => __pbn__P1 != null; + public void ResetP1() => __pbn__P1 = null; + private double? __pbn__P1; + + [global::ProtoBuf.ProtoMember(6, Name = @"p2")] + public double P2 + { + get { return __pbn__P2.GetValueOrDefault(); } + set { __pbn__P2 = value; } + } + public bool ShouldSerializeP2() => __pbn__P2 != null; + public void ResetP2() => __pbn__P2 = null; + private double? __pbn__P2; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/distortion.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/distortion.cs.meta new file mode 100644 index 00000000..01b14123 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/distortion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b6bffb343ba1909098b8d65962c03cf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/empty.cs b/Assets/Scripts/Tools/ProtobufMessages/empty.cs new file mode 100644 index 00000000..0474ffd5 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/empty.cs @@ -0,0 +1,32 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: empty.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Empty : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"unused")] + public bool Unused + { + get { return __pbn__Unused.GetValueOrDefault(); } + set { __pbn__Unused = value; } + } + public bool ShouldSerializeUnused() => __pbn__Unused != null; + public void ResetUnused() => __pbn__Unused = null; + private bool? __pbn__Unused; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/empty.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/empty.cs.meta new file mode 100644 index 00000000..ef5a7b1d --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/empty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 829ecba304d2967258902e4baf6bbbec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/factory.cs b/Assets/Scripts/Tools/ProtobufMessages/factory.cs new file mode 100644 index 00000000..2c16c1b8 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/factory.cs @@ -0,0 +1,80 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: factory.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Factory : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"sdf")] + [global::System.ComponentModel.DefaultValue("")] + public string Sdf + { + get { return __pbn__Sdf ?? ""; } + set { __pbn__Sdf = value; } + } + public bool ShouldSerializeSdf() => __pbn__Sdf != null; + public void ResetSdf() => __pbn__Sdf = null; + private string __pbn__Sdf; + + [global::ProtoBuf.ProtoMember(2, Name = @"sdf_filename")] + [global::System.ComponentModel.DefaultValue("")] + public string SdfFilename + { + get { return __pbn__SdfFilename ?? ""; } + set { __pbn__SdfFilename = value; } + } + public bool ShouldSerializeSdfFilename() => __pbn__SdfFilename != null; + public void ResetSdfFilename() => __pbn__SdfFilename = null; + private string __pbn__SdfFilename; + + [global::ProtoBuf.ProtoMember(3, Name = @"pose")] + public Pose Pose { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"edit_name")] + [global::System.ComponentModel.DefaultValue("")] + public string EditName + { + get { return __pbn__EditName ?? ""; } + set { __pbn__EditName = value; } + } + public bool ShouldSerializeEditName() => __pbn__EditName != null; + public void ResetEditName() => __pbn__EditName = null; + private string __pbn__EditName; + + [global::ProtoBuf.ProtoMember(5, Name = @"clone_model_name")] + [global::System.ComponentModel.DefaultValue("")] + public string CloneModelName + { + get { return __pbn__CloneModelName ?? ""; } + set { __pbn__CloneModelName = value; } + } + public bool ShouldSerializeCloneModelName() => __pbn__CloneModelName != null; + public void ResetCloneModelName() => __pbn__CloneModelName = null; + private string __pbn__CloneModelName; + + [global::ProtoBuf.ProtoMember(6, Name = @"allow_renaming")] + [global::System.ComponentModel.DefaultValue(true)] + public bool AllowRenaming + { + get { return __pbn__AllowRenaming ?? true; } + set { __pbn__AllowRenaming = value; } + } + public bool ShouldSerializeAllowRenaming() => __pbn__AllowRenaming != null; + public void ResetAllowRenaming() => __pbn__AllowRenaming = null; + private bool? __pbn__AllowRenaming; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/factory.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/factory.cs.meta new file mode 100644 index 00000000..abf86222 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/factory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca3f39313bfdefd78af54f9da0e2beac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/fluid.cs b/Assets/Scripts/Tools/ProtobufMessages/fluid.cs new file mode 100644 index 00000000..48c64410 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/fluid.cs @@ -0,0 +1,28 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: fluid.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Fluid : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)] + public string Name { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"position")] + public global::System.Collections.Generic.List Positions { get; } = new global::System.Collections.Generic.List(); + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/fluid.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/fluid.cs.meta new file mode 100644 index 00000000..8ec2c68d --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/fluid.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 86aa9664156e1edca99e396bcfa1b952 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/fog.cs b/Assets/Scripts/Tools/ProtobufMessages/fog.cs new file mode 100644 index 00000000..0ef92021 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/fog.cs @@ -0,0 +1,79 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: fog.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Fog : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"type")] + [global::System.ComponentModel.DefaultValue(FogType.None)] + public FogType Type + { + get { return __pbn__Type ?? FogType.None; } + set { __pbn__Type = value; } + } + public bool ShouldSerializeType() => __pbn__Type != null; + public void ResetType() => __pbn__Type = null; + private FogType? __pbn__Type; + + [global::ProtoBuf.ProtoMember(2, Name = @"color")] + public Color Color { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"density")] + public float Density + { + get { return __pbn__Density.GetValueOrDefault(); } + set { __pbn__Density = value; } + } + public bool ShouldSerializeDensity() => __pbn__Density != null; + public void ResetDensity() => __pbn__Density = null; + private float? __pbn__Density; + + [global::ProtoBuf.ProtoMember(4, Name = @"start")] + public float Start + { + get { return __pbn__Start.GetValueOrDefault(); } + set { __pbn__Start = value; } + } + public bool ShouldSerializeStart() => __pbn__Start != null; + public void ResetStart() => __pbn__Start = null; + private float? __pbn__Start; + + [global::ProtoBuf.ProtoMember(5, Name = @"end")] + public float End + { + get { return __pbn__End.GetValueOrDefault(); } + set { __pbn__End = value; } + } + public bool ShouldSerializeEnd() => __pbn__End != null; + public void ResetEnd() => __pbn__End = null; + private float? __pbn__End; + + [global::ProtoBuf.ProtoContract()] + public enum FogType + { + [global::ProtoBuf.ProtoEnum(Name = @"NONE")] + None = 1, + [global::ProtoBuf.ProtoEnum(Name = @"LINEAR")] + Linear = 2, + [global::ProtoBuf.ProtoEnum(Name = @"EXPONENTIAL")] + Exponential = 3, + [global::ProtoBuf.ProtoEnum(Name = @"EXPONENTIAL2")] + Exponential2 = 4, + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/fog.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/fog.cs.meta new file mode 100644 index 00000000..39536773 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/fog.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dcecaae27267bbce39b8b45cc752af83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/friction.cs b/Assets/Scripts/Tools/ProtobufMessages/friction.cs new file mode 100644 index 00000000..63ec3639 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/friction.cs @@ -0,0 +1,139 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: friction.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Friction : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"mu")] + public double Mu + { + get { return __pbn__Mu.GetValueOrDefault(); } + set { __pbn__Mu = value; } + } + public bool ShouldSerializeMu() => __pbn__Mu != null; + public void ResetMu() => __pbn__Mu = null; + private double? __pbn__Mu; + + [global::ProtoBuf.ProtoMember(2, Name = @"mu2")] + public double Mu2 + { + get { return __pbn__Mu2.GetValueOrDefault(); } + set { __pbn__Mu2 = value; } + } + public bool ShouldSerializeMu2() => __pbn__Mu2 != null; + public void ResetMu2() => __pbn__Mu2 = null; + private double? __pbn__Mu2; + + [global::ProtoBuf.ProtoMember(3, Name = @"fdir1")] + public Vector3d Fdir1 { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"slip1")] + public double Slip1 + { + get { return __pbn__Slip1.GetValueOrDefault(); } + set { __pbn__Slip1 = value; } + } + public bool ShouldSerializeSlip1() => __pbn__Slip1 != null; + public void ResetSlip1() => __pbn__Slip1 = null; + private double? __pbn__Slip1; + + [global::ProtoBuf.ProtoMember(5, Name = @"slip2")] + public double Slip2 + { + get { return __pbn__Slip2.GetValueOrDefault(); } + set { __pbn__Slip2 = value; } + } + public bool ShouldSerializeSlip2() => __pbn__Slip2 != null; + public void ResetSlip2() => __pbn__Slip2 = null; + private double? __pbn__Slip2; + + [global::ProtoBuf.ProtoMember(6)] + public Torsional torsional { get; set; } + + [global::ProtoBuf.ProtoContract()] + public partial class Torsional : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"coefficient")] + public double Coefficient + { + get { return __pbn__Coefficient.GetValueOrDefault(); } + set { __pbn__Coefficient = value; } + } + public bool ShouldSerializeCoefficient() => __pbn__Coefficient != null; + public void ResetCoefficient() => __pbn__Coefficient = null; + private double? __pbn__Coefficient; + + [global::ProtoBuf.ProtoMember(2, Name = @"use_patch_radius")] + public bool UsePatchRadius + { + get { return __pbn__UsePatchRadius.GetValueOrDefault(); } + set { __pbn__UsePatchRadius = value; } + } + public bool ShouldSerializeUsePatchRadius() => __pbn__UsePatchRadius != null; + public void ResetUsePatchRadius() => __pbn__UsePatchRadius = null; + private bool? __pbn__UsePatchRadius; + + [global::ProtoBuf.ProtoMember(3, Name = @"patch_radius")] + public double PatchRadius + { + get { return __pbn__PatchRadius.GetValueOrDefault(); } + set { __pbn__PatchRadius = value; } + } + public bool ShouldSerializePatchRadius() => __pbn__PatchRadius != null; + public void ResetPatchRadius() => __pbn__PatchRadius = null; + private double? __pbn__PatchRadius; + + [global::ProtoBuf.ProtoMember(4, Name = @"surface_radius")] + public double SurfaceRadius + { + get { return __pbn__SurfaceRadius.GetValueOrDefault(); } + set { __pbn__SurfaceRadius = value; } + } + public bool ShouldSerializeSurfaceRadius() => __pbn__SurfaceRadius != null; + public void ResetSurfaceRadius() => __pbn__SurfaceRadius = null; + private double? __pbn__SurfaceRadius; + + [global::ProtoBuf.ProtoMember(5)] + public Ode ode { get; set; } + + [global::ProtoBuf.ProtoContract(Name = @"ODE")] + public partial class Ode : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"slip")] + public double Slip + { + get { return __pbn__Slip.GetValueOrDefault(); } + set { __pbn__Slip = value; } + } + public bool ShouldSerializeSlip() => __pbn__Slip != null; + public void ResetSlip() => __pbn__Slip = null; + private double? __pbn__Slip; + + } + + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/friction.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/friction.cs.meta new file mode 100644 index 00000000..7a4be6ae --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/friction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8085e504a641367768c1feee22517d70 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/geometry.cs b/Assets/Scripts/Tools/ProtobufMessages/geometry.cs new file mode 100644 index 00000000..eb14747c --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/geometry.cs @@ -0,0 +1,87 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: geometry.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Geometry : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1)] + [global::System.ComponentModel.DefaultValue(Type.Box)] + public Type type + { + get { return __pbn__type ?? Type.Box; } + set { __pbn__type = value; } + } + public bool ShouldSerializetype() => __pbn__type != null; + public void Resettype() => __pbn__type = null; + private Type? __pbn__type; + + [global::ProtoBuf.ProtoMember(2, Name = @"box")] + public BoxGeom Box { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"cylinder")] + public CylinderGeom Cylinder { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"plane")] + public PlaneGeom Plane { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"sphere")] + public SphereGeom Sphere { get; set; } + + [global::ProtoBuf.ProtoMember(6, Name = @"image")] + public ImageGeom Image { get; set; } + + [global::ProtoBuf.ProtoMember(7, Name = @"heightmap")] + public HeightmapGeom Heightmap { get; set; } + + [global::ProtoBuf.ProtoMember(8, Name = @"mesh")] + public MeshGeom Mesh { get; set; } + + [global::ProtoBuf.ProtoMember(9, Name = @"points")] + public global::System.Collections.Generic.List Points { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(10, Name = @"polyline")] + public global::System.Collections.Generic.List Polylines { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoContract()] + public enum Type + { + [global::ProtoBuf.ProtoEnum(Name = @"BOX")] + Box = 1, + [global::ProtoBuf.ProtoEnum(Name = @"CYLINDER")] + Cylinder = 2, + [global::ProtoBuf.ProtoEnum(Name = @"SPHERE")] + Sphere = 3, + [global::ProtoBuf.ProtoEnum(Name = @"PLANE")] + Plane = 4, + [global::ProtoBuf.ProtoEnum(Name = @"IMAGE")] + Image = 5, + [global::ProtoBuf.ProtoEnum(Name = @"HEIGHTMAP")] + Heightmap = 6, + [global::ProtoBuf.ProtoEnum(Name = @"MESH")] + Mesh = 7, + [global::ProtoBuf.ProtoEnum(Name = @"TRIANGLE_FAN")] + TriangleFan = 8, + [global::ProtoBuf.ProtoEnum(Name = @"LINE_STRIP")] + LineStrip = 9, + [global::ProtoBuf.ProtoEnum(Name = @"POLYLINE")] + Polyline = 10, + [global::ProtoBuf.ProtoEnum(Name = @"EMPTY")] + Empty = 11, + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/geometry.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/geometry.cs.meta new file mode 100644 index 00000000..44655a39 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/geometry.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c39bf5b951045ad9bb3fcc47c94e03f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/gps.cs b/Assets/Scripts/Tools/ProtobufMessages/gps.cs new file mode 100644 index 00000000..6187eb15 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gps.cs @@ -0,0 +1,67 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: gps.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract(Name = @"GPS")] + public partial class Gps : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"time", IsRequired = true)] + public Time Time { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"link_name", IsRequired = true)] + public string LinkName { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"latitude_deg", IsRequired = true)] + public double LatitudeDeg { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"longitude_deg", IsRequired = true)] + public double LongitudeDeg { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"altitude", IsRequired = true)] + public double Altitude { get; set; } + + [global::ProtoBuf.ProtoMember(6, Name = @"velocity_east")] + public double VelocityEast + { + get { return __pbn__VelocityEast.GetValueOrDefault(); } + set { __pbn__VelocityEast = value; } + } + public bool ShouldSerializeVelocityEast() => __pbn__VelocityEast != null; + public void ResetVelocityEast() => __pbn__VelocityEast = null; + private double? __pbn__VelocityEast; + + [global::ProtoBuf.ProtoMember(7, Name = @"velocity_north")] + public double VelocityNorth + { + get { return __pbn__VelocityNorth.GetValueOrDefault(); } + set { __pbn__VelocityNorth = value; } + } + public bool ShouldSerializeVelocityNorth() => __pbn__VelocityNorth != null; + public void ResetVelocityNorth() => __pbn__VelocityNorth = null; + private double? __pbn__VelocityNorth; + + [global::ProtoBuf.ProtoMember(8, Name = @"velocity_up")] + public double VelocityUp + { + get { return __pbn__VelocityUp.GetValueOrDefault(); } + set { __pbn__VelocityUp = value; } + } + public bool ShouldSerializeVelocityUp() => __pbn__VelocityUp != null; + public void ResetVelocityUp() => __pbn__VelocityUp = null; + private double? __pbn__VelocityUp; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/gps.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gps.cs.meta new file mode 100644 index 00000000..e4925da1 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gps.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db1e20a9d656620e3ae9705d5f5b6c45 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs b/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs new file mode 100644 index 00000000..92c72ff0 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs @@ -0,0 +1,43 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: gps_sensor.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class GPSSensor : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"position")] + public Sensing Position { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"velocity")] + public Sensing Velocity { get; set; } + + [global::ProtoBuf.ProtoContract()] + public partial class Sensing : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"horizontal_noise")] + public SensorNoise HorizontalNoise { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"vertical_noise")] + public SensorNoise VerticalNoise { get; set; } + + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs.meta new file mode 100644 index 00000000..29170036 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gps_sensor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9d9b449d192aa9a07a5d383ef3dbb828 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/gui.cs b/Assets/Scripts/Tools/ProtobufMessages/gui.cs new file mode 100644 index 00000000..1e866ebe --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gui.cs @@ -0,0 +1,38 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: gui.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract(Name = @"GUI")] + public partial class Gui : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"fullscreen")] + public bool Fullscreen + { + get { return __pbn__Fullscreen.GetValueOrDefault(); } + set { __pbn__Fullscreen = value; } + } + public bool ShouldSerializeFullscreen() => __pbn__Fullscreen != null; + public void ResetFullscreen() => __pbn__Fullscreen = null; + private bool? __pbn__Fullscreen; + + [global::ProtoBuf.ProtoMember(2, Name = @"camera")] + public GUICamera Camera { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"plugin")] + public global::System.Collections.Generic.List Plugins { get; } = new global::System.Collections.Generic.List(); + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/gui.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gui.cs.meta new file mode 100644 index 00000000..d5f80b6b --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gui.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c65dfe72adfca1ad9a2f7c582602c38 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs b/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs new file mode 100644 index 00000000..5c5418af --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs @@ -0,0 +1,53 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: gui_camera.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class GUICamera : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)] + public string Name { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"view_controller")] + [global::System.ComponentModel.DefaultValue("")] + public string ViewController + { + get { return __pbn__ViewController ?? ""; } + set { __pbn__ViewController = value; } + } + public bool ShouldSerializeViewController() => __pbn__ViewController != null; + public void ResetViewController() => __pbn__ViewController = null; + private string __pbn__ViewController; + + [global::ProtoBuf.ProtoMember(3, Name = @"pose")] + public Pose Pose { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"track")] + public TrackVisual Track { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"projection_type")] + [global::System.ComponentModel.DefaultValue("")] + public string ProjectionType + { + get { return __pbn__ProjectionType ?? ""; } + set { __pbn__ProjectionType = value; } + } + public bool ShouldSerializeProjectionType() => __pbn__ProjectionType != null; + public void ResetProjectionType() => __pbn__ProjectionType = null; + private string __pbn__ProjectionType; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs.meta new file mode 100644 index 00000000..64ae4580 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gui_camera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0fb3d171c559a91d0b466147c9fd677e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs b/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs new file mode 100644 index 00000000..cbce2233 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs @@ -0,0 +1,25 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: gz_string.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class GzString : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"data", IsRequired = true)] + public string Data { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs.meta new file mode 100644 index 00000000..b398853b --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gz_string.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93aba49193cff7c12ae2d8bd0f0865a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs b/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs new file mode 100644 index 00000000..0d11b652 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs @@ -0,0 +1,25 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: gz_string_v.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract(Name = @"GzString_V")] + public partial class GzStringV : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"data")] + public global::System.Collections.Generic.List Datas { get; } = new global::System.Collections.Generic.List(); + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs.meta new file mode 100644 index 00000000..31f287af --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/gz_string_v.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f87186cc2accf52f8c02b7998f4dd9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/header.cs b/Assets/Scripts/Tools/ProtobufMessages/header.cs new file mode 100644 index 00000000..41d6f659 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/header.cs @@ -0,0 +1,46 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: header.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Header : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"str_id")] + [global::System.ComponentModel.DefaultValue("")] + public string StrId + { + get { return __pbn__StrId ?? ""; } + set { __pbn__StrId = value; } + } + public bool ShouldSerializeStrId() => __pbn__StrId != null; + public void ResetStrId() => __pbn__StrId = null; + private string __pbn__StrId; + + [global::ProtoBuf.ProtoMember(2, Name = @"stamp")] + public Time Stamp { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"index")] + public int Index + { + get { return __pbn__Index.GetValueOrDefault(); } + set { __pbn__Index = value; } + } + public bool ShouldSerializeIndex() => __pbn__Index != null; + public void ResetIndex() => __pbn__Index = null; + private int? __pbn__Index; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/header.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/header.cs.meta new file mode 100644 index 00000000..cbfc0a2f --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/header.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3bce6546fb7e837a3a159e0a033eb03e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs b/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs new file mode 100644 index 00000000..088cd694 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs @@ -0,0 +1,124 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: heightmapgeom.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class HeightmapGeom : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"image")] + public Image Image { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"size", IsRequired = true)] + public Vector3d Size { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"origin")] + public Vector3d Origin { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"heights")] + public float[] Heights { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"width")] + public int Width + { + get { return __pbn__Width.GetValueOrDefault(); } + set { __pbn__Width = value; } + } + public bool ShouldSerializeWidth() => __pbn__Width != null; + public void ResetWidth() => __pbn__Width = null; + private int? __pbn__Width; + + [global::ProtoBuf.ProtoMember(6, Name = @"height")] + public int Height + { + get { return __pbn__Height.GetValueOrDefault(); } + set { __pbn__Height = value; } + } + public bool ShouldSerializeHeight() => __pbn__Height != null; + public void ResetHeight() => __pbn__Height = null; + private int? __pbn__Height; + + [global::ProtoBuf.ProtoMember(7, Name = @"texture")] + public global::System.Collections.Generic.List Textures { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(8, Name = @"blend")] + public global::System.Collections.Generic.List Blends { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(9, Name = @"use_terrain_paging")] + public bool UseTerrainPaging + { + get { return __pbn__UseTerrainPaging.GetValueOrDefault(); } + set { __pbn__UseTerrainPaging = value; } + } + public bool ShouldSerializeUseTerrainPaging() => __pbn__UseTerrainPaging != null; + public void ResetUseTerrainPaging() => __pbn__UseTerrainPaging = null; + private bool? __pbn__UseTerrainPaging; + + [global::ProtoBuf.ProtoMember(10, Name = @"filename")] + [global::System.ComponentModel.DefaultValue("")] + public string Filename + { + get { return __pbn__Filename ?? ""; } + set { __pbn__Filename = value; } + } + public bool ShouldSerializeFilename() => __pbn__Filename != null; + public void ResetFilename() => __pbn__Filename = null; + private string __pbn__Filename; + + [global::ProtoBuf.ProtoMember(11, Name = @"sampling")] + public uint Sampling + { + get { return __pbn__Sampling.GetValueOrDefault(); } + set { __pbn__Sampling = value; } + } + public bool ShouldSerializeSampling() => __pbn__Sampling != null; + public void ResetSampling() => __pbn__Sampling = null; + private uint? __pbn__Sampling; + + [global::ProtoBuf.ProtoContract()] + public partial class Texture : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"diffuse", IsRequired = true)] + public string Diffuse { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"normal", IsRequired = true)] + public string Normal { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"size", IsRequired = true)] + public double Size { get; set; } + + } + + [global::ProtoBuf.ProtoContract()] + public partial class Blend : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"min_height", IsRequired = true)] + public double MinHeight { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"fade_dist", IsRequired = true)] + public double FadeDist { get; set; } + + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs.meta new file mode 100644 index 00000000..3f239d31 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/heightmapgeom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 698bbe03b24ae805093800ab3c5eea60 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/hydra.cs b/Assets/Scripts/Tools/ProtobufMessages/hydra.cs new file mode 100644 index 00000000..221e433f --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/hydra.cs @@ -0,0 +1,70 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: hydra.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Hydra : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"right", IsRequired = true)] + public Paddle Right { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"left", IsRequired = true)] + public Paddle Left { get; set; } + + [global::ProtoBuf.ProtoContract()] + public partial class Paddle : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"pose", IsRequired = true)] + public Pose Pose { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"button_bumper", IsRequired = true)] + public bool ButtonBumper { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"button_1", IsRequired = true)] + public bool Button1 { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"button_2", IsRequired = true)] + public bool Button2 { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"button_3", IsRequired = true)] + public bool Button3 { get; set; } + + [global::ProtoBuf.ProtoMember(6, Name = @"button_4", IsRequired = true)] + public bool Button4 { get; set; } + + [global::ProtoBuf.ProtoMember(7, Name = @"button_joy", IsRequired = true)] + public bool ButtonJoy { get; set; } + + [global::ProtoBuf.ProtoMember(8, Name = @"button_center", IsRequired = true)] + public bool ButtonCenter { get; set; } + + [global::ProtoBuf.ProtoMember(9, Name = @"joy_x", IsRequired = true)] + public double JoyX { get; set; } + + [global::ProtoBuf.ProtoMember(10, Name = @"joy_y", IsRequired = true)] + public double JoyY { get; set; } + + [global::ProtoBuf.ProtoMember(11, Name = @"trigger", IsRequired = true)] + public double Trigger { get; set; } + + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/hydra.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/hydra.cs.meta new file mode 100644 index 00000000..6a19d97c --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/hydra.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 882cceb622c966e4db886c0fb1be7318 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/image.cs b/Assets/Scripts/Tools/ProtobufMessages/image.cs new file mode 100644 index 00000000..70250156 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/image.cs @@ -0,0 +1,37 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: image.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Image : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"width", IsRequired = true)] + public uint Width { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"height", IsRequired = true)] + public uint Height { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"pixel_format", IsRequired = true)] + public uint PixelFormat { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"step", IsRequired = true)] + public uint Step { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"data", IsRequired = true)] + public byte[] Data { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/image.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/image.cs.meta new file mode 100644 index 00000000..8467fb45 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/image.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 73182cc810b9f36fb926c723cf83d2c0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs b/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs new file mode 100644 index 00000000..53056a68 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs @@ -0,0 +1,28 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: image_stamped.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class ImageStamped : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"time", IsRequired = true)] + public Time Time { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"image", IsRequired = true)] + public Image Image { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs.meta new file mode 100644 index 00000000..45f9a3bf --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/image_stamped.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 77bce749a6da39e999c6a2f485755aa2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs b/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs new file mode 100644 index 00000000..59746137 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs @@ -0,0 +1,66 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: imagegeom.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class ImageGeom : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"uri", IsRequired = true)] + public string Uri { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"scale")] + public double Scale + { + get { return __pbn__Scale.GetValueOrDefault(); } + set { __pbn__Scale = value; } + } + public bool ShouldSerializeScale() => __pbn__Scale != null; + public void ResetScale() => __pbn__Scale = null; + private double? __pbn__Scale; + + [global::ProtoBuf.ProtoMember(3, Name = @"threshold")] + [global::System.ComponentModel.DefaultValue(255)] + public int Threshold + { + get { return __pbn__Threshold ?? 255; } + set { __pbn__Threshold = value; } + } + public bool ShouldSerializeThreshold() => __pbn__Threshold != null; + public void ResetThreshold() => __pbn__Threshold = null; + private int? __pbn__Threshold; + + [global::ProtoBuf.ProtoMember(4, Name = @"height")] + public double Height + { + get { return __pbn__Height.GetValueOrDefault(); } + set { __pbn__Height = value; } + } + public bool ShouldSerializeHeight() => __pbn__Height != null; + public void ResetHeight() => __pbn__Height = null; + private double? __pbn__Height; + + [global::ProtoBuf.ProtoMember(5, Name = @"granularity")] + public int Granularity + { + get { return __pbn__Granularity.GetValueOrDefault(); } + set { __pbn__Granularity = value; } + } + public bool ShouldSerializeGranularity() => __pbn__Granularity != null; + public void ResetGranularity() => __pbn__Granularity = null; + private int? __pbn__Granularity; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs.meta new file mode 100644 index 00000000..36431a10 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/imagegeom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80402e84388091b4d9beb475bf964575 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs b/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs new file mode 100644 index 00000000..a3db8b79 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs @@ -0,0 +1,28 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: images_stamped.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class ImagesStamped : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"time", IsRequired = true)] + public Time Time { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"image")] + public global::System.Collections.Generic.List Images { get; } = new global::System.Collections.Generic.List(); + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs.meta new file mode 100644 index 00000000..1357d55e --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/images_stamped.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d55eecf0739a01c8baead0480a412e07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/imu.cs b/Assets/Scripts/Tools/ProtobufMessages/imu.cs new file mode 100644 index 00000000..666a2f29 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/imu.cs @@ -0,0 +1,37 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: imu.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract(Name = @"IMU")] + public partial class Imu : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"stamp", IsRequired = true)] + public Time Stamp { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"entity_name", IsRequired = true)] + public string EntityName { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"orientation", IsRequired = true)] + public Quaternion Orientation { get; set; } + + [global::ProtoBuf.ProtoMember(4, Name = @"angular_velocity", IsRequired = true)] + public Vector3d AngularVelocity { get; set; } + + [global::ProtoBuf.ProtoMember(5, Name = @"linear_acceleration", IsRequired = true)] + public Vector3d LinearAcceleration { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/imu.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/imu.cs.meta new file mode 100644 index 00000000..e846b15b --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/imu.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce3fe7805cabe210db239b8eedc7e988 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/imu_sensor.cs b/Assets/Scripts/Tools/ProtobufMessages/imu_sensor.cs new file mode 100644 index 00000000..38eabaa0 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/imu_sensor.cs @@ -0,0 +1,64 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: imu_sensor.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class IMUSensor : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1)] + public AngularVelocity angular_velocity { get; set; } + + [global::ProtoBuf.ProtoMember(2)] + public LinearAcceleration linear_acceleration { get; set; } + + [global::ProtoBuf.ProtoContract()] + public partial class AngularVelocity : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"x_noise")] + public SensorNoise XNoise { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"y_noise")] + public SensorNoise YNoise { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"z_noise")] + public SensorNoise ZNoise { get; set; } + + } + + [global::ProtoBuf.ProtoContract()] + public partial class LinearAcceleration : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"x_noise")] + public SensorNoise XNoise { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"y_noise")] + public SensorNoise YNoise { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"z_noise")] + public SensorNoise ZNoise { get; set; } + + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/imu_sensor.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/imu_sensor.cs.meta new file mode 100644 index 00000000..ee4f19b8 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/imu_sensor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2bf1087751b7c03039b870221cb74095 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/inertial.cs b/Assets/Scripts/Tools/ProtobufMessages/inertial.cs new file mode 100644 index 00000000..4eee6c6c --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/inertial.cs @@ -0,0 +1,95 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: inertial.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Inertial : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"mass")] + public double Mass + { + get { return __pbn__Mass.GetValueOrDefault(); } + set { __pbn__Mass = value; } + } + public bool ShouldSerializeMass() => __pbn__Mass != null; + public void ResetMass() => __pbn__Mass = null; + private double? __pbn__Mass; + + [global::ProtoBuf.ProtoMember(2, Name = @"pose")] + public Pose Pose { get; set; } + + [global::ProtoBuf.ProtoMember(3, Name = @"ixx")] + public double Ixx + { + get { return __pbn__Ixx.GetValueOrDefault(); } + set { __pbn__Ixx = value; } + } + public bool ShouldSerializeIxx() => __pbn__Ixx != null; + public void ResetIxx() => __pbn__Ixx = null; + private double? __pbn__Ixx; + + [global::ProtoBuf.ProtoMember(4, Name = @"ixy")] + public double Ixy + { + get { return __pbn__Ixy.GetValueOrDefault(); } + set { __pbn__Ixy = value; } + } + public bool ShouldSerializeIxy() => __pbn__Ixy != null; + public void ResetIxy() => __pbn__Ixy = null; + private double? __pbn__Ixy; + + [global::ProtoBuf.ProtoMember(5, Name = @"ixz")] + public double Ixz + { + get { return __pbn__Ixz.GetValueOrDefault(); } + set { __pbn__Ixz = value; } + } + public bool ShouldSerializeIxz() => __pbn__Ixz != null; + public void ResetIxz() => __pbn__Ixz = null; + private double? __pbn__Ixz; + + [global::ProtoBuf.ProtoMember(6, Name = @"iyy")] + public double Iyy + { + get { return __pbn__Iyy.GetValueOrDefault(); } + set { __pbn__Iyy = value; } + } + public bool ShouldSerializeIyy() => __pbn__Iyy != null; + public void ResetIyy() => __pbn__Iyy = null; + private double? __pbn__Iyy; + + [global::ProtoBuf.ProtoMember(7, Name = @"iyz")] + public double Iyz + { + get { return __pbn__Iyz.GetValueOrDefault(); } + set { __pbn__Iyz = value; } + } + public bool ShouldSerializeIyz() => __pbn__Iyz != null; + public void ResetIyz() => __pbn__Iyz = null; + private double? __pbn__Iyz; + + [global::ProtoBuf.ProtoMember(8, Name = @"izz")] + public double Izz + { + get { return __pbn__Izz.GetValueOrDefault(); } + set { __pbn__Izz = value; } + } + public bool ShouldSerializeIzz() => __pbn__Izz != null; + public void ResetIzz() => __pbn__Izz = null; + private double? __pbn__Izz; + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/inertial.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/inertial.cs.meta new file mode 100644 index 00000000..03f89210 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/inertial.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd28e0e2bd08abe4c83cdf051606d5a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/int.cs b/Assets/Scripts/Tools/ProtobufMessages/int.cs new file mode 100644 index 00000000..8ec51c32 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/int.cs @@ -0,0 +1,25 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: int.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Int : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"data", IsRequired = true)] + public int Data { get; set; } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/int.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/int.cs.meta new file mode 100644 index 00000000..47e140b3 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/int.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49f1f107415f93aecb8a46459b49bf59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/joint.cs b/Assets/Scripts/Tools/ProtobufMessages/joint.cs new file mode 100644 index 00000000..392d791b --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/joint.cs @@ -0,0 +1,237 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: joint.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class Joint : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"name", IsRequired = true)] + public string Name { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"id")] + public uint Id + { + get { return __pbn__Id.GetValueOrDefault(); } + set { __pbn__Id = value; } + } + public bool ShouldSerializeId() => __pbn__Id != null; + public void ResetId() => __pbn__Id = null; + private uint? __pbn__Id; + + [global::ProtoBuf.ProtoMember(3, Name = @"angle")] + public double[] Angles { get; set; } + + [global::ProtoBuf.ProtoMember(4)] + [global::System.ComponentModel.DefaultValue(Type.Revolute)] + public Type type + { + get { return __pbn__type ?? Type.Revolute; } + set { __pbn__type = value; } + } + public bool ShouldSerializetype() => __pbn__type != null; + public void Resettype() => __pbn__type = null; + private Type? __pbn__type; + + [global::ProtoBuf.ProtoMember(5, Name = @"parent")] + [global::System.ComponentModel.DefaultValue("")] + public string Parent + { + get { return __pbn__Parent ?? ""; } + set { __pbn__Parent = value; } + } + public bool ShouldSerializeParent() => __pbn__Parent != null; + public void ResetParent() => __pbn__Parent = null; + private string __pbn__Parent; + + [global::ProtoBuf.ProtoMember(6, Name = @"parent_id")] + public uint ParentId + { + get { return __pbn__ParentId.GetValueOrDefault(); } + set { __pbn__ParentId = value; } + } + public bool ShouldSerializeParentId() => __pbn__ParentId != null; + public void ResetParentId() => __pbn__ParentId = null; + private uint? __pbn__ParentId; + + [global::ProtoBuf.ProtoMember(7, Name = @"child")] + [global::System.ComponentModel.DefaultValue("")] + public string Child + { + get { return __pbn__Child ?? ""; } + set { __pbn__Child = value; } + } + public bool ShouldSerializeChild() => __pbn__Child != null; + public void ResetChild() => __pbn__Child = null; + private string __pbn__Child; + + [global::ProtoBuf.ProtoMember(8, Name = @"child_id")] + public uint ChildId + { + get { return __pbn__ChildId.GetValueOrDefault(); } + set { __pbn__ChildId = value; } + } + public bool ShouldSerializeChildId() => __pbn__ChildId != null; + public void ResetChildId() => __pbn__ChildId = null; + private uint? __pbn__ChildId; + + [global::ProtoBuf.ProtoMember(9, Name = @"pose")] + public Pose Pose { get; set; } + + [global::ProtoBuf.ProtoMember(10, Name = @"axis1")] + public Axis Axis1 { get; set; } + + [global::ProtoBuf.ProtoMember(11, Name = @"axis2")] + public Axis Axis2 { get; set; } + + [global::ProtoBuf.ProtoMember(12, Name = @"cfm")] + public double Cfm + { + get { return __pbn__Cfm.GetValueOrDefault(); } + set { __pbn__Cfm = value; } + } + public bool ShouldSerializeCfm() => __pbn__Cfm != null; + public void ResetCfm() => __pbn__Cfm = null; + private double? __pbn__Cfm; + + [global::ProtoBuf.ProtoMember(13, Name = @"bounce")] + public double Bounce + { + get { return __pbn__Bounce.GetValueOrDefault(); } + set { __pbn__Bounce = value; } + } + public bool ShouldSerializeBounce() => __pbn__Bounce != null; + public void ResetBounce() => __pbn__Bounce = null; + private double? __pbn__Bounce; + + [global::ProtoBuf.ProtoMember(14, Name = @"velocity")] + public double Velocity + { + get { return __pbn__Velocity.GetValueOrDefault(); } + set { __pbn__Velocity = value; } + } + public bool ShouldSerializeVelocity() => __pbn__Velocity != null; + public void ResetVelocity() => __pbn__Velocity = null; + private double? __pbn__Velocity; + + [global::ProtoBuf.ProtoMember(15, Name = @"fudge_factor")] + public double FudgeFactor + { + get { return __pbn__FudgeFactor.GetValueOrDefault(); } + set { __pbn__FudgeFactor = value; } + } + public bool ShouldSerializeFudgeFactor() => __pbn__FudgeFactor != null; + public void ResetFudgeFactor() => __pbn__FudgeFactor = null; + private double? __pbn__FudgeFactor; + + [global::ProtoBuf.ProtoMember(16, Name = @"limit_cfm")] + public double LimitCfm + { + get { return __pbn__LimitCfm.GetValueOrDefault(); } + set { __pbn__LimitCfm = value; } + } + public bool ShouldSerializeLimitCfm() => __pbn__LimitCfm != null; + public void ResetLimitCfm() => __pbn__LimitCfm = null; + private double? __pbn__LimitCfm; + + [global::ProtoBuf.ProtoMember(17, Name = @"limit_erp")] + public double LimitErp + { + get { return __pbn__LimitErp.GetValueOrDefault(); } + set { __pbn__LimitErp = value; } + } + public bool ShouldSerializeLimitErp() => __pbn__LimitErp != null; + public void ResetLimitErp() => __pbn__LimitErp = null; + private double? __pbn__LimitErp; + + [global::ProtoBuf.ProtoMember(18, Name = @"suspension_cfm")] + public double SuspensionCfm + { + get { return __pbn__SuspensionCfm.GetValueOrDefault(); } + set { __pbn__SuspensionCfm = value; } + } + public bool ShouldSerializeSuspensionCfm() => __pbn__SuspensionCfm != null; + public void ResetSuspensionCfm() => __pbn__SuspensionCfm = null; + private double? __pbn__SuspensionCfm; + + [global::ProtoBuf.ProtoMember(19, Name = @"suspension_erp")] + public double SuspensionErp + { + get { return __pbn__SuspensionErp.GetValueOrDefault(); } + set { __pbn__SuspensionErp = value; } + } + public bool ShouldSerializeSuspensionErp() => __pbn__SuspensionErp != null; + public void ResetSuspensionErp() => __pbn__SuspensionErp = null; + private double? __pbn__SuspensionErp; + + [global::ProtoBuf.ProtoMember(20)] + public Gearbox gearbox { get; set; } + + [global::ProtoBuf.ProtoMember(21)] + public Screw screw { get; set; } + + [global::ProtoBuf.ProtoMember(22, Name = @"sensor")] + public global::System.Collections.Generic.List Sensors { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoContract()] + public partial class Gearbox : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"gearbox_reference_body", IsRequired = true)] + public string GearboxReferenceBody { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"gearbox_ratio", IsRequired = true)] + public double GearboxRatio { get; set; } + + } + + [global::ProtoBuf.ProtoContract()] + public partial class Screw : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"thread_pitch", IsRequired = true)] + public double ThreadPitch { get; set; } + + } + + [global::ProtoBuf.ProtoContract()] + public enum Type + { + [global::ProtoBuf.ProtoEnum(Name = @"REVOLUTE")] + Revolute = 1, + [global::ProtoBuf.ProtoEnum(Name = @"REVOLUTE2")] + Revolute2 = 2, + [global::ProtoBuf.ProtoEnum(Name = @"PRISMATIC")] + Prismatic = 3, + [global::ProtoBuf.ProtoEnum(Name = @"UNIVERSAL")] + Universal = 4, + [global::ProtoBuf.ProtoEnum(Name = @"BALL")] + Ball = 5, + [global::ProtoBuf.ProtoEnum(Name = @"SCREW")] + Screw = 6, + [global::ProtoBuf.ProtoEnum(Name = @"GEARBOX")] + Gearbox = 7, + [global::ProtoBuf.ProtoEnum(Name = @"FIXED")] + Fixed = 8, + } + + } + +} + +#pragma warning restore CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Assets/Scripts/Tools/ProtobufMessages/joint.cs.meta b/Assets/Scripts/Tools/ProtobufMessages/joint.cs.meta new file mode 100644 index 00000000..e946f073 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/joint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d2ad09d1edd14283ea77079456c77600 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ProtobufMessages/joint_animation.cs b/Assets/Scripts/Tools/ProtobufMessages/joint_animation.cs new file mode 100644 index 00000000..2be225c2 --- /dev/null +++ b/Assets/Scripts/Tools/ProtobufMessages/joint_animation.cs @@ -0,0 +1,46 @@ +// +// This file was generated by a tool; you should avoid making direct changes. +// Consider using 'partial classes' to extend these types +// Input: joint_animation.proto +// + +#pragma warning disable CS0612, CS1591, CS3021, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 +namespace gazebo.msgs +{ + + [global::ProtoBuf.ProtoContract()] + public partial class JointAnimation : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"model_name", IsRequired = true)] + public string ModelName { get; set; } + + [global::ProtoBuf.ProtoMember(2, Name = @"joint")] + public global::System.Collections.Generic.List Joints { get; } = new global::System.Collections.Generic.List(); + + [global::ProtoBuf.ProtoMember(3, Name = @"time")] + public global::System.Collections.Generic.List