diff --git a/.gitignore b/.gitignore index 8d5e3d43..b868b397 100644 --- a/.gitignore +++ b/.gitignore @@ -76,4 +76,26 @@ Recordings/ # Paid assets /[Aa]ssets/Magic Light Probes/* -/[Aa]ssets/[Bb]akery/* \ No newline at end of file +/[Aa]ssets/[Bb]akery/* + + + +#FMOD + +# Never ignore DLLs in the FMOD subfolder. +!/[Aa]ssets/Plugins/FMOD/**/lib/* + +# Don't ignore images and gizmos used by FMOD in the Unity Editor. +!/[Aa]ssets/Gizmos/FMOD/* +!/[Aa]ssets/Editor Default Resources/FMOD/* + +# Ignore the Cache folder since it is updated locally. +/[Aa]ssets/Plugins/FMOD/Cache/* + +# Ignore bank files in the StreamingAssets folder. +/[Aa]ssets/StreamingAssets/**/*.bank +/[Aa]ssets/StreamingAssets/**/*.bank.meta + +# If the source bank files are kept outside of the StreamingAssets folder then these can be ignored. +# Log files can be ignored. +fmod_editor.log \ No newline at end of file diff --git a/Assets/Plugins.meta b/Assets/Plugins.meta new file mode 100644 index 00000000..4b4b1aaa --- /dev/null +++ b/Assets/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7614f5c67d1ff3542beaf4fe57f2b011 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD.meta b/Assets/Plugins/FMOD.meta new file mode 100644 index 00000000..73f856b7 --- /dev/null +++ b/Assets/Plugins/FMOD.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 06ae579381df01a4a87bb149dec89954 +folderAsset: yes +timeCreated: 1429061260 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/Cache.meta b/Assets/Plugins/FMOD/Cache.meta new file mode 100644 index 00000000..07755680 --- /dev/null +++ b/Assets/Plugins/FMOD/Cache.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 073efe56830e3114db9d15a0a53828e4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/FMODUnity.asmdef b/Assets/Plugins/FMOD/FMODUnity.asmdef new file mode 100644 index 00000000..115fd817 --- /dev/null +++ b/Assets/Plugins/FMOD/FMODUnity.asmdef @@ -0,0 +1,47 @@ +{ + "name": "FMODUnity", + "references": [ + "Unity.Timeline", + "Unity.Addressables", + "Unity.ResourceManager", + "Unity.RenderPipelines.Universal.Runtime" + + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2021_3_OR_NEWER" + ], + "versionDefines": [ + { + "name": "com.unity.timeline", + "expression": "1.0.0", + "define": "UNITY_TIMELINE_EXIST" + }, + { + "name": "com.unity.addressables", + "expression": "1.0.0", + "define": "UNITY_ADDRESSABLES_EXIST" + }, + { + "name": "com.unity.modules.physics", + "expression": "1.0.0", + "define": "UNITY_PHYSICS_EXIST" + }, + { + "name": "com.unity.modules.physics2d", + "expression": "1.0.0", + "define": "UNITY_PHYSICS2D_EXIST" + }, + { + "name": "com.unity.urp", + "expression": "1.0.0", + "define": "UNITY_URP_EXIST" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/FMODUnity.asmdef.meta b/Assets/Plugins/FMOD/FMODUnity.asmdef.meta new file mode 100644 index 00000000..5f7fa24d --- /dev/null +++ b/Assets/Plugins/FMOD/FMODUnity.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0c752da273b17c547ae705acf0f2adf2 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/LICENSE.txt b/Assets/Plugins/FMOD/LICENSE.txt new file mode 100644 index 00000000..2ce86fa4 --- /dev/null +++ b/Assets/Plugins/FMOD/LICENSE.txt @@ -0,0 +1,1053 @@ + FMOD END USER LICENCE AGREEMENT + =============================== + +This End User Licence Agreement (EULA) is a legal agreement between you and +Firelight Technologies Pty Ltd (ACN 099 182 448) (us or we) and governs your +use of FMOD Studio and FMOD Engine, together the Software. + +1. GRANT OF LICENCE + +1.1 FMOD Studio + +This EULA grants you the right to use FMOD Studio, being the desktop +application for adaptive audio content creation, for all use, including +Commercial use, subject to the following: + + i. FMOD Studio is used to create content for use with the FMOD Engine + only; + ii. FMOD Studio is not redistributed in any form. + +1.2 FMOD Engine + +This EULA grants you the right to use the FMOD Engine, 'FMOD Ex' or 'FMOD 3' +being the run-time engines for adaptive audio playback, without payment, for +personal (hobbyist), educational (students and teachers) or Non-Commercial use, +subject to the following: + + i. FMOD Engine is integrated and redistributed in a software application + (Product) only; + ii. FMOD Engine is not distributed as part of a game engine or tool set; + iii. FMOD Engine is not used in any Commercial enterprise or for any + Commercial production or subcontracting, except for the purposes of + Evaluation or Development of a Commercial Product; + iv. Non-Commercial use does not involve any form of monetisation, + sponsorship or promotion; + v. Product includes attribution in accordance with Clause 3. + +This EULA grants you the right to use FMOD Engine, for limited Commercial +use, subject to the following: + + i. Development budget of the project is less than $600k USD (Refer to + https://www.fmod.com/licensing#licensing-faq) for information); + ii. Total gross revenue / funding per year for the developer, before + expenses, is less than $200k USD (Refer to + https://www.fmod.com/licensing#licensing-faq for information); + iii. FMOD Engine is integrated and redistributed in a game application + (Product) only; + iv. FMOD Engine is not distributed as part of a game engine or tool set; + v. FMOD Engine is not distributed as part of a Product with the intent + to be commercially exploited by another business or institution; + vi. Project is registered in your profile page at + https://www.fmod.com/profile#projects; + vii. Product includes attribution in accordance with Clause 3. + +This EULA does not grant you the right to use 'FMOD Ex' or 'FMOD 3', for +Commercial use. A custom commercial license must be acquired from Firelight +Technologies by contacting sales@fmod.com. + +1.3 FMOD SDK + +This EULA grants you the right to use the FMOD SDK, interfacing either 'FMOD +Engine', 'FMOD Ex' or 'FMOD 3', comprising the programming interface +specification, documentation and examples subject to the following: + + i. FMOD SDK is used to develop a software application using the FMOD + Engine; + ii. FMOD SDK is used to develop an external DSP, Output or Codec plugin; + iii. FMOD SDK files are not be distributed with the exception of the FMOD + Engine run-time libraries (.DLL, .SO for example). + +1.4 FMOD example code and media + +This EULA grants you the right to use FMOD example code, being all or snippets +of source code files located in the FMOD API examples folder and scripting +examples in the documentation, for all use, including Commercial use, subject +to the following: + + i. Media files included in FMOD examples, including wav, ogg, mp3, fsb + and bank files, are not to be redistributed. + +2.OTHER USE + +For all Commercial use, and any Non Commercial use not permitted by this +license, a separate license is required. Refer to www.fmod.com/licensing for +information. + +3. CREDITS + +All Products require an in game credit line which must include the words "FMOD" +and "Firelight Technologies Pty Ltd." Refer to www.fmod.com/attribution for +examples. + +4. INTELLECTUAL PROPERTY RIGHTS + +We are and remain at all times the owner of the Software (including all +intellectual property rights in or to the Software). For the avoidance of doubt, +nothing in this EULA may be deemed to grant or assign to you any proprietary or +ownership interest or intellectual property rights in or to the Software other +than the rights licensed pursuant to Clause 1. + +You acknowledge and agree that you have no right, title or interest in and to +the intellectual property rights in the Software. + +5. SECURITY AND RISK + +You are responsible for protecting the Software and any related materials at all +times from unauthorised access, use or damage. + +6. WARRANTY AND LIMITATION OF LIABILITY + +The Software is provided by us “as is” and, to the maximum extent permitted by +law, any express or implied warranties of any kind, including (but not limited +to) all implied warranties of merchantability and fitness for a particular +purpose are disclaimed. + +In no event shall we (and our employees, contractors and subcontractors), +developers and contributors be liable for any direct, special, indirect or +consequential damages whatsoever resulting from loss of data or profits, whether +in an action of contract, negligence or other tortious conduct, arising out of +or in connection with the use or performance of the Software. + +7. OGG VORBIS CODEC + +FMOD uses the Ogg Vorbis codec © 2002, Xiph.Org Foundation. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + i. Redistributions of source code must retain the above copyright notice, + the list of conditions and the following disclaimer. + + ii. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other material provided with the distribution. + + iii. Neither the name of the Xiph.org Foundation nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +8. RESONANCE AUDIO SDK + +FMOD includes Resonance Audio SDK, licensed under the Apache Licence, Version +2.0 (the Licence); you may not use this file except in compliance with the +License. You may obtain a copy of the License at: + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. + +8. ANDROID PLATFORM CODE + +Copyright (C) 2010 The Android Open Source Project All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +9. AUDIOMOTORS DEMO CONTENT + +The audiogaming_audiomotors_demo_engine.agp file is provided for evaluation +purposes only and is not to be redistributed. AudioMotors V2 Pro is required to +create your own engine content. Refer to https://lesound.io for information. + +10. Qt Toolkit + +FMOD uses Qt Toolkit Copyright (C) 2017 The Qt Company Ltd under the +GNU Lesser General Public License version 3. + +FMOD dynamically links to the unmodified Qt libraries, as provided by +The Qt Company in the pre-compiled binary format. If unable to obtain +source code from The Qt Company, we offer to provide it via the support +options available to all users outlined on our website. + +------------------------------------------------------------------------- + + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + + +------------------------------------------------------------------------- + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright © 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + +0. Additional Definitions. + + As used herein, “this License” refers to version 3 of the GNU Lesser +General Public License, and the “GNU GPL” refers to version 3 of the +GNU General Public License. + + “The Library” refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An “Application” is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A “Combined Work” is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the “Linked +Version”. + + The “Minimal Corresponding Source” for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The “Corresponding Application Code” for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + +1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + +2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort + to ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + +3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this + license document. + +4. Combined Works. + + You may convey a Combined Work under terms of your choice that, taken +together, effectively do not restrict modification of the portions of +the Library contained in the Combined Work and reverse engineering for +debugging such modifications, if you also do each of the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this + license document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of + this License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with + the Library. A suitable mechanism is one that (a) uses at run + time a copy of the Library already present on the user's + computer system, and (b) will operate properly with a modified + version of the Library that is interface-compatible with the + Linked Version. + + e) Provide Installation Information, but only if you would + otherwise be required to provide such information under section 6 + of the GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the Application + with a modified version of the Linked Version. (If you use option + 4d0, the Installation Information must accompany the Minimal + Corresponding Source and Corresponding Application Code. If you + use option 4d1, you must provide the Installation Information in + the manner specified by section 6 of the GNU GPL for conveying + Corresponding Source.) + +5. Combined Libraries. + + You may place library facilities that are a work based on the Library +side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities, conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of + it is a work based on the Library, and explaining where to find + the accompanying uncombined form of the same work. + +6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +as you received it specifies that a certain numbered version of the +GNU Lesser General Public License “or any later version” applies to +it, you have the option of following the terms and conditions either +of that published version or of any later version published by the +Free Software Foundation. If the Library as you received it does not +specify a version number of the GNU Lesser General Public License, +you may choose any version of the GNU Lesser General Public License +ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the Library. + +--------------------------- +Last updated 17th Jun 2024. \ No newline at end of file diff --git a/Assets/Plugins/FMOD/LICENSE.txt.meta b/Assets/Plugins/FMOD/LICENSE.txt.meta new file mode 100644 index 00000000..73f16cd7 --- /dev/null +++ b/Assets/Plugins/FMOD/LICENSE.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fef88d5e0cfffab458ff59acc0d5a07a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/README.txt b/Assets/Plugins/FMOD/README.txt new file mode 100644 index 00000000..d84c967d --- /dev/null +++ b/Assets/Plugins/FMOD/README.txt @@ -0,0 +1,14 @@ +Welcome to FMOD for Unity + +This package allows you to easily play back audio events created in FMOD Studio +within your Unity project. + +The best place to start is with our online documentation: +https://fmod.com/docs/2.03/unity + +If you prefer a more step-by-step guide, try our integration tutorial that +builds on the familiar Karting Microgame: +https://fmod.com/unity-integrate + +For support, join the conversation on our Unity forums: +https://qa.fmod.com/c/unity diff --git a/Assets/Plugins/FMOD/README.txt.meta b/Assets/Plugins/FMOD/README.txt.meta new file mode 100644 index 00000000..aedadd8d --- /dev/null +++ b/Assets/Plugins/FMOD/README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 081074d1d9d6ab448b88688c3730e8a1 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/Resources.meta b/Assets/Plugins/FMOD/Resources.meta new file mode 100644 index 00000000..9d65e0be --- /dev/null +++ b/Assets/Plugins/FMOD/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7f2018ab6a44ad7458ee0938950d002e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset new file mode 100644 index 00000000..960d2cc1 --- /dev/null +++ b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7ef795603174f1f6a2308d09011d5567051dc1eaf7b70754d1f39db7424f2f6 +size 20244 diff --git a/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset.meta b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset.meta new file mode 100644 index 00000000..a4bf79b0 --- /dev/null +++ b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7fdd48378732dcd40822ad91167c82a3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons.meta b/Assets/Plugins/FMOD/addons.meta new file mode 100644 index 00000000..378c8d9c --- /dev/null +++ b/Assets/Plugins/FMOD/addons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 850b7bf08237b964b8b005fe703774f9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio.meta new file mode 100644 index 00000000..fdcef734 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce39533effc93ba409e337ba540bf789 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor.meta new file mode 100644 index 00000000..6cea53fe --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93923a20291353a40809350917bab197 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef new file mode 100644 index 00000000..5fec8976 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef @@ -0,0 +1,19 @@ +{ + "name": "FMODUnityResonanceEditor", + "references": [ + "FMODUnityResonance" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2021_3_OR_NEWER" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef.meta new file mode 100644 index 00000000..8b6366f9 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 194213485063a984b98ce9410892267a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs new file mode 100644 index 00000000..d6a129f3 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs @@ -0,0 +1,186 @@ +// Copyright 2017 Google Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using UnityEngine; +using UnityEditor; +using System.Collections; +using static FMODUnityResonance.FmodResonanceAudioRoom; + +namespace FMODUnityResonance +{ + /// A custom editor for properties on the FmodResonanceAudioRoom script. This appears in the + /// Inspector window of a FmodResonanceAudioRoom object. + [CustomEditor(typeof(FmodResonanceAudioRoom))] + [CanEditMultipleObjects] + public class FmodResonanceAudioRoomEditor : Editor + { + private SerializedProperty leftWall = null; + private SerializedProperty rightWall = null; + private SerializedProperty floor = null; + private SerializedProperty ceiling = null; + private SerializedProperty backWall = null; + private SerializedProperty frontWall = null; + private SerializedProperty reflectivity = null; + private SerializedProperty reverbGainDb = null; + private SerializedProperty reverbBrightness = null; + private SerializedProperty reverbTime = null; + private SerializedProperty size = null; + + private GUIContent surfaceMaterialsLabel; + private GUIContent surfaceMaterialLabel; + private GUIContent reflectivityLabel; + private GUIContent reverbGainLabel; + private GUIContent reverbPropertiesLabel; + private GUIContent reverbBrightnessLabel; + private GUIContent reverbTimeLabel; + private GUIContent sizeLabel; + + private static readonly string[] SurfaceMaterialDisplay = new string[] { + L10n.Tr("Transparent"), + L10n.Tr("Acoustic Ceiling Tiles"), + L10n.Tr("Brick Bare"), + L10n.Tr("Brick Painted"), + L10n.Tr("Concrete Block Coarse"), + L10n.Tr("Concrete Block Painted"), + L10n.Tr("Curtain Heavy"), + L10n.Tr("Fiberglass Insulation"), + L10n.Tr("Glass Thin"), + L10n.Tr("Glass Thick"), + L10n.Tr("Grass"), + L10n.Tr("Linoleum On Concrete"), + L10n.Tr("Marble"), + L10n.Tr("Metal"), + L10n.Tr("Parquet On Concrete"), + L10n.Tr("Plaster Rough"), + L10n.Tr("Plaster Smooth"), + L10n.Tr("Plywood Panel"), + L10n.Tr("Polished Concrete Or Tile"), + L10n.Tr("Sheetrock"), + L10n.Tr("Water Or Ice Surface"), + L10n.Tr("Wood Ceiling"), + L10n.Tr("Wood Panel"), + }; + + private static readonly int[] SurfaceMaterialValues = new int[] { + (int)SurfaceMaterial.Transparent, + (int)SurfaceMaterial.AcousticCeilingTiles, + (int)SurfaceMaterial.BrickBare, + (int)SurfaceMaterial.BrickPainted, + (int)SurfaceMaterial.ConcreteBlockCoarse, + (int)SurfaceMaterial.ConcreteBlockPainted, + (int)SurfaceMaterial.CurtainHeavy, + (int)SurfaceMaterial.FiberglassInsulation, + (int)SurfaceMaterial.GlassThin, + (int)SurfaceMaterial.GlassThick, + (int)SurfaceMaterial.Grass, + (int)SurfaceMaterial.LinoleumOnConcrete, + (int)SurfaceMaterial.Marble, + (int)SurfaceMaterial.Metal, + (int)SurfaceMaterial.ParquetOnConcrete, + (int)SurfaceMaterial.PlasterRough, + (int)SurfaceMaterial.PlasterSmooth, + (int)SurfaceMaterial.PlywoodPanel, + (int)SurfaceMaterial.PolishedConcreteOrTile, + (int)SurfaceMaterial.Sheetrock, + (int)SurfaceMaterial.WaterOrIceSurface, + (int)SurfaceMaterial.WoodCeiling, + (int)SurfaceMaterial.WoodPanel, + }; + + private void OnEnable() + { + surfaceMaterialsLabel = new GUIContent(L10n.Tr("Surface Materials"), + L10n.Tr("Room surface materials to calculate the acoustic properties of the room.")); + surfaceMaterialLabel = new GUIContent(L10n.Tr("Surface Material"), + L10n.Tr("Surface material used to calculate the acoustic properties of the room.")); + reflectivityLabel = new GUIContent(L10n.Tr("Reflectivity"), + L10n.Tr("Adjusts what proportion of the direct sound is reflected back by each surface, after an appropriate delay. Reverberation is unaffected by this setting.")); + reverbGainLabel = new GUIContent(L10n.Tr("Gain (dB)"), + L10n.Tr("Applies a gain adjustment to the reverberation in the room. The default value will leave reverb unaffected.")); + reverbPropertiesLabel = new GUIContent(L10n.Tr("Reverb Properties"), + L10n.Tr("Parameters to adjust the reverb properties of the room.")); + reverbBrightnessLabel = new GUIContent(L10n.Tr("Brightness"), + L10n.Tr("Adjusts the balance between high and low frequencies in the reverb.")); + reverbTimeLabel = new GUIContent(L10n.Tr("Time"), + L10n.Tr("Adjusts the overall duration of the reverb by a positive scaling factor.")); + sizeLabel = new GUIContent(L10n.Tr("Size"), L10n.Tr("Sets the room dimensions.")); + leftWall = serializedObject.FindProperty("LeftWall"); + rightWall = serializedObject.FindProperty("RightWall"); + floor = serializedObject.FindProperty("Floor"); + ceiling = serializedObject.FindProperty("Ceiling"); + backWall = serializedObject.FindProperty("BackWall"); + frontWall = serializedObject.FindProperty("FrontWall"); + reflectivity = serializedObject.FindProperty("Reflectivity"); + reverbGainDb = serializedObject.FindProperty("ReverbGainDb"); + reverbBrightness = serializedObject.FindProperty("ReverbBrightness"); + reverbTime = serializedObject.FindProperty("ReverbTime"); + size = serializedObject.FindProperty("Size"); + } + + /// @cond + public override void OnInspectorGUI() + { + serializedObject.Update(); + + // Add clickable script field, as would have been provided by DrawDefaultInspector() + MonoScript script = MonoScript.FromMonoBehaviour(target as MonoBehaviour); + EditorGUI.BeginDisabledGroup(true); + EditorGUILayout.ObjectField("Script", script, typeof(MonoScript), false); + EditorGUI.EndDisabledGroup(); + EditorGUILayout.LabelField(surfaceMaterialsLabel); + ++EditorGUI.indentLevel; + DrawSurfaceMaterial(leftWall, L10n.Tr("Left Wall")); + DrawSurfaceMaterial(rightWall, L10n.Tr("Right Wall")); + DrawSurfaceMaterial(floor, L10n.Tr("Floor")); + DrawSurfaceMaterial(ceiling, L10n.Tr("Ceiling")); + DrawSurfaceMaterial(backWall, L10n.Tr("Back Wall")); + DrawSurfaceMaterial(frontWall, L10n.Tr("Front Wall")); + --EditorGUI.indentLevel; + + EditorGUILayout.Separator(); + + EditorGUILayout.Slider(reflectivity, 0.0f, FmodResonanceAudio.MaxReflectivity, reflectivityLabel); + + EditorGUILayout.Separator(); + + EditorGUILayout.LabelField(reverbPropertiesLabel); + ++EditorGUI.indentLevel; + EditorGUILayout.Slider(reverbGainDb, FmodResonanceAudio.MinGainDb, FmodResonanceAudio.MaxGainDb, + reverbGainLabel); + EditorGUILayout.Slider(reverbBrightness, FmodResonanceAudio.MinReverbBrightness, + FmodResonanceAudio.MaxReverbBrightness, reverbBrightnessLabel); + EditorGUILayout.Slider(reverbTime, 0.0f, FmodResonanceAudio.MaxReverbTime, reverbTimeLabel); + --EditorGUI.indentLevel; + + EditorGUILayout.Separator(); + + EditorGUILayout.PropertyField(size, sizeLabel); + + serializedObject.ApplyModifiedProperties(); + } + /// @endcond + + private void DrawSurfaceMaterial(SerializedProperty surfaceMaterial, string displayName) + { + EditorGUILayout.BeginHorizontal(); + + GUIContent labelContent = new GUIContent(displayName, surfaceMaterialLabel.tooltip); + EditorGUILayout.LabelField(labelContent, GUILayout.Width(150)); + surfaceMaterial.intValue = EditorGUILayout.IntPopup( + surfaceMaterial.intValue, SurfaceMaterialDisplay, SurfaceMaterialValues); + + EditorGUILayout.EndHorizontal(); + } + } +} diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs.meta new file mode 100644 index 00000000..b24704b4 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 935c6716e27bd481e97897dd9e1de595 +timeCreated: 1511395157 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/Localization.cs b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/Localization.cs new file mode 100644 index 00000000..934bd587 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/Localization.cs @@ -0,0 +1,3 @@ +#if UNITY_2020_2_OR_NEWER +[assembly: UnityEditor.Localization] +#endif \ No newline at end of file diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/Localization.cs.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/Localization.cs.meta new file mode 100644 index 00000000..9aa2d6df --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/Localization.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6711f1f86af21644c897cc89748266f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/zh_hans.po b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/zh_hans.po new file mode 100644 index 00000000..ec7b46b6 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/zh_hans.po @@ -0,0 +1,195 @@ +msgid "" +msgstr "" +"Project-Id-Version: FMOD for Unity\n" +"POT-Creation-Date: 2024-12-20 15:03+1100\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: zh_hans\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.5\n" +"X-Poedit-KeywordsList: ;L10n.Tr\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: .\n" + +#: FmodResonanceAudioRoomEditor.cs:51 +msgid "Transparent" +msgstr "透明" + +#: FmodResonanceAudioRoomEditor.cs:52 +msgid "Acoustic Ceiling Tiles" +msgstr "吸音天花板瓦" + +#: FmodResonanceAudioRoomEditor.cs:53 +msgid "Brick Bare" +msgstr "裸砖" + +#: FmodResonanceAudioRoomEditor.cs:54 +msgid "Brick Painted" +msgstr "涂漆砖" + +#: FmodResonanceAudioRoomEditor.cs:55 +msgid "Concrete Block Coarse" +msgstr "粗糙混凝土块" + +#: FmodResonanceAudioRoomEditor.cs:56 +msgid "Concrete Block Painted" +msgstr "涂漆混凝土块" + +#: FmodResonanceAudioRoomEditor.cs:57 +msgid "Curtain Heavy" +msgstr "厚重窗帘" + +#: FmodResonanceAudioRoomEditor.cs:58 +msgid "Fiberglass Insulation" +msgstr "玻璃纤维绝缘" + +#: FmodResonanceAudioRoomEditor.cs:59 +msgid "Glass Thin" +msgstr "薄玻璃" + +#: FmodResonanceAudioRoomEditor.cs:60 +msgid "Glass Thick" +msgstr "厚玻璃" + +#: FmodResonanceAudioRoomEditor.cs:61 +msgid "Grass" +msgstr "草地" + +#: FmodResonanceAudioRoomEditor.cs:62 +msgid "Linoleum On Concrete" +msgstr "沥青混凝土" + +#: FmodResonanceAudioRoomEditor.cs:63 +msgid "Marble" +msgstr "大理石" + +#: FmodResonanceAudioRoomEditor.cs:64 +msgid "Metal" +msgstr "金属" + +#: FmodResonanceAudioRoomEditor.cs:65 +msgid "Parquet On Concrete" +msgstr "混凝土上的镶木地板" + +#: FmodResonanceAudioRoomEditor.cs:66 +msgid "Plaster Rough" +msgstr "粗糙石膏" + +#: FmodResonanceAudioRoomEditor.cs:67 +msgid "Plaster Smooth" +msgstr "光滑石膏" + +#: FmodResonanceAudioRoomEditor.cs:68 +msgid "Plywood Panel" +msgstr "胶合板" + +#: FmodResonanceAudioRoomEditor.cs:69 +msgid "Polished Concrete Or Tile" +msgstr "抛光混凝土或瓷砖" + +#: FmodResonanceAudioRoomEditor.cs:70 +msgid "Sheetrock" +msgstr "石膏板" + +#: FmodResonanceAudioRoomEditor.cs:71 +msgid "Water Or Ice Surface" +msgstr "水面或冰面" + +#: FmodResonanceAudioRoomEditor.cs:72 +msgid "Wood Ceiling" +msgstr "木质天花板" + +#: FmodResonanceAudioRoomEditor.cs:73 +msgid "Wood Panel" +msgstr "木板" + +#: FmodResonanceAudioRoomEditor.cs:104 +msgid "Surface Materials" +msgstr "表面材质" + +#: FmodResonanceAudioRoomEditor.cs:105 +msgid "Room surface materials to calculate the acoustic properties of the room." +msgstr "用于计算房间声学属性的房间表面材质。" + +#: FmodResonanceAudioRoomEditor.cs:106 +msgid "Surface Material" +msgstr "表面材质" + +#: FmodResonanceAudioRoomEditor.cs:107 +msgid "Surface material used to calculate the acoustic properties of the room." +msgstr "用于计算房间声学属性的表面材质。" + +#: FmodResonanceAudioRoomEditor.cs:108 +msgid "Reflectivity" +msgstr "反射率" + +#: FmodResonanceAudioRoomEditor.cs:109 +msgid "Adjusts what proportion of the direct sound is reflected back by each surface, after an appropriate delay. Reverberation is unaffected by this setting." +msgstr "调整每个表面在适当延迟后反射回直接声音的比例。混响效果不受此设置影响。" + +#: FmodResonanceAudioRoomEditor.cs:110 +msgid "Gain (dB)" +msgstr "增加增益(分贝)" + +#: FmodResonanceAudioRoomEditor.cs:111 +msgid "Applies a gain adjustment to the reverberation in the room. The default value will leave reverb unaffected." +msgstr "对房间中的混响应用增益调整。默认值将不影响混响效果。" + +#: FmodResonanceAudioRoomEditor.cs:112 +msgid "Reverb Properties" +msgstr "混响属性" + +#: FmodResonanceAudioRoomEditor.cs:113 +msgid "Parameters to adjust the reverb properties of the room." +msgstr "用于调整房间混响属性的参数。" + +#: FmodResonanceAudioRoomEditor.cs:114 +msgid "Brightness" +msgstr "亮度" + +#: FmodResonanceAudioRoomEditor.cs:115 +msgid "Adjusts the balance between high and low frequencies in the reverb." +msgstr "调整混响中高频和低频之间的平衡。" + +#: FmodResonanceAudioRoomEditor.cs:116 +msgid "Time" +msgstr "时间" + +#: FmodResonanceAudioRoomEditor.cs:117 +msgid "Adjusts the overall duration of the reverb by a positive scaling factor." +msgstr "通过正比例缩放因子调整混响的整体持续时间。" + +#: FmodResonanceAudioRoomEditor.cs:118 +msgid "Size" +msgstr "尺寸" + +#: FmodResonanceAudioRoomEditor.cs:118 +msgid "Sets the room dimensions." +msgstr "设置房间的尺寸。" + +#: FmodResonanceAudioRoomEditor.cs:144 +msgid "Left Wall" +msgstr "左墙" + +#: FmodResonanceAudioRoomEditor.cs:145 +msgid "Right Wall" +msgstr "右墙" + +#: FmodResonanceAudioRoomEditor.cs:146 +msgid "Floor" +msgstr "地板" + +#: FmodResonanceAudioRoomEditor.cs:147 +msgid "Ceiling" +msgstr "天花板" + +#: FmodResonanceAudioRoomEditor.cs:148 +msgid "Back Wall" +msgstr "后墙" + +#: FmodResonanceAudioRoomEditor.cs:149 +msgid "Front Wall" +msgstr "前墙" diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/zh_hans.po.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/zh_hans.po.meta new file mode 100644 index 00000000..7cc65a63 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/zh_hans.po.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: df892acb3265e0043b3bb1b8981b5aeb +LocalizationImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts.meta new file mode 100644 index 00000000..3e4a6384 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05a6a02c28ee77a49b6fcadf67aff3b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef new file mode 100644 index 00000000..94d9f828 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef @@ -0,0 +1,17 @@ +{ + "name": "FMODUnityResonance", + "references": [ + "FMODUnity" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2021_3_OR_NEWER" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef.meta new file mode 100644 index 00000000..25e9a501 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 44d09cf463b68274884d8a3c8a94e528 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs new file mode 100644 index 00000000..c7f47506 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs @@ -0,0 +1,290 @@ +// Copyright 2017 Google Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using UnityEngine; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using FMODUnity; + +namespace FMODUnityResonance +{ + /// This is the main Resonance Audio class that communicates with the FMOD Unity integration. Native + /// functions of the system can only be called through this class to preserve the internal system + /// functionality. + public static class FmodResonanceAudio + { + /// Maximum allowed gain value in decibels. + public const float MaxGainDb = 24.0f; + + /// Minimum allowed gain value in decibels. + public const float MinGainDb = -24.0f; + + /// Maximum allowed reverb brightness modifier value. + public const float MaxReverbBrightness = 1.0f; + + /// Minimum allowed reverb brightness modifier value. + public const float MinReverbBrightness = -1.0f; + + /// Maximum allowed reverb time modifier value. + public const float MaxReverbTime = 3.0f; + + /// Maximum allowed reflectivity multiplier of a room surface material. + public const float MaxReflectivity = 2.0f; + + // Right-handed to left-handed matrix converter (and vice versa). + private static readonly Matrix4x4 flipZ = Matrix4x4.Scale(new Vector3(1, 1, -1)); + + // Get a handle to the Resonance Audio Listener FMOD Plugin. + private static readonly string listenerPluginName = "Resonance Audio Listener"; + + // Size of |RoomProperties| struct in bytes. + private static readonly int roomPropertiesSize = Marshal.SizeOf(); + + // Plugin data parameter index for the room properties. + private static readonly int roomPropertiesIndex = 1; + + // Boundaries instance to be used in room detection logic. + private static Bounds bounds = new Bounds(Vector3.zero, Vector3.zero); + + // Container to store the currently active rooms in the scene. + private static List enabledRooms = new List(); + + // Current listener position. + private static FMOD.VECTOR listenerPositionFmod = new FMOD.VECTOR(); + + // FMOD Resonance Audio Listener Plugin. + private static FMOD.DSP listenerPlugin; + + /// Updates the room effects of the environment with given |room| properties. + /// @note This should only be called from the main Unity thread. + public static void UpdateAudioRoom(FmodResonanceAudioRoom room, bool roomEnabled) + { + // Update the enabled rooms list. + if (roomEnabled) + { + if (!enabledRooms.Contains(room)) + { + enabledRooms.Add(room); + } + } + else + { + enabledRooms.Remove(room); + } + // Update the current room effects to be applied. + if (enabledRooms.Count > 0) + { + FmodResonanceAudioRoom currentRoom = enabledRooms[enabledRooms.Count - 1]; + RoomProperties roomProperties = GetRoomProperties(currentRoom); + // Pass the room properties into a pointer. + IntPtr roomPropertiesPtr = Marshal.AllocHGlobal(roomPropertiesSize); + Marshal.StructureToPtr(roomProperties, roomPropertiesPtr, false); + ListenerPlugin.setParameterData(roomPropertiesIndex, GetBytes(roomPropertiesPtr, + roomPropertiesSize)); + Marshal.FreeHGlobal(roomPropertiesPtr); + } + else + { + // Set the room properties to a null room, which will effectively disable the room effects. + ListenerPlugin.setParameterData(roomPropertiesIndex, GetBytes(IntPtr.Zero, 0)); + } + } + + /// Returns whether the listener is currently inside the given |room| boundaries. + public static bool IsListenerInsideRoom(FmodResonanceAudioRoom room) + { + // Compute the room position relative to the listener. + FMOD.VECTOR unused; + RuntimeManager.CoreSystem.get3DListenerAttributes(0, out listenerPositionFmod, out unused, + out unused, out unused); + Vector3 listenerPosition = new Vector3(listenerPositionFmod.x, listenerPositionFmod.y, + listenerPositionFmod.z); + Vector3 relativePosition = listenerPosition - room.transform.position; + Quaternion rotationInverse = Quaternion.Inverse(room.transform.rotation); + // Set the size of the room as the boundary and return whether the listener is inside. + bounds.size = Vector3.Scale(room.transform.lossyScale, room.Size); + return bounds.Contains(rotationInverse * relativePosition); + } + + [StructLayout(LayoutKind.Sequential)] + private struct RoomProperties + { + // Center position of the room in world space. + public float PositionX; + public float PositionY; + public float PositionZ; + + // Rotation (quaternion) of the room in world space. + public float RotationX; + public float RotationY; + public float RotationZ; + public float RotationW; + + // Size of the shoebox room in world space. + public float DimensionsX; + public float DimensionsY; + public float DimensionsZ; + + // Material name of each surface of the shoebox room. + public FmodResonanceAudioRoom.SurfaceMaterial MaterialLeft; + public FmodResonanceAudioRoom.SurfaceMaterial MaterialRight; + public FmodResonanceAudioRoom.SurfaceMaterial MaterialBottom; + public FmodResonanceAudioRoom.SurfaceMaterial MaterialTop; + public FmodResonanceAudioRoom.SurfaceMaterial MaterialFront; + public FmodResonanceAudioRoom.SurfaceMaterial MaterialBack; + + // User defined uniform scaling factor for reflectivity. This parameter has no effect when set + // to 1.0f. + public float ReflectionScalar; + + // User defined reverb tail gain multiplier. This parameter has no effect when set to 0.0f. + public float ReverbGain; + + // Adjusts the reverberation time across all frequency bands. RT60 values are multiplied by this + // factor. Has no effect when set to 1.0f. + public float ReverbTime; + + // Controls the slope of a line from the lowest to the highest RT60 values (increases high + // frequency RT60s when positive, decreases when negative). Has no effect when set to 0.0f. + public float ReverbBrightness; + }; + + // Returns the FMOD Resonance Audio Listener Plugin. + private static FMOD.DSP ListenerPlugin + { + get + { + if (!listenerPlugin.hasHandle()) + { + listenerPlugin = Initialize(); + } + return listenerPlugin; + } + } + + // Converts given |db| value to its amplitude equivalent where 'dB = 20 * log10(amplitude)'. + private static float ConvertAmplitudeFromDb(float db) + { + return Mathf.Pow(10.0f, 0.05f * db); + } + + // Converts given |position| and |rotation| from Unity space to audio space. + private static void ConvertAudioTransformFromUnity(ref Vector3 position, + ref Quaternion rotation) + { + // Compose the transformation matrix. + Matrix4x4 transformMatrix = Matrix4x4.TRS(position, rotation, Vector3.one); + // Convert the transformation matrix from left-handed to right-handed. + transformMatrix = flipZ * transformMatrix * flipZ; + // Update |position| and |rotation| respectively. + position = transformMatrix.GetColumn(3); + rotation = Quaternion.LookRotation(transformMatrix.GetColumn(2), transformMatrix.GetColumn(1)); + } + + // Returns a byte array of |length| created from |ptr|. + private static byte[] GetBytes(IntPtr ptr, int length) + { + if (ptr != IntPtr.Zero) + { + byte[] byteArray = new byte[length]; + Marshal.Copy(ptr, byteArray, 0, length); + return byteArray; + } + // Return an empty array if the pointer is null. + return new byte[1]; + } + + // Returns room properties of the given |room|. + private static RoomProperties GetRoomProperties(FmodResonanceAudioRoom room) + { + RoomProperties roomProperties; + Vector3 position = room.transform.position; + Quaternion rotation = room.transform.rotation; + Vector3 scale = Vector3.Scale(room.transform.lossyScale, room.Size); + ConvertAudioTransformFromUnity(ref position, ref rotation); + roomProperties.PositionX = position.x; + roomProperties.PositionY = position.y; + roomProperties.PositionZ = position.z; + roomProperties.RotationX = rotation.x; + roomProperties.RotationY = rotation.y; + roomProperties.RotationZ = rotation.z; + roomProperties.RotationW = rotation.w; + roomProperties.DimensionsX = scale.x; + roomProperties.DimensionsY = scale.y; + roomProperties.DimensionsZ = scale.z; + roomProperties.MaterialLeft = room.LeftWall; + roomProperties.MaterialRight = room.RightWall; + roomProperties.MaterialBottom = room.Floor; + roomProperties.MaterialTop = room.Ceiling; + roomProperties.MaterialFront = room.FrontWall; + roomProperties.MaterialBack = room.BackWall; + roomProperties.ReverbGain = ConvertAmplitudeFromDb(room.ReverbGainDb); + roomProperties.ReverbTime = room.ReverbTime; + roomProperties.ReverbBrightness = room.ReverbBrightness; + roomProperties.ReflectionScalar = room.Reflectivity; + return roomProperties; + } + + // Initializes and returns the FMOD Resonance Audio Listener Plugin. + private static FMOD.DSP Initialize() + { + // Search through all busses on in banks. + int numBanks = 0; + FMOD.DSP dsp = new FMOD.DSP(); + FMOD.Studio.Bank[] banks = null; + RuntimeManager.StudioSystem.getBankCount(out numBanks); + RuntimeManager.StudioSystem.getBankList(out banks); + for (int currentBank = 0; currentBank < numBanks; ++currentBank) + { + int numBusses = 0; + FMOD.Studio.Bus[] busses = null; + banks[currentBank].getBusCount(out numBusses); + banks[currentBank].getBusList(out busses); + for (int currentBus = 0; currentBus < numBusses; ++currentBus) + { + // Make sure the channel group of the current bus is assigned properly. + string busPath = null; + busses[currentBus].getPath(out busPath); + RuntimeManager.StudioSystem.getBus(busPath, out busses[currentBus]); + busses[currentBus].lockChannelGroup(); + RuntimeManager.StudioSystem.flushCommands(); + FMOD.ChannelGroup channelGroup; + busses[currentBus].getChannelGroup(out channelGroup); + if (channelGroup.hasHandle()) + { + int numDsps = 0; + channelGroup.getNumDSPs(out numDsps); + for (int currentDsp = 0; currentDsp < numDsps; ++currentDsp) + { + channelGroup.getDSP(currentDsp, out dsp); + string dspNameSb; + int unusedInt = 0; + uint unusedUint = 0; + dsp.getInfo(out dspNameSb, out unusedUint, out unusedInt, out unusedInt, out unusedInt); + if (dspNameSb.ToString().Equals(listenerPluginName) && dsp.hasHandle()) + { + return dsp; + } + } + } + busses[currentBus].unlockChannelGroup(); + } + } + RuntimeUtils.DebugLogError(listenerPluginName + " not found in the FMOD project."); + return dsp; + } + } +} diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs.meta new file mode 100644 index 00000000..4c2e2f74 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6794e6301575a445d8588930a0752568 +timeCreated: 1511395157 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs new file mode 100644 index 00000000..e74449c8 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs @@ -0,0 +1,121 @@ +// Copyright 2017 Google Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using UnityEngine; +using UnityEngine.Serialization; +using System.Collections; + +namespace FMODUnityResonance +{ + /// Resonance Audio room component that simulates environmental effects of a room with respect to + /// the properties of the attached game object. + [AddComponentMenu("ResonanceAudio/FmodResonanceAudioRoom")] + public class FmodResonanceAudioRoom : MonoBehaviour + { + /// Material type that determines the acoustic properties of a room surface. + public enum SurfaceMaterial + { + Transparent = 0, ///< Transparent + AcousticCeilingTiles = 1, ///< Acoustic ceiling tiles + BrickBare = 2, ///< Brick, bare + BrickPainted = 3, ///< Brick, painted + ConcreteBlockCoarse = 4, ///< Concrete block, coarse + ConcreteBlockPainted = 5, ///< Concrete block, painted + CurtainHeavy = 6, ///< Curtain, heavy + FiberglassInsulation = 7, ///< Fiberglass insulation + GlassThin = 8, ///< Glass, thin + GlassThick = 9, ///< Glass, thick + Grass = 10, ///< Grass + LinoleumOnConcrete = 11, ///< Linoleum on concrete + Marble = 12, ///< Marble + Metal = 13, ///< Galvanized sheet metal + ParquetOnConcrete = 14, ///< Parquet on concrete + PlasterRough = 15, ///< Plaster, rough + PlasterSmooth = 16, ///< Plaster, smooth + PlywoodPanel = 17, ///< Plywood panel + PolishedConcreteOrTile = 18, ///< Polished concrete or tile + Sheetrock = 19, ///< Sheetrock + WaterOrIceSurface = 20, ///< Water or ice surface + WoodCeiling = 21, ///< Wood ceiling + WoodPanel = 22 ///< Wood panel + } + + /// Room surface material in negative x direction. + [FormerlySerializedAs("leftWall")] + public SurfaceMaterial LeftWall = SurfaceMaterial.ConcreteBlockCoarse; + + /// Room surface material in positive x direction. + [FormerlySerializedAs("rightWall")] + public SurfaceMaterial RightWall = SurfaceMaterial.ConcreteBlockCoarse; + + /// Room surface material in negative y direction. + [FormerlySerializedAs("floor")] + public SurfaceMaterial Floor = SurfaceMaterial.ParquetOnConcrete; + + /// Room surface material in positive y direction. + [FormerlySerializedAs("ceiling")] + public SurfaceMaterial Ceiling = SurfaceMaterial.PlasterRough; + + /// Room surface material in negative z direction. + [FormerlySerializedAs("backWall")] + public SurfaceMaterial BackWall = SurfaceMaterial.ConcreteBlockCoarse; + + /// Room surface material in positive z direction. + [FormerlySerializedAs("frontWall")] + public SurfaceMaterial FrontWall = SurfaceMaterial.ConcreteBlockCoarse; + + /// Reflectivity scalar for each surface of the room. + [FormerlySerializedAs("reflectivity")] + public float Reflectivity = 1.0f; + + /// Reverb gain modifier in decibels. + [FormerlySerializedAs("reverbGainDb")] + public float ReverbGainDb = 0.0f; + + /// Reverb brightness modifier. + [FormerlySerializedAs("reverbBrightness")] + public float ReverbBrightness = 0.0f; + + /// Reverb time modifier. + [FormerlySerializedAs("reverbTime")] + public float ReverbTime = 1.0f; + + /// Size of the room (normalized with respect to scale of the game object). + [FormerlySerializedAs("size")] + public Vector3 Size = Vector3.one; + + private void OnEnable() + { + FmodResonanceAudio.UpdateAudioRoom(this, FmodResonanceAudio.IsListenerInsideRoom(this)); + } + + private void OnDisable() + { + FmodResonanceAudio.UpdateAudioRoom(this, false); + } + + private void Update() + { + FmodResonanceAudio.UpdateAudioRoom(this, FmodResonanceAudio.IsListenerInsideRoom(this)); + } + + private void OnDrawGizmosSelected() + { + // Draw shoebox model wireframe of the room. + Gizmos.color = Color.yellow; + Gizmos.matrix = transform.localToWorldMatrix; + Gizmos.DrawWireCube(Vector3.zero, Size); + } + } +} diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs.meta new file mode 100644 index 00000000..3ee062da --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6b0c5e63920ee4f55b7ec5248525af4b +timeCreated: 1511395157 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images.meta b/Assets/Plugins/FMOD/images.meta new file mode 100644 index 00000000..11207983 --- /dev/null +++ b/Assets/Plugins/FMOD/images.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 27e5eef2bd66ffe429eebdc4579b7231 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/AddIcon.png b/Assets/Plugins/FMOD/images/AddIcon.png new file mode 100644 index 00000000..62d6e58e --- /dev/null +++ b/Assets/Plugins/FMOD/images/AddIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:860e3a60f97b4f9961eda80617e922ceffeb67aa145077ba0599863ca306a467 +size 380 diff --git a/Assets/Plugins/FMOD/images/AddIcon.png.meta b/Assets/Plugins/FMOD/images/AddIcon.png.meta new file mode 100644 index 00000000..4b199427 --- /dev/null +++ b/Assets/Plugins/FMOD/images/AddIcon.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 3300e81f02e64924eb7cb7782713b126 +timeCreated: 1455151837 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/ArrowIcon.png b/Assets/Plugins/FMOD/images/ArrowIcon.png new file mode 100644 index 00000000..d6184417 --- /dev/null +++ b/Assets/Plugins/FMOD/images/ArrowIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ad41545295b579cf3d262f069c5b9ec48b03bd5a1f64a465b7af44272f66cb7 +size 292 diff --git a/Assets/Plugins/FMOD/images/ArrowIcon.png.meta b/Assets/Plugins/FMOD/images/ArrowIcon.png.meta new file mode 100644 index 00000000..423fb26f --- /dev/null +++ b/Assets/Plugins/FMOD/images/ArrowIcon.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 01c0101f357b9da4ba78b8f58c290f86 +timeCreated: 1455161898 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/BankIcon.png b/Assets/Plugins/FMOD/images/BankIcon.png new file mode 100644 index 00000000..2de820b0 --- /dev/null +++ b/Assets/Plugins/FMOD/images/BankIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:057c16f44a3725bb4228401150c905b384ce1e1dfde6902ab074b8405c05b7c7 +size 3699 diff --git a/Assets/Plugins/FMOD/images/BankIcon.png.meta b/Assets/Plugins/FMOD/images/BankIcon.png.meta new file mode 100644 index 00000000..f53f3a79 --- /dev/null +++ b/Assets/Plugins/FMOD/images/BankIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: a7e06068a7215854a84bf5ed8280ed15 +timeCreated: 1433208188 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/Border.png b/Assets/Plugins/FMOD/images/Border.png new file mode 100644 index 00000000..4d9969ec --- /dev/null +++ b/Assets/Plugins/FMOD/images/Border.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe700034ded2e2586d707689971698310ce5964018d1a774fb6c6ed9f9060d27 +size 179 diff --git a/Assets/Plugins/FMOD/images/Border.png.meta b/Assets/Plugins/FMOD/images/Border.png.meta new file mode 100644 index 00000000..92ec9078 --- /dev/null +++ b/Assets/Plugins/FMOD/images/Border.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 40848578d1961334d820821bec6175a4 +timeCreated: 1455150446 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/BrowserIcon.png b/Assets/Plugins/FMOD/images/BrowserIcon.png new file mode 100644 index 00000000..6e0acd4d --- /dev/null +++ b/Assets/Plugins/FMOD/images/BrowserIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e45e42c47b7bf4214d50dcdca6ee7c7b47cce163eb948f8ffcdbf99837fe504c +size 3194 diff --git a/Assets/Plugins/FMOD/images/BrowserIcon.png.meta b/Assets/Plugins/FMOD/images/BrowserIcon.png.meta new file mode 100644 index 00000000..c8b42755 --- /dev/null +++ b/Assets/Plugins/FMOD/images/BrowserIcon.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: c783b763d12874147876e070661b66ab +timeCreated: 1455688158 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/ContinuousParameterIcon.png b/Assets/Plugins/FMOD/images/ContinuousParameterIcon.png new file mode 100644 index 00000000..e317c4ca --- /dev/null +++ b/Assets/Plugins/FMOD/images/ContinuousParameterIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:765322a24dd9be4feda19b5338f83cfdb4250a329c7ddd6e784b4205cb9e5f40 +size 3234 diff --git a/Assets/Plugins/FMOD/images/ContinuousParameterIcon.png.meta b/Assets/Plugins/FMOD/images/ContinuousParameterIcon.png.meta new file mode 100644 index 00000000..e0177f1c --- /dev/null +++ b/Assets/Plugins/FMOD/images/ContinuousParameterIcon.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: b92803770616fc747bc3c40ffaec0a42 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + applyGammaDecoding: 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/Plugins/FMOD/images/CopyIcon.png b/Assets/Plugins/FMOD/images/CopyIcon.png new file mode 100644 index 00000000..41013f26 --- /dev/null +++ b/Assets/Plugins/FMOD/images/CopyIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2b04ee62fd5d8072051bce97cf0edb1465ed43e71ac14485869297157ea05a9 +size 552 diff --git a/Assets/Plugins/FMOD/images/CopyIcon.png.meta b/Assets/Plugins/FMOD/images/CopyIcon.png.meta new file mode 100644 index 00000000..792ff4b8 --- /dev/null +++ b/Assets/Plugins/FMOD/images/CopyIcon.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 6e164dcb85fc8ad4b9ab2f1e883862d2 +timeCreated: 1455688729 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/CrossYellow.png b/Assets/Plugins/FMOD/images/CrossYellow.png new file mode 100644 index 00000000..ab9a2f69 --- /dev/null +++ b/Assets/Plugins/FMOD/images/CrossYellow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76090493a60a8bf675e1ab27c5183fc0c1624c889ca6dfe64a703cde2187e88d +size 278 diff --git a/Assets/Plugins/FMOD/images/CrossYellow.png.meta b/Assets/Plugins/FMOD/images/CrossYellow.png.meta new file mode 100644 index 00000000..ef4e3561 --- /dev/null +++ b/Assets/Plugins/FMOD/images/CrossYellow.png.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 348d2265b48c67342a4db2a7062813fa +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + 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: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/Delete.png b/Assets/Plugins/FMOD/images/Delete.png new file mode 100644 index 00000000..3bbc0943 --- /dev/null +++ b/Assets/Plugins/FMOD/images/Delete.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ca01b263c0395dce602ba7ff5a836d7f461216d860427a0e3df55a7ab71efa6 +size 221 diff --git a/Assets/Plugins/FMOD/images/Delete.png.meta b/Assets/Plugins/FMOD/images/Delete.png.meta new file mode 100644 index 00000000..40412c6f --- /dev/null +++ b/Assets/Plugins/FMOD/images/Delete.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 196080340db65c44883dd3f599556fb9 +timeCreated: 1434604329 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/DiscreteParameterIcon.png b/Assets/Plugins/FMOD/images/DiscreteParameterIcon.png new file mode 100644 index 00000000..b5fd7a7c --- /dev/null +++ b/Assets/Plugins/FMOD/images/DiscreteParameterIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bae2b164cbe65ba21d1d509da1f6861c82256a1e8402a7d6d265e7f98d5ebc11 +size 3041 diff --git a/Assets/Plugins/FMOD/images/DiscreteParameterIcon.png.meta b/Assets/Plugins/FMOD/images/DiscreteParameterIcon.png.meta new file mode 100644 index 00000000..81ee8697 --- /dev/null +++ b/Assets/Plugins/FMOD/images/DiscreteParameterIcon.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 509563e7079a6ed4cbf3b3240327e702 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + applyGammaDecoding: 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/Plugins/FMOD/images/EventIcon.png b/Assets/Plugins/FMOD/images/EventIcon.png new file mode 100644 index 00000000..639d0357 --- /dev/null +++ b/Assets/Plugins/FMOD/images/EventIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:846f36969a9193bb47cde4c12d2b39c76d3eaa9db4d8ba8b16eb76d21225f24b +size 705 diff --git a/Assets/Plugins/FMOD/images/EventIcon.png.meta b/Assets/Plugins/FMOD/images/EventIcon.png.meta new file mode 100644 index 00000000..f680acd9 --- /dev/null +++ b/Assets/Plugins/FMOD/images/EventIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: a602f206f9cb31f439c79a2fe23687c5 +timeCreated: 1432616010 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/FMODLogoBlack.png b/Assets/Plugins/FMOD/images/FMODLogoBlack.png new file mode 100644 index 00000000..84f5bfc5 --- /dev/null +++ b/Assets/Plugins/FMOD/images/FMODLogoBlack.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cece587e055d82ea2776b0ebff697ce32e024f301ed62077a573e851c75dcab +size 9688 diff --git a/Assets/Plugins/FMOD/images/FMODLogoBlack.png.meta b/Assets/Plugins/FMOD/images/FMODLogoBlack.png.meta new file mode 100644 index 00000000..8a39f85e --- /dev/null +++ b/Assets/Plugins/FMOD/images/FMODLogoBlack.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: 36e46b3c334e47e41a0b4ff2f26905ea +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + 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: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + 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/Plugins/FMOD/images/FMODLogoWhite.png b/Assets/Plugins/FMOD/images/FMODLogoWhite.png new file mode 100644 index 00000000..7af7037a --- /dev/null +++ b/Assets/Plugins/FMOD/images/FMODLogoWhite.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b766d70460bfa442ede86dcdaeac016650552c511be711319c94b74554a7fd9f +size 8803 diff --git a/Assets/Plugins/FMOD/images/FMODLogoWhite.png.meta b/Assets/Plugins/FMOD/images/FMODLogoWhite.png.meta new file mode 100644 index 00000000..7b306ec8 --- /dev/null +++ b/Assets/Plugins/FMOD/images/FMODLogoWhite.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: 8fd8ccb8d7e81d943b28ea7975c7185d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + 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: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: PS4 + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + 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/Plugins/FMOD/images/FolderIconClosed.png b/Assets/Plugins/FMOD/images/FolderIconClosed.png new file mode 100644 index 00000000..014196bb --- /dev/null +++ b/Assets/Plugins/FMOD/images/FolderIconClosed.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e0e2cfe75a26e20382f957b843f704ce604a0b24e5152470ebd28208cfac212 +size 2963 diff --git a/Assets/Plugins/FMOD/images/FolderIconClosed.png.meta b/Assets/Plugins/FMOD/images/FolderIconClosed.png.meta new file mode 100644 index 00000000..4b3bdbe4 --- /dev/null +++ b/Assets/Plugins/FMOD/images/FolderIconClosed.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 70efeb6d97126f843b30b8ed62d18a4f +timeCreated: 1432621560 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/FolderIconOpen.png b/Assets/Plugins/FMOD/images/FolderIconOpen.png new file mode 100644 index 00000000..ffded31d --- /dev/null +++ b/Assets/Plugins/FMOD/images/FolderIconOpen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a5f22962370823cae68458fcc089dd0759636aff6d1e2f45bd701d740aa5598 +size 3221 diff --git a/Assets/Plugins/FMOD/images/FolderIconOpen.png.meta b/Assets/Plugins/FMOD/images/FolderIconOpen.png.meta new file mode 100644 index 00000000..1be40860 --- /dev/null +++ b/Assets/Plugins/FMOD/images/FolderIconOpen.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: d2b54e4f7f80b9448a41d3c5985f5672 +timeCreated: 1432621574 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/LabeledParameterIcon.png b/Assets/Plugins/FMOD/images/LabeledParameterIcon.png new file mode 100644 index 00000000..bbc27572 --- /dev/null +++ b/Assets/Plugins/FMOD/images/LabeledParameterIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:929ddbd86aad8bc5ae3b466bb2f5f36ed953da22b04cbf4dd8ab8166e4ef91b4 +size 3101 diff --git a/Assets/Plugins/FMOD/images/LabeledParameterIcon.png.meta b/Assets/Plugins/FMOD/images/LabeledParameterIcon.png.meta new file mode 100644 index 00000000..0a824810 --- /dev/null +++ b/Assets/Plugins/FMOD/images/LabeledParameterIcon.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: b4d696e5c0be6f44bb2f02aa41320656 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + 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 + applyGammaDecoding: 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/Plugins/FMOD/images/LevelMeter.png b/Assets/Plugins/FMOD/images/LevelMeter.png new file mode 100644 index 00000000..27ffcca4 --- /dev/null +++ b/Assets/Plugins/FMOD/images/LevelMeter.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf765236491fd508c50e16b64a19b8f27e79f2174d94c61dd2399dd39ebf8d88 +size 2685 diff --git a/Assets/Plugins/FMOD/images/LevelMeter.png.meta b/Assets/Plugins/FMOD/images/LevelMeter.png.meta new file mode 100644 index 00000000..4c7a36b7 --- /dev/null +++ b/Assets/Plugins/FMOD/images/LevelMeter.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 21e7a3d41a926364a8b9a6704ebe80d8 +timeCreated: 1433917421 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/LevelMeterOff.png b/Assets/Plugins/FMOD/images/LevelMeterOff.png new file mode 100644 index 00000000..81068bd5 --- /dev/null +++ b/Assets/Plugins/FMOD/images/LevelMeterOff.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e162e74d2e9c71d12514bd3199c46cb79046e2e2df315aa8bf5587f61bbd6cd +size 2194 diff --git a/Assets/Plugins/FMOD/images/LevelMeterOff.png.meta b/Assets/Plugins/FMOD/images/LevelMeterOff.png.meta new file mode 100644 index 00000000..473c6cbe --- /dev/null +++ b/Assets/Plugins/FMOD/images/LevelMeterOff.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 48dc5470d93f669419f294fcd33f7b7c +timeCreated: 1434426551 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/NotFound.png b/Assets/Plugins/FMOD/images/NotFound.png new file mode 100644 index 00000000..ca6e7b54 --- /dev/null +++ b/Assets/Plugins/FMOD/images/NotFound.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ae518102dd2ae8fab1a9bd2f526c8897de491f55f28ceb72ac3a4e0365d330d +size 3139 diff --git a/Assets/Plugins/FMOD/images/NotFound.png.meta b/Assets/Plugins/FMOD/images/NotFound.png.meta new file mode 100644 index 00000000..bd16a949 --- /dev/null +++ b/Assets/Plugins/FMOD/images/NotFound.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 1138ab068176f29499337d7a73dfecd9 +timeCreated: 1432798099 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/Preview.png b/Assets/Plugins/FMOD/images/Preview.png new file mode 100644 index 00000000..b4416d39 --- /dev/null +++ b/Assets/Plugins/FMOD/images/Preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5442882e67f6bd03f05d5cdaf38b12ab53099e2fc002c17ff9d75fe74d917ad1 +size 17576 diff --git a/Assets/Plugins/FMOD/images/Preview.png.meta b/Assets/Plugins/FMOD/images/Preview.png.meta new file mode 100644 index 00000000..b9fc668d --- /dev/null +++ b/Assets/Plugins/FMOD/images/Preview.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: 0793eda432fc5df4ab1291e6baacd771 +timeCreated: 1434430906 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/PreviewEmitter.png b/Assets/Plugins/FMOD/images/PreviewEmitter.png new file mode 100644 index 00000000..bbbbe102 --- /dev/null +++ b/Assets/Plugins/FMOD/images/PreviewEmitter.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d555a49c7381486bc846b226dbaedf52ae4bf3206e7f150c07756641b3228e88 +size 278 diff --git a/Assets/Plugins/FMOD/images/PreviewEmitter.png.meta b/Assets/Plugins/FMOD/images/PreviewEmitter.png.meta new file mode 100644 index 00000000..7e74c5d7 --- /dev/null +++ b/Assets/Plugins/FMOD/images/PreviewEmitter.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 9519043db3741934fa01455c47683e8c +timeCreated: 1434431177 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/SearchIconBlack.png b/Assets/Plugins/FMOD/images/SearchIconBlack.png new file mode 100644 index 00000000..4118e535 --- /dev/null +++ b/Assets/Plugins/FMOD/images/SearchIconBlack.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17a08ec9844a6c30a78346c21d4ea627645fa217d8e1e6ef8225885e80c663ef +size 3025 diff --git a/Assets/Plugins/FMOD/images/SearchIconBlack.png.meta b/Assets/Plugins/FMOD/images/SearchIconBlack.png.meta new file mode 100644 index 00000000..aaa1c13b --- /dev/null +++ b/Assets/Plugins/FMOD/images/SearchIconBlack.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 99471facfde9fb84dbe4a81ad570ebce +timeCreated: 1434602090 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/SelectedAlt.png b/Assets/Plugins/FMOD/images/SelectedAlt.png new file mode 100644 index 00000000..b39f1633 --- /dev/null +++ b/Assets/Plugins/FMOD/images/SelectedAlt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9450a6d1836697cc7b196df8d9b829c66dc9e38400cd00e78abc0fa0d4290b84 +size 170 diff --git a/Assets/Plugins/FMOD/images/SelectedAlt.png.meta b/Assets/Plugins/FMOD/images/SelectedAlt.png.meta new file mode 100644 index 00000000..0ddcc1f8 --- /dev/null +++ b/Assets/Plugins/FMOD/images/SelectedAlt.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 8ce9b717b1bc7564cbe35664f2f178a7 +timeCreated: 1455161898 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/SnapshotIcon.png b/Assets/Plugins/FMOD/images/SnapshotIcon.png new file mode 100644 index 00000000..86ac78db --- /dev/null +++ b/Assets/Plugins/FMOD/images/SnapshotIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a64f883f76eec0a308b9af0607394b4030b3c0b25e22afaae48779b7525c2ef9 +size 737 diff --git a/Assets/Plugins/FMOD/images/SnapshotIcon.png.meta b/Assets/Plugins/FMOD/images/SnapshotIcon.png.meta new file mode 100644 index 00000000..4755690c --- /dev/null +++ b/Assets/Plugins/FMOD/images/SnapshotIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: cf2bba5fb8be7e64ca39979f18eb372a +timeCreated: 1434600422 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/StudioIcon.png b/Assets/Plugins/FMOD/images/StudioIcon.png new file mode 100644 index 00000000..d5b631b9 --- /dev/null +++ b/Assets/Plugins/FMOD/images/StudioIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adb4854cc54817bc18bab8f51b6b9f5dd49220f7019877e596cb02fddf009dd8 +size 3581 diff --git a/Assets/Plugins/FMOD/images/StudioIcon.png.meta b/Assets/Plugins/FMOD/images/StudioIcon.png.meta new file mode 100644 index 00000000..2f7dae74 --- /dev/null +++ b/Assets/Plugins/FMOD/images/StudioIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: a4edfa5854cdec34b98b1c55f0562bdd +timeCreated: 1434601223 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/TickGreen.png b/Assets/Plugins/FMOD/images/TickGreen.png new file mode 100644 index 00000000..67a6b133 --- /dev/null +++ b/Assets/Plugins/FMOD/images/TickGreen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6d253361b6878408e62b8aa8da4edb6167fa97c038748f18ebad22292cb6e65 +size 244 diff --git a/Assets/Plugins/FMOD/images/TickGreen.png.meta b/Assets/Plugins/FMOD/images/TickGreen.png.meta new file mode 100644 index 00000000..0f39bc16 --- /dev/null +++ b/Assets/Plugins/FMOD/images/TickGreen.png.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 27533226416c4f549b9bec9c024100f7 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + 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: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/TransportOpen.png b/Assets/Plugins/FMOD/images/TransportOpen.png new file mode 100644 index 00000000..cd382e12 --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportOpen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09901dc10713d986ef1df3b28d6d637d978263f86eebd18fddb57b8d7d3cf472 +size 4234 diff --git a/Assets/Plugins/FMOD/images/TransportOpen.png.meta b/Assets/Plugins/FMOD/images/TransportOpen.png.meta new file mode 100644 index 00000000..c06cc4e7 --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportOpen.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: b0fb832e401d1514a9611735d8d340b1 +timeCreated: 1453178387 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/TransportPlayButtonOff.png b/Assets/Plugins/FMOD/images/TransportPlayButtonOff.png new file mode 100644 index 00000000..382eaf77 --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportPlayButtonOff.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7235df4b7a8cc331595984bae5f2f11f18a2da8808a92cbc268454ad7836999d +size 3525 diff --git a/Assets/Plugins/FMOD/images/TransportPlayButtonOff.png.meta b/Assets/Plugins/FMOD/images/TransportPlayButtonOff.png.meta new file mode 100644 index 00000000..48014c58 --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportPlayButtonOff.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 29258b1336a580946bc144df00b74ac1 +timeCreated: 1453177025 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/TransportPlayButtonOn.png b/Assets/Plugins/FMOD/images/TransportPlayButtonOn.png new file mode 100644 index 00000000..71dc6f0e --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportPlayButtonOn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b3ef1497d5583fc59777d3e32b7f0841a1b40cad462f6c7b76e02b600cbe7d2 +size 3715 diff --git a/Assets/Plugins/FMOD/images/TransportPlayButtonOn.png.meta b/Assets/Plugins/FMOD/images/TransportPlayButtonOn.png.meta new file mode 100644 index 00000000..7d4553fd --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportPlayButtonOn.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 2d777c9a14189d241aea1afeeeff448c +timeCreated: 1453177025 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/TransportStopButtonOff.png b/Assets/Plugins/FMOD/images/TransportStopButtonOff.png new file mode 100644 index 00000000..7cb939f8 --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportStopButtonOff.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3813b737ddf9a4c4ccbad813498d029e168f5d2bdb55ac4940f380f0ef34b9b +size 3290 diff --git a/Assets/Plugins/FMOD/images/TransportStopButtonOff.png.meta b/Assets/Plugins/FMOD/images/TransportStopButtonOff.png.meta new file mode 100644 index 00000000..9f592a1b --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportStopButtonOff.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: cafa069c15865d543a07375373f0a18e +timeCreated: 1453177025 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/TransportStopButtonOn.png b/Assets/Plugins/FMOD/images/TransportStopButtonOn.png new file mode 100644 index 00000000..d913100c --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportStopButtonOn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b575ed82986cacca2633358315b4ff642d81fd277825afd54f4ddc5d97880b32 +size 3463 diff --git a/Assets/Plugins/FMOD/images/TransportStopButtonOn.png.meta b/Assets/Plugins/FMOD/images/TransportStopButtonOn.png.meta new file mode 100644 index 00000000..7ebdb4f6 --- /dev/null +++ b/Assets/Plugins/FMOD/images/TransportStopButtonOn.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: eab53cb0959d1244aadeacf8b76c755c +timeCreated: 1453177025 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/images/Wrench.png b/Assets/Plugins/FMOD/images/Wrench.png new file mode 100644 index 00000000..196c857d --- /dev/null +++ b/Assets/Plugins/FMOD/images/Wrench.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d6b8c5858c1ee781c129bd611fe94412088d7198285766ce88433901f85a22f +size 521 diff --git a/Assets/Plugins/FMOD/images/Wrench.png.meta b/Assets/Plugins/FMOD/images/Wrench.png.meta new file mode 100644 index 00000000..294315a6 --- /dev/null +++ b/Assets/Plugins/FMOD/images/Wrench.png.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 507cd805ad331e54cb9e9cab5a9270b5 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + 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: 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: 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: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platform_ios.mm b/Assets/Plugins/FMOD/platform_ios.mm new file mode 100644 index 00000000..3828a8a0 --- /dev/null +++ b/Assets/Plugins/FMOD/platform_ios.mm @@ -0,0 +1,128 @@ +#import +#import + +static void (*gSuspendCallback)(bool suspend) = nullptr; +static bool gIsSuspended = false; +static bool gNeedsReset = false; + +extern "C" void RegisterSuspendCallback(void (*callback)(bool)) +{ + if (gSuspendCallback || !callback) + { + return; + } + gSuspendCallback = callback; + + [[NSNotificationCenter defaultCenter] addObserverForName:AVAudioSessionInterruptionNotification object:nil queue:nil usingBlock:^(NSNotification *notification) + { + AVAudioSessionInterruptionType type = (AVAudioSessionInterruptionType)[[notification.userInfo valueForKey:AVAudioSessionInterruptionTypeKey] unsignedIntegerValue]; + if (type == AVAudioSessionInterruptionTypeBegan) + { + NSLog(@"Interruption Began"); + // Ignore deprecated warnings regarding AVAudioSessionInterruptionReasonAppWasSuspended and + // AVAudioSessionInterruptionWasSuspendedKey, we protect usage for the versions where they are available + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + + // If the audio session was deactivated while the app was in the background, the app receives the + // notification when relaunched. Identify this reason for interruption and ignore it. + if (@available(iOS 16.0, tvOS 14.5, *)) + { + // Delayed suspend-in-background notifications no longer exist, this must be a real interruption + } + #if !TARGET_OS_TV // tvOS never supported "AVAudioSessionInterruptionReasonAppWasSuspended" + else if (@available(iOS 14.5, *)) + { + if ([[notification.userInfo valueForKey:AVAudioSessionInterruptionReasonKey] intValue] == AVAudioSessionInterruptionReasonAppWasSuspended) + { + return; // Ignore delayed suspend-in-background notification + } + } + #endif + else + { + if ([[notification.userInfo valueForKey:AVAudioSessionInterruptionWasSuspendedKey] boolValue]) + { + return; // Ignore delayed suspend-in-background notification + } + } + + gSuspendCallback(true); + gIsSuspended = true; + + #pragma clang diagnostic pop + } + else if (type == AVAudioSessionInterruptionTypeEnded) + { + NSLog(@"Interruption Ended"); + NSError *errorMessage = nullptr; + if (![[AVAudioSession sharedInstance] setActive:TRUE error:&errorMessage]) + { + // Interruption like Siri can prevent session activation, wait for did-become-active notification + NSLog(@"AVAudioSessionInterruptionNotification: AVAudioSession.setActive() failed: %@", errorMessage); + return; + } + + gSuspendCallback(false); + gIsSuspended = false; + } + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification object:nil queue:nil usingBlock:^(NSNotification *notification) + { + // Unity video playback prior to 2022.3 on tvOS breaks FMOD audio, so force a reset + #if TARGET_OS_TV && !UNITY_2022_3_OR_NEWER + gNeedsReset = true; + #endif + + if (gNeedsReset) + { + gSuspendCallback(true); + gIsSuspended = true; + } + + NSError *errorMessage = nullptr; + if (![[AVAudioSession sharedInstance] setActive:TRUE error:&errorMessage]) + { + if ([errorMessage code] == AVAudioSessionErrorCodeCannotStartPlaying) + { + // Interruption like Screen Time can prevent session activation, but will not trigger an interruption-ended notification. + // There is no other callback or trigger to hook into after this point, we are not in the background and there is no other audio playing. + // Our only option is to have a sleep loop until the Audio Session can be activated again. + while (![[AVAudioSession sharedInstance] setActive:TRUE error:nil]) + { + usleep(20000); + } + } + else + { + // Interruption like Siri can prevent session activation, wait for interruption-ended notification. + NSLog(@"UIApplicationDidBecomeActiveNotification: AVAudioSession.setActive() failed: %@", errorMessage); + return; + } + } + + // It's possible the system missed sending us an interruption end, so recover here + if (gIsSuspended) + { + gSuspendCallback(false); + gNeedsReset = false; + gIsSuspended = false; + } + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:AVAudioSessionMediaServicesWereResetNotification object:nil queue:nil usingBlock:^(NSNotification *notification) + { + if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground || gIsSuspended) + { + // Received the reset notification while in the background, need to reset the AudioUnit when we come back to foreground. + gNeedsReset = true; + } + else + { + // In the foregound but something chopped the media services, need to do a reset. + gSuspendCallback(true); + gSuspendCallback(false); + } + }]; +} diff --git a/Assets/Plugins/FMOD/platform_ios.mm.meta b/Assets/Plugins/FMOD/platform_ios.mm.meta new file mode 100644 index 00000000..53d926f3 --- /dev/null +++ b/Assets/Plugins/FMOD/platform_ios.mm.meta @@ -0,0 +1,112 @@ +fileFormatVersion: 2 +guid: fc7eb3c9194584004bdf04921e5cb057 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude VisionOS: 0 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + VisionOS: VisionOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + CPU: AnyCPU + FrameworkDependencies: + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms.meta b/Assets/Plugins/FMOD/platforms.meta new file mode 100644 index 00000000..d6fd5949 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b617f082dd1f0645bde3b4ff3cbc25a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android.meta b/Assets/Plugins/FMOD/platforms/android.meta new file mode 100644 index 00000000..67a97add --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca9461535f8115a4fb8293c748bcd2e1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib.meta b/Assets/Plugins/FMOD/platforms/android/lib.meta new file mode 100644 index 00000000..bce0b766 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 328160e4bc4e8b74296f830386ae016b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a.meta b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a.meta new file mode 100644 index 00000000..a37fe476 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54305e5cd6046514181f9b21fb0c44ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmod.so b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmod.so new file mode 100644 index 00000000..16fd6fe4 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmod.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmod.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmod.so.meta new file mode 100644 index 00000000..d701741c --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmod.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 1 +guid: 159cb3726937c6c498fa49eb627b0d96 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARM64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodL.so b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodL.so new file mode 100644 index 00000000..75ad5843 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodL.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodL.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodL.so.meta new file mode 100644 index 00000000..9606d428 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 1 +guid: 6f74d8321b529d948a7672da4ca54356 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARM64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudio.so b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudio.so new file mode 100644 index 00000000..d76d968c Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudio.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudio.so.meta new file mode 100644 index 00000000..fe3f6394 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 1 +guid: e4d6c68823f34e440bfe4e4ecba4c113 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARM64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudioL.so b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudioL.so new file mode 100644 index 00000000..58b7e964 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudioL.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudioL.so.meta new file mode 100644 index 00000000..2aeaca18 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libfmodstudioL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 1 +guid: 85af50ee41bfd9c4fbd8107aee814c50 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARM64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libresonanceaudio.so b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libresonanceaudio.so new file mode 100644 index 00000000..7dd19af6 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libresonanceaudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libresonanceaudio.so.meta new file mode 100644 index 00000000..7f2ce707 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/arm64-v8a/libresonanceaudio.so.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 2bd9aca31d63ca248bf159e7562a3609 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: + CPU: ARM64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a.meta b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a.meta new file mode 100644 index 00000000..b1124ede --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 49cc70c20e469a541a7974182c9f588a +folderAsset: yes +timeCreated: 1447698325 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmod.so b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmod.so new file mode 100644 index 00000000..091859c0 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmod.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmod.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmod.so.meta new file mode 100644 index 00000000..a5d9796d --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmod.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: f71c8f89be7646142baed6d482d5e89c +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodL.so b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodL.so new file mode 100644 index 00000000..57262b31 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodL.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodL.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodL.so.meta new file mode 100644 index 00000000..e65ac8cb --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 0e95029f987dfa248934eaa63745b504 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudio.so b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudio.so new file mode 100644 index 00000000..cfa6dcd9 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudio.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudio.so.meta new file mode 100644 index 00000000..32a556f8 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: cf01ad74bd6e5df46996c61b81ba590c +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudioL.so b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudioL.so new file mode 100644 index 00000000..c0e2042b Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudioL.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudioL.so.meta new file mode 100644 index 00000000..dc7579cb --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libfmodstudioL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 8de47c7524234f64fb6a7d661154b1a3 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libresonanceaudio.so b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libresonanceaudio.so new file mode 100644 index 00000000..162d4391 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libresonanceaudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libresonanceaudio.so.meta new file mode 100644 index 00000000..1a47aaab --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/armeabi-v7a/libresonanceaudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: fb0aabfc61c4c1548ac6990286c84327 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/fmod.jar b/Assets/Plugins/FMOD/platforms/android/lib/fmod.jar new file mode 100644 index 00000000..76d5b46f Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/fmod.jar differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/fmod.jar.meta b/Assets/Plugins/FMOD/platforms/android/lib/fmod.jar.meta new file mode 100644 index 00000000..19efd70c --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/fmod.jar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: cba124c31f7e10640bc2ff9464f8ac15 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86.meta new file mode 100644 index 00000000..c925ac6b --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 95bcdcdca315ef640bec049de80ee3eb +folderAsset: yes +timeCreated: 1447698325 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmod.so b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmod.so new file mode 100644 index 00000000..2b7b8c11 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmod.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmod.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmod.so.meta new file mode 100644 index 00000000..01a0984d --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmod.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 099e80baee62d0c439475fae45e69f4e +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodL.so b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodL.so new file mode 100644 index 00000000..a0078515 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodL.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodL.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodL.so.meta new file mode 100644 index 00000000..b99f6cc0 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 54236e4c5b88f494598efb4d226b44f0 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudio.so b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudio.so new file mode 100644 index 00000000..60c8233d Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudio.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudio.so.meta new file mode 100644 index 00000000..6845b419 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: a20d361b085100b4997c4e5b0b83af31 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudioL.so b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudioL.so new file mode 100644 index 00000000..473b65f8 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudioL.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudioL.so.meta new file mode 100644 index 00000000..1df26b1e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86/libfmodstudioL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 0975b093811db4e4e9e67bc483ad2299 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libresonanceaudio.so b/Assets/Plugins/FMOD/platforms/android/lib/x86/libresonanceaudio.so new file mode 100644 index 00000000..f85f8fa2 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86/libresonanceaudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86/libresonanceaudio.so.meta new file mode 100644 index 00000000..275946e8 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86/libresonanceaudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 5c35d7fa6769b114aa63172aaf1fd782 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86_64.meta new file mode 100644 index 00000000..862ec7d9 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86_64.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f5986fa1e569b7246ae8249e5d8de1c0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmod.so b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmod.so new file mode 100644 index 00000000..8f26abb0 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmod.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmod.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmod.so.meta new file mode 100644 index 00000000..bb9b46ec --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmod.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 7b1a5b0e7617bcf49885fb2dd09d7085 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86_64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodL.so b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodL.so new file mode 100644 index 00000000..9c13e0cd Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodL.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodL.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodL.so.meta new file mode 100644 index 00000000..96e79ffd --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 51dea0d403c47f345a6efe70b23fe6e3 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86_64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudio.so b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudio.so new file mode 100644 index 00000000..227ccbec Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudio.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudio.so.meta new file mode 100644 index 00000000..959af8cb --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 8c078c4748d95c2489bb3b82aa144194 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86_64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudioL.so b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudioL.so new file mode 100644 index 00000000..7a1c481d Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudioL.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudioL.so.meta new file mode 100644 index 00000000..0ae12cc8 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libfmodstudioL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 9a5fc9953c8c261488bf0cb6c202e04b +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86_64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libresonanceaudio.so b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libresonanceaudio.so new file mode 100644 index 00000000..d4f95bc1 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libresonanceaudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libresonanceaudio.so.meta new file mode 100644 index 00000000..fa3c00d6 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/lib/x86_64/libresonanceaudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 295b4c80a560c81409d44c273128b743 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86_64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/src.meta b/Assets/Plugins/FMOD/platforms/android/src.meta new file mode 100644 index 00000000..c06295cb --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 03be3f097a522854dbe1d585023925fb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/android/src/PlatformAndroid.cs b/Assets/Plugins/FMOD/platforms/android/src/PlatformAndroid.cs new file mode 100644 index 00000000..edbf9789 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/src/PlatformAndroid.cs @@ -0,0 +1,127 @@ +using System.Collections.Generic; +using System; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if UNITY_ANDROID && !UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { + public const string dll = "fmod" + dllSuffix; + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { + public const string dll = "fmodstudio" + dllSuffix; + } +} +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformAndroid : Platform + { + static PlatformAndroid() + { + Settings.AddPlatformTemplate("2fea114e74ecf3c4f920e1d5cc1c4c40"); + } + + internal override string DisplayName { get { return "Android"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.Android, this); + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield return BuildTarget.Android; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.Android; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return new BinaryAssetFolderInfo("android", "Plugins/Android/libs"); + } + + private static readonly string[] Architectures = { "arm64-v8a", "armeabi-v7a", "x86", "x86_64" }; + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + yield return new FileRecord("fmod.jar") + .WithAbsoluteVersion(FileLayout.Release_1_10, "Plugins/Android/fmod.jar"); + + foreach (string architecture in Architectures) + { + yield return new FileRecord(string.Format("{0}/libfmod{1}.so", architecture, suffix)); + yield return new FileRecord(string.Format("{0}/libfmodstudio{1}.so", architecture, suffix)); + } + } + + protected override IEnumerable GetOptionalBinaryFiles(BuildTarget buildTarget, bool allVariants) + { + foreach (string architecture in Architectures) + { + yield return new FileRecord(string.Format("{0}/libgvraudio.so", architecture)); + yield return new FileRecord(string.Format("{0}/libresonanceaudio.so", architecture)); + } + } + + internal override bool SupportsAdditionalCPP(BuildTarget target) + { + // Unity parses --additional-cpp arguments specified via + // PlayerSettings.SetAdditionalIl2CppArgs() incorrectly when the Android + // Export Project option is set. + return false; + } +#endif + + internal override string GetBankFolder() + { + return StaticGetBankFolder(); + } + + internal static string StaticGetBankFolder() + { + return (Settings.Instance.AndroidUseOBB || Settings.Instance.AndroidPatchBuild) + ? Application.streamingAssetsPath : "file:///android_asset"; + } + + internal override string GetPluginPath(string pluginName) + { + return StaticGetPluginPath(pluginName); + } + + internal static string StaticGetPluginPath(string pluginName) + { + return string.Format("lib{0}.so", pluginName); + } +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes + { + get + { + return sValidOutputTypes; + } + } + + private static OutputType[] sValidOutputTypes = { + new OutputType() { displayName = "Java Audio Track", outputType = FMOD.OUTPUTTYPE.AUDIOTRACK }, + new OutputType() { displayName = "OpenSL ES", outputType = FMOD.OUTPUTTYPE.OPENSL }, + new OutputType() { displayName = "AAudio", outputType = FMOD.OUTPUTTYPE.AAUDIO }, + }; + + internal override int CoreCount { get { return MaximumCoreCount; } } +#endif + } +} diff --git a/Assets/Plugins/FMOD/platforms/android/src/PlatformAndroid.cs.meta b/Assets/Plugins/FMOD/platforms/android/src/PlatformAndroid.cs.meta new file mode 100644 index 00000000..ea893098 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/android/src/PlatformAndroid.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 97ba6cc2660c0ca498540d254701057a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5.meta b/Assets/Plugins/FMOD/platforms/html5.meta new file mode 100644 index 00000000..82517eb7 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e8b0cce3730fcf4e996e9cd562a9858 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib.meta b/Assets/Plugins/FMOD/platforms/html5/lib.meta new file mode 100644 index 00000000..7e944c8a --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b177b3448f6e68e4b9f8c04bee3914aa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19.meta b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19.meta new file mode 100644 index 00000000..8c7ea11e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54847690d6c23734ca89652cb5ad8efb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudio.a b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudio.a new file mode 100644 index 00000000..7877081a Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudio.a differ diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudio.a.meta b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudio.a.meta new file mode 100644 index 00000000..5187cc79 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudio.a.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 18569240b868e8b44a20d32b2df12f5c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudioL.a b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudioL.a new file mode 100644 index 00000000..7388dc7d Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudioL.a differ diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudioL.a.meta b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudioL.a.meta new file mode 100644 index 00000000..0f5921f3 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/2.0.19/libfmodstudioL.a.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 072de5b62d53c944fa2bae4cc3cd1754 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39.meta b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39.meta new file mode 100644 index 00000000..19a5b914 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7959e64b0c3130b46bf491f58fdfd6c7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudio.a b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudio.a new file mode 100644 index 00000000..376397cd Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudio.a differ diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudio.a.meta b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudio.a.meta new file mode 100644 index 00000000..44f4f362 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudio.a.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: c74d44e6ba102764fb85c6dc1e6d4168 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudioL.a b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudioL.a new file mode 100644 index 00000000..81cf58d5 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudioL.a differ diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudioL.a.meta b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudioL.a.meta new file mode 100644 index 00000000..da7e3108 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.39/libfmodstudioL.a.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: aa0ee2b898faebd44b3b1def99fb7ab4 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8.meta b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8.meta new file mode 100644 index 00000000..47e55fdb --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76b6a358cc688fb4eb30cf7da58ae388 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudio.a b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudio.a new file mode 100644 index 00000000..066e198d Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudio.a differ diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudio.a.meta b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudio.a.meta new file mode 100644 index 00000000..a7abc354 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudio.a.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: e52d91a08688cb04695051b8a87a82bd +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudioL.a b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudioL.a new file mode 100644 index 00000000..4c2be878 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudioL.a differ diff --git a/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudioL.a.meta b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudioL.a.meta new file mode 100644 index 00000000..6f6fc7f1 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/lib/3.1.8/libfmodstudioL.a.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 8ba5025cbb9d0bf499e12351728e7679 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/src.meta b/Assets/Plugins/FMOD/platforms/html5/src.meta new file mode 100644 index 00000000..934cfff3 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21a9406360b210946b0f52e8bf5ca333 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/html5/src/PlatformWebGL.cs b/Assets/Plugins/FMOD/platforms/html5/src/PlatformWebGL.cs new file mode 100644 index 00000000..01a0ca38 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/src/PlatformWebGL.cs @@ -0,0 +1,107 @@ +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if UNITY_WEBGL && !UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { + public const string dll = "__Internal"; + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { + public const string dll = "__Internal"; + } +} +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformWebGL : Platform + { + static PlatformWebGL() + { + Settings.AddPlatformTemplate("46fbfdf3fc43db0458918377fd40293e"); + } + + internal override string DisplayName { get { return "WebGL"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.WebGLPlayer, this); + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield return BuildTarget.WebGL; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.WebGL; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return new BinaryAssetFolderInfo("html5", "Plugins/WebGL"); + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + bool emVer_2_0_19 = false; + bool emVer_3_1_8 = false; + bool emVer_3_1_39 = false; + +#if UNITY_6000_0_OR_NEWER + emVer_3_1_39 = true; +#elif UNITY_2022_3_OR_NEWER + emVer_3_1_8 = true; +#else + emVer_2_0_19 = true; +#endif + + if (allVariants || emVer_3_1_39) + { + yield return new FileRecord(string.Format("3.1.39/libfmodstudio{0}.a", suffix)); + } + + if (allVariants || emVer_3_1_8) + { + yield return new FileRecord(string.Format("3.1.8/libfmodstudio{0}.a", suffix)); + } + + if (allVariants || emVer_2_0_19) + { + yield return new FileRecord(string.Format("2.0.19/libfmodstudio{0}.a", suffix)); + } + } + + internal override bool IsFMODStaticallyLinked { get { return true; } } +#endif + + internal override string GetPluginPath(string pluginName) + { + return string.Format("{0}/{1}.a", GetPluginBasePath(), pluginName); + } +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes + { + get + { + return sValidOutputTypes; + } + } + + private static OutputType[] sValidOutputTypes = { + new OutputType() { displayName = "JavaScript webaudio output", outputType = FMOD.OUTPUTTYPE.WEBAUDIO }, + }; +#endif + } +} diff --git a/Assets/Plugins/FMOD/platforms/html5/src/PlatformWebGL.cs.meta b/Assets/Plugins/FMOD/platforms/html5/src/PlatformWebGL.cs.meta new file mode 100644 index 00000000..ff186e1e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/html5/src/PlatformWebGL.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b87314b32fbe18943af496e4b47136c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios.meta b/Assets/Plugins/FMOD/platforms/ios.meta new file mode 100644 index 00000000..db1a7b92 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56ef07f8e7caf5f4589a020791b532cd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/lib.meta b/Assets/Plugins/FMOD/platforms/ios/lib.meta new file mode 100644 index 00000000..957cdc9c --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf8c331b8ccdb944fa925884d9ffa69c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounityplugin.a b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounityplugin.a new file mode 100644 index 00000000..3b829a33 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounityplugin.a differ diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounityplugin.a.meta b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounityplugin.a.meta new file mode 100644 index 00000000..3873ef3e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounityplugin.a.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: 79c89db1833831740aee981c0d90d2d4 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + iOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginL.a b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginL.a new file mode 100644 index 00000000..296bf3d1 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginL.a differ diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginL.a.meta b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginL.a.meta new file mode 100644 index 00000000..1b101428 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginL.a.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: 5aa4057a8deee1c45a69677125e2c241 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + iOS: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulator.a b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulator.a new file mode 100644 index 00000000..3d88b3e0 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulator.a differ diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulator.a.meta b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulator.a.meta new file mode 100644 index 00000000..8f575c77 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulator.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 26235204f425d41479c8e41c99e96f50 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulatorL.a b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulatorL.a new file mode 100644 index 00000000..70e093c4 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulatorL.a differ diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulatorL.a.meta b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulatorL.a.meta new file mode 100644 index 00000000..5ecf6863 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/lib/libfmodstudiounitypluginsimulatorL.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 9aed261b7fbc24099a9b58cbbf374583 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudio.a b/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudio.a new file mode 100644 index 00000000..38065526 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudio.a differ diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudio.a.meta b/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudio.a.meta new file mode 100644 index 00000000..f5899986 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudio.a.meta @@ -0,0 +1,61 @@ +fileFormatVersion: 2 +guid: bc5d15d8f7607af478126b815040cbd2 +timeCreated: 1511469552 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 0 + settings: + CPU: None + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 0 + settings: + CPU: None + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + iOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudiosimulator.a b/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudiosimulator.a new file mode 100644 index 00000000..7573706e Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudiosimulator.a differ diff --git a/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudiosimulator.a.meta b/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudiosimulator.a.meta new file mode 100644 index 00000000..ec712019 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/lib/libresonanceaudiosimulator.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 5ad1791b3b48a4ba39c30a2b4f438486 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/src.meta b/Assets/Plugins/FMOD/platforms/ios/src.meta new file mode 100644 index 00000000..7dd91fde --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb7a0bd9281687744b74c40dd220a50f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/ios/src/PlatformIOS.cs b/Assets/Plugins/FMOD/platforms/ios/src/PlatformIOS.cs new file mode 100644 index 00000000..11b837da --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/src/PlatformIOS.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if UNITY_IPHONE && !UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { + public const string dll = "__Internal"; + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { + public const string dll = "__Internal"; + } +} +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformIOS : Platform + { + static PlatformIOS() + { + Settings.AddPlatformTemplate("0f8eb3f400726694eb47beb1a9f94ce8"); + } + + internal override string DisplayName { get { return "iOS"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.IPhonePlayer, this); + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield return BuildTarget.iOS; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.iOS; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return new BinaryAssetFolderInfo("ios", "Plugins/iOS"); + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + if (allVariants || PlayerSettings.iOS.sdkVersion == iOSSdkVersion.DeviceSDK) + { + yield return new FileRecord(string.Format("libfmodstudiounityplugin{0}.a", suffix)); + } + + if (allVariants || PlayerSettings.iOS.sdkVersion == iOSSdkVersion.SimulatorSDK) + { + yield return new FileRecord(string.Format("libfmodstudiounitypluginsimulator{0}.a", suffix)); + } + } + + protected override IEnumerable GetOptionalBinaryFiles(BuildTarget buildTarget, bool allVariants) + { + if (allVariants || PlayerSettings.iOS.sdkVersion == iOSSdkVersion.DeviceSDK) + { + yield return new FileRecord("libgvraudio.a"); + yield return new FileRecord("libresonanceaudio.a"); + } + + if (allVariants || PlayerSettings.iOS.sdkVersion == iOSSdkVersion.SimulatorSDK) + { + yield return new FileRecord("libresonanceaudiosimulator.a"); + } + } + + internal override bool IsFMODStaticallyLinked { get { return true; } } + + internal override bool SupportsAdditionalCPP(BuildTarget target) + { + return StaticSupportsAdditionalCpp(); + } + + public static bool StaticSupportsAdditionalCpp() + { + return false; + } +#endif + + internal override void LoadPlugins(FMOD.System coreSystem, Action reportResult) + { + StaticLoadPlugins(this, coreSystem, reportResult); + } + + public static void StaticLoadPlugins(Platform platform, FMOD.System coreSystem, + Action reportResult) + { + platform.LoadStaticPlugins(coreSystem, reportResult); + + } + +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes + { + get + { + return sValidOutputTypes; + } + } + + private static OutputType[] sValidOutputTypes = { + new OutputType() { displayName = "Core Audio", outputType = FMOD.OUTPUTTYPE.COREAUDIO }, + }; +#endif + } +} diff --git a/Assets/Plugins/FMOD/platforms/ios/src/PlatformIOS.cs.meta b/Assets/Plugins/FMOD/platforms/ios/src/PlatformIOS.cs.meta new file mode 100644 index 00000000..41fa2dfe --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/ios/src/PlatformIOS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc1f51bc35d549941904cf062bae93a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/linux.meta b/Assets/Plugins/FMOD/platforms/linux.meta new file mode 100644 index 00000000..1d182ec9 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 127a9ee57a2a27a439bf9e6b2d5731b6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/linux/lib.meta b/Assets/Plugins/FMOD/platforms/linux/lib.meta new file mode 100644 index 00000000..6da4e802 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b28687fd18577ce4c838b916a4ed5c54 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/linux/lib/x86_64.meta b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64.meta new file mode 100644 index 00000000..265b71a8 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f99f1bb123ca3b6449fc49fc745c0fed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudio.so b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudio.so new file mode 100644 index 00000000..341ee95c Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudio.so.meta b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudio.so.meta new file mode 100644 index 00000000..67f8f9a2 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudio.so.meta @@ -0,0 +1,65 @@ +fileFormatVersion: 2 +guid: 9063aa11b1fcfcf4cb6030a076d14a30 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_15 + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 0 + settings: + CPU: None + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudioL.so b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudioL.so new file mode 100644 index 00000000..c776017e Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudioL.so differ diff --git a/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudioL.so.meta new file mode 100644 index 00000000..d5e20a9e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libfmodstudioL.so.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 8fddc6064073f794ca855a1e70613a66 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: x86_64 + OS: Linux + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libresonanceaudio.so b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libresonanceaudio.so new file mode 100644 index 00000000..1724bd33 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libresonanceaudio.so differ diff --git a/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libresonanceaudio.so.meta new file mode 100644 index 00000000..6f3803ca --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux/lib/x86_64/libresonanceaudio.so.meta @@ -0,0 +1,69 @@ +fileFormatVersion: 2 +guid: bca6f630c310b4945b52486d2ed1da0a +timeCreated: 1511469552 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: + CPU: AnyCPU + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Linux + Linux: + enabled: 0 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_15 + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 0 + settings: + CPU: AnyCPU + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Assets/Plugins/FMOD/platforms/linux/src.meta b/Assets/Plugins/FMOD/platforms/linux/src.meta new file mode 100644 index 00000000..2625b93c --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb8b6c816014ed44ebc2db5f8dc5e03e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/linux/src/PlatformLinux.cs b/Assets/Plugins/FMOD/platforms/linux/src/PlatformLinux.cs new file mode 100644 index 00000000..7438767a --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux/src/PlatformLinux.cs @@ -0,0 +1,110 @@ +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if UNITY_STANDALONE_LINUX && !UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { + public const string dll = "fmodstudio" + dllSuffix; + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { + public const string dll = "fmodstudio" + dllSuffix; + } +} +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformLinux : Platform + { + static PlatformLinux() + { + Settings.AddPlatformTemplate("b7716510a1f36934c87976f3a81dbf3d"); + } + + internal override string DisplayName { get { return "Linux"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.LinuxPlayer, this); + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield return BuildTarget.StandaloneLinux64; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.Linux; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return new BinaryAssetFolderInfo("linux", "Plugins"); + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + yield return new FileRecord(string.Format("x86_64/libfmodstudio{0}.so", suffix)); + } + + protected override IEnumerable GetOptionalBinaryFiles(BuildTarget buildTarget, bool allVariants) + { + if (allVariants) + { + yield return new FileRecord("x86_64/libfmod.so"); + yield return new FileRecord("x86_64/libfmodL.so"); + } + + yield return new FileRecord("x86_64/libgvraudio.so"); + yield return new FileRecord("x86_64/libresonanceaudio.so"); + } + + protected override IEnumerable GetObsoleteFiles() + { + yield return "lib/linux/x86/libfmodstudio.so"; + yield return "platforms/linux/lib/x86/libfmodstudio.so"; + yield return "lib/linux/x86/libfmodstudioL.so"; + yield return "platforms/linux/lib/x86/libfmodstudioL.so"; + } +#endif + + internal override string GetPluginPath(string pluginName) + { + return string.Format("{0}/lib{1}.so", GetPluginBasePath(), pluginName); + } + +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes + { + get + { + return sValidOutputTypes; + } + } + + private static OutputType[] sValidOutputTypes = { + new OutputType() { displayName = "Pulse Audio", outputType = FMOD.OUTPUTTYPE.PULSEAUDIO }, + new OutputType() { displayName = "Advanced Linux Sound Architecture", outputType = FMOD.OUTPUTTYPE.ALSA }, + }; +#endif + + internal override List DefaultCodecChannels { get { return staticCodecChannels; } } + + private static List staticCodecChannels = new List() + { + new CodecChannelCount { format = CodecType.FADPCM, channels = 0 }, + new CodecChannelCount { format = CodecType.Vorbis, channels = 32 }, + }; + } +} diff --git a/Assets/Plugins/FMOD/platforms/linux/src/PlatformLinux.cs.meta b/Assets/Plugins/FMOD/platforms/linux/src/PlatformLinux.cs.meta new file mode 100644 index 00000000..f9b88e1e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/linux/src/PlatformLinux.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 73549a74f689f0849a8271d9e908c514 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac.meta b/Assets/Plugins/FMOD/platforms/mac.meta new file mode 100644 index 00000000..3bf1fba1 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5dd2bfa8b9eb6874b9e50b79490891a7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib.meta b/Assets/Plugins/FMOD/platforms/mac/lib.meta new file mode 100644 index 00000000..d4b4fb8d --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 98f2ca7007fe2074d953e949a6fdf971 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle.meta new file mode 100644 index 00000000..5ab94eb0 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle.meta @@ -0,0 +1,68 @@ +fileFormatVersion: 2 +guid: 4f94b6752a0d5ad489274786cbfbc6e5 +folderAsset: yes +timeCreated: 1442816865 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: OSX + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents.meta new file mode 100644 index 00000000..22a63533 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2879b055c8551c44caa264ce7208ea17 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/Info.plist b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/Info.plist new file mode 100644 index 00000000..98befae9 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/Info.plist @@ -0,0 +1,36 @@ + + + + + BuildMachineOSBuild + 17G4015 + CFBundleDevelopmentRegion + English + CFBundleExecutable + fmodstudio + CFBundleIdentifier + com.fmod.fmodstudio + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.0 + CSResourcesFileMapped + no + LSRequiresIPhoneOS + + MinimumOSVersion + 10.7 + NSHighResolutionCapable + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/Info.plist.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/Info.plist.meta new file mode 100644 index 00000000..8434f925 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fdf09afde87e8e440a6e331d1850add6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS.meta new file mode 100644 index 00000000..c0faa7ba --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4c7ef954631945d4981884adcc603e81 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS/fmodstudio b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS/fmodstudio new file mode 100644 index 00000000..ef5cd5fb Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS/fmodstudio differ diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS/fmodstudio.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS/fmodstudio.meta new file mode 100644 index 00000000..c9f7db92 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/MacOS/fmodstudio.meta @@ -0,0 +1,6 @@ +fileFormatVersion: 2 +guid: c5e926e235023354fb6b94bc154a8d2c +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature.meta new file mode 100644 index 00000000..b0d36f87 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0731b3df0eb593f4ebe376b7a4fe7b96 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature/CodeResources b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature/CodeResources new file mode 100644 index 00000000..d5d0fd74 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature/CodeResources @@ -0,0 +1,115 @@ + + + + + files + + files2 + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature/CodeResources.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature/CodeResources.meta new file mode 100644 index 00000000..ecde5de3 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudio.bundle/Contents/_CodeSignature/CodeResources.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a7e866ce49bf582479f3675646324389 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle.meta new file mode 100644 index 00000000..84b5498e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: fecc2c28e945bbb4da3aca8a2f07dfb0 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + OS: OSX + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents.meta new file mode 100644 index 00000000..b93a3b44 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 99d82b6758d211244a26db33da5df6ae +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/Info.plist b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/Info.plist new file mode 100644 index 00000000..2760ee7f --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/Info.plist @@ -0,0 +1,36 @@ + + + + + BuildMachineOSBuild + 17G4015 + CFBundleDevelopmentRegion + English + CFBundleExecutable + fmodstudioL + CFBundleIdentifier + com.fmod.fmodstudioL + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.0 + CSResourcesFileMapped + no + LSRequiresIPhoneOS + + MinimumOSVersion + 10.7 + NSHighResolutionCapable + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/Info.plist.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/Info.plist.meta new file mode 100644 index 00000000..a59b05ce --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 28bc99f6ddbcf4149a24dfd29409a5cc +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS.meta new file mode 100644 index 00000000..9946415d --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5bcb432be37dff04297a06a32bdaf5a8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS/fmodstudioL b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS/fmodstudioL new file mode 100644 index 00000000..3b3a2ed9 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS/fmodstudioL differ diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS/fmodstudioL.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS/fmodstudioL.meta new file mode 100644 index 00000000..71c84f61 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/MacOS/fmodstudioL.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a298d76594bb27a4b839b827b7ccc56b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature.meta new file mode 100644 index 00000000..affd343e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d1a5963d0d6bca41983f249e84c6d82 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources new file mode 100644 index 00000000..d5d0fd74 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources @@ -0,0 +1,115 @@ + + + + + files + + files2 + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources.meta b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources.meta new file mode 100644 index 00000000..a01fc2e6 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6f4387888d43e8e459737087caf63eeb +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle.meta b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle.meta new file mode 100644 index 00000000..2a46a150 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 04e20ff877bea8747ae257229c720dcc +folderAsset: yes +timeCreated: 1511469544 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 0 + settings: + CPU: None + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents.meta b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents.meta new file mode 100644 index 00000000..e8297a79 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a5e43a852000e2443a14695f63ceffd7 +folderAsset: yes +timeCreated: 1511469545 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/Info.plist b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/Info.plist new file mode 100644 index 00000000..95ee74ac --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/Info.plist @@ -0,0 +1,36 @@ + + + + + BuildMachineOSBuild + 17G4015 + CFBundleDevelopmentRegion + English + CFBundleExecutable + resonanceaudio + CFBundleIdentifier + com.fmod.resonanceaudio + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.0 + CSResourcesFileMapped + no + LSRequiresIPhoneOS + + MinimumOSVersion + 10.7 + NSHighResolutionCapable + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/Info.plist.meta b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/Info.plist.meta new file mode 100644 index 00000000..b2bd0fa5 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ea043299abb5407419ae750dbbee6564 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS.meta b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS.meta new file mode 100644 index 00000000..70f53e65 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 242a6e2e6d91dcf45a7ef7bdd7bfe227 +folderAsset: yes +timeCreated: 1511469545 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS/resonanceaudio b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS/resonanceaudio new file mode 100644 index 00000000..43243e0e Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS/resonanceaudio differ diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS/resonanceaudio.meta b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS/resonanceaudio.meta new file mode 100644 index 00000000..bdd97486 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/MacOS/resonanceaudio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e2968e9faea7be4ea2b24d5bd144749 +timeCreated: 1511469545 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature.meta b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature.meta new file mode 100644 index 00000000..b5fc209e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ff1efee5fe0cee4d969f44cbce4294f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources new file mode 100644 index 00000000..d5d0fd74 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources @@ -0,0 +1,115 @@ + + + + + files + + files2 + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources.meta b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources.meta new file mode 100644 index 00000000..78599bd1 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/lib/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e84a173ce5cfbbe4b8d3cf667e97df31 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/src.meta b/Assets/Plugins/FMOD/platforms/mac/src.meta new file mode 100644 index 00000000..d51d5c9a --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 29af24c23c3906b44bbaeaa0c832f235 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/mac/src/PlatformMac.cs b/Assets/Plugins/FMOD/platforms/mac/src/PlatformMac.cs new file mode 100644 index 00000000..66802d8b --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/src/PlatformMac.cs @@ -0,0 +1,108 @@ +using System.Collections.Generic; +using System.IO; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if UNITY_STANDALONE_OSX && !UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { + public const string dll = "fmodstudio" + dllSuffix; + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { + public const string dll = "fmodstudio" + dllSuffix; + } +} +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformMac : Platform + { + static PlatformMac() + { + Settings.AddPlatformTemplate("52eb9df5db46521439908db3a29a1bbb"); + } + + internal override string DisplayName { get { return "macOS"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.OSXPlayer, this); + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield return BuildTarget.StandaloneOSX; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.Mac; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return new BinaryAssetFolderInfo("mac", "Plugins"); + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + yield return new FileRecord(string.Format("fmodstudio{0}.bundle", suffix)); + } + + protected override IEnumerable GetOptionalBinaryFiles(BuildTarget buildTarget, bool allVariants) + { + yield return new FileRecord("gvraudio.bundle"); + yield return new FileRecord("resonanceaudio.bundle"); + } + + internal override bool SupportsAdditionalCPP(BuildTarget target) + { + return false; + } +#endif + + internal override string GetPluginPath(string pluginName) + { + string pluginPath = string.Format("{0}/{1}.bundle", GetPluginBasePath(), pluginName); + if (System.IO.Directory.Exists((pluginPath))) + { + return pluginPath; + } + else + { + return string.Format("{0}/{1}.dylib", GetPluginBasePath(), pluginName); + } + } +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes + { + get + { + return sValidOutputTypes; + } + } + + private static OutputType[] sValidOutputTypes = { + new OutputType() { displayName = "Core Audio", outputType = FMOD.OUTPUTTYPE.COREAUDIO }, + }; +#endif + + internal override List DefaultCodecChannels { get { return staticCodecChannels; } } + + private static List staticCodecChannels = new List() + { + new CodecChannelCount { format = CodecType.FADPCM, channels = 0 }, + new CodecChannelCount { format = CodecType.Vorbis, channels = 32 }, + }; + } +} diff --git a/Assets/Plugins/FMOD/platforms/mac/src/PlatformMac.cs.meta b/Assets/Plugins/FMOD/platforms/mac/src/PlatformMac.cs.meta new file mode 100644 index 00000000..68dbe885 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/mac/src/PlatformMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d92d0baf34dae0e4ea032a42bd6107c0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/tvos.meta b/Assets/Plugins/FMOD/platforms/tvos.meta new file mode 100644 index 00000000..7ddd670d --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b878fb13ea2d16a40b79b4400b5149ba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib.meta b/Assets/Plugins/FMOD/platforms/tvos/lib.meta new file mode 100644 index 00000000..c767ae4f --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3ba8f748d2f09ff46a33e76a54eb551f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounityplugin.a b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounityplugin.a new file mode 100644 index 00000000..06f8ef3f Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounityplugin.a differ diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounityplugin.a.meta b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounityplugin.a.meta new file mode 100644 index 00000000..856dcf38 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounityplugin.a.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 4abc247d0f34143ec95396c7b6bec6a8 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + tvOS: + enabled: 1 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginL.a b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginL.a new file mode 100644 index 00000000..d6b405ac Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginL.a differ diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginL.a.meta b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginL.a.meta new file mode 100644 index 00000000..ba7ba805 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginL.a.meta @@ -0,0 +1,20 @@ +fileFormatVersion: 2 +guid: 982978af662f9ea43b7979c7f61bbad3 +timeCreated: 1507179416 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulator.a b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulator.a new file mode 100644 index 00000000..37f95cec Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulator.a differ diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulator.a.meta b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulator.a.meta new file mode 100644 index 00000000..c38a112c --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulator.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 86d28a38815714041bf19dc4cc59ce65 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulatorL.a b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulatorL.a new file mode 100644 index 00000000..8922721b Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulatorL.a differ diff --git a/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulatorL.a.meta b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulatorL.a.meta new file mode 100644 index 00000000..af33c6b1 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos/lib/libfmodstudiounitypluginsimulatorL.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 649598f6abf894e128aa33102756da99 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/tvos/src.meta b/Assets/Plugins/FMOD/platforms/tvos/src.meta new file mode 100644 index 00000000..88418f41 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a36cddbc75870b64e98ebaac7424553e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/tvos/src/PlatformAppleTV.cs b/Assets/Plugins/FMOD/platforms/tvos/src/PlatformAppleTV.cs new file mode 100644 index 00000000..71a25a8b --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos/src/PlatformAppleTV.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if UNITY_TVOS && !UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { + public const string dll = "__Internal"; + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { + public const string dll = "__Internal"; + } +} +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformAppleTV : Platform + { + static PlatformAppleTV() + { + Settings.AddPlatformTemplate("e7a046c753c3c3d4aacc91f6597f310d"); + } + + internal override string DisplayName { get { return "Apple TV"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.tvOS, this); + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield return BuildTarget.tvOS; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.AppleTV; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return new BinaryAssetFolderInfo("tvos", "Plugins/tvOS"); + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + if (allVariants || PlayerSettings.tvOS.sdkVersion == tvOSSdkVersion.Device) + { + yield return new FileRecord(string.Format("libfmodstudiounityplugin{0}.a", suffix)); + } + + if (allVariants || PlayerSettings.tvOS.sdkVersion == tvOSSdkVersion.Simulator) + { + yield return new FileRecord(string.Format("libfmodstudiounitypluginsimulator{0}.a", suffix)); + } + } + + internal override bool SupportsAdditionalCPP(BuildTarget target) + { + return PlatformIOS.StaticSupportsAdditionalCpp(); + } +#endif + +#if !UNITY_EDITOR + internal override void LoadPlugins(FMOD.System coreSystem, Action reportResult) + { + PlatformIOS.StaticLoadPlugins(this, coreSystem, reportResult); + } +#endif + +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes + { + get + { + return sValidOutputTypes; + } + } + + private static OutputType[] sValidOutputTypes = { + new OutputType() { displayName = "Core Audio", outputType = FMOD.OUTPUTTYPE.COREAUDIO }, + }; +#endif + } +} diff --git a/Assets/Plugins/FMOD/platforms/tvos/src/PlatformAppleTV.cs.meta b/Assets/Plugins/FMOD/platforms/tvos/src/PlatformAppleTV.cs.meta new file mode 100644 index 00000000..a49dadf8 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/tvos/src/PlatformAppleTV.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17eea195bdfbf014e91ba7620ee491f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp.meta b/Assets/Plugins/FMOD/platforms/uwp.meta new file mode 100644 index 00000000..797ac196 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76cc08b21e1f3d04e9cc8fdf3cef9eda +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib.meta b/Assets/Plugins/FMOD/platforms/uwp/lib.meta new file mode 100644 index 00000000..cfc2439e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: faacb4351a5f83845b1cea9370b4d244 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/arm.meta new file mode 100644 index 00000000..7e0ebdbe --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0cddbb9418c24f44d87fc49581769340 +folderAsset: yes +timeCreated: 1457408139 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmod.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmod.dll new file mode 100644 index 00000000..31640290 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmod.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:631b4bf9ee5bdc873983e1bb6c535c8035d8769ec9be0847f14ba1bc3ea62848 +size 1125888 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmod.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmod.dll.meta new file mode 100644 index 00000000..1d7a3dbe --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmod.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 907f4331811d73442b58d50627a775d4 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodL.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodL.dll new file mode 100644 index 00000000..9470d5ad --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6afed3986a3d0e5b77379754e53c635891fac73cf903950b71d43374b83bb18d +size 1321984 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodL.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodL.dll.meta new file mode 100644 index 00000000..3c490d84 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 82bacb4b0f3cc85418d2a1aa2ca57df6 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudio.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudio.dll new file mode 100644 index 00000000..92d9c147 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58e0c6ed6cc8e2a13603b719dbcb7560c08e5a0c0368edeab3fdeb23062a27d7 +size 728576 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudio.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudio.dll.meta new file mode 100644 index 00000000..0a1de25e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudio.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: a7c1eb40b6cc0b8468c161b5ba9a6df6 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudioL.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudioL.dll new file mode 100644 index 00000000..72aff853 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudioL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e530bfd3fa2b97d9ce0b3222ccbe253661601140102364a9501d08e2f2043dca +size 1276928 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudioL.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudioL.dll.meta new file mode 100644 index 00000000..af4f20b1 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/arm/fmodstudioL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 5476dd86ee3260f4bb2283aef1d9a883 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x64.meta new file mode 100644 index 00000000..3a6641e0 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 81189b2e21a815647a28e3437c86beb2 +folderAsset: yes +timeCreated: 1457064777 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmod.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmod.dll new file mode 100644 index 00000000..467432cb --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmod.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfc69054c04588f93b2ae2df1f57d9cb7dc2757d282dd8ade2c73143e5e9772b +size 1631232 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmod.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmod.dll.meta new file mode 100644 index 00000000..0822901f --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmod.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 68f9a982a926833498d438319388a455 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodL.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodL.dll new file mode 100644 index 00000000..176247f9 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4aaf7070c56383f24ee3a8736b63a33ae6a039e0b93baccc28c15665d9305686 +size 1853440 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodL.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodL.dll.meta new file mode 100644 index 00000000..233512d3 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: d15f9d3e1089b114a8f625e994fea839 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudio.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudio.dll new file mode 100644 index 00000000..a7077f45 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b94d5d164cf7ddccfbd1a7107c081fb42e3ce5cb6acdfce9cc8f184fba6d6c0c +size 1063424 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudio.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudio.dll.meta new file mode 100644 index 00000000..3412da57 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudio.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 29800d7cce1a5fc46ae163c8a68d8346 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudioL.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudioL.dll new file mode 100644 index 00000000..1e3daa1f --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudioL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8801c4225d9f901b2de14d1b7f08519a73341d25957642f54eaca1ff93a3b777 +size 1658368 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudioL.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudioL.dll.meta new file mode 100644 index 00000000..0bbdb23c --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x64/fmodstudioL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 813ca429588de5d40b5c8a184a15bcd9 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x86.meta new file mode 100644 index 00000000..d4dbed4a --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fa5c1a42d40246b4a83af1e8192b6bdf +folderAsset: yes +timeCreated: 1457063023 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmod.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmod.dll new file mode 100644 index 00000000..95bbaf03 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmod.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efbce53bf6b4d503e81ead528d2245a91977f8a9971cbdc0e4ecfea0cfdbb46b +size 1379840 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmod.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmod.dll.meta new file mode 100644 index 00000000..38df19ed --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmod.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 39f9a761a2a032045a853a069db31081 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodL.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodL.dll new file mode 100644 index 00000000..f4e7835a --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e76dfa5cd0a3f451c8f54af0810d6fb739c871aefcf32ce7ad63dd8e554d267 +size 1573376 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodL.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodL.dll.meta new file mode 100644 index 00000000..9dfb7500 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 243e8fba07980f74b8d49ef345dadd64 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudio.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudio.dll new file mode 100644 index 00000000..222f2596 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe1688113ae497cf314cd40bef1a9245ee89bc84a1043ec68780af1fae6569f3 +size 838656 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudio.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudio.dll.meta new file mode 100644 index 00000000..74c73fce --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudio.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: ecb0cc0019197154b9baeef623b6ec0a +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudioL.dll b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudioL.dll new file mode 100644 index 00000000..ce24c480 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudioL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e99027af492819318f5a09a5ed9830e7c5adc41a6062dd4abf65c11d5bcb814 +size 1338880 diff --git a/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudioL.dll.meta b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudioL.dll.meta new file mode 100644 index 00000000..05692027 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/uwp/lib/x86/fmodstudioL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 43ab9a198caf2d841b813eb81e02486d +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos.meta b/Assets/Plugins/FMOD/platforms/visionos.meta new file mode 100644 index 00000000..5bffd1c0 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c0af21c1e7f184d6f860c5bb39642057 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib.meta b/Assets/Plugins/FMOD/platforms/visionos/lib.meta new file mode 100644 index 00000000..45f91802 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b847b610a434440b0854bdda3a8522fe +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xros.a b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xros.a new file mode 100644 index 00000000..09a60e77 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xros.a differ diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xros.a.meta b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xros.a.meta new file mode 100644 index 00000000..b70ffcfa --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xros.a.meta @@ -0,0 +1,73 @@ +fileFormatVersion: 2 +guid: 240b87501d4c14726b85b03230183106 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude VisionOS: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + VisionOS: VisionOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xrsimulator.a b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xrsimulator.a new file mode 100644 index 00000000..04767fee Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xrsimulator.a differ diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xrsimulator.a.meta b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xrsimulator.a.meta new file mode 100644 index 00000000..c285a5e9 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudioL_xrsimulator.a.meta @@ -0,0 +1,73 @@ +fileFormatVersion: 2 +guid: cc7984acfd746420c810ab83b89887c4 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude VisionOS: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + VisionOS: VisionOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xros.a b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xros.a new file mode 100644 index 00000000..be36bbe4 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xros.a differ diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xros.a.meta b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xros.a.meta new file mode 100644 index 00000000..546c9888 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xros.a.meta @@ -0,0 +1,73 @@ +fileFormatVersion: 2 +guid: b06ee804ac1c44c538ef636ef4e034c1 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude VisionOS: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + VisionOS: VisionOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xrsimulator.a b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xrsimulator.a new file mode 100644 index 00000000..23305f0c Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xrsimulator.a differ diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xrsimulator.a.meta b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xrsimulator.a.meta new file mode 100644 index 00000000..620add38 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/lib/libfmodstudio_xrsimulator.a.meta @@ -0,0 +1,73 @@ +fileFormatVersion: 2 +guid: da47e54c091124c7baa78e13f90216f3 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude VisionOS: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + VisionOS: VisionOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xros.a b/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xros.a new file mode 100644 index 00000000..f9081de2 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xros.a differ diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xros.a.meta b/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xros.a.meta new file mode 100644 index 00000000..d53c9372 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xros.a.meta @@ -0,0 +1,73 @@ +fileFormatVersion: 2 +guid: c56aac88d64894d01a74d1cf8f609da6 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude VisionOS: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + VisionOS: VisionOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xrsimulator.a b/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xrsimulator.a new file mode 100644 index 00000000..504fba56 Binary files /dev/null and b/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xrsimulator.a differ diff --git a/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xrsimulator.a.meta b/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xrsimulator.a.meta new file mode 100644 index 00000000..92f85c80 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/lib/libresonanceaudio_xrsimulator.a.meta @@ -0,0 +1,73 @@ +fileFormatVersion: 2 +guid: ab84f09ed56d54cd3867c72395f7658c +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude VisionOS: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + VisionOS: VisionOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/src.meta b/Assets/Plugins/FMOD/platforms/visionos/src.meta new file mode 100644 index 00000000..0d0d5914 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dbc65c69ec16043268c63c40c92f8bf0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/visionos/src/PlatformVisionOS.cs b/Assets/Plugins/FMOD/platforms/visionos/src/PlatformVisionOS.cs new file mode 100644 index 00000000..84232ffe --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/src/PlatformVisionOS.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if UNITY_VISIONOS && !UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { + public const string dll = "__Internal"; + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { + public const string dll = "__Internal"; + } +} +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformVisionOS : Platform + { + static PlatformVisionOS() + { + Settings.AddPlatformTemplate("de700ef3f37a49b58a57ae3addf01ad9"); + } + + internal override string DisplayName { get { return "visionOS"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + #if UNITY_VISIONOS + settings.DeclareRuntimePlatform(RuntimePlatform.VisionOS, this); + #endif + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + #if UNITY_VISIONOS + yield return BuildTarget.VisionOS; + #else + yield return BuildTarget.NoTarget; + #endif + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.None; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return new BinaryAssetFolderInfo("visionos", FileLayout.Release_2_2); + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + #if UNITY_VISIONOS + if (allVariants || PlayerSettings.VisionOS.sdkVersion == VisionOSSdkVersion.Device) + #endif + { + yield return new FileRecord(string.Format("libfmodstudio{0}_xros.a", suffix)); + } + + #if UNITY_VISIONOS + if (allVariants || PlayerSettings.VisionOS.sdkVersion == VisionOSSdkVersion.Simulator) + #endif + { + yield return new FileRecord(string.Format("libfmodstudio{0}_xrsimulator.a", suffix)); + } + } + + protected override IEnumerable GetOptionalBinaryFiles(BuildTarget buildTarget, bool allVariants) + { + #if UNITY_VISIONOS + if (allVariants || PlayerSettings.VisionOS.sdkVersion == VisionOSSdkVersion.Device) + #endif + { + yield return new FileRecord("libresonanceaudio_xros.a"); + } + + #if UNITY_VISIONOS + if (allVariants || PlayerSettings.VisionOS.sdkVersion == VisionOSSdkVersion.Simulator) + #endif + { + yield return new FileRecord("libresonanceaudio_xrsimulator.a"); + } + } + + internal override bool IsFMODStaticallyLinked { get { return true; } } + + internal override bool SupportsAdditionalCPP(BuildTarget target) + { + return PlatformIOS.StaticSupportsAdditionalCpp(); + } +#endif + +#if !UNITY_EDITOR + internal override void LoadPlugins(FMOD.System coreSystem, Action reportResult) + { + PlatformIOS.StaticLoadPlugins(this, coreSystem, reportResult); + } +#endif + +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes + { + get + { + return sValidOutputTypes; + } + } + + private static OutputType[] sValidOutputTypes = { + new OutputType() { displayName = "Core Audio", outputType = FMOD.OUTPUTTYPE.COREAUDIO }, + }; +#endif + } +} diff --git a/Assets/Plugins/FMOD/platforms/visionos/src/PlatformVisionOS.cs.meta b/Assets/Plugins/FMOD/platforms/visionos/src/PlatformVisionOS.cs.meta new file mode 100644 index 00000000..d4ad7e09 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/visionos/src/PlatformVisionOS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f591a193113347409efedcc618e83d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win.meta b/Assets/Plugins/FMOD/platforms/win.meta new file mode 100644 index 00000000..6414d985 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c66754bc90bcdd74dbacaa9bc9adf48b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib.meta b/Assets/Plugins/FMOD/platforms/win/lib.meta new file mode 100644 index 00000000..c8a4d9d8 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4ad89dfcd36045640a8e902f16b09363 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86.meta b/Assets/Plugins/FMOD/platforms/win/lib/x86.meta new file mode 100644 index 00000000..e23ad280 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 03f590b69e4afe14fa1c73f89a98a203 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudio.dll b/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudio.dll new file mode 100644 index 00000000..8289086e --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:712e8a838c85d9c9e03f150350e324b4de9f3a64221920e505f1cc56a4fbf8d9 +size 2604544 diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudio.dll.meta b/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudio.dll.meta new file mode 100644 index 00000000..a32046af --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudio.dll.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 1550e5c882b8c2445a1f14f8b1b23d41 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: None + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: None + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudioL.dll b/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudioL.dll new file mode 100644 index 00000000..11fa6e01 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudioL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7197ff88772bde1a7da4aff5975746da1d88c3edba0ae2670db14d805452fd4a +size 3500544 diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudioL.dll.meta b/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudioL.dll.meta new file mode 100644 index 00000000..ba151b38 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86/fmodstudioL.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 22b97e569d11c114dbd137714df592ed +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: x86 + OS: Windows + - first: + Standalone: Win + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86/resonanceaudio.dll b/Assets/Plugins/FMOD/platforms/win/lib/x86/resonanceaudio.dll new file mode 100644 index 00000000..29787e98 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86/resonanceaudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6588e24d03237ee37e90cbcf8a8311daef3151b4db02d82ed9596ef4b11a84b +size 694784 diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86/resonanceaudio.dll.meta b/Assets/Plugins/FMOD/platforms/win/lib/x86/resonanceaudio.dll.meta new file mode 100644 index 00000000..b3274db4 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86/resonanceaudio.dll.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: b2c11f1e03736f748bd861d7bf4f8952 +timeCreated: 1511469552 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Editor: + enabled: 0 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86_64.meta b/Assets/Plugins/FMOD/platforms/win/lib/x86_64.meta new file mode 100644 index 00000000..d574d01b --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86_64.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8105cca2fc4eb2e488e010278c3ea1bf +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudio.dll b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudio.dll new file mode 100644 index 00000000..b4563cbe --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3274c2433c0650b70fe347597b84c0ce31e9ae9273dd5cb137b6286f008781f5 +size 3248128 diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudio.dll.meta b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudio.dll.meta new file mode 100644 index 00000000..2059acb8 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudio.dll.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 684d4d47a018ed14080e15f4c99b8e86 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 1 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: None + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudioL.dll b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudioL.dll new file mode 100644 index 00000000..0efa3fcf --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudioL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ea60cf98b5fcd795d364ee2f2f47f22b8dcbfc559f61c070353ca7486fa2b5a +size 4355072 diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudioL.dll.meta b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudioL.dll.meta new file mode 100644 index 00000000..9ffd67cc --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudioL.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 8758fa26796b44b47b97b6e17ace8975 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: x86_64 + OS: Windows + - first: + Standalone: Win64 + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86_64/resonanceaudio.dll b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/resonanceaudio.dll new file mode 100644 index 00000000..bd6856cc --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/resonanceaudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1667e5336ae067ab1d9aa04e7bcca9789ff5573ed4c7f6fa9305404d0485f99 +size 816640 diff --git a/Assets/Plugins/FMOD/platforms/win/lib/x86_64/resonanceaudio.dll.meta b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/resonanceaudio.dll.meta new file mode 100644 index 00000000..611e72f0 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/lib/x86_64/resonanceaudio.dll.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 4c8fb9b92ea2eae4f9112a3941c4f128 +timeCreated: 1511469552 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/src.meta b/Assets/Plugins/FMOD/platforms/win/src.meta new file mode 100644 index 00000000..14b32ebb --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e3438d4d60981a7489133b13b11958ec +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platforms/win/src/PlatformWindows.cs b/Assets/Plugins/FMOD/platforms/win/src/PlatformWindows.cs new file mode 100644 index 00000000..1c5a1623 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/src/PlatformWindows.cs @@ -0,0 +1,171 @@ +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if !UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { +#if UNITY_STANDALONE_WIN + public const string dll = "fmodstudio" + dllSuffix; +#elif UNITY_WSA + public const string dll = "fmod" + dllSuffix; +#endif + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { +#if UNITY_STANDALONE_WIN || UNITY_WSA + public const string dll = "fmodstudio" + dllSuffix; +#endif + } +} +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformWindows : Platform + { + static PlatformWindows() + { + Settings.AddPlatformTemplate("2c5177b11d81d824dbb064f9ac8527da"); + } + + internal override string DisplayName { get { return "Windows"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.WindowsPlayer, this); + settings.DeclareRuntimePlatform(RuntimePlatform.WSAPlayerX86, this); + settings.DeclareRuntimePlatform(RuntimePlatform.WSAPlayerX64, this); + settings.DeclareRuntimePlatform(RuntimePlatform.WSAPlayerARM, this); + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield return BuildTarget.StandaloneWindows; + yield return BuildTarget.StandaloneWindows64; + yield return BuildTarget.WSAPlayer; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.Windows; } } +#endif + +#if UNITY_WINRT_8_1 || UNITY_WSA_10_0 + internal override string GetBankFolder() + { + return "ms-appx:///Data/StreamingAssets"; + } +#endif + +#if UNITY_EDITOR + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + switch (buildTarget) + { + case BuildTarget.StandaloneWindows: + case BuildTarget.StandaloneWindows64: + return new BinaryAssetFolderInfo("win", "Plugins"); + case BuildTarget.WSAPlayer: + return new BinaryAssetFolderInfo("uwp", "Plugins/UWP"); + default: + throw new System.ArgumentException("Unrecognised build target: " + buildTarget); + } + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + string dllSuffix = suffix + ".dll"; + + switch (buildTarget) + { + case BuildTarget.StandaloneWindows: + yield return new FileRecord("x86/fmodstudio" + dllSuffix); + break; + case BuildTarget.StandaloneWindows64: + yield return new FileRecord("x86_64/fmodstudio" + dllSuffix); + break; + case BuildTarget.WSAPlayer: + foreach (string architecture in new[] { "arm", "x64", "x86" }) + { + yield return new FileRecord(string.Format("{0}/fmod{1}", architecture, dllSuffix)); + yield return new FileRecord(string.Format("{0}/fmodstudio{1}", architecture, dllSuffix)); + } + break; + default: + throw new System.NotSupportedException("Unrecognised Build Target"); + } + } + + protected override IEnumerable GetOptionalBinaryFiles(BuildTarget buildTarget, bool allVariants) + { + switch (buildTarget) + { + case BuildTarget.StandaloneWindows: + yield return new FileRecord("x86/gvraudio.dll"); + yield return new FileRecord("x86/resonanceaudio.dll"); + break; + case BuildTarget.StandaloneWindows64: + yield return new FileRecord("x86_64/gvraudio.dll"); + yield return new FileRecord("x86_64/resonanceaudio.dll"); + break; + case BuildTarget.WSAPlayer: + yield break; + default: + throw new System.NotSupportedException("Unrecognised Build Target"); + } + } + + internal override bool SupportsAdditionalCPP(BuildTarget target) + { + return target != BuildTarget.WSAPlayer; + } +#endif + + internal override string GetPluginPath(string pluginName) + { +#if UNITY_STANDALONE_WIN + #if UNITY_64 + return string.Format("{0}/X86_64/{1}.dll", GetPluginBasePath(), pluginName); + #else + return string.Format("{0}/X86/{1}.dll", GetPluginBasePath(), pluginName); + #endif +#else // UNITY_WSA + return string.Format("{0}.dll", pluginName); +#endif + } +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes + { + get + { + return sValidOutputTypes; + } + } + + private static OutputType[] sValidOutputTypes = { + new OutputType() { displayName = "Windows Audio Session API", outputType = FMOD.OUTPUTTYPE.WASAPI }, + new OutputType() { displayName = "Windows Sonic", outputType = FMOD.OUTPUTTYPE.WINSONIC }, + }; + + internal override int CoreCount { get { return MaximumCoreCount; } } +#endif + + internal override List DefaultCodecChannels { get { return staticCodecChannels; } } + + private static List staticCodecChannels = new List() + { + new CodecChannelCount { format = CodecType.FADPCM, channels = 0 }, + new CodecChannelCount { format = CodecType.Vorbis, channels = 32 }, + }; + } +} diff --git a/Assets/Plugins/FMOD/platforms/win/src/PlatformWindows.cs.meta b/Assets/Plugins/FMOD/platforms/win/src/PlatformWindows.cs.meta new file mode 100644 index 00000000..ac31c999 --- /dev/null +++ b/Assets/Plugins/FMOD/platforms/win/src/PlatformWindows.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9660e62d6232af242877f0cc2b90c63d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src.meta b/Assets/Plugins/FMOD/src.meta new file mode 100644 index 00000000..e435fc44 --- /dev/null +++ b/Assets/Plugins/FMOD/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2994e348941404549b266423c2ac329f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/AutomatableSlots.cs b/Assets/Plugins/FMOD/src/AutomatableSlots.cs new file mode 100644 index 00000000..777eb4b7 --- /dev/null +++ b/Assets/Plugins/FMOD/src/AutomatableSlots.cs @@ -0,0 +1,85 @@ +using System; +using UnityEngine.Serialization; + +namespace FMODUnity +{ + [Serializable] + public struct AutomatableSlots + { + public const int Count = 16; + + [FormerlySerializedAs("slot00")] + public float Slot00; + [FormerlySerializedAs("slot01")] + public float Slot01; + [FormerlySerializedAs("slot02")] + public float Slot02; + [FormerlySerializedAs("slot03")] + public float Slot03; + [FormerlySerializedAs("slot04")] + public float Slot04; + [FormerlySerializedAs("slot05")] + public float Slot05; + [FormerlySerializedAs("slot06")] + public float Slot06; + [FormerlySerializedAs("slot07")] + public float Slot07; + [FormerlySerializedAs("slot08")] + public float Slot08; + [FormerlySerializedAs("slot09")] + public float Slot09; + [FormerlySerializedAs("slot10")] + public float Slot10; + [FormerlySerializedAs("slot11")] + public float Slot11; + [FormerlySerializedAs("slot12")] + public float Slot12; + [FormerlySerializedAs("slot13")] + public float Slot13; + [FormerlySerializedAs("slot14")] + public float Slot14; + [FormerlySerializedAs("slot15")] + public float Slot15; + + public float GetValue(int index) + { + switch(index) + { + case 0: + return Slot00; + case 1: + return Slot01; + case 2: + return Slot02; + case 3: + return Slot03; + case 4: + return Slot04; + case 5: + return Slot05; + case 6: + return Slot06; + case 7: + return Slot07; + case 8: + return Slot08; + case 9: + return Slot09; + case 10: + return Slot10; + case 11: + return Slot11; + case 12: + return Slot12; + case 13: + return Slot13; + case 14: + return Slot14; + case 15: + return Slot15; + default: + throw new ArgumentException(string.Format("Invalid slot index: {0}", index)); + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/AutomatableSlots.cs.meta b/Assets/Plugins/FMOD/src/AutomatableSlots.cs.meta new file mode 100644 index 00000000..890a60b6 --- /dev/null +++ b/Assets/Plugins/FMOD/src/AutomatableSlots.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c13d4e62f5f7b44bb33162cbf29a9f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/BankRefAttribute.cs b/Assets/Plugins/FMOD/src/BankRefAttribute.cs new file mode 100644 index 00000000..de449173 --- /dev/null +++ b/Assets/Plugins/FMOD/src/BankRefAttribute.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace FMODUnity +{ + public class BankRefAttribute : PropertyAttribute + { + } +} diff --git a/Assets/Plugins/FMOD/src/BankRefAttribute.cs.meta b/Assets/Plugins/FMOD/src/BankRefAttribute.cs.meta new file mode 100644 index 00000000..06ddbb18 --- /dev/null +++ b/Assets/Plugins/FMOD/src/BankRefAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a8ab5f38e7776644297d8b3687c39b49 +timeCreated: 1445488716 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor.meta b/Assets/Plugins/FMOD/src/Editor.meta new file mode 100644 index 00000000..ea0ad527 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdb2bdc82b47a634b803bb658c6e312b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs b/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs new file mode 100644 index 00000000..c126d056 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs @@ -0,0 +1,66 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomPropertyDrawer(typeof(BankRefAttribute))] + public class BankRefDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + Texture browseIcon = EditorUtils.LoadImage("SearchIconBlack.png"); + + SerializedProperty pathProperty = property; + + EditorGUI.BeginProperty(position, label, property); + + Event e = Event.current; + if (e.type == EventType.DragPerform && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef)) + { + pathProperty.stringValue = ((EditorBankRef)DragAndDrop.objectReferences[0]).Name; + + e.Use(); + } + } + if (e.type == EventType.DragUpdated && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + + float baseHeight = GUI.skin.textField.CalcSize(new GUIContent()).y; + + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + + var buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.padding.top = buttonStyle.padding.bottom = 1; + + Rect searchRect = new Rect(position.x + position.width - browseIcon.width - 15, position.y, browseIcon.width + 10, baseHeight); + Rect pathRect = new Rect(position.x, position.y, searchRect.x - position.x - 5, baseHeight); + + EditorGUI.PropertyField(pathRect, pathProperty, GUIContent.none); + if (GUI.Button(searchRect, new GUIContent(browseIcon, "Select FMOD Bank"), buttonStyle)) + { + var eventBrowser = ScriptableObject.CreateInstance(); + + eventBrowser.ChooseBank(property); + var windowRect = position; + windowRect.position = GUIUtility.GUIToScreenPoint(windowRect.position); + windowRect.height = searchRect.height + 1; + eventBrowser.ShowAsDropDown(windowRect, new Vector2(windowRect.width, 400)); + } + + EditorGUI.EndProperty(); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs.meta b/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs.meta new file mode 100644 index 00000000..9b8463c9 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 49ebe6fea5e4bfc4bb492bba062b2afe +timeCreated: 1433209573 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/BankRefreshWindow.cs b/Assets/Plugins/FMOD/src/Editor/BankRefreshWindow.cs new file mode 100644 index 00000000..3a081b42 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BankRefreshWindow.cs @@ -0,0 +1,237 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + public class BankRefreshWindow : EditorWindow + { + private static BankRefreshWindow instance = null; + + private SerializedObject serializedSettings; + private SerializedProperty cooldown; + private SerializedProperty showWindow; + + private bool readyToRefreshBanks = false; + private float closeTime = float.MaxValue; + private string lastRefreshError = null; + + private const float CloseDelay = 5; + + public static bool IsVisible { get { return instance != null; } } + + public static bool ReadyToRefreshBanks { get { return instance == null || instance.readyToRefreshBanks; } } + + public static void ShowWindow() + { + if (instance == null) + { + instance = CreateInstance(); + instance.titleContent = new GUIContent(L10n.Tr("FMOD Bank Refresh Status")); + instance.minSize = new Vector2(400, 200); + instance.maxSize = new Vector2(1000, 200); + + instance.ShowUtility(); + } + } + + private void OnEnable() + { + serializedSettings = new SerializedObject(Settings.Instance); + cooldown = serializedSettings.FindProperty("BankRefreshCooldown"); + showWindow = serializedSettings.FindProperty("ShowBankRefreshWindow"); + + // instance is set to null when scripts are recompiled + if (instance == null) + { + instance = this; + } + else if (instance != this) + { + Close(); + } + } + + private void OnDestroy() + { + if (instance == this) + { + instance = null; + } + } + + private void OnInspectorUpdate() + { + Repaint(); + + if (BankRefresher.TimeUntilBankRefresh() != float.MaxValue) + { + closeTime = float.MaxValue; + } + + if (Time.realtimeSinceStartup > closeTime) + { + Close(); + } + } + + public static void HandleBankRefresh(string error) + { + if (error != null) + { + RuntimeUtils.DebugLogErrorFormat("FMOD: Bank refresh failed: {0}", error); + } + + if (instance != null) + { + instance.readyToRefreshBanks = false; + instance.lastRefreshError = error; + + if (error == null) + { + instance.closeTime = Time.realtimeSinceStartup + CloseDelay; + } + } + } + + private void OnGUI() + { + serializedSettings.Update(); + + DrawStatus(); + + GUILayout.FlexibleSpace(); + + SettingsEditor.DisplayBankRefreshSettings(cooldown, showWindow, false); + + DrawButtons(); + + serializedSettings.ApplyModifiedProperties(); + } + + private bool ConsumeEscapeKey() + { + if ((focusedWindow == this) && Event.current.isKey && Event.current.keyCode == KeyCode.Escape) + { + Event.current.Use(); + return true; + } + else + { + return false; + } + } + + private void DrawStatus() + { + GUIStyle labelStyle = new GUIStyle(EditorStyles.whiteLargeLabel); + labelStyle.alignment = TextAnchor.MiddleCenter; + + GUIStyle largeErrorStyle = new GUIStyle(labelStyle); + largeErrorStyle.normal.textColor = Color.red; + + GUIStyle errorStyle = new GUIStyle(GUI.skin.box); + errorStyle.alignment = TextAnchor.UpperLeft; + errorStyle.wordWrap = true; + errorStyle.normal.textColor = Color.red; + + float timeSinceFileChange = BankRefresher.TimeSinceSourceFileChange(); + + if (timeSinceFileChange != float.MaxValue) + { + GUILayout.Label(string.Format(L10n.Tr("The FMOD source banks changed {0} ago."), + EditorUtils.DurationString(timeSinceFileChange)), labelStyle); + + float timeUntilBankRefresh = BankRefresher.TimeUntilBankRefresh(); + + if (timeUntilBankRefresh == 0) + { + GUILayout.Label(L10n.Tr("Refreshing banks now..."), labelStyle); + readyToRefreshBanks = true; + } + else if (timeUntilBankRefresh != float.MaxValue) + { + if (DrawCountdown(L10n.Tr("Refreshing banks"), timeUntilBankRefresh, Settings.Instance.BankRefreshCooldown, labelStyle) + || ConsumeEscapeKey()) + { + BankRefresher.DisableAutoRefresh(); + } + } + else + { + GUILayout.Label(L10n.Tr("Would you like to refresh banks?"), labelStyle); + } + } + else + { + if (lastRefreshError == null) + { + GUILayout.Label(L10n.Tr("The FMOD banks are up to date."), labelStyle); + } + else + { + GUILayout.Label(L10n.Tr("Bank refresh failed:"), largeErrorStyle); + GUILayout.Box(lastRefreshError, errorStyle, GUILayout.ExpandWidth(true)); + } + } + + if (closeTime != float.MaxValue) + { + float timeUntilClose = Mathf.Max(0, closeTime - Time.realtimeSinceStartup); + + if (DrawCountdown(L10n.Tr("Closing"), timeUntilClose, CloseDelay, labelStyle) || ConsumeEscapeKey()) + { + closeTime = float.MaxValue; + } + } + } + + private static bool DrawCountdown(string text, float remainingTime, float totalTime, GUIStyle labelStyle) + { + GUILayout.Label(string.Format(L10n.Tr("{0} in {1}..."), text, EditorUtils.DurationString(remainingTime)), labelStyle); + + const float boxHeight = 2; + + Rect controlRect = EditorGUILayout.GetControlRect(false, boxHeight * 2); + + Rect boxRect = controlRect; + boxRect.width *= remainingTime / totalTime; + boxRect.x += (controlRect.width - boxRect.width) / 2; + boxRect.height = 2; + + GUI.DrawTexture(boxRect, EditorGUIUtility.whiteTexture); + + GUIContent cancelContent = new GUIContent(L10n.Tr("Cancel")); + + controlRect = EditorGUILayout.GetControlRect(false, EditorGUIUtility.singleLineHeight * 2); + + Rect buttonRect = controlRect; + buttonRect.width = 100; + buttonRect.x += (controlRect.width - buttonRect.width) / 2; + + return GUI.Button(buttonRect, cancelContent); + } + + private void DrawButtons() + { + Rect rect = EditorGUILayout.GetControlRect(false, EditorGUIUtility.singleLineHeight * 2); + + int buttonCount = 2; + + Rect closeRect = rect; + closeRect.width = rect.width / buttonCount; + + Rect refreshRect = rect; + refreshRect.xMin = closeRect.xMax; + + if (GUI.Button(closeRect, L10n.Tr("Close"))) + { + Close(); + } + + if (GUI.Button(refreshRect, L10n.Tr("Refresh Banks Now"))) + { + EventManager.RefreshBanks(); + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/BankRefreshWindow.cs.meta b/Assets/Plugins/FMOD/src/Editor/BankRefreshWindow.cs.meta new file mode 100644 index 00000000..efec694b --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BankRefreshWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40a1ca322d08d704eacd449863718b31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/BankRefresher.cs b/Assets/Plugins/FMOD/src/Editor/BankRefresher.cs new file mode 100644 index 00000000..0c75f5e1 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BankRefresher.cs @@ -0,0 +1,167 @@ +using System; +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + public class BankRefresher + { + private static string currentWatchPath; + private static FileSystemWatcher sourceFileWatcher; + private static bool sourceFilesChanged = false; + private static float lastSourceFileChange = float.MaxValue; + private static bool autoRefresh = true; + private static float nextFilePollTime = float.MinValue; + + private const int FilePollPeriod = 5; + + public static void DisableAutoRefresh() + { + autoRefresh = false; + } + + public static void Startup() + { + sourceFileWatcher = new FileSystemWatcher(); + sourceFileWatcher.IncludeSubdirectories = true; + sourceFileWatcher.NotifyFilter = NotifyFilters.LastWrite; + + sourceFileWatcher.Changed += OnSourceFileChanged; + sourceFileWatcher.Created += OnSourceFileChanged; + sourceFileWatcher.Deleted += OnSourceFileChanged; + + EditorApplication.update += Update; + } + + private static void OnSourceFileChanged(object source, FileSystemEventArgs e) + { + sourceFilesChanged = true; + } + + private static void Update() + { + UpdateFileWatcherPath(); + CheckSourceFilesChanged(); + CheckCacheFileExists(); + RefreshBanksIfReady(); + } + + private static void UpdateFileWatcherPath() + { + string sourceBankPath = Settings.Instance.SourceBankPath; + + string pathToWatch; + + if (Path.IsPathRooted(sourceBankPath)) + { + pathToWatch = Path.GetFullPath(sourceBankPath); + } + else + { + pathToWatch = Path.GetFullPath(Environment.CurrentDirectory + "/" + sourceBankPath); + } + + if (currentWatchPath != pathToWatch) + { + currentWatchPath = pathToWatch; + + try { + sourceFileWatcher.EnableRaisingEvents = false; + sourceFilesChanged = false; + + if (!string.IsNullOrEmpty(sourceBankPath)) + { + sourceFileWatcher.Path = pathToWatch; + sourceFileWatcher.EnableRaisingEvents = true; + } + } + catch (ArgumentException e) + { + RuntimeUtils.DebugLogWarningFormat("Error watching {0}: {1}", pathToWatch, e.Message); + } + } + } + + private static void CheckSourceFilesChanged() + { + if (sourceFilesChanged) + { + lastSourceFileChange = Time.realtimeSinceStartup; + sourceFilesChanged = false; + + if (!BankRefreshWindow.IsVisible) + { + autoRefresh = true; + } + + if (IsWindowEnabled()) + { + BankRefreshWindow.ShowWindow(); + } + } + } + + private static void CheckCacheFileExists() + { + if (Time.realtimeSinceStartup >= nextFilePollTime) + { + if (!File.Exists(EventManager.CacheAssetFullName)) + { + EventManager.RefreshBanks(); + } + + nextFilePollTime = Time.realtimeSinceStartup + FilePollPeriod; + } + } + + private static void RefreshBanksIfReady() + { + if (TimeUntilBankRefresh() == 0 && BankRefreshWindow.ReadyToRefreshBanks) + { + EventManager.RefreshBanks(); + } + } + + public static void HandleBankRefresh(string result) + { + lastSourceFileChange = float.MaxValue; + BankRefreshWindow.HandleBankRefresh(result); + } + + private static bool IsWindowEnabled() + { + Settings settings = Settings.Instance; + + return settings.BankRefreshCooldown == Settings.BankRefreshPrompt + || (settings.BankRefreshCooldown >= 0 && settings.ShowBankRefreshWindow); + } + + public static float TimeSinceSourceFileChange() + { + if (lastSourceFileChange == float.MaxValue) + { + return float.MaxValue; + } + else + { + return Mathf.Max(0, Time.realtimeSinceStartup - lastSourceFileChange); + } + } + + public static float TimeUntilBankRefresh() + { + if (!autoRefresh + || lastSourceFileChange == float.MaxValue + || Settings.Instance.BankRefreshCooldown < 0) + { + return float.MaxValue; + } + else + { + float nextRefreshTime = lastSourceFileChange + Settings.Instance.BankRefreshCooldown; + return Mathf.Max(0, nextRefreshTime - Time.realtimeSinceStartup); + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/BankRefresher.cs.meta b/Assets/Plugins/FMOD/src/Editor/BankRefresher.cs.meta new file mode 100644 index 00000000..fb733614 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BankRefresher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e564c074e96205b49b91ff80126983c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/BoltIntegration.cs b/Assets/Plugins/FMOD/src/Editor/BoltIntegration.cs new file mode 100644 index 00000000..8adac7d1 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BoltIntegration.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using UnityEngine; +using UnityEditor; +using UnityEditor.Build; + +#if (UNITY_VISUALSCRIPTING_EXIST) +using Unity.VisualScripting; +#elif (UNITY_BOLT_EXIST) +using Ludiq; +using Bolt; +#endif + +namespace FMODUnity +{ + public class BoltIntegration : MonoBehaviour + { + [MenuItem("FMOD/Generate Visual Scripting Units")] + public static void GenerateBoltUnitOptions() + { +#if (UNITY_BOLT_EXIST || UNITY_VISUALSCRIPTING_EXIST) + BuildBoltUnitOptions(); +#else + TriggerBuild(); +#endif + } + +#if !(UNITY_BOLT_EXIST || UNITY_VISUALSCRIPTING_EXIST) + [MenuItem("FMOD/Generate Visual Scripting Units", true)] + private static bool IsBoltPresent() + { + Assembly ludiqCoreRuntimeAssembly = null; + Assembly boltFlowEditorAssembly = null; + + try + { + ludiqCoreRuntimeAssembly = Assembly.Load("Ludiq.Core.Runtime"); + boltFlowEditorAssembly = Assembly.Load("Bolt.Flow.Editor"); + } + catch (FileNotFoundException) + { + return false; + } + + return true; + } + + private static void TriggerBuild() + { + BuildTarget target = EditorUserBuildSettings.activeBuildTarget; + BuildTargetGroup group = BuildPipeline.GetBuildTargetGroup(target); + NamedBuildTarget namedBuildTarget = NamedBuildTarget.FromBuildTargetGroup(group); + string previousSymbols = PlayerSettings.GetScriptingDefineSymbols(namedBuildTarget); + + if (!previousSymbols.Contains("UNITY_BOLT_EXIST")) + { + PlayerSettings.SetScriptingDefineSymbols(namedBuildTarget, previousSymbols + ";UNITY_BOLT_EXIST"); + } + Settings.Instance.BoltUnitOptionsBuildPending = true; + AssetDatabase.Refresh(); + } + +#else + private static void BuildBoltUnitOptions() + { +#if (UNITY_BOLT_EXIST) + DictionaryAsset projectSettings = AssetDatabase.LoadAssetAtPath(PathUtility.FromProject(LudiqCore.Paths.projectSettings), typeof(DictionaryAsset)) as DictionaryAsset; + List assemblyOptions = projectSettings.dictionary["assemblyOptions"] as List; +#else + List assemblyOptions = BoltCore.Configuration.assemblyOptions; +#endif + + if (!assemblyOptions.Contains("FMODUnity")) + { + assemblyOptions.Add("FMODUnity"); + } + + if (!assemblyOptions.Contains("FMODUnityResonance")) + { + assemblyOptions.Add("FMODUnityResonance"); + } +#if (UNITY_BOLT_EXIST) + List typeOptions = projectSettings.dictionary["typeOptions"] as List; +#else + List typeOptions = BoltCore.Configuration.typeOptions; +#endif + Assembly fmodUnityAssembly = Assembly.Load("FMODUnity"); + Assembly fmodUnityResonanceAssembly = Assembly.Load("FMODUnityResonance"); + + List allTypes = new List(GetTypesForNamespace(fmodUnityAssembly, "FMOD")); + allTypes.AddRange(GetTypesForNamespace(fmodUnityAssembly, "FMOD.Studio")); + allTypes.AddRange(GetTypesForNamespace(fmodUnityAssembly, "FMODUnity")); + allTypes.AddRange(GetTypesForNamespace(fmodUnityResonanceAssembly, "FMODUnityResonance")); + + foreach (Type type in allTypes) + { + if (!typeOptions.Contains(type)) + { + typeOptions.Add(type); + } + } + + Codebase.UpdateSettings(); +#if (UNITY_BOLT_EXIST) + UnitBase.Build(); +#else + BoltCore.Configuration.Save(); + UnitBase.Rebuild(); +#endif + } + + private static IEnumerable GetTypesForNamespace(Assembly assembly, string requestedNamespace) + { + return assembly.GetTypes() + .Where(t => string.Equals(t.Namespace, requestedNamespace, StringComparison.Ordinal)); + } +#endif + + public static void Startup() + { +#if (UNITY_BOLT_EXIST || UNITY_VISUALSCRIPTING_EXIST) + if (Settings.Instance.BoltUnitOptionsBuildPending) + { + Settings.Instance.BoltUnitOptionsBuildPending = false; + BuildBoltUnitOptions(); + } +#endif + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/BoltIntegration.cs.meta b/Assets/Plugins/FMOD/src/Editor/BoltIntegration.cs.meta new file mode 100644 index 00000000..0ab100c6 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BoltIntegration.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f876942dd549ef444a82ab923e75ccb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/CodeGeneration.cs b/Assets/Plugins/FMOD/src/Editor/CodeGeneration.cs new file mode 100644 index 00000000..f9ff18c7 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/CodeGeneration.cs @@ -0,0 +1,124 @@ +#if UNITY_EDITOR +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace FMODUnity +{ + public static class CodeGeneration + { + public static void GenerateStaticPluginRegistration(string filePath, Platform platform, + Action reportError) + { + List validatedPlugins = ValidateStaticPlugins(platform.StaticPlugins, reportError); + + using (StreamWriter file = new StreamWriter(filePath)) + { + WriteStaticPluginRegistration(file, platform.IsFMODStaticallyLinked, validatedPlugins); + } + } + + private static void WriteStaticPluginRegistration(StreamWriter file, bool isFMODStaticallyLinked, + IEnumerable pluginFunctions) + { + file.WriteLine("#if ENABLE_IL2CPP"); + file.WriteLine(); + file.WriteLine("// This file was generated by FMOD for Unity from the Static Plugins list in the FMOD settings."); + file.WriteLine(); + + file.WriteLine("using System;"); + file.WriteLine("using System.Runtime.InteropServices;"); + file.WriteLine(); + + file.WriteLine("namespace FMODUnity"); + file.WriteLine("{"); + + file.WriteLine(" class {0}", Platform.RegisterStaticPluginsClassName); + file.WriteLine(" {"); + + // Import the plugin functions + foreach (string pluginFunction in pluginFunctions) + { + file.WriteLine(" [DllImport(\"__Internal\")]"); + file.WriteLine(" private static extern IntPtr {0}();", pluginFunction); + file.WriteLine(); + } + + // Import the RegisterDSP function + file.WriteLine(" [DllImport(FMOD.VERSION.dll)]"); + file.WriteLine(" private static extern FMOD.RESULT FMOD5_System_RegisterDSP(IntPtr system, IntPtr description, IntPtr handle);"); + file.WriteLine(); + + file.WriteLine(" public static void {0}(FMOD.System coreSystem, Action reportResult)", + Platform.RegisterStaticPluginsFunctionName); + file.WriteLine(" {"); + + if (pluginFunctions.Any()) + { + file.WriteLine(" FMOD.RESULT result;"); + + foreach (string pluginFunction in pluginFunctions) + { + file.WriteLine(); + file.WriteLine(" result = FMOD5_System_RegisterDSP(coreSystem.handle, {0}(), IntPtr.Zero);", pluginFunction); + file.WriteLine(" reportResult(result, \"Registering static plugin '{0}'\");", pluginFunction); + } + } + + file.WriteLine(" }"); + file.WriteLine(" }"); + file.WriteLine("}"); + file.WriteLine(""); + file.WriteLine("#endif // ENABLE_IL2CPP"); + } + + private static List ValidateStaticPlugins(List staticPlugins, Action reportError) + { + List result = new List(); + + for (int i = 0; i < staticPlugins.Count; ++i) + { + string functionName = staticPlugins[i]; + + string trimmedName = (functionName != null) ? functionName.Trim() : null; + + if (string.IsNullOrEmpty(trimmedName)) + { + reportError(string.Format("Static plugin {0} has no name and will be ignored.", i + 1)); + } + else if (IsValidFunctionName(trimmedName, reportError)) + { + result.Add(trimmedName); + } + } + + return result; + } + + private static bool IsValidFunctionName(string name, Action reportError) + { + if (!(char.IsLetter(name[0]) || name[0] == '_')) + { + reportError(string.Format( + "Plugin name '{0}' is not valid. Names must start with a letter or an underscore ('_').", name)); + return false; + } + + for (int i = 1; i < name.Length; ++i) + { + if (!(char.IsLetterOrDigit(name[i]) || name[i] == '_')) + { + reportError(string.Format( + "Plugin name '{0}' is not valid. " + + "Character '{1}' at position {2} is invalid - it must be a letter, a number, or an underscore ('_').", + name, name[i], i)); + return false; + } + } + + return true; + } + } +} +#endif diff --git a/Assets/Plugins/FMOD/src/Editor/CodeGeneration.cs.meta b/Assets/Plugins/FMOD/src/Editor/CodeGeneration.cs.meta new file mode 100644 index 00000000..31bb1fdc --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/CodeGeneration.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 438155f6a2d689e45b5cc7701d412b80 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs b/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs new file mode 100644 index 00000000..fd6d7d1d --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs @@ -0,0 +1,402 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; + +namespace FMODUnity +{ + public class CreateEventPopup : EditorWindow + { + private class FolderEntry + { + public FolderEntry parent; + public string name; + public string guid; + public List entries = new List(); + public Rect rect; + } + + private SerializedProperty outputProperty; + + private FolderEntry rootFolder; + private FolderEntry currentFolder; + private List banks; + + private int lastHover = 0; + private string eventFolder = "/"; + private string eventName = ""; + private string currentFilter = ""; + private int selectedBank = 0; + private bool resetCursor = true; + private Vector2 scrollPos = new Vector2(); + private Rect scrollRect = new Rect(); + private bool isConnected = false; + + internal void SelectEvent(SerializedProperty property) + { + outputProperty = property; + } + + private class BankEntry + { + public string name; + public string guid; + } + + public CreateEventPopup() + { + } + + private void BuildTree() + { + var rootGuid = EditorUtils.GetScriptOutput("studio.project.workspace.masterEventFolder.id"); + rootFolder = new FolderEntry(); + rootFolder.guid = rootGuid; + BuildTreeItem(rootFolder); + wantsMouseMove = true; + banks = new List(); + + const string buildBankTreeFunc = + @"function() { + var output = """"; + const items = [ studio.project.workspace.masterBankFolder ]; + while (items.length > 0) { + var currentItem = items.shift(); + if (currentItem.isOfType(""BankFolder"")) { + currentItem.items.reverse().forEach(function(val) { + items.unshift(val); + }); + } else { + output += "","" + currentItem.id + currentItem.getPath().replace(""bank:/"", """"); + } + } + return output; + }"; + + string bankList = EditorUtils.GetScriptOutput(string.Format("({0})()", buildBankTreeFunc)); + string[] bankListSplit = bankList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + foreach (var bank in bankListSplit) + { + var entry = new BankEntry(); + entry.guid = bank.Substring(0, 38); + entry.name = bank.Substring(38); + banks.Add(entry); + } + } + + private void BuildTreeItem(FolderEntry entry) + { + // lookup the entry + EditorUtils.GetScriptOutput(string.Format("cur = studio.project.lookup(\"{0}\");", entry.guid)); + + // get child count + string itemCountString = EditorUtils.GetScriptOutput("cur.items.length;"); + int itemCount; + Int32.TryParse(itemCountString, out itemCount); + + // iterate children looking for folder + for (int item = 0; item < itemCount; item++) + { + EditorUtils.GetScriptOutput(String.Format("child = cur.items[{0}]", item)); + + // check if it's a folder + string isFolder = EditorUtils.GetScriptOutput("child.isOfExactType(\"EventFolder\")"); + if (isFolder == "false") + { + continue; + } + + // Get guid and name + string info = EditorUtils.GetScriptOutput("child.id + child.name"); + + var childEntry = new FolderEntry(); + childEntry.guid = info.Substring(0, 38); + childEntry.name = info.Substring(38); + childEntry.parent = entry; + entry.entries.Add(childEntry); + } + + // Recurse for child entries + foreach(var childEntry in entry.entries) + { + BuildTreeItem(childEntry); + } + } + + public void OnGUI() + { + var borderIcon = EditorUtils.LoadImage("Border.png"); + var border = new GUIStyle(GUI.skin.box); + border.normal.background = borderIcon; + GUI.Box(new Rect(1, 1, position.width - 1, position.height - 1), GUIContent.none, border); + + if (Event.current.type == EventType.Layout) + { + isConnected = EditorUtils.IsConnectedToStudio(); + } + + if (!isConnected) + { + this.ShowNotification(new GUIContent("FMOD Studio not running")); + return; + } + + this.RemoveNotification(); + + if (rootFolder == null) + { + BuildTree(); + currentFolder = rootFolder; + } + + var arrowIcon = EditorUtils.LoadImage("ArrowIcon.png"); + var hoverIcon = EditorUtils.LoadImage("SelectedAlt.png"); + + var nextEntry = currentFolder; + + var filteredEntries = currentFolder.entries.FindAll((x) => x.name.StartsWith(currentFilter, StringComparison.CurrentCultureIgnoreCase)); + + // Process key strokes for the folder list + { + if (Event.current.keyCode == KeyCode.UpArrow) + { + if (Event.current.type == EventType.KeyDown) + { + lastHover = Math.Max(lastHover - 1, 0); + if (filteredEntries[lastHover].rect.y < scrollPos.y) + { + scrollPos.y = filteredEntries[lastHover].rect.y; + } + } + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.DownArrow) + { + if (Event.current.type == EventType.KeyDown) + { + lastHover = Math.Min(lastHover + 1, filteredEntries.Count - 1); + if (filteredEntries[lastHover].rect.y + filteredEntries[lastHover].rect.height > scrollPos.y + scrollRect.height) + { + scrollPos.y = filteredEntries[lastHover].rect.y - scrollRect.height + filteredEntries[lastHover].rect.height * 2; + } + } + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.RightArrow) + { + if (Event.current.type == EventType.KeyDown) + nextEntry = filteredEntries[lastHover]; + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.LeftArrow) + { + if (Event.current.type == EventType.KeyDown) + if (currentFolder.parent != null) + { + nextEntry = currentFolder.parent; + } + Event.current.Use(); + } + } + + bool disabled = eventName.Length == 0; + EditorGUI.BeginDisabledGroup(disabled); + if (GUILayout.Button("Create Event")) + { + CreateEventInStudio(); + this.Close(); + } + EditorGUI.EndDisabledGroup(); + + { + GUI.SetNextControlName("name"); + + EditorGUILayout.LabelField("Name"); + eventName = EditorGUILayout.TextField(eventName); + } + + { + EditorGUILayout.LabelField("Bank"); + selectedBank = EditorGUILayout.Popup(selectedBank, banks.Select(x => x.name).ToArray()); + } + + bool updateEventPath = false; + { + GUI.SetNextControlName("folder"); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.LabelField("Path"); + eventFolder = GUILayout.TextField(eventFolder); + if (EditorGUI.EndChangeCheck()) + { + updateEventPath = true; + } + } + + if (resetCursor) + { + resetCursor = false; + + var textEditor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl); + if (textEditor != null) + { + textEditor.MoveCursorToPosition(new Vector2(9999, 9999)); + } + } + + // Draw the current folder as a title bar, click to go back one level + { + Rect currentRect = EditorGUILayout.GetControlRect(); + + var bg = new GUIStyle(GUI.skin.box); + Rect bgRect = new Rect(currentRect); + bgRect.x = 2; + bgRect.width = position.width-4; + GUI.Box(bgRect, GUIContent.none, bg); + + Rect textureRect = currentRect; + textureRect.width = arrowIcon.width; + if (currentFolder.name != null) + { + GUI.DrawTextureWithTexCoords(textureRect, arrowIcon, new Rect(1, 1, -1, -1)); + } + + Rect labelRect = currentRect; + labelRect.x += arrowIcon.width; + labelRect.width -= arrowIcon.width; + GUI.Label(labelRect, currentFolder.name != null ? currentFolder.name : "Folders", EditorStyles.boldLabel); + + if (Event.current.type == EventType.MouseDown && currentRect.Contains(Event.current.mousePosition) && + currentFolder.parent != null) + { + nextEntry = currentFolder.parent; + Event.current.Use(); + } + } + + var normal = new GUIStyle(GUI.skin.label); + normal.padding.left = 14; + var hover = new GUIStyle(normal); + hover.normal.background = hoverIcon; + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, false); + + for (int i = 0; i < filteredEntries.Count; i++) + { + var entry = filteredEntries[i]; + var content = new GUIContent(entry.name); + var rect = EditorGUILayout.GetControlRect(); + if ((rect.Contains(Event.current.mousePosition) && Event.current.type == EventType.MouseMove) || i == lastHover) + { + lastHover = i; + + GUI.Label(rect, content, hover); + if (rect.Contains(Event.current.mousePosition) && Event.current.type == EventType.MouseDown) + { + nextEntry = entry; + } + } + else + { + GUI.Label(rect, content, normal); + } + + Rect textureRect = rect; + textureRect.x = textureRect.width - arrowIcon.width; + textureRect.width = arrowIcon.width; + GUI.DrawTexture(textureRect, arrowIcon); + + if (Event.current.type == EventType.Repaint) + { + entry.rect = rect; + } + } + EditorGUILayout.EndScrollView(); + + if (Event.current.type == EventType.Repaint) + { + scrollRect = GUILayoutUtility.GetLastRect(); + } + + if (currentFolder != nextEntry) + { + lastHover = 0; + currentFolder = nextEntry; + UpdateTextFromList(); + Repaint(); + } + + if (updateEventPath) + { + UpdateListFromText(); + } + + if (Event.current.type == EventType.MouseMove) + { + Repaint(); + } + } + + private void CreateEventInStudio() + { + string eventGuid = EditorUtils.CreateStudioEvent(eventFolder, eventName); + + if (!string.IsNullOrEmpty(eventGuid)) + { + EditorUtils.GetScriptOutput(String.Format("studio.project.lookup(\"{0}\").relationships.banks.add(studio.project.lookup(\"{1}\"));", eventGuid, banks[selectedBank].guid)); + EditorUtils.GetScriptOutput("studio.project.build();"); + + if (!eventFolder.EndsWith("/")) + { + eventFolder += "/"; + } + + string fullPath = "event:" + eventFolder + eventName; + outputProperty.SetEventReference(FMOD.GUID.Parse(eventGuid), fullPath); + EditorUtils.UpdateParamsOnEmitter(outputProperty.serializedObject, fullPath); + outputProperty.serializedObject.ApplyModifiedProperties(); + } + } + + private void UpdateListFromText() + { + int endFolders = eventFolder.LastIndexOf("/"); + currentFilter = eventFolder.Substring(endFolders + 1); + + var folders = eventFolder.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + FolderEntry entry = rootFolder; + int i; + for (i = 0; i < folders.Length; i++) + { + var newEntry = entry.entries.Find((x) => x.name.Equals(folders[i], StringComparison.CurrentCultureIgnoreCase)); + if (newEntry == null) + { + break; + } + entry = newEntry; + } + currentFolder = entry; + + // Treat an exact filter match as being in that folder and clear the filter + if (entry.name != null && entry.name.Equals(currentFilter, StringComparison.CurrentCultureIgnoreCase)) + { + currentFilter = ""; + } + } + + private void UpdateTextFromList() + { + string path = ""; + var entry = currentFolder; + while (entry.parent != null) + { + path = entry.name + "/" + path; + entry = entry.parent; + } + + eventFolder = "/" + path; + resetCursor = true; + currentFilter = ""; + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs.meta b/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs.meta new file mode 100644 index 00000000..10b10096 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9c9773a32ed4a2b429fd42645175c32b +timeCreated: 1455063674 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs b/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs new file mode 100644 index 00000000..3c82ca95 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +namespace FMODUnity +{ + public class EditorBankRef : ScriptableObject + { + [SerializeField] + public string Path; + + [SerializeField] + public string Name; + + [SerializeField] + public string StudioPath; + + [SerializeField] + private Int64 lastModified; + + [SerializeField] + public List FileSizes; + + public bool Exists; + + public DateTime LastModified + { + get { return new DateTime(lastModified); } + set { lastModified = value.Ticks; } + } + + public static string CalculateName(string filePath, string basePath) + { + string relativePath = filePath.Substring(basePath.Length + 1); + string extension = System.IO.Path.GetExtension(relativePath); + + string name = relativePath.Substring(0, relativePath.Length - extension.Length); + name = RuntimeUtils.GetCommonPlatformPath(name); + + return name; + } + + public void SetPath(string filePath, string basePath) + { + Path = RuntimeUtils.GetCommonPlatformPath(filePath); + Name = CalculateName(filePath, basePath); + base.name = "bank:/" + Name + System.IO.Path.GetExtension(filePath); + } + + public void SetStudioPath(string studioPath) + { + string stringCmp; + stringCmp = System.IO.Path.GetFileName(Name); + if (!studioPath.Contains(stringCmp)) + { + // No match means localization + studioPath = studioPath.Substring(0, studioPath.LastIndexOf("/") + 1); + studioPath += stringCmp; + } + StudioPath = studioPath; + } + + [Serializable] + public class NameValuePair + { + public string Name; + public long Value; + + public NameValuePair(string name, long value) + { + Name = name; + Value = value; + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs.meta new file mode 100644 index 00000000..6773b8b1 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c18180ecb35941f4682ae60107b85b7c +timeCreated: 1432775088 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs b/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs new file mode 100644 index 00000000..406d95d0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; + +namespace FMODUnity +{ + public class EditorEventRef : ScriptableObject + { + [SerializeField] + public string Path; + + [SerializeField] + public FMOD.GUID Guid; + + [SerializeField] + public List Banks; + [SerializeField] + public bool IsStream; + [SerializeField] + public bool Is3D; + [SerializeField] + public bool IsOneShot; + [SerializeField] + public List Parameters; + [SerializeField] + public float MinDistance; + [SerializeField] + public float MaxDistance; + [SerializeField] + public int Length; + + public List LocalParameters + { + get { return Parameters.Where(p => p.IsGlobal == false).OrderBy(p => p.Name).ToList(); } + } + + public List GlobalParameters + { + get { return Parameters.Where(p => p.IsGlobal == true).OrderBy(p => p.Name).ToList(); } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs.meta new file mode 100644 index 00000000..81521cc1 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ceb653cd98e289a4e8697a1af55201f2 +timeCreated: 1432775088 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs b/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs new file mode 100644 index 00000000..c1bc821e --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + public enum ParameterType + { + Continuous, + Discrete, + Labeled, + } + + public class EditorParamRef : ScriptableObject + { + [SerializeField] + public string Name; + [SerializeField] + public string StudioPath; + [SerializeField] + public float Min; + [SerializeField] + public float Max; + [SerializeField] + public float Default; + [SerializeField] + public ParameterID ID; + [SerializeField] + public ParameterType Type; + [SerializeField] + public bool IsGlobal; + [SerializeField] + public string[] Labels = { }; + + public bool Exists; + + [Serializable] + public struct ParameterID + { + public static implicit operator ParameterID(FMOD.Studio.PARAMETER_ID source) + { + return new ParameterID { + data1 = source.data1, + data2 = source.data2, + }; + } + + public static implicit operator FMOD.Studio.PARAMETER_ID(ParameterID source) + { + return new FMOD.Studio.PARAMETER_ID { + data1 = source.data1, + data2 = source.data2, + }; + } + + public bool Equals(FMOD.Studio.PARAMETER_ID other) + { + return data1 == other.data1 && data2 == other.data2; + } + + public uint data1; + public uint data2; + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs.meta new file mode 100644 index 00000000..aa123d2a --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fecb8ef7f94ca804a8ab72049b86782e +timeCreated: 1432775088 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorSettings.cs b/Assets/Plugins/FMOD/src/Editor/EditorSettings.cs new file mode 100644 index 00000000..73c4d153 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorSettings.cs @@ -0,0 +1,709 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEngine; + +namespace FMODUnity +{ + [InitializeOnLoad] + public class EditorSettings : IEditorSettings + { + static EditorSettings() + { + Settings.EditorSettings = new EditorSettings(); + } + + public const string DownloadURL = "https://www.fmod.com/download"; + + // This is used to find the platform that implements the current Unity build target. + private Dictionary PlatformForBuildTarget = new Dictionary(); + + private static string FMODFolderFull => RuntimeUtils.PluginBasePath; + + private const string CacheFolderName = "Cache"; + private static string CacheFolderRelative => $"{RuntimeUtils.PluginBasePath}/{CacheFolderName}"; + private static string CacheFolderFull => $"{FMODFolderFull}/{CacheFolderName}"; + + private const string RegisterStaticPluginsFile = "RegisterStaticPlugins.cs"; + private static string RegisterStaticPluginsAssetPathRelative => $"{CacheFolderRelative}/{RegisterStaticPluginsFile}"; + private static string RegisterStaticPluginsAssetPathFull => $"{CacheFolderFull}/{RegisterStaticPluginsFile}"; + + [NonSerialized] + private Dictionary binaryCompatibilitiesBeforeBuild; + + public static EditorSettings Instance + { + get + { + return Settings.EditorSettings as EditorSettings; + } + } + + public Settings RuntimeSettings { get; set; } + + [MenuItem("FMOD/Edit Settings", priority = 0)] + public static void EditSettings() + { + Selection.activeObject = Settings.Instance; + EditorApplication.ExecuteMenuItem("Window/General/Inspector"); + } + + public void Clear() + { + PlatformForBuildTarget.Clear(); + binaryCompatibilitiesBeforeBuild = null; + } + + public void CreateSettingsAsset(string assetName) + { + string resourcesPath = $"{FMODFolderFull}/Resources"; + + bool inPackagesFolder = resourcesPath.StartsWith("Packages/"); + if (inPackagesFolder) + { + resourcesPath = "Assets/Plugins/FMOD/Resources"; + } + EditorUtils.EnsureFolderExists(resourcesPath); + AssetDatabase.CreateAsset(RuntimeSettings, $"{resourcesPath}/{assetName}.asset"); + + AddPlatformsToAsset(); + } + + public void AddPlatformForBuildTargets(Platform platform) + { + foreach (BuildTarget buildTarget in platform.GetBuildTargets()) + { + if (buildTarget != BuildTarget.NoTarget) + { + try + { + PlatformForBuildTarget.Add(buildTarget, platform); + } + catch (Exception e) + { + RuntimeUtils.DebugLogWarningFormat("FMOD: Error platform {0} already added to build targets. : {1}", buildTarget, e.Message); + } + } + } + } + + // Adds a new platform group to the set of platforms. + public PlatformGroup AddPlatformGroup(string displayName, int sortOrder) + { + PlatformGroup group = PlatformGroup.Create(displayName, Legacy.Platform.None); + group.DisplaySortOrder = sortOrder; + + RuntimeSettings.AddPlatform(group); + AssetDatabase.AddObjectToAsset(group, RuntimeSettings); + + RuntimeSettings.LinkPlatform(group); + + return group; + } + + private void ClearPlatformSettings() + { + RemovePlatformFromAsset(RuntimeSettings.DefaultPlatform); + RemovePlatformFromAsset(RuntimeSettings.PlayInEditorPlatform); + + RuntimeSettings.Platforms.ForEach(RemovePlatformFromAsset); + + foreach (Platform platform in Resources.LoadAll(Settings.SettingsAssetName)) + { + RemovePlatformFromAsset(platform); + } + + RuntimeSettings.DefaultPlatform = null; + RuntimeSettings.PlayInEditorPlatform = null; + + RuntimeSettings.Platforms.Clear(); + PlatformForBuildTarget.Clear(); + RuntimeSettings.PlatformForRuntimePlatform.Clear(); + } + + // Testing function: Resets all platform settings. + public void ResetPlatformSettings() + { + ClearPlatformSettings(); + RuntimeSettings.OnEnable(); + } + + // Testing function: Reimports legacy platform settings. + public void ReimportLegacyPlatforms() + { + ClearPlatformSettings(); + RuntimeSettings.MigratedPlatforms.Clear(); + RuntimeSettings.OnEnable(); + } + + public void UpdateMigratedPlatform(Platform platform) + { + if (!RuntimeSettings.MigratedPlatforms.Contains(platform.LegacyIdentifier)) + { + RuntimeSettings.MigratedPlatforms.Add(platform.LegacyIdentifier); + } + } + + // Adds any missing platforms: + // * From the template collection + // * From the legacy settings + public void AddMissingPlatforms() + { + var newPlatforms = new List(); + + foreach (Settings.PlatformTemplate template in Settings.PlatformTemplates) + { + if (!RuntimeSettings.PlatformExists(template.Identifier)) + { + newPlatforms.Add(template.CreateInstance()); + } + } + + // Ensure that the default platform exists + if (!RuntimeSettings.DefaultPlatform) + { + RuntimeSettings.DefaultPlatform = ScriptableObject.CreateInstance(); + newPlatforms.Add(RuntimeSettings.DefaultPlatform); + } + + // Ensure that the Play In Editor platform exists + if (!RuntimeSettings.PlayInEditorPlatform) + { + RuntimeSettings.PlayInEditorPlatform = ScriptableObject.CreateInstance(); + newPlatforms.Add(RuntimeSettings.PlayInEditorPlatform); + } + + // Ensure that the default and Play In Editor platforms have properties + AffirmPlatformProperties(RuntimeSettings.DefaultPlatform); + AffirmPlatformProperties(RuntimeSettings.PlayInEditorPlatform); + + // Migrate plugins if necessary + var PluginsProperty = Platform.PropertyAccessors.Plugins; + + if (!RuntimeSettings.MigratedPlatforms.Contains(RuntimeSettings.DefaultPlatform.LegacyIdentifier)) + { + PluginsProperty.Set(RuntimeSettings.DefaultPlatform, RuntimeSettings.Plugins); + } + else if (!PluginsProperty.HasValue(RuntimeSettings.DefaultPlatform)) + { + PluginsProperty.Set(RuntimeSettings.DefaultPlatform, new List()); + } + + // Migrate LiveUpdatePort + if (!Platform.PropertyAccessors.LiveUpdatePort.HasValue(RuntimeSettings.DefaultPlatform)) + { + Platform.PropertyAccessors.LiveUpdatePort.Set(RuntimeSettings.DefaultPlatform, RuntimeSettings.LiveUpdatePort); + } + + // Create a map for migrating legacy settings + var platformMap = new Dictionary(); + + foreach (Platform platform in RuntimeSettings.Platforms.Concat(newPlatforms)) + { + if (platform.LegacyIdentifier != Legacy.Platform.None) + { + platformMap.Add(platform.LegacyIdentifier, platform); + } + } + + Func AffirmPlatform = null; + + // Ensures that all of the platform's ancestors exist. + Action AffirmAncestors = (platform) => + { + Legacy.Platform legacyParent = Legacy.Parent(platform.LegacyIdentifier); + + if (legacyParent != Legacy.Platform.None) + { + platform.ParentIdentifier = AffirmPlatform(legacyParent).Identifier; + } + }; + + // Gets the platform corresponding to legacyPlatform (or creates it if it is a group), + // and ensures that it has properties and all of its ancestors exist. + // Returns null if legacyPlatform is unknown. + AffirmPlatform = (legacyPlatform) => + { + Platform platform; + + if (platformMap.TryGetValue(legacyPlatform, out platform)) + { + platform.AffirmProperties(); + } + else if (Legacy.IsGroup(legacyPlatform)) + { + PlatformGroup group = PlatformGroup.Create(Legacy.DisplayName(legacyPlatform), legacyPlatform); + platformMap.Add(legacyPlatform, group); + newPlatforms.Add(group); + + platform = group; + } + else + { + // This is an unknown platform + return null; + } + + AffirmAncestors(platform); + + return platform; + }; + + // Gets the target plaform to use when migrating settings from legacyPlatform. + // Returns null if legacyPlatform is unknown or has already been migrated. + Func getMigrationTarget = (legacyPlatform) => + { + if (RuntimeSettings.MigratedPlatforms.Contains(legacyPlatform)) + { + // Already migrated + return null; + } + + return AffirmPlatform(legacyPlatform); + }; + + var speakerModeSettings = RuntimeSettings.SpeakerModeSettings.ConvertAll( + setting => new Legacy.PlatformSetting() + { + Value = (FMOD.SPEAKERMODE)setting.Value, + Platform = setting.Platform + } + ); + + // Migrate all the legacy settings, creating platforms as we need them via AffirmPlatform + MigrateLegacyPlatforms(speakerModeSettings, Platform.PropertyAccessors.SpeakerMode, getMigrationTarget); + MigrateLegacyPlatforms(RuntimeSettings.SampleRateSettings, Platform.PropertyAccessors.SampleRate, getMigrationTarget); + MigrateLegacyPlatforms(RuntimeSettings.LiveUpdateSettings, Platform.PropertyAccessors.LiveUpdate, getMigrationTarget); + MigrateLegacyPlatforms(RuntimeSettings.OverlaySettings, Platform.PropertyAccessors.Overlay, getMigrationTarget); + MigrateLegacyPlatforms(RuntimeSettings.BankDirectorySettings, Platform.PropertyAccessors.BuildDirectory, getMigrationTarget); + MigrateLegacyPlatforms(RuntimeSettings.VirtualChannelSettings, Platform.PropertyAccessors.VirtualChannelCount, getMigrationTarget); + MigrateLegacyPlatforms(RuntimeSettings.RealChannelSettings, Platform.PropertyAccessors.RealChannelCount, getMigrationTarget); + + // Now we ensure that if a legacy group has settings, all of its descendants exist + // and inherit from it (even if they have no settings of their own), so that the + // inheritance structure matches the old system. + // We look at all groups (not just newly created ones), because a newly created platform + // may need to inherit from a preexisting group. + var groupsToProcess = new Queue(platformMap.Values.Where( + platform => platform is PlatformGroup + && platform.LegacyIdentifier != Legacy.Platform.None + && platform.HasAnyOverriddenProperties)); + + while (groupsToProcess.Count > 0) + { + Platform group = groupsToProcess.Dequeue(); + + // Ensure that all descendants exist + foreach (var child in platformMap.Values) + { + if (child.Active) + { + // Don't overwrite existing settings + continue; + } + + var legacyPlatform = child.LegacyIdentifier; + + if (legacyPlatform == Legacy.Platform.iOS || legacyPlatform == Legacy.Platform.Android) + { + // These platforms were overridden by MobileHigh and MobileLow in the old system + continue; + } + + if (RuntimeSettings.MigratedPlatforms.Contains(legacyPlatform)) + { + // The user may have deleted this platform since migration, so don't mess with it + continue; + } + + if (Legacy.Parent(legacyPlatform) == group.LegacyIdentifier) + { + child.AffirmProperties(); + child.ParentIdentifier = group.Identifier; + + if (child is PlatformGroup) + { + groupsToProcess.Enqueue(child as PlatformGroup); + } + } + } + } + + // Add all of the new platforms to the set of known platforms + foreach (Platform platform in newPlatforms) + { + RuntimeSettings.AddPlatform(platform); + } + + RuntimeSettings.Platforms.ForEach(UpdateMigratedPlatform); + } + + private void MigrateLegacyPlatforms(List settings, + Platform.PropertyAccessor property, Func getMigrationTarget) + where TSetting : Legacy.PlatformSetting + { + foreach (TSetting setting in settings) + { + Platform platform = getMigrationTarget(setting.Platform); + + if (platform != null) + { + property.Set(platform, setting.Value); + } + } + } + + // The platform that implements the current Unity build target. + public Platform CurrentEditorPlatform + { + get + { + return GetPlatform(EditorUserBuildSettings.activeBuildTarget); + } + } + + public Platform GetPlatform(BuildTarget buildTarget) + { + if (PlatformForBuildTarget.ContainsKey(buildTarget)) + { + return PlatformForBuildTarget[buildTarget]; + } + else + { + return RuntimeSettings.DefaultPlatform; + } + } + + public void SetPlatformParent(Platform platform, Platform newParent) + { + Platform oldParent = RuntimeSettings.FindPlatform(platform.ParentIdentifier); + + if (oldParent != null) + { + oldParent.ChildIdentifiers.Remove(platform.Identifier); + } + + if (newParent != null) + { + platform.ParentIdentifier = newParent.Identifier; + + newParent.ChildIdentifiers.Add(platform.Identifier); + SortPlatformChildren(newParent); + } + else + { + platform.ParentIdentifier = null; + } + } + + public void SetPlatformSortOrder(Platform platform, float sortOrder) + { + if (platform.DisplaySortOrder != sortOrder) + { + platform.DisplaySortOrder = sortOrder; + + if (platform.Parent != null) + { + SortPlatformChildren(platform.Parent); + } + } + } + + public void SortPlatformChildren(Platform platform) + { + platform.ChildIdentifiers.Sort((a, b) => { + Platform platformA = RuntimeSettings.FindPlatform(a); + Platform platformB = RuntimeSettings.FindPlatform(b); + + return platformA.DisplaySortOrder.CompareTo(platformB.DisplaySortOrder); + }); + } + + // Ensures that the given platform has valid properties. + private void AffirmPlatformProperties(Platform platform) + { + if (!platform.Active) + { + RuntimeUtils.DebugLogFormat("[FMOD] Cannot find properties for platform {0}, creating default properties", platform.Identifier); + RuntimeSettings.AddPlatformProperties(platform); + } + } + + private void RemovePlatformFromAsset(Platform platform) + { + if (AssetDatabase.Contains(platform)) + { + UnityEngine.Object.DestroyImmediate(platform, true); + } + } + + public bool CanBuildTarget(BuildTarget target, Platform.BinaryType binaryType, out string error) + { + if (Settings.Instance == null) + { + error = "Settings instance has not been initialized. Unable to continue build."; + return false; + } + + Platform platform; + + if (!PlatformForBuildTarget.TryGetValue(target, out platform)) + { + error = string.Format("No FMOD platform found for build target {0}. " + + "You may need to install a platform specific integration package from {1}.", + target, DownloadURL); + return false; + } + + IEnumerable missingPathsQuery = platform.GetBinaryFilePaths(target, binaryType) + .Where(path => !File.Exists(path) && !Directory.Exists(path)); + + if (missingPathsQuery.Any()) + { + string[] missingPaths = missingPathsQuery.Select(path => "- " + path).ToArray(); + + string summary; + + if (missingPaths.Length == 1) + { + summary = string.Format("There is an FMOD binary missing for build target {0}", target); + } + else + { + summary = string.Format("There are {0} FMOD binaries missing for build target {1}", + missingPaths.Length, target); + } + + if (binaryType == Platform.BinaryType.Logging) + { + summary += " (development build)"; + } + + error = string.Format( + "{0}:\n" + + "{1}\n" + + "Please run the {2} menu command.\n", + summary, string.Join("\n", missingPaths), FileReorganizer.ReorganizerMenuItemPath); + return false; + } + + error = null; + return true; + } + + public void PreprocessBuild(BuildTarget target, Platform.BinaryType binaryType) + { + Platform platform = PlatformForBuildTarget[target]; + + PreprocessStaticPlugins(platform, target); + + SelectBinaries(platform, target, binaryType); + } + + private void PostprocessBuild(BuildTarget target) + { + foreach(string path in binaryCompatibilitiesBeforeBuild.Keys) + { + PluginImporter importer = AssetImporter.GetAtPath(path) as PluginImporter; + + if (importer != null) + { + importer.SetCompatibleWithPlatform(target, binaryCompatibilitiesBeforeBuild[path]); + } + } + } + + private void PreprocessStaticPlugins(Platform platform, BuildTarget target) + { + // Ensure we don't have leftover temporary changes from a previous build. + CleanTemporaryFiles(); + + BuildTargetGroup buildTargetGroup = BuildPipeline.GetBuildTargetGroup(target); + NamedBuildTarget namedBuildTarget = NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup); + ScriptingImplementation scriptingBackend = PlayerSettings.GetScriptingBackend(namedBuildTarget); + + if (platform.StaticPlugins.Count > 0) + { + if (scriptingBackend == ScriptingImplementation.IL2CPP) + { + Action reportError = message => { + RuntimeUtils.DebugLogWarningFormat("FMOD: Error processing static plugins for platform {0}: {1}", + platform.DisplayName, message); + }; + + if (!AssetDatabase.IsValidFolder(CacheFolderFull)) + { + RuntimeUtils.DebugLogFormat("Creating {0}", CacheFolderFull); + AssetDatabase.CreateFolder(FMODFolderFull, CacheFolderName); + } + + // Generate registration code and import it so it's included in the build. + RuntimeUtils.DebugLogFormat("FMOD: Generating static plugin registration code in {0}", RegisterStaticPluginsAssetPathFull); + + string filePath = RegisterStaticPluginsAssetPathRelative.Replace("Assets", Application.dataPath); + CodeGeneration.GenerateStaticPluginRegistration(filePath, platform, reportError); + AssetDatabase.ImportAsset(RegisterStaticPluginsAssetPathFull); + } + else + { + RuntimeUtils.DebugLogWarningFormat( + "FMOD: Platform {0} has {1} static plugins specified, " + + "but static plugins are only supported on the IL2CPP scripting backend", + platform.DisplayName, platform.StaticPlugins.Count); + } + } + } + + public void CleanTemporaryFiles() + { + DeleteTemporaryFile(RegisterStaticPluginsAssetPathFull); + } + + public void DeleteTemporaryFile(string assetPath) + { + bool assetExists = !string.IsNullOrEmpty(AssetDatabase.AssetPathToGUID(assetPath)); + + if (assetExists && AssetDatabase.DeleteAsset(assetPath)) + { + RuntimeUtils.DebugLogFormat("FMOD: Removed temporary file {0}", assetPath); + } + } + + private static void SelectBinaries(Platform platform, BuildTarget target, Platform.BinaryType binaryType) + { + string message = string.Format("FMOD: Selected binaries for platform {0}{1}:", target, + (binaryType == Platform.BinaryType.Logging) ? " (development build)" : string.Empty); + + Instance.binaryCompatibilitiesBeforeBuild = new Dictionary(); + + HashSet enabledPaths = new HashSet(); + + foreach (string path in platform.GetBinaryAssetPaths(target, binaryType | Platform.BinaryType.Optional)) + { + PluginImporter importer = AssetImporter.GetAtPath(path) as PluginImporter; + + if (importer is PluginImporter) + { + Instance.binaryCompatibilitiesBeforeBuild.Add(path, importer.GetCompatibleWithPlatform(target)); + + importer.SetCompatibleWithPlatform(target, true); + + enabledPaths.Add(path); + + message += string.Format("\n- Enabled {0}", path); + } + } + + foreach (string path in platform.GetBinaryAssetPaths(target, Platform.BinaryType.All)) + { + if (!enabledPaths.Contains(path)) + { + PluginImporter importer = AssetImporter.GetAtPath(path) as PluginImporter; + + if (importer is PluginImporter) + { + Instance.binaryCompatibilitiesBeforeBuild.Add(path, importer.GetCompatibleWithPlatform(target)); + + importer.SetCompatibleWithPlatform(target, false); + + message += string.Format("\n- Disabled {0}", path); + } + } + } + + RuntimeUtils.DebugLog(message); + } + + public bool ForceLoggingBinaries { get; set; } = false; + + public class BuildProcessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport + { + public int callbackOrder { get { return 0; } } + + public void OnPreprocessBuild(BuildReport report) + { + Platform.BinaryType binaryType; + + if ((report.summary.options & BuildOptions.Development) == BuildOptions.Development + || EditorSettings.Instance.ForceLoggingBinaries) + { + binaryType = Platform.BinaryType.Logging; + } + else + { + binaryType = Platform.BinaryType.Release; + } + + string error; + if (!EditorSettings.Instance.CanBuildTarget(report.summary.platform, binaryType, out error)) + { + throw new BuildFailedException(error); + } + + bool androidPatchBuildPrevious = Settings.Instance.AndroidPatchBuild; + if ((report.summary.options & BuildOptions.PatchPackage) == BuildOptions.PatchPackage) + { + Settings.Instance.AndroidPatchBuild = true; + } + else + { + Settings.Instance.AndroidPatchBuild = false; + } + if (androidPatchBuildPrevious != Settings.Instance.AndroidPatchBuild) + { + EditorUtility.SetDirty(Settings.Instance); + } + + EditorSettings.Instance.PreprocessBuild(report.summary.platform, binaryType); + } + + public void OnPostprocessBuild(BuildReport report) + { + Instance.PostprocessBuild(report.summary.platform); + Settings.Instance.AndroidPatchBuild = false; + } + } + + public void CheckActiveBuildTarget() + { + Settings.EditorSettings.CleanTemporaryFiles(); + + Platform.BinaryType binaryType = EditorUserBuildSettings.development + ? Platform.BinaryType.Logging + : Platform.BinaryType.Release; + + string error; + if (!CanBuildTarget(EditorUserBuildSettings.activeBuildTarget, binaryType, out error)) + { + RuntimeUtils.DebugLogWarning(error); + + if (EditorWindow.HasOpenInstances()) + { + GUIContent message = + new GUIContent("FMOD detected issues with this platform!\nSee the Console for details."); + EditorWindow.GetWindow().ShowNotification(message, 10); + } + } + } + + // Adds all platforms to the settings asset, so they get stored in the same file as the main + // Settings object. + public void AddPlatformsToAsset() + { + RuntimeSettings.Platforms.ForEach(AddPlatformToAsset); + } + + private void AddPlatformToAsset(Platform platform) + { + if (!AssetDatabase.Contains(platform)) + { + platform.name = "FMODStudioSettingsPlatform"; + AssetDatabase.AddObjectToAsset(platform, RuntimeSettings); + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EditorSettings.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorSettings.cs.meta new file mode 100644 index 00000000..33884c45 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c9e3e2137498d343a2e31906a12dec2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs b/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs new file mode 100644 index 00000000..bdcffac7 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs @@ -0,0 +1,1921 @@ +#if UNITY_ADDRESSABLES_EXIST + // The Addressables package depends on the ScriptableBuildPipeline package + #define UNITY_SCRIPTABLEBUILDPIPELINE_EXIST +#endif + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Reflection; +using UnityEngine; +using UnityEditor; +using UnityEditor.Build; +#if UNITY_SCRIPTABLEBUILDPIPELINE_EXIST +using UnityEditor.Build.Pipeline; +#endif +using UnityEditor.SceneManagement; +using System.IO; +using System.Text; +using System.Net.Sockets; + +namespace FMODUnity +{ + public class EditorUtils : MonoBehaviour + { + public const string BuildFolder = "Build"; + + private static FMOD.Studio.System system; + private static FMOD.SPEAKERMODE speakerMode; + private static string encryptionKey; + + private static List loadedPreviewBanks = new List(); + private static FMOD.Studio.EventDescription previewEventDesc; + private static FMOD.Studio.EventInstance previewEventInstance; + + private const int StudioScriptPort = 3663; + private static NetworkStream networkStream = null; + private static StreamReader streamReader = null; + private static Socket socket = null; + private static IAsyncResult socketConnection = null; + + public static void CheckResult(FMOD.RESULT result) + { + if (result != FMOD.RESULT.OK) + { + RuntimeUtils.DebugLogError(string.Format("FMOD Studio: Encountered Error: {0} {1}", result, FMOD.Error.String(result))); + } + } + + public static void ValidateSource(out bool valid, out string reason) + { + valid = true; + reason = ""; + var settings = Settings.Instance; + if (settings.HasSourceProject) + { + if (string.IsNullOrEmpty(settings.SourceProjectPath)) + { + valid = false; + reason =L10n.Tr("The FMOD Studio project path must be set to an .fspro file."); + return; + } + if (!File.Exists(settings.SourceProjectPath)) + { + valid = false; + reason = string.Format(L10n.Tr("The FMOD Studio project path '{0}' does not exist."), settings.SourceProjectPath); + return; + } + + string projectPath = settings.SourceProjectPath; + string projectFolder = Path.GetDirectoryName(projectPath); + string buildFolder = RuntimeUtils.GetCommonPlatformPath(Path.Combine(projectFolder, BuildFolder)); + if (!Directory.Exists(buildFolder) || + Directory.GetDirectories(buildFolder).Length == 0 || + Directory.GetFiles(Directory.GetDirectories(buildFolder)[0], "*.bank", SearchOption.AllDirectories).Length == 0 + ) + { + valid = false; + reason = string.Format(L10n.Tr("The FMOD Studio project '{0}' does not contain any built banks. Please build your project in FMOD Studio."), settings.SourceProjectPath); + return; + } + } + else + { + if (String.IsNullOrEmpty(settings.SourceBankPath)) + { + valid = false; + reason = L10n.Tr("The build path has not been set."); + return; + } + if (!Directory.Exists(settings.SourceBankPath)) + { + valid = false; + reason = string.Format(L10n.Tr("The build path '{0}' does not exist."), settings.SourceBankPath); + return; + } + + if (settings.HasPlatforms) + { + if (Directory.GetDirectories(settings.SourceBankPath).Length == 0) + { + valid = false; + reason = string.Format(L10n.Tr("Build path '{0}' does not contain any platform sub-directories. Please check that the build path is correct."), settings.SourceBankPath); + return; + } + } + else + { + if (Directory.GetFiles(settings.SourceBankPath, "*.strings.bank").Length == 0) + { + valid = false; + reason = string.Format(L10n.Tr("Build path '{0}' does not contain any built banks."), settings.SourceBankPath); + return; + } + } + } + } + + public static string[] GetBankPlatforms() + { + string buildFolder = Settings.Instance.SourceBankPath; + try + { + if (Directory.GetFiles(buildFolder, "*.bank").Length == 0) + { + string[] buildDirectories = Directory.GetDirectories(buildFolder); + string[] buildNames = new string[buildDirectories.Length]; + for (int i = 0; i < buildDirectories.Length; i++) + { + buildNames[i] = Path.GetFileNameWithoutExtension(buildDirectories[i]); + } + return buildNames; + } + } + catch + { + } + return new string[0]; + } + + public static string VersionString(uint version) + { + uint major = (version & 0x00FF0000) >> 16; + uint minor = (version & 0x0000FF00) >> 8; + uint patch = (version & 0x000000FF); + + return string.Format("{0:X1}.{1:X2}.{2:X2}", major, minor, patch); + } + + public static string DurationString(float seconds) + { + float minutes = seconds / 60; + float hours = minutes / 60; + + if (hours >= 1) + { + return Pluralize(Mathf.FloorToInt(hours), L10n.Tr("hour"), L10n.Tr("hours")); + } + else if (minutes >= 1) + { + return Pluralize(Mathf.FloorToInt(minutes), L10n.Tr("minute"), L10n.Tr("minutes")); + } + else if (seconds >= 1) + { + return Pluralize(Mathf.FloorToInt(seconds), L10n.Tr("second"), L10n.Tr("seconds")); + } + else + { + return L10n.Tr("a moment"); + } + } + + public static string SeriesString(string separator, string finalSeparator, IEnumerable elements) + { + if (!elements.Any()) + { + return string.Empty; + } + else if (!elements.Skip(1).Any()) + { + return elements.First(); + } + else + { + return string.Join(separator, elements.Take(elements.Count() - 1)) + finalSeparator + elements.Last(); + } + } + + public static string Pluralize(int count, string singular, string plural) + { + return string.Format("{0} {1}", count, (count == 1) ? singular : plural); + } + + public static Texture2D LoadImage(string filename) + { + Texture2D texture = EditorGUIUtility.Load($"{RuntimeUtils.PluginBasePath}/images/{filename}") as Texture2D; + + if (texture == null) + { + texture = EditorGUIUtility.Load($"Assets/Editor Default Resources/FMOD/{filename}") as Texture2D; + } + + return texture; + } + + public static string GameObjectPath(Component component, GameObject root = null) + { + Transform transform = component.transform; + + StringBuilder objectPath = new StringBuilder(); + + while(transform != null && transform.gameObject != root) + { + if (objectPath.Length > 0) + { + objectPath.Insert(0, "/"); + } + + objectPath.Insert(0, transform.name); + + transform = transform.parent; + } + + return objectPath.ToString(); + } + + public static bool HasAttribute(MemberInfo member) + where T : Attribute + { + Attribute[] attributes = Attribute.GetCustomAttributes(member, typeof(Attribute), true); + + return attributes.Any(a => typeof(T).IsAssignableFrom(a.GetType())); + } + + public static bool AssetExists(string path) + { + string fullPath = $"{Environment.CurrentDirectory}/{path}"; + + // We check that the file or directory exists as well because recently deleted assets remain in the database + return !string.IsNullOrEmpty(AssetDatabase.AssetPathToGUID(path)) + && (File.Exists(fullPath) || Directory.Exists(fullPath)); + } + + public static void EnsureFolderExists(string folderPath) + { + if (!AssetDatabase.IsValidFolder(folderPath)) + { + string parentFolder = GetParentFolder(folderPath); + + EnsureFolderExists(parentFolder); + + string folderName = Path.GetFileName(folderPath); + + AssetDatabase.CreateFolder(parentFolder, folderName); + } + } + + // Path.GetDirectoryName replaces '/' with '\\' in some scripting runtime versions, + // so we have to roll our own. + public static string GetParentFolder(string assetPath) + { + int endIndex = assetPath.LastIndexOf('/'); + + return (endIndex > 0) ? assetPath.Substring(0, endIndex) : string.Empty; + } + + public static void DrawLegacyEvent(SerializedProperty property, string migrationTarget) + { + // Display the legacy event field if it is not empty + if (!string.IsNullOrEmpty(property.stringValue)) + { + EditorGUILayout.PropertyField(property, new GUIContent(L10n.Tr("Legacy Event"))); + + using (new EditorGUI.IndentLevelScope()) + { + GUIContent content = new GUIContent( + string.Format(L10n.Tr("Will be migrated to {0}"), migrationTarget), + EditorGUIUtility.IconContent("console.infoicon.sml").image); + GUIStyle style = new GUIStyle(GUI.skin.label) { richText = true }; + + Rect rect = EditorGUILayout.GetControlRect(false, style.CalcSize(content).y); + rect = EditorGUI.IndentedRect(rect); + + GUI.Label(rect, content, style); + } + } + } + + // Gets a control rect, draws a help button at the end of the line, + // and returns a rect describing the remaining space. + public static Rect DrawHelpButtonLayout(Func createContent) + { + Vector2 helpSize = GetHelpButtonSize(); + + Rect rect = EditorGUILayout.GetControlRect(true, helpSize.y); + + return DrawHelpButton(rect, createContent); + } + + public static Rect DrawHelpButton(Rect rect, Func createContent) + { + GUIContent content; + GUIStyle style; + GetHelpButtonData(out content, out style); + + Vector2 helpSize = style.CalcSize(content); + + Rect helpRect = rect; + helpRect.xMin = helpRect.xMax - helpSize.x; + + if (GUI.Button(helpRect, content, style)) + { + PopupWindow.Show(helpRect, createContent()); + } + + Rect remainderRect = rect; + remainderRect.xMax = helpRect.xMin; + + return remainderRect; + } + + public static float DrawParameterValueLayout(float value, EditorParamRef paramRef) + { + if (paramRef.Type == ParameterType.Labeled) + { + return EditorGUILayout.Popup((int)value, paramRef.Labels); + } + else if (paramRef.Type == ParameterType.Discrete) + { + return EditorGUILayout.IntSlider((int)value, (int)paramRef.Min, (int)paramRef.Max); + } + else + { + return EditorGUILayout.Slider(value, paramRef.Min, paramRef.Max); + } + } + + public static Vector2 GetHelpButtonSize() + { + GUIContent content; + GUIStyle style; + GetHelpButtonData(out content, out style); + + return style.CalcSize(content); + } + + private static void GetHelpButtonData(out GUIContent content, out GUIStyle style) + { + content = EditorGUIUtility.IconContent("_Help"); + style = GUI.skin.label; + } + +#if !FMOD_STORE_UPLOAD + [InitializeOnLoadMethod] +#endif + private static void Startup() + { + EditorApplication.update += Update; + AssemblyReloadEvents.beforeAssemblyReload += HandleBeforeAssemblyReload; + EditorApplication.playModeStateChanged += HandleOnPlayModeChanged; + EditorApplication.pauseStateChanged += HandleOnPausedModeChanged; + + if (Application.isBatchMode) + { + BuildStatusWatcher.Startup(); + } + else + { + EditorApplication.update += CallStartupMethodsWhenReady; + } + } + + private static void HandleBeforeAssemblyReload() + { + DestroySystem(); + } + + private static void HandleOnPausedModeChanged(PauseState state) + { + if (RuntimeManager.IsInitialized && RuntimeManager.HaveMasterBanksLoaded) + { + RuntimeManager.GetBus("bus:/").setPaused(EditorApplication.isPaused); + RuntimeManager.StudioSystem.update(); + } + } + + private static void HandleOnPlayModeChanged(PlayModeStateChange state) + { + // Entering Play Mode will cause scripts to reload, losing all state + // This is the last chance to clean up FMOD and avoid a leak. + if (state == PlayModeStateChange.ExitingEditMode) + { + DestroySystem(); + } + } + + private static void Update() + { + // Update the editor system + if (system.isValid()) + { + CheckResult(system.update()); + + if (speakerMode != Settings.Instance.PlayInEditorPlatform.SpeakerMode) + { + RecreateSystem(); + } + + if (encryptionKey != Settings.Instance.EncryptionKey) + { + RecreateSystem(); + } + } + + for (int i = 0; i < previewEventInstances.Count; i++) + { + var instance = previewEventInstances[i]; + if (instance.isValid()) + { + FMOD.Studio.PLAYBACK_STATE state; + instance.getPlaybackState(out state); + if (state == FMOD.Studio.PLAYBACK_STATE.STOPPED) + { + PreviewStop(instance); + i--; + } + } + } + } + + private static void CallStartupMethodsWhenReady() + { + if (EditorApplication.isUpdating) + { + // Some startup code accesses Settings.Instance; this can obliterate settings if + // the asset database is being updated, so wait until the update is finished. + return; + } + + EditorApplication.update -= CallStartupMethodsWhenReady; + + // Explicitly initialize Settings so that both it and EditorSettings will work. + Settings.Initialize(); + Settings.EditorSettings.CheckActiveBuildTarget(); + + CheckBaseFolderGUID(); + CheckMacLibraries(); + + Legacy.CleanTemporaryChanges(); + CleanObsoleteFiles(); + +#if UNITY_TIMELINE_EXIST + // Register timeline event receivers. + FMODEventPlayableBehavior.Enter += (sender, args) => + { + FMODEventPlayableBehavior behavior = sender as FMODEventPlayableBehavior; + if (!string.IsNullOrEmpty(behavior.EventReference.Path)) + { + LoadPreviewBanks(); + EditorEventRef eventRef = EventManager.EventFromPath(behavior.EventReference.Path); + Dictionary paramValues = new Dictionary(); + foreach (EditorParamRef param in eventRef.Parameters) + { + paramValues.Add(param.Name, param.Default); + } + foreach (ParamRef param in behavior.Parameters) + { + paramValues[param.Name] = param.Value; + } + + args.eventInstance = PreviewEvent(eventRef, paramValues, behavior.CurrentVolume, behavior.ClipStartTime); + } + }; + + FMODEventPlayableBehavior.Exit += (sender, args) => + { + FMODEventPlayableBehavior behavior = sender as FMODEventPlayableBehavior; + if (behavior.StopType != STOP_MODE.None) + { + FMOD.Studio.STOP_MODE stopType = behavior.StopType == STOP_MODE.Immediate ? FMOD.Studio.STOP_MODE.IMMEDIATE : FMOD.Studio.STOP_MODE.ALLOWFADEOUT; + PreviewStop(args.eventInstance, stopType); + } + }; + + FMODEventPlayableBehavior.GraphStop += (sender, args) => + { + PreviewStop(args.eventInstance); + }; + + FMODEventPlayable.OnCreatePlayable += (sender, args) => + { + FMODEventPlayable playable = sender as FMODEventPlayable; + if (playable.Parameters.Length > 0 || playable.Template.ParameterLinks.Count > 0) + { + LoadPreviewBanks(); + FMOD.Studio.EventDescription eventDescription; + system.getEventByID(playable.EventReference.Guid, out eventDescription); + playable.LinkParameters(eventDescription); + } + }; +#endif + + BuildStatusWatcher.Startup(); + BankRefresher.Startup(); + BoltIntegration.Startup(); + EventManager.Startup(); + SetupWizardWindow.Startup(); + } + + private static void RecreateSystem() + { + StopAllPreviews(); + DestroySystem(); + CreateSystem(); + } + + private static void DestroySystem() + { + if (system.isValid()) + { + RuntimeUtils.DebugLog("FMOD Studio: Destroying editor system instance"); + UnloadPreviewBanks(); + system.release(); + system.clearHandle(); + } + } + + private static void CreateSystem() + { + RuntimeUtils.DebugLog("FMOD Studio: Creating editor system instance"); + RuntimeUtils.EnforceLibraryOrder(); + + FMOD.RESULT result = FMOD.Debug.Initialize(FMOD.DEBUG_FLAGS.LOG, FMOD.DEBUG_MODE.FILE, null, "fmod_editor.log"); + if (result != FMOD.RESULT.OK) + { + RuntimeUtils.DebugLogWarning("FMOD Studio: Cannot open fmod_editor.log. Logging will be disabled for importing and previewing"); + } + + CheckResult(FMOD.Studio.System.create(out system)); + + FMOD.System lowlevel; + CheckResult(system.getCoreSystem(out lowlevel)); + + // Use play-in-editor speaker mode for event browser preview and metering + speakerMode = Settings.Instance.PlayInEditorPlatform.SpeakerMode; + CheckResult(lowlevel.setSoftwareFormat(0, speakerMode, 0)); + + encryptionKey = Settings.Instance.EncryptionKey; + if (!string.IsNullOrEmpty(encryptionKey)) + { + FMOD.Studio.ADVANCEDSETTINGS studioAdvancedSettings = new FMOD.Studio.ADVANCEDSETTINGS(); + CheckResult(system.setAdvancedSettings(studioAdvancedSettings, encryptionKey)); + } + + CheckResult(system.initialize(256, FMOD.Studio.INITFLAGS.ALLOW_MISSING_PLUGINS | FMOD.Studio.INITFLAGS.SYNCHRONOUS_UPDATE, FMOD.INITFLAGS.NORMAL, IntPtr.Zero)); + + FMOD.ChannelGroup master; + CheckResult(lowlevel.getMasterChannelGroup(out master)); + FMOD.DSP masterHead; + CheckResult(master.getDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, out masterHead)); + CheckResult(masterHead.setMeteringEnabled(false, true)); + } + + public static void UpdateParamsOnEmitter(SerializedObject serializedObject, string path) + { + if (string.IsNullOrEmpty(path) || EventManager.EventFromPath(path) == null) + { + return; + } + + var eventRef = EventManager.EventFromPath(path); + serializedObject.ApplyModifiedProperties(); + if (serializedObject.isEditingMultipleObjects) + { + foreach (var obj in serializedObject.targetObjects) + { + UpdateParamsOnEmitter(obj, eventRef); + } + } + else + { + UpdateParamsOnEmitter(serializedObject.targetObject, eventRef); + } + serializedObject.Update(); + } + + private static void UpdateParamsOnEmitter(UnityEngine.Object obj, EditorEventRef eventRef) + { + var emitter = obj as StudioEventEmitter; + if (emitter == null) + { + // Custom game object + return; + } + + for (int i = 0; i < emitter.Params.Length; i++) + { + if (!eventRef.LocalParameters.Exists((x) => x.Name == emitter.Params[i].Name)) + { + int end = emitter.Params.Length - 1; + emitter.Params[i] = emitter.Params[end]; + Array.Resize(ref emitter.Params, end); + i--; + } + } + + emitter.OverrideAttenuation = false; + emitter.OverrideMinDistance = eventRef.MinDistance; + emitter.OverrideMaxDistance = eventRef.MaxDistance; + } + + public static FMOD.Studio.System System + { + get + { + if (!system.isValid()) + { + CreateSystem(); + } + return system; + } + } + + [MenuItem("FMOD/Help/Getting Started", priority = 2)] + private static void OnlineGettingStarted() + { + OpenOnlineDocumentation("unity", "user-guide"); + } + + [MenuItem("FMOD/Help/Integration Manual", priority = 3)] + public static void OnlineManual() + { + OpenOnlineDocumentation("unity"); + } + + [MenuItem("FMOD/Help/API Manual", priority = 4)] + private static void OnlineAPIDocs() + { + OpenOnlineDocumentation("api"); + } + + [MenuItem("FMOD/Help/Support Forum", priority = 16)] + private static void OnlineQA() + { + Application.OpenURL("https://qa.fmod.com/"); + } + + [MenuItem("FMOD/Help/Revision History", priority = 5)] + private static void OnlineRevisions() + { + OpenOnlineDocumentation("api", "welcome-revision-history"); + } + + public static void OpenOnlineDocumentation(string section, string page = null, string anchor = null) + { + const string Prefix = "https://fmod.com/docs/"; + string version = string.Format("{0:X}.{1:X}", FMOD.VERSION.number >> 16, (FMOD.VERSION.number >> 8) & 0xFF); + string url; + + if (!string.IsNullOrEmpty(page)) + { + if (!string.IsNullOrEmpty(anchor)) + { + url = string.Format("{0}/{1}/{2}/{3}.html#{4}", Prefix, version, section, page, anchor); + } + else + { + url = string.Format("{0}/{1}/{2}/{3}.html", Prefix, version, section, page); + } + } + else + { + url = string.Format("{0}/{1}/{2}", Prefix, version, section); + } + + Application.OpenURL(url); + } + + [MenuItem("FMOD/About Integration", priority = 7)] + public static void About() + { + FMOD.System lowlevel; + CheckResult(System.getCoreSystem(out lowlevel)); + + uint version; + uint buildNumber; + CheckResult(lowlevel.getVersion(out version, out buildNumber)); + + string text = string.Format( + L10n.Tr("Version: {0}\nBuild Number: {1}\n\nCopyright \u00A9 Firelight Technologies Pty, Ltd. 2014-2025 \n\nSee LICENSE.TXT for additional license information."), + VersionString(version), + buildNumber); + + EditorUtility.DisplayDialog(L10n.Tr("FMOD Studio Unity Integration"), text, "OK"); + } + + private static List previewEventInstances = new List(); + + public static bool PreviewBanksLoaded + { + get { return loadedPreviewBanks.Count > 0; } + } + + public static void LoadPreviewBanks() + { + if (PreviewBanksLoaded) + { + return; + } + + foreach (var bank in EventManager.Banks) + { + FMOD.Studio.Bank previewBank; + FMOD.RESULT result = System.loadBankFile(bank.Path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out previewBank); + if (result != FMOD.RESULT.ERR_EVENT_ALREADY_LOADED) // ignore error when a bank is already loaded, e.g. localized banks. + { + CheckResult(result); + } + loadedPreviewBanks.Add(previewBank); + } + } + + public static void UnloadPreviewBanks() + { + if (!PreviewBanksLoaded) + { + return; + } + + loadedPreviewBanks.ForEach(x => { x.unload(); x.clearHandle(); }); + loadedPreviewBanks.Clear(); + } + + public static FMOD.Studio.EventInstance PreviewEvent(EditorEventRef eventRef, Dictionary previewParamValues, float volume = 1, float startTime = 0.0f) + { + FMOD.Studio.EventDescription eventDescription; + FMOD.Studio.EventInstance eventInstance; + + CheckResult(System.getEventByID(eventRef.Guid, out eventDescription)); + CheckResult(eventDescription.createInstance(out eventInstance)); + + foreach (EditorParamRef param in eventRef.Parameters) + { + FMOD.Studio.PARAMETER_DESCRIPTION paramDesc; + if (param.IsGlobal) + { + CheckResult(System.getParameterDescriptionByName(param.Name, out paramDesc)); + } + else + { + CheckResult(eventDescription.getParameterDescriptionByName(param.Name, out paramDesc)); + } + + float value = previewParamValues.ContainsKey(param.Name) ? previewParamValues[param.Name] : param.Default; + param.ID = paramDesc.id; + + if (param.IsGlobal) + { + CheckResult(System.setParameterByID(param.ID, value)); + } + else + { + CheckResult(eventInstance.setParameterByID(param.ID, value)); + } + } + + CheckResult(eventInstance.setVolume(volume)); + CheckResult(eventInstance.setTimelinePosition((int)(startTime * 1000.0f))); + CheckResult(eventInstance.start()); + + previewEventInstances.Add(eventInstance); + + return eventInstance; + } + + public static void PreviewPause(FMOD.Studio.EventInstance eventInstance) + { + if (eventInstance.isValid() && previewEventInstances.Contains(eventInstance)) + { + bool paused; + CheckResult(eventInstance.getPaused(out paused)); + CheckResult(eventInstance.setPaused(!paused)); + } + } + + public static void PreviewStop(FMOD.Studio.EventInstance eventInstance, FMOD.Studio.STOP_MODE stopMode = FMOD.Studio.STOP_MODE.IMMEDIATE) + { + if (previewEventInstances.Contains(eventInstance)) + { + previewEventInstances.Remove(eventInstance); + if (eventInstance.isValid()) + { + eventInstance.stop(stopMode); + eventInstance.release(); + eventInstance.clearHandle(); + } + } + } + + public static void StopAllPreviews() + { + foreach (FMOD.Studio.EventInstance eventInstance in previewEventInstances) + { + PreviewStop(eventInstance); + } + } + + public static float[] GetMetering() + { + FMOD.System lowlevel; + CheckResult(System.getCoreSystem(out lowlevel)); + FMOD.ChannelGroup master; + CheckResult(lowlevel.getMasterChannelGroup(out master)); + FMOD.DSP masterHead; + CheckResult(master.getDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, out masterHead)); + + FMOD.DSP_METERING_INFO outputMetering; + CheckResult(masterHead.getMeteringInfo(IntPtr.Zero, out outputMetering)); + + FMOD.SPEAKERMODE mode; + int rate, raw; + lowlevel.getSoftwareFormat(out rate, out mode, out raw); + int channels; + lowlevel.getSpeakerModeChannels(mode, out channels); + + float[] data = new float[channels]; + if (outputMetering.numchannels > 0) + { + Array.Copy(outputMetering.rmslevel, data, channels); + } + return data; + } + + private static NetworkStream ScriptStream + { + get + { + if (networkStream == null) + { + try + { + if (socket == null) + { + socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + } + + if (!socket.Connected) + { + socketConnection = socket.BeginConnect("127.0.0.1", StudioScriptPort, null, null); + socketConnection.AsyncWaitHandle.WaitOne(); + socket.EndConnect(socketConnection); + socketConnection = null; + } + + networkStream = new NetworkStream(socket); + + byte[] headerBytes = new byte[128]; + int read = ScriptStream.Read(headerBytes, 0, 128); + string header = Encoding.UTF8.GetString(headerBytes, 0, read - 1); + if (header.StartsWith("log():")) + { + RuntimeUtils.DebugLog("FMOD Studio: Script Client returned " + header.Substring(6)); + } + } + catch (Exception e) + { + RuntimeUtils.DebugLog("FMOD Studio: Script Client failed to connect - Check FMOD Studio is running"); + + socketConnection = null; + socket = null; + networkStream = null; + streamReader = null; + throw e; + } + } + return networkStream; + } + } + + private static StreamReader ScriptStreamReader + { + get + { + if (streamReader == null) + { + streamReader = new StreamReader(ScriptStream); + } + return streamReader; + } + } + + private static void AsyncConnectCallback(IAsyncResult result) + { + try + { + socket.EndConnect(result); + } + catch (Exception) + { + } + finally + { + socketConnection = null; + } + } + + public static bool IsConnectedToStudio() + { + try + { + if (socket != null && socket.Connected) + { + if (SendScriptCommand("true")) + { + return true; + } + } + + if (socketConnection == null) + { + socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + socketConnection = socket.BeginConnect("127.0.0.1", StudioScriptPort, AsyncConnectCallback, null); + } + + return false; + + } + catch(Exception e) + { + RuntimeUtils.DebugLogException(e); + return false; + } + } + + public static bool SendScriptCommand(string command) + { + byte[] commandBytes = Encoding.UTF8.GetBytes(command); + try + { + ScriptStream.Write(commandBytes, 0, commandBytes.Length); + byte[] commandReturnBytes = new byte[128]; + int read = ScriptStream.Read(commandReturnBytes, 0, 128); + string result = Encoding.UTF8.GetString(commandReturnBytes, 0, read - 1); + return (result.Contains("true")); + } + catch (Exception) + { + if (networkStream != null) + { + networkStream.Close(); + networkStream = null; + streamReader = null; + } + return false; + } + } + + public static string GetScriptOutput(string command) + { + byte[] commandBytes = Encoding.UTF8.GetBytes(command); + try + { + ScriptStream.Write(commandBytes, 0, commandBytes.Length); + char[] myReadBuffer = new char[2048]; + StringBuilder myCompleteMessage = new StringBuilder(); + int numberOfCharactersRead = ScriptStreamReader.Read(myReadBuffer, 0, myReadBuffer.Length); + + while (numberOfCharactersRead > 0) + { + int nullIndex = Array.IndexOf(myReadBuffer, '\0', 0, numberOfCharactersRead); + + if (nullIndex > 0) + { + myCompleteMessage.Append(myReadBuffer, 0, nullIndex - 1); + } + else if (nullIndex < 0) + { + myCompleteMessage.Append(myReadBuffer, 0, numberOfCharactersRead); + } + + if (nullIndex >= 0) + { + break; + } + + numberOfCharactersRead = ScriptStreamReader.Read(myReadBuffer, 0, myReadBuffer.Length); + } + + string result = myCompleteMessage.ToString(); + if (result.StartsWith("out():")) + { + return result.Substring(6).Trim(); + } + + return null; + } + catch (Exception) + { + networkStream.Close(); + networkStream = null; + streamReader = null; + return null; + } + } + + private static string GetMasterBank() + { + GetScriptOutput(string.Format("masterBankFolder = studio.project.workspace.masterBankFolder;")); + string bankCountString = GetScriptOutput(string.Format("masterBankFolder.items.length;")); + int bankCount = int.Parse(bankCountString); + for (int i = 0; i < bankCount; i++) + { + string isMaster = GetScriptOutput(string.Format("masterBankFolder.items[{1}].isOfExactType(\"MasterBank\");", i)); + if (isMaster == "true") + { + string guid = GetScriptOutput(string.Format("masterBankFolder.items[{1}].id;", i)); + return guid; + } + } + return ""; + } + + private static bool CheckForNameConflict(string folderGuid, string eventName) + { + const string checkForNameConflictFunc = + @"function(folderGuid, eventName) { + var nameConflict = false; + studio.project.lookup(folderGuid).items.forEach(function(val) { + nameConflict |= val.name == eventName; + }); + return nameConflict; + }"; + + string conflictBool = GetScriptOutput(string.Format("({0})(\"{1}\", \"{2}\")", checkForNameConflictFunc, folderGuid, eventName)); + return conflictBool == "1"; + } + + public static string CreateStudioEvent(string eventPath, string eventName) + { + var folders = eventPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + string folderGuid = GetScriptOutput("studio.project.workspace.masterEventFolder.id;"); + + const string getFolderGuidFunc = + @"function(parentGuid, folderName) { + folderGuid = """"; + studio.project.lookup(parentGuid).items.forEach(function(val) { + folderGuid = val.isOfType(""EventFolder"") && val.name == folderName ? val.id : folderGuid; + }); + if (folderGuid == """") + { + var newFolder = studio.project.create(""EventFolder""); + newFolder.name = folderName; + newFolder.folder = studio.project.lookup(parentGuid); + folderGuid = newFolder.id; + } + return folderGuid; + }"; + + for (int i = 0; i < folders.Length; i++) + { + string parentGuid = folderGuid; + folderGuid = GetScriptOutput(string.Format("({0})(\"{1}\", \"{2}\")", getFolderGuidFunc, parentGuid, folders[i])); + } + + if (CheckForNameConflict(folderGuid, eventName)) + { + EditorUtility.DisplayDialog(L10n.Tr("Name Conflict"), string.Format(L10n.Tr("The event {0} already exists under {1}"), eventName, eventPath), "OK"); + return null; + } + + const string createEventFunc = + @"function(eventName, folderGuid) { + event = studio.project.create(""Event""); + event.note = ""Placeholder created via Unity""; + event.name = eventName; + event.folder = studio.project.lookup(folderGuid); + + track = studio.project.create(""GroupTrack""); + track.mixerGroup.output = event.mixer.masterBus; + track.mixerGroup.name = ""Audio 1""; + event.relationships.groupTracks.add(track); + + tag = studio.project.create(""Tag""); + tag.name = ""placeholder""; + tag.folder = studio.project.workspace.masterTagFolder; + event.relationships.tags.add(tag); + + return event.id; + }"; + + string eventGuid = GetScriptOutput(string.Format("({0})(\"{1}\", \"{2}\")", createEventFunc, eventName, folderGuid)); + return eventGuid; + } + + // The FMOD base folder needs to have a known GUID so that we can find it + // if it has been moved, and so that platform specific integration packages can + // be installed correctly. + // + // However, old FMOD packages didn't specify a GUID for the base folder, meaning Unity + // would generate a new one. If this is the case, we need to patch the metadata with + // the correct GUID. + private static void CheckBaseFolderGUID() + { + if (string.IsNullOrEmpty(AssetDatabase.GUIDToAssetPath(RuntimeUtils.BaseFolderGUID))) + { + string folderPath = RuntimeUtils.PluginBasePathDefault; + + if (!Directory.Exists(folderPath)) + { + Debug.LogErrorFormat("FMOD: Couldn't find base folder by GUID ({0}) or path ({1})", + RuntimeUtils.BaseFolderGUID, RuntimeUtils.PluginBasePathDefault); + return; + } + + const string DialogTitle = "Update FMOD Folder Metadata"; + + bool update = EditorUtility.DisplayDialog(DialogTitle, + $"The metadata for the {folderPath} folder needs to be updated" + + " so that FMOD can locate required files.\n\n" + + "After this change you may move the FMOD folder to any location within your project.", + "Update Metadata", "Ignore"); + + while (update) + { + string error = ReplaceMetaFileGUID(folderPath, RuntimeUtils.BaseFolderGUID); + + if (error == null) + { + return; + } + + update = EditorUtility.DisplayDialog(DialogTitle, + $"Error updating metadata for {folderPath}:\n\n{error}\n\nDo you want to try again?", + "Try Again", "Ignore"); + } + } + } + + private static string ReplaceMetaFileGUID(string assetPath, string newGUID) + { + try + { + string filePath = $"{assetPath}.meta"; + + if (!AssetDatabase.MakeEditable(filePath)) + { + return $"Failed to open {filePath} for editing"; + } + + string[] lines = File.ReadAllLines(filePath); + + const string GuidPrefix = "guid:"; + bool guidReplaced = false; + + using (StreamWriter stream = File.CreateText(filePath)) + { + foreach (string line in lines) + { + if (!guidReplaced && line.StartsWith(GuidPrefix)) + { + guidReplaced = true; + stream.WriteLine($"{GuidPrefix} {newGUID}"); + } + else + { + stream.WriteLine(line); + } + } + } + + if (!guidReplaced) + { + return $"Couldn't find a line starting with '{GuidPrefix}' in {filePath}"; + } + + Debug.LogFormat("FMOD: Updated the GUID for {0} to {1}", assetPath, newGUID); + + AssetDatabase.ImportAsset(assetPath); + + return null; + } + catch (Exception e) + { + Debug.LogWarningFormat("FMOD: Failed to update the GUID for {0}: {1}", assetPath, e.Message); + + return e.Message; + } + } + + private static void CheckMacLibraries() + { + Platform platformMac = EditorSettings.Instance.GetPlatform(BuildTarget.StandaloneOSX); + + IEnumerable allLibraries = platformMac.GetBuildTargets() + .SelectMany(t => platformMac.GetBinaryAssetPaths(t, Platform.BinaryType.All)) + .Distinct(); + + List librariesToRepair = allLibraries.Where(path => { + string infoPlistPath = $"{path}/Contents/Info.plist"; + + if (File.Exists(infoPlistPath)) + { + string contents = File.ReadAllText(infoPlistPath); + + return contents.Contains("\r\n"); + } + + return false; + }) + .ToList(); + + if (!librariesToRepair.Any()) + { + return; + } + + librariesToRepair.Sort(); + + const string DialogTitle = "Repair FMOD Libraries"; + + bool repair = EditorUtility.DisplayDialog(DialogTitle, + "The following FMOD libraries contain incorrect line endings, and need to be repaired:\n\n" + + $"{string.Join("\n", librariesToRepair)}\n\n" + + "Do you want to repair them now?", "Repair", "Ignore"); + + while (repair) + { + try + { + RepairMacLibraries(librariesToRepair); + repair = false; + } + catch (Exception e) + { + repair = EditorUtility.DisplayDialog(DialogTitle, + $"Error repairing FMOD libraries:\n\n{e.Message}\n\nDo you want to try again?", + "Try Again", "Ignore"); + } + } + } + + private static void RepairMacLibraries(IEnumerable paths) + { + foreach (string path in paths) + { + string infoPlistPath = $"{path}/Contents/Info.plist"; + + if (!AssetDatabase.MakeEditable(infoPlistPath)) + { + throw new Exception($"Failed to open {infoPlistPath} for editing"); + } + + string contents = File.ReadAllText(infoPlistPath); + contents = contents.Replace("\r\n", "\n"); + + File.WriteAllText(infoPlistPath, contents); + + Debug.LogFormat("FMOD: Replaced CRLF line endings with LF in {0}", infoPlistPath); + } + } + + private static void CleanObsoleteFiles() + { + if (Environment.GetCommandLineArgs().Any(a => a == "-exportPackage")) + { + // Don't delete anything or it won't be included in the package + return; + } + if (EditorApplication.isPlayingOrWillChangePlaymode) + { + // Messing with the asset database while entering play mode causes a NullReferenceException + return; + } + + string obsoleteFolder = $"{RuntimeUtils.PluginBasePath}/obsolete"; + + if (AssetDatabase.IsValidFolder(obsoleteFolder)) + { + EditorApplication.LockReloadAssemblies(); + + string[] guids = AssetDatabase.FindAssets(string.Empty, new string[] { obsoleteFolder }); + foreach (string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + if (AssetDatabase.DeleteAsset(path)) + { + RuntimeUtils.DebugLogFormat("FMOD: Removed obsolete file {0}", path); + } + } + if(AssetDatabase.MoveAssetToTrash(obsoleteFolder)) + { + RuntimeUtils.DebugLogFormat("FMOD: Removed obsolete folder {0}", obsoleteFolder); + } + AssetDatabase.Refresh(); + EditorApplication.UnlockReloadAssemblies(); + } + } + + public static string WritableAssetPath(string cacheAssetName) + { + if (RuntimeUtils.PluginBasePath.StartsWith("Assets/")) + { + return $"{RuntimeUtils.PluginBasePath}/Cache/Editor/{cacheAssetName}.asset"; + } + else + { + return $"Assets/Plugins/FMOD/Cache/Editor/{cacheAssetName}.asset"; + } + } + } + + public class StagingSystem + { + private static string PlatformsFolder => $"{RuntimeUtils.PluginBasePath}/platforms"; + private static string StagingFolder => $"{RuntimeUtils.PluginBasePath}/staging"; + private const string AnyCPU = "AnyCPU"; + + private static readonly LibInfo[] LibrariesToUpdate = { + new LibInfo() {cpu = "x86", os = "Windows", lib = "fmodstudioL.dll", platform = "win", buildTarget = BuildTarget.StandaloneWindows}, + new LibInfo() {cpu = "x86_64", os = "Windows", lib = "fmodstudioL.dll", platform = "win", buildTarget = BuildTarget.StandaloneWindows64}, + new LibInfo() {cpu = "x86_64", os = "Linux", lib = "libfmodstudioL.so", platform = "linux", buildTarget = BuildTarget.StandaloneLinux64}, + new LibInfo() {cpu = AnyCPU, os = "OSX", lib = "fmodstudioL.bundle", platform = "mac", buildTarget = BuildTarget.StandaloneOSX}, + }; + + public static bool SourceLibsExist + { + get + { + return LibrariesToUpdate.Any((info) => + { + string sourcePath = GetSourcePath(info); + + if (sourcePath != null) + { + return AssetImporter.GetAtPath(sourcePath) as PluginImporter != null; + } + else + { + return false; + } + }); + } + } + + private struct LibInfo + { + public string cpu; + public string os; + public string lib; + public string platform; + public BuildTarget buildTarget; + }; + + private static string GetTargetPath(LibInfo libInfo) + { + foreach (Platform.FileLayout layout in Platform.OldFileLayouts) + { + string path = GetTargetPath(libInfo, layout); + + if (EditorUtils.AssetExists(path)) + { + return path; + } + } + + return null; + } + + private static string GetTargetPath(LibInfo libInfo, Platform.FileLayout layout) + { + switch (layout) + { + case Platform.FileLayout.Release_1_10: + return $"Assets/Plugins/{CPUAndLibPath(libInfo)}"; + case Platform.FileLayout.Release_2_0: + return $"Assets/Plugins/FMOD/lib/{libInfo.platform}/{CPUAndLibPath(libInfo)}"; + case Platform.FileLayout.Release_2_1: + case Platform.FileLayout.Release_2_2: + return $"{PlatformsFolder}/{libInfo.platform}/lib/{CPUAndLibPath(libInfo)}"; + default: + throw new ArgumentException("Unrecognised file layout: " + layout); + } + } + + private static string CPUAndLibPath(LibInfo libInfo) + { + return (libInfo.cpu == AnyCPU) ? libInfo.lib : $"{libInfo.cpu}/{libInfo.lib}"; + } + + private static string GetSourcePath(LibInfo libInfo) + { + return $"{StagingFolder}/{libInfo.platform}/lib/{CPUAndLibPath(libInfo)}"; + } + + public class UpdateStep + { + internal Settings.SharedLibraryUpdateStages Stage; + public string Name; + public string Description; + public string Details; + public Action Execute; + + public void CacheDetails() + { + Details = GetDetails(); + } + + private Func GetDetails; + + internal static UpdateStep Create(Settings.SharedLibraryUpdateStages stage, string name, string description, + Func details, Action execute) + { + return new UpdateStep() { + Stage = stage, + Name = name, + Description = description, + GetDetails = details, + Execute = execute, + }; + } + } + + public static readonly UpdateStep[] UpdateSteps = { + UpdateStep.Create( + stage: Settings.SharedLibraryUpdateStages.DisableExistingLibraries, + name: L10n.Tr("Disable Existing Native Libraries"), + description: L10n.Tr("Disable the existing FMOD native libraries so that Unity will not load them at startup time."), + details: () => { + IEnumerable importers = + LibrariesToUpdate.Select(GetPluginImporter).Where(p => p != null); + + if (!importers.Any()) + { + return string.Empty; + } + + IEnumerable paths = importers.Select(p => $"\n* {p.assetPath}"); + + return string.Format(L10n.Tr("This will disable these native libraries:{0}"),string.Join(string.Empty, paths)); + }, + execute: () => { + foreach (LibInfo libInfo in LibrariesToUpdate) + { + PluginImporter pluginImporter = GetPluginImporter(libInfo); + if (pluginImporter != null && pluginImporter.GetCompatibleWithEditor()) + { + pluginImporter.SetCompatibleWithEditor(false); + pluginImporter.SetCompatibleWithAnyPlatform(false); + EditorUtility.SetDirty(pluginImporter); + pluginImporter.SaveAndReimport(); + } + } + + Settings.Instance.SharedLibraryUpdateStage = Settings.SharedLibraryUpdateStages.RestartUnity; + Settings.Instance.SharedLibraryTimeSinceStart = EditorApplication.timeSinceStartup; + EditorUtility.SetDirty(Settings.Instance); + } + ), + + UpdateStep.Create( + stage: Settings.SharedLibraryUpdateStages.RestartUnity, + name: L10n.Tr("Restart Unity"), + description: L10n.Tr("Restart Unity so that it releases its lock on the existing FMOD native libraries."), + details: () => { + return L10n.Tr("This will restart Unity. You will be prompted to save your work if you have unsaved scene modifications."); + }, + execute: () => { + if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) + { + EditorApplication.OpenProject(Environment.CurrentDirectory); + } + } + ), + + UpdateStep.Create( + stage: Settings.SharedLibraryUpdateStages.CopyNewLibraries, + name: L10n.Tr("Copy New Native Libraries"), + description: L10n.Tr("Copy the new FMOD native libraries to the correct location and enable them."), + details: () => { + List actions = new List(); + + foreach (LibInfo libInfo in LibrariesToUpdate) + { + string sourcePath = GetSourcePath(libInfo); + string targetPath = GetTargetPath(libInfo); + + if (EditorUtils.AssetExists(sourcePath)) + { + if (targetPath != null) + { + actions.Add($"Delete {targetPath}"); + } + + targetPath = GetTargetPath(libInfo, Platform.FileLayout.Latest); + + actions.Add($"Copy {sourcePath} to {targetPath}"); + } + + if (targetPath != null) + { + actions.Add($"Enable {targetPath}"); + } + } + + actions.Add($"Remove {StagingFolder}"); + + return string.Format(L10n.Tr("This will do the following:\n* {0}"), string.Join("\n* ", actions)); + }, + execute: () => { + bool allCopiesSucceeded = true; + + foreach (LibInfo libInfo in LibrariesToUpdate) + { + string sourcePath = GetSourcePath(libInfo); + string targetPath = GetTargetPath(libInfo); + + if (EditorUtils.AssetExists(sourcePath)) + { + if (targetPath != null) + { + if (!AssetDatabase.DeleteAsset(targetPath)) + { + RuntimeUtils.DebugLogError(string.Format("FMOD: Could not delete {0}", targetPath)); + } + } + + targetPath = GetTargetPath(libInfo, Platform.FileLayout.Latest); + + EditorUtils.EnsureFolderExists(EditorUtils.GetParentFolder(targetPath)); + + if (!AssetDatabase.CopyAsset(sourcePath, targetPath)) + { + RuntimeUtils.DebugLogError(string.Format("FMOD: Could not copy {0} to {1}", sourcePath, targetPath)); + allCopiesSucceeded = false; + } + } + + PluginImporter pluginImporter = AssetImporter.GetAtPath(targetPath) as PluginImporter; + + if (pluginImporter != null) + { + pluginImporter.ClearSettings(); + pluginImporter.SetCompatibleWithEditor(true); + pluginImporter.SetCompatibleWithAnyPlatform(false); + pluginImporter.SetCompatibleWithPlatform(libInfo.buildTarget, true); + pluginImporter.SetEditorData("CPU", libInfo.cpu); + pluginImporter.SetEditorData("OS", libInfo.os); + EditorUtility.SetDirty(pluginImporter); + pluginImporter.SaveAndReimport(); + } + } + + if (allCopiesSucceeded) + { + if (AssetDatabase.MoveAssetToTrash(StagingFolder)) + { + RuntimeUtils.DebugLogFormat("FMOD: Removed staging folder {0}", StagingFolder); + } + else + { + RuntimeUtils.DebugLogError(string.Format("FMOD: Could not remove staging folder {0}", StagingFolder)); + } + } + + ResetUpdateStage(); + + // This is so that Unity finds the new libraries + EditorUtility.RequestScriptReload(); + } + ), + }; + + private static PluginImporter GetPluginImporter(LibInfo libInfo) + { + string targetPath = GetTargetPath(libInfo); + + if (targetPath != null) + { + return AssetImporter.GetAtPath(targetPath) as PluginImporter; + } + else + { + return null; + } + } + + private static UpdateStep FindUpdateStep(Settings.SharedLibraryUpdateStages stage) + { + return UpdateSteps.FirstOrDefault(s => s.Stage == stage); + } + + private static void ResetUpdateStage() + { + if (Settings.Instance.SharedLibraryUpdateStage != Settings.SharedLibraryUpdateStages.Start || + Settings.Instance.SharedLibraryTimeSinceStart != 0) + { + Settings.Instance.SharedLibraryUpdateStage = Settings.SharedLibraryUpdateStages.Start; + Settings.Instance.SharedLibraryTimeSinceStart = 0; + EditorUtility.SetDirty(Settings.Instance); + } + } + + public static UpdateStep Startup() + { + if (!AssetDatabase.IsValidFolder(StagingFolder)) + { + ResetUpdateStage(); + return null; + } + + if (Settings.Instance.SharedLibraryUpdateStage == Settings.SharedLibraryUpdateStages.Start) + { + bool targetLibsExist = LibrariesToUpdate.Any(info => GetPluginImporter(info) != null); + + if (targetLibsExist) + { + Settings.Instance.SharedLibraryUpdateStage = Settings.SharedLibraryUpdateStages.DisableExistingLibraries; + EditorUtility.SetDirty(Settings.Instance); + } + else + { + FindUpdateStep(Settings.SharedLibraryUpdateStages.CopyNewLibraries).Execute(); + + ResetUpdateStage(); + return null; + } + } + + if (Settings.Instance.SharedLibraryUpdateStage == Settings.SharedLibraryUpdateStages.RestartUnity + && EditorApplication.timeSinceStartup < Settings.Instance.SharedLibraryTimeSinceStart) + { + // Unity has been restarted + Settings.Instance.SharedLibraryUpdateStage = Settings.SharedLibraryUpdateStages.CopyNewLibraries; + EditorUtility.SetDirty(Settings.Instance); + } + + return GetNextUpdateStep(); + } + + public static UpdateStep GetNextUpdateStep() + { + UpdateStep step = FindUpdateStep(Settings.Instance.SharedLibraryUpdateStage); + + if (step != null) + { + step.CacheDetails(); + } + + return step; + } + } + + public abstract class HelpContent : PopupWindowContent + { + private GUIContent icon; + + protected abstract void Prepare(); + protected abstract Vector2 GetContentSize(); + protected abstract void DrawContent(); + + public override void OnOpen() + { + icon = EditorGUIUtility.IconContent("console.infoicon"); + + Prepare(); + } + + public override Vector2 GetWindowSize() + { + Vector2 contentSize = GetContentSize(); + + Vector2 iconSize = GUI.skin.label.CalcSize(icon); + + return new Vector2(contentSize.x + iconSize.x, + Math.Max(contentSize.y, iconSize.y) + EditorGUIUtility.standardVerticalSpacing); + } + + public override void OnGUI(Rect rect) + { + using (new GUILayout.HorizontalScope()) + { + using (new GUILayout.VerticalScope()) + { + GUILayout.Label(icon); + } + + using (new GUILayout.VerticalScope()) + { + DrawContent(); + } + } + } + } + + public class SimpleHelp : HelpContent + { + private GUIContent text; + private GUIStyle style; + private float textWidth; + + public SimpleHelp(string text, float textWidth = 300) + { + this.text = new GUIContent(text); + this.textWidth = textWidth; + } + + protected override void Prepare() + { + style = new GUIStyle(GUI.skin.label) { + richText = true, + wordWrap = true, + alignment = TextAnchor.MiddleLeft, + }; + } + + protected override Vector2 GetContentSize() + { + float textHeight = style.CalcHeight(text, textWidth) + style.margin.bottom; + + return new Vector2(textWidth, textHeight); + } + + protected override void DrawContent() + { + GUILayout.Label(text, style); + } + } + + public class BuildStatusWatcher + { + public static Action OnBuildStarted; + public static Action OnBuildEnded; + + private static bool buildInProgress = false; + + private static void SetBuildInProgress(bool inProgress) + { + if (inProgress != buildInProgress) + { + buildInProgress = inProgress; + + if (buildInProgress) + { + EditorApplication.update += PollBuildStatus; + + if (OnBuildStarted != null) + { + OnBuildStarted(); + } + } + else + { + EditorApplication.update -= PollBuildStatus; + + if (OnBuildEnded != null) + { + OnBuildEnded(); + } + } + } + } + + private static void PollBuildStatus() + { + SetBuildInProgress(BuildPipeline.isBuildingPlayer); + } + + private class BuildProcessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport + { + public int callbackOrder { get { return 0; } } + + public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report) + { + SetBuildInProgress(true); + } + + public void OnPostprocessBuild(UnityEditor.Build.Reporting.BuildReport report) + { + SetBuildInProgress(false); + } + } + + public static void Startup() + { +#if UNITY_SCRIPTABLEBUILDPIPELINE_EXIST + BuildCallbacks callbacks = ContentPipeline.BuildCallbacks; + + callbacks.PostDependencyCallback += (parameters, dependencyData) => { + SetBuildInProgress(true); + return ReturnCode.Success; + }; + + callbacks.PostWritingCallback += (parameters, dependencyData, writeData, results) => { + SetBuildInProgress(false); + return ReturnCode.Success; + }; +#endif + } + } + + public static class SerializedPropertyExtensions + { + public static bool ArrayContains(this SerializedProperty array, Func predicate) + { + return FindArrayIndex(array, predicate) >= 0; + } + + public static bool ArrayContains(this SerializedProperty array, string subPropertyName, + Func predicate) + { + return FindArrayIndex(array, subPropertyName, predicate) >= 0; + } + + public static int FindArrayIndex(this SerializedProperty array, Func predicate) + { + for (int i = 0; i < array.arraySize; ++i) + { + SerializedProperty current = array.GetArrayElementAtIndex(i); + + if (predicate(current)) + { + return i; + } + } + + return -1; + } + + public static int FindArrayIndex(this SerializedProperty array, string subPropertyName, + Func predicate) + { + for (int i = 0; i < array.arraySize; ++i) + { + SerializedProperty current = array.GetArrayElementAtIndex(i); + SerializedProperty subProperty = current.FindPropertyRelative(subPropertyName); + + if (predicate(subProperty)) + { + return i; + } + } + + return -1; + } + + public static void ArrayAdd(this SerializedProperty array, Action initialize) + { + array.InsertArrayElementAtIndex(array.arraySize); + initialize(array.GetArrayElementAtIndex(array.arraySize - 1)); + } + + public static void ArrayClear(this SerializedProperty array) + { + while (array.arraySize > 0) + { + array.DeleteArrayElementAtIndex(array.arraySize - 1); + } + } + + private static FMOD.GUID GetGuid(this SerializedProperty property) + { + return new FMOD.GUID() { + Data1 = property.FindPropertyRelative("Data1").intValue, + Data2 = property.FindPropertyRelative("Data2").intValue, + Data3 = property.FindPropertyRelative("Data3").intValue, + Data4 = property.FindPropertyRelative("Data4").intValue, + }; + } + + public static void SetGuid(this SerializedProperty property, FMOD.GUID guid) + { + property.FindPropertyRelative("Data1").intValue = guid.Data1; + property.FindPropertyRelative("Data2").intValue = guid.Data2; + property.FindPropertyRelative("Data3").intValue = guid.Data3; + property.FindPropertyRelative("Data4").intValue = guid.Data4; + } + + public static void SetEventReference(this SerializedProperty property, FMOD.GUID guid, string path) + { + SerializedProperty guidProperty = property.FindPropertyRelative("Guid"); + guidProperty.SetGuid(guid); + + SerializedProperty pathProperty = property.FindPropertyRelative("Path"); + pathProperty.stringValue = path; + } + + public static EventReference GetEventReference(this SerializedProperty property) + { + SerializedProperty pathProperty = property.FindPropertyRelative("Path"); + SerializedProperty guidProperty = property.FindPropertyRelative("Guid"); + + return new EventReference() { + Path = pathProperty.stringValue, + Guid = guidProperty.GetGuid(), + }; + } + } + + public class NoIndentScope : IDisposable + { + private int oldIndentLevel; + + public NoIndentScope() + { + oldIndentLevel = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + } + + public void Dispose() + { + EditorGUI.indentLevel = oldIndentLevel; + } + } + + public class NaturalComparer : IComparer + { + public int Compare(string a, string b) + { + return EditorUtility.NaturalCompare(a, b); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs.meta new file mode 100644 index 00000000..7a44a90a --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2bb4068641d1f71478f95a9b73533f51 +timeCreated: 1432608272 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs b/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs new file mode 100644 index 00000000..7dde4c32 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs @@ -0,0 +1,1782 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEditor; +using UnityEditor.IMGUI.Controls; +using UnityEngine; +using System.IO; + +namespace FMODUnity +{ + public class EventBrowser : EditorWindow, ISerializationCallbackReceiver + { + [SerializeField] + private bool isStandaloneWindow; + + [NonSerialized] + private float nextRepaintTime; + + [NonSerialized] + private float[] cachedMetering; + + private const float RepaintInterval = 1 / 30.0f; + + private Texture2D borderIcon; + private GUIStyle borderStyle; + + [NonSerialized] + private TreeView treeView; + + [NonSerialized] + private SearchField searchField; + + [SerializeField] + private PreviewArea previewArea = new PreviewArea(); + + [SerializeField] + private TreeView.State treeViewState; + + [NonSerialized] + private DateTime LastKnownCacheTime; + + private SerializedProperty outputProperty; + + public static FMOD.Studio.EventInstance PreviewEventInstance { get; private set; } + + [MenuItem("FMOD/Event Browser", priority = 2)] + public static void ShowWindow() + { + EventBrowser eventBrowser = GetWindow("FMOD Events"); + eventBrowser.minSize = new Vector2(380, 600); + + eventBrowser.BeginStandaloneWindow(); + + EditorUtils.LoadPreviewBanks(); + } + + public static bool IsOpen + { + get; private set; + } + + public void OnBeforeSerialize() + { + treeViewState = treeView.state; + } + + public void OnAfterDeserialize() + { + } + + private void Update() + { + bool forceRepaint = false; + + float[] currentMetering = EditorUtils.GetMetering(); + if (cachedMetering == null || !cachedMetering.SequenceEqual(currentMetering)) + { + cachedMetering = currentMetering; + forceRepaint = true; + } + + if (LastKnownCacheTime != EventManager.CacheTime) + { + ReadEventCache(); + forceRepaint = true; + } + + if (forceRepaint || (previewArea != null && previewArea.forceRepaint && nextRepaintTime < Time.realtimeSinceStartup)) + { + Repaint(); + nextRepaintTime = Time.time + RepaintInterval; + } + } + + private void ReadEventCache() + { + LastKnownCacheTime = EventManager.CacheTime; + treeView.Reload(); + } + + private class TreeView : UnityEditor.IMGUI.Controls.TreeView + { + private static readonly Texture2D folderOpenIcon = EditorUtils.LoadImage("FolderIconOpen.png"); + private static readonly Texture2D folderClosedIcon = EditorUtils.LoadImage("FolderIconClosed.png"); + private static readonly Texture2D eventIcon = EditorUtils.LoadImage("EventIcon.png"); + private static readonly Texture2D snapshotIcon = EditorUtils.LoadImage("SnapshotIcon.png"); + private static readonly Texture2D bankIcon = EditorUtils.LoadImage("BankIcon.png"); + private static readonly Texture2D continuousParameterIcon = EditorUtils.LoadImage("ContinuousParameterIcon.png"); + private static readonly Texture2D discreteParameterIcon = EditorUtils.LoadImage("DiscreteParameterIcon.png"); + private static readonly Texture2D labeledParameterIcon = EditorUtils.LoadImage("LabeledParameterIcon.png"); + + private Dictionary itemIDs = new Dictionary(); + + private const string EventPrefix = "event:/"; + private const string SnapshotPrefix = "snapshot:/"; + private const string BankPrefix = "bank:/"; + private const string ParameterPrefix = "parameter:/"; + + bool expandNextFolderSet = false; + string nextFramedItemPath; + private string[] searchStringSplit; + + IList noSearchExpandState; + + float oldBaseIndent; + + public TreeView(State state) : base(state.baseState) + { + noSearchExpandState = state.noSearchExpandState; + SelectedObject = state.selectedObject; + TypeFilter = state.typeFilter; + DragEnabled = state.dragEnabled; + + for (int i = 0; i < state.itemPaths.Count; ++i) + { + itemIDs.Add(state.itemPaths[i], state.itemIDs[i]); + } + } + + public void JumpToEvent(string path) + { + JumpToItem(path); + } + + public void JumpToBank(string name) + { + JumpToItem(BankPrefix + name); + } + + private void JumpToItem(string path) + { + nextFramedItemPath = path; + Reload(); + + int itemID; + if (itemIDs.TryGetValue(path, out itemID)) + { + SetSelection(new List { itemID }, + TreeViewSelectionOptions.RevealAndFrame | TreeViewSelectionOptions.FireSelectionChanged); + } + else + { + SetSelection(new List()); + } + } + + private class LeafItem : TreeViewItem + { + public LeafItem(int id, int depth, ScriptableObject data) + : base(id, depth) + { + Data = data; + } + + public ScriptableObject Data; + } + + private class FolderItem : TreeViewItem + { + public FolderItem(int id, int depth, string displayName) + : base(id, depth, displayName) + { + } + } + + private FolderItem CreateFolderItem(string name, string path, bool hasChildren, bool forceExpanded, + TreeViewItem parent) + { + FolderItem item = new FolderItem(AffirmItemID("folder:" + path), 0, name); + + bool expanded; + + if (!hasChildren) + { + expanded = false; + } + else if (forceExpanded || expandNextFolderSet + || (nextFramedItemPath != null && nextFramedItemPath.StartsWith(path))) + { + SetExpanded(item.id, true); + expanded = true; + } + else + { + expanded = IsExpanded(item.id); + } + + if (expanded) + { + item.icon = folderOpenIcon; + } + else + { + item.icon = folderClosedIcon; + + if (hasChildren) + { + item.children = CreateChildListForCollapsedParent(); + } + } + + parent.AddChild(item); + + return item; + } + + protected override TreeViewItem BuildRoot() + { + return new TreeViewItem(-1, -1); + } + + private int AffirmItemID(string path) + { + int id; + + if (!itemIDs.TryGetValue(path, out id)) + { + id = itemIDs.Count; + itemIDs.Add(path, id); + } + + return id; + } + + public TypeFilter TypeFilter { get; set; } + public bool DragEnabled { get; set; } + + protected override IList BuildRows(TreeViewItem root) + { + if (hasSearch) + { + searchStringSplit = searchString.Split(' '); + } + + if (rootItem.children != null) + { + rootItem.children.Clear(); + } + + if ((TypeFilter & TypeFilter.Event) != 0) + { + CreateSubTree(L10n.Tr("Events"), EventPrefix, + EventManager.Events.Where(e => e.Path.StartsWith(EventPrefix)), e => e.Path); + + CreateSubTree(L10n.Tr("Snapshots"), SnapshotPrefix, + EventManager.Events.Where(e => e.Path.StartsWith(SnapshotPrefix)), s => s.Path); + } + + if ((TypeFilter & TypeFilter.Bank) != 0) + { + CreateSubTree(L10n.Tr("Banks"), BankPrefix, EventManager.Banks, b => b.StudioPath); + } + + if ((TypeFilter & TypeFilter.Parameter) != 0) + { + CreateSubTree(L10n.Tr("Global Parameters"), ParameterPrefix, + EventManager.Parameters, p => p.StudioPath); + } + + List rows = new List(); + + AddChildrenInOrder(rows, rootItem); + + SetupDepthsFromParentsAndChildren(rootItem); + + expandNextFolderSet = false; + nextFramedItemPath = null; + + return rows; + } + + private static NaturalComparer naturalComparer = new NaturalComparer(); + + private void CreateSubTree(string rootName, string rootPath, + IEnumerable sourceRecords, Func GetPath, + Func MakeUniquePath = null) + where T : ScriptableObject + { + var records = sourceRecords.Select(r => new { source = r, path = GetPath(r) }); + + if (hasSearch) + { + records = records.Where(r => { + foreach (var word in searchStringSplit) + { + if (word.Length > 0 && r.path.IndexOf(word, StringComparison.OrdinalIgnoreCase) < 0) + { + return false; + } + } + return true; + }); + } + + records = records.OrderBy(r => r.path, naturalComparer); + + TreeViewItem root = + CreateFolderItem(rootName, rootPath, records.Any(), TypeFilter != TypeFilter.All, rootItem); + + List currentFolderItems = new List(); + + foreach (var record in records) + { + string leafName; + TreeViewItem parent = CreateFolderItems(record.path, currentFolderItems, root, out leafName); + + if (parent != null) + { + string uniquePath; + + if (MakeUniquePath != null) + { + uniquePath = MakeUniquePath(record.path, record.source); + } + else + { + uniquePath = record.path; + } + + TreeViewItem leafItem = new LeafItem(AffirmItemID(uniquePath), 0, record.source); + leafItem.displayName = leafName; + leafItem.icon = IconForRecord(record.source); + + parent.AddChild(leafItem); + } + } + } + + private Texture2D IconForRecord(ScriptableObject record) + { + EditorEventRef eventRef = record as EditorEventRef; + if (eventRef != null) + { + if (eventRef.Path.StartsWith(SnapshotPrefix)) + { + return snapshotIcon; + } + else + { + return eventIcon; + } + } + + EditorBankRef bankRef = record as EditorBankRef; + if (bankRef != null) + { + return bankIcon; + } + + EditorParamRef paramRef = record as EditorParamRef; + if (paramRef != null) + { + switch(paramRef.Type) + { + case ParameterType.Continuous: + return continuousParameterIcon; + case ParameterType.Discrete: + return discreteParameterIcon; + case ParameterType.Labeled: + return labeledParameterIcon; + } + } + + return null; + } + + private TreeViewItem CreateFolderItems(string path, List currentFolderItems, + TreeViewItem root, out string leafName) + { + TreeViewItem parent = root; + + char separator = '/'; + + // Skip the type prefix at the start of the path + int elementStart = path.IndexOf(separator) + 1; + + for (int i = 0; ; ++i) + { + if (!IsExpanded(parent.id)) + { + leafName = null; + return null; + } + + int elementEnd = path.IndexOf(separator, elementStart); + + if (elementEnd < 0) + { + // No more folders; elementStart points to the event name + break; + } + + string folderName = path.Substring(elementStart, elementEnd - elementStart); + + if (i < currentFolderItems.Count && folderName != currentFolderItems[i].displayName) + { + currentFolderItems.RemoveRange(i, currentFolderItems.Count - i); + } + + if (i == currentFolderItems.Count) + { + FolderItem folderItem = + CreateFolderItem(folderName, path.Substring(0, elementEnd), true, false, parent); + + currentFolderItems.Add(folderItem); + } + + elementStart = elementEnd + 1; + parent = currentFolderItems[i]; + } + + leafName = path.Substring(elementStart); + return parent; + } + + private static void AddChildrenInOrder(List list, TreeViewItem item) + { + if (item.children != null) + { + foreach (TreeViewItem child in item.children.Where(child => child is FolderItem)) + { + list.Add(child); + + AddChildrenInOrder(list, child); + } + + foreach (TreeViewItem child in item.children.Where(child => !(child == null || child is FolderItem))) + { + list.Add(child); + } + } + } + + protected override bool CanMultiSelect(TreeViewItem item) + { + return false; + } + + protected override bool CanChangeExpandedState(TreeViewItem item) + { + return item.hasChildren; + } + + protected override bool CanStartDrag(CanStartDragArgs args) + { + if (DragEnabled && args.draggedItem is LeafItem) + { + return IsDraggable((args.draggedItem as LeafItem).Data); + } + else + { + return false; + } + } + + protected override void SetupDragAndDrop(SetupDragAndDropArgs args) + { + IList items = FindRows(args.draggedItemIDs); + + if (items[0] is LeafItem) + { + LeafItem item = items[0] as LeafItem; + + DragAndDrop.PrepareStartDrag(); + DragAndDrop.objectReferences = new UnityEngine.Object[] { Instantiate(item.Data) }; + + string title = string.Empty; + + if (item.Data is EditorEventRef) + { + title = L10n.Tr("New FMOD Studio Emitter"); + } + else if (item.Data is EditorBankRef) + { + title = L10n.Tr("New FMOD Studio Bank Loader"); + } + else if (item.Data is EditorParamRef) + { + title = L10n.Tr("New FMOD Studio Global Parameter Trigger"); + } + + DragAndDrop.StartDrag(title); + } + } + + protected override DragAndDropVisualMode HandleDragAndDrop(DragAndDropArgs args) + { + return DragAndDropVisualMode.None; + } + + protected override void SearchChanged(string newSearch) + { + if (!string.IsNullOrEmpty(newSearch.Trim())) + { + expandNextFolderSet = true; + + if (noSearchExpandState == null) + { + // A new search is beginning + noSearchExpandState = GetExpanded(); + SetExpanded(new List()); + } + } + else + { + if (noSearchExpandState != null) + { + // A search is ending + SetExpanded(noSearchExpandState); + noSearchExpandState = null; + } + } + } + + public ScriptableObject SelectedObject { get; private set; } + public ScriptableObject DoubleClickedObject { get; private set; } + + protected override void SelectionChanged(IList selectedIDs) + { + SelectedObject = null; + + if (selectedIDs.Count > 0) + { + TreeViewItem item = FindItem(selectedIDs[0], rootItem); + + if (item is LeafItem) + { + SelectedObject = (item as LeafItem).Data; + } + } + } + + protected override void DoubleClickedItem(int id) + { + TreeViewItem item = FindItem(id, rootItem); + + if (item is LeafItem) + { + DoubleClickedObject = (item as LeafItem).Data; + } + } + + protected override void BeforeRowsGUI() + { + oldBaseIndent = baseIndent; + DoubleClickedObject = null; + } + + protected override void RowGUI(RowGUIArgs args) + { + if (hasSearch) + { + // Hack to undo TreeView flattening the hierarchy when searching + baseIndent = oldBaseIndent + args.item.depth * depthIndentWidth; + } + + base.RowGUI(args); + + TreeViewItem item = args.item; + + if (Event.current.type == EventType.MouseUp && item is FolderItem && item.hasChildren) + { + Rect rect = args.rowRect; + rect.xMin = GetContentIndent(item); + + if (rect.Contains(Event.current.mousePosition)) + { + SetExpanded(item.id, !IsExpanded(item.id)); + Event.current.Use(); + } + } + } + + protected override void AfterRowsGUI() + { + baseIndent = oldBaseIndent; + } + + [Serializable] + public class State + { + public TreeViewState baseState; + public List noSearchExpandState; + public ScriptableObject selectedObject; + public List itemPaths = new List(); + public List itemIDs = new List(); + public TypeFilter typeFilter = TypeFilter.All; + public bool dragEnabled = true; + + public State() : this(new TreeViewState()) + { + } + + public State(TreeViewState baseState) + { + this.baseState = baseState; + } + } + + new public State state + { + get + { + State result = new State(base.state); + + if (noSearchExpandState != null) + { + result.noSearchExpandState = new List(noSearchExpandState); + } + + result.selectedObject = SelectedObject; + + foreach (var entry in itemIDs) + { + result.itemPaths.Add(entry.Key); + result.itemIDs.Add(entry.Value); + } + + result.typeFilter = TypeFilter; + result.dragEnabled = true; + + return result; + } + } + } + + private void AffirmResources() + { + if (borderIcon == null) + { + borderIcon = EditorUtils.LoadImage("Border.png"); + + borderStyle = new GUIStyle(GUI.skin.box); + borderStyle.normal.background = borderIcon; + borderStyle.margin = new RectOffset(); + } + } + + private bool InChooserMode { get { return outputProperty != null; } } + + private void OnGUI() + { + if (!IsOpen) + { + return; + } + + AffirmResources(); + + if (InChooserMode) + { + GUILayout.BeginVertical(borderStyle, GUILayout.ExpandWidth(true)); + } + + treeView.searchString = searchField.OnGUI(treeView.searchString); + + Rect treeRect = GUILayoutUtility.GetRect(0, 0, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + treeRect.y += 2; + treeRect.height -= 2; + + treeView.OnGUI(treeRect); + + if (InChooserMode) + { + GUILayout.EndVertical(); + HandleChooserModeEvents(); + } + else + { + previewArea.treeView = treeView; + previewArea.OnGUI(position.width, cachedMetering != null ? cachedMetering : EditorUtils.GetMetering()); + } + } + + private void HandleChooserModeEvents() + { + if (Event.current.isKey) + { + KeyCode keyCode = Event.current.keyCode; + + if ((keyCode == KeyCode.Return || keyCode == KeyCode.KeypadEnter) && treeView.SelectedObject != null) + { + SetOutputProperty(treeView.SelectedObject); + Event.current.Use(); + Close(); + } + else if (keyCode == KeyCode.Escape) + { + Event.current.Use(); + Close(); + } + } + else if (treeView.DoubleClickedObject != null) + { + SetOutputProperty(treeView.DoubleClickedObject); + Close(); + } + } + + private void SetOutputProperty(ScriptableObject data) + { + if (data is EditorEventRef) + { + EditorEventRef eventRef = data as EditorEventRef; + + outputProperty.SetEventReference(eventRef.Guid, eventRef.Path); + + EditorUtils.UpdateParamsOnEmitter(outputProperty.serializedObject, eventRef.Path); + } + else if (data is EditorBankRef) + { + outputProperty.stringValue = (data as EditorBankRef).Name; + } + else if (data is EditorParamRef) + { + outputProperty.stringValue = (data as EditorParamRef).Name; + } + + outputProperty.serializedObject.ApplyModifiedProperties(); + } + + [Serializable] + private class PreviewArea + { + [NonSerialized] + public TreeView treeView; + + [NonSerialized] + private EditorEventRef currentEvent; + + [SerializeField] + private DetailsView detailsView = new DetailsView(); + + [SerializeField] + private TransportControls transportControls = new TransportControls(); + + [SerializeField] + private Event3DPreview event3DPreview = new Event3DPreview(); + + [SerializeField] + private PreviewMeters meters = new PreviewMeters(); + + [SerializeField] + private EventParameterControls parameterControls = new EventParameterControls(); + + private GUIStyle mainStyle; + + private bool isNarrow; + + public bool forceRepaint { get { return transportControls.forceRepaint; } } + + private void SetEvent(EditorEventRef eventRef) + { + if (eventRef != currentEvent) + { + currentEvent = eventRef; + + EditorUtils.PreviewStop(PreviewEventInstance); + transportControls.Reset(); + event3DPreview.Reset(); + parameterControls.Reset(); + } + } + + private void AffirmResources() + { + if (mainStyle == null) + { + mainStyle = new GUIStyle(GUI.skin.box); + mainStyle.margin = new RectOffset(); + } + } + + public void OnGUI(float width, float[] metering) + { + isNarrow = width < 600; + + AffirmResources(); + + ScriptableObject selectedObject = treeView.SelectedObject; + + if (selectedObject is EditorEventRef) + { + SetEvent(selectedObject as EditorEventRef); + } + else + { + SetEvent(null); + } + + if (selectedObject != null) + { + GUILayout.BeginVertical(mainStyle, GUILayout.ExpandWidth(true)); + + if (selectedObject is EditorEventRef) + { + EditorEventRef eventRef = selectedObject as EditorEventRef; + + if (eventRef.Path.StartsWith("event:")) + { + DrawEventPreview(eventRef, metering); + } + else if (eventRef.Path.StartsWith("snapshot:")) + { + detailsView.DrawSnapshot(eventRef); + } + } + else if (selectedObject is EditorBankRef) + { + detailsView.DrawBank(selectedObject as EditorBankRef); + } + else if (selectedObject is EditorParamRef) + { + detailsView.DrawParameter(selectedObject as EditorParamRef); + } + + GUILayout.EndVertical(); + } + } + + private void DrawSeparatorLine() + { + GUILayout.Box(GUIContent.none, GUILayout.Height(1), GUILayout.ExpandWidth(true)); + } + + private void DrawEventPreview(EditorEventRef eventRef, float[] metering) + { + detailsView.DrawEvent(eventRef, isNarrow); + + DrawSeparatorLine(); + + // Playback controls, 3D Preview and meters + EditorGUILayout.BeginHorizontal(GUILayout.Height(event3DPreview.Height)); + GUILayout.FlexibleSpace(); + + EditorGUILayout.BeginVertical(); + + if (!isNarrow) + { + GUILayout.FlexibleSpace(); + } + + transportControls.OnGUI(eventRef, parameterControls.ParameterValues); + + if (isNarrow) + { + EditorGUILayout.Separator(); + meters.OnGUI(true, metering); + } + else + { + GUILayout.FlexibleSpace(); + } + + EditorGUILayout.EndVertical(); + + event3DPreview.OnGUI(eventRef); + + if (!isNarrow) + { + meters.OnGUI(false, metering); + } + + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + + DrawSeparatorLine(); + + parameterControls.OnGUI(eventRef); + } + } + + [Serializable] + private class DetailsView + { + private Texture copyIcon; + private GUIStyle textFieldNameStyle; + + private void AffirmResources() + { + if (copyIcon == null) + { + copyIcon = EditorUtils.LoadImage("CopyIcon.png"); + + textFieldNameStyle = new GUIStyle(EditorStyles.label); + textFieldNameStyle.fontStyle = FontStyle.Bold; + } + } + + public void DrawEvent(EditorEventRef selectedEvent, bool isNarrow) + { + AffirmResources(); + + DrawCopyableTextField(L10n.Tr("Full Path"), selectedEvent.Path); + + DrawTextField(L10n.Tr("Banks"), string.Join(", ", selectedEvent.Banks.Select(x => x.Name).ToArray())); + + EditorGUILayout.BeginHorizontal(); + DrawTextField(L10n.Tr("Panning"), selectedEvent.Is3D ? "3D" : "2D"); + DrawTextField(L10n.Tr("Oneshot"), selectedEvent.IsOneShot.ToString()); + + TimeSpan t = TimeSpan.FromMilliseconds(selectedEvent.Length); + DrawTextField(L10n.Tr("Length"), selectedEvent.Length > 0 ? string.Format("{0:D2}:{1:D2}:{2:D3}", t.Minutes, t.Seconds, t.Milliseconds) : "N/A"); + + if (!isNarrow) DrawTextField(L10n.Tr("Streaming"), selectedEvent.IsStream.ToString()); + EditorGUILayout.EndHorizontal(); + if (isNarrow) DrawTextField(L10n.Tr("Streaming"), selectedEvent.IsStream.ToString()); + } + + public void DrawSnapshot(EditorEventRef eventRef) + { + AffirmResources(); + + DrawCopyableTextField(L10n.Tr("Full Path"), eventRef.Path); + } + + public void DrawBank(EditorBankRef bank) + { + AffirmResources(); + + DrawCopyableTextField(L10n.Tr("Full Path"), "bank:/" + bank.Name); + + string[] SizeSuffix = { "B", "KB", "MB", "GB" }; + + GUILayout.Label(L10n.Tr("Platform Bank Sizes"), textFieldNameStyle); + + EditorGUI.indentLevel++; + + foreach (var sizeInfo in bank.FileSizes) + { + int order = 0; + long size = sizeInfo.Value; + + while (size >= 1024 && order + 1 < SizeSuffix.Length) + { + order++; + size /= 1024; + } + + EditorGUILayout.LabelField(sizeInfo.Name, string.Format("{0} {1}", size, SizeSuffix[order])); + } + + EditorGUI.indentLevel--; + } + + public void DrawParameter(EditorParamRef parameter) + { + AffirmResources(); + + DrawCopyableTextField(L10n.Tr("Name"), parameter.Name); + DrawCopyableTextField("ID", + string.Format("{{ data1 = 0x{0:x8}, data2 = 0x{1:x8} }}", parameter.ID.data1, parameter.ID.data2)); + DrawTextField(L10n.Tr("Minimum"), parameter.Min.ToString()); + DrawTextField(L10n.Tr("Maximum"), parameter.Max.ToString()); + } + + private void DrawCopyableTextField(string name, string value) + { + EditorGUILayout.BeginHorizontal(); + DrawTextField(name, value); + if (GUILayout.Button(copyIcon, GUILayout.ExpandWidth(false))) + { + EditorGUIUtility.systemCopyBuffer = value; + } + EditorGUILayout.EndHorizontal(); + } + + private void DrawTextField(string name, string content) + { + EditorGUILayout.BeginHorizontal(); + + GUILayout.Label(name, textFieldNameStyle, GUILayout.Width(75)); + GUILayout.Label(content); + + EditorGUILayout.EndHorizontal(); + } + } + + [Serializable] + private class TransportControls + { + private Texture playOff; + private Texture playOn; + private Texture stopOff; + private Texture stopOn; + private Texture openIcon; + private GUIStyle buttonStyle; + + public bool forceRepaint { get; private set; } + + public void Reset() + { + forceRepaint = false; + } + + private void AffirmResources() + { + if (playOff == null) + { + playOff = EditorUtils.LoadImage("TransportPlayButtonOff.png"); + playOn = EditorUtils.LoadImage("TransportPlayButtonOn.png"); + stopOff = EditorUtils.LoadImage("TransportStopButtonOff.png"); + stopOn = EditorUtils.LoadImage("TransportStopButtonOn.png"); + openIcon = EditorUtils.LoadImage("transportOpen.png"); + + buttonStyle = new GUIStyle(); + buttonStyle.padding.left = 4; + buttonStyle.padding.top = 10; + } + } + + public void OnGUI(EditorEventRef selectedEvent, Dictionary parameterValues) + { + AffirmResources(); + + FMOD.Studio.PLAYBACK_STATE previewState = FMOD.Studio.PLAYBACK_STATE.STOPPED; + bool paused = false; + + if (PreviewEventInstance.isValid()) + { + PreviewEventInstance.getPlaybackState(out previewState); + PreviewEventInstance.getPaused(out paused); + } + + bool playing = previewState == FMOD.Studio.PLAYBACK_STATE.PLAYING; + bool stopped = previewState == FMOD.Studio.PLAYBACK_STATE.STOPPED; + + EditorGUILayout.BeginHorizontal(); + + if (GUILayout.Button(stopped || paused ? stopOn : stopOff, buttonStyle, GUILayout.ExpandWidth(false))) + { + forceRepaint = false; + + if (paused) + { + EditorUtils.PreviewStop(PreviewEventInstance); + PreviewEventInstance.release(); + PreviewEventInstance.clearHandle(); + } + if (playing) + { + EditorUtils.PreviewPause(PreviewEventInstance); + } + } + if (GUILayout.Button(playing ? playOn : playOff, buttonStyle, GUILayout.ExpandWidth(false))) + { + if (paused) + { + EditorUtils.PreviewPause(PreviewEventInstance); + } + else + { + if (PreviewEventInstance.isValid()) + { + EditorUtils.PreviewStop(PreviewEventInstance); + } + PreviewEventInstance = EditorUtils.PreviewEvent(selectedEvent, parameterValues); + } + + forceRepaint = true; + } + if (GUILayout.Button(new GUIContent(openIcon, L10n.Tr("Show Event in FMOD Studio")), buttonStyle, GUILayout.ExpandWidth(false))) + { + string cmd = string.Format("studio.window.navigateTo(studio.project.lookup(\"{0}\"))", selectedEvent.Guid); + EditorUtils.SendScriptCommand(cmd); + } + + EditorGUILayout.EndHorizontal(); + } + } + + [Serializable] + private class Event3DPreview + { + private bool isDragging; + private Rect arenaRect; + + private Vector2 eventPosition; + private float eventDistance = 0; + private float eventOrientation = 0; + + private Texture arena; + private Texture emitter; + + public void Reset() + { + eventPosition = new Vector2(0, 0); + eventDistance = 0; + eventOrientation = 0; + } + + private void AffirmResources() + { + if (arena == null) + { + arena = EditorUtils.LoadImage("Preview.png"); + emitter = EditorUtils.LoadImage("PreviewEmitter.png"); + } + } + + public float Height + { + get + { + AffirmResources(); + return GUI.skin.label.CalcSize(new GUIContent(arena)).y; + } + } + + public void OnGUI(EditorEventRef selectedEvent) + { + AffirmResources(); + + var originalColour = GUI.color; + if (!selectedEvent.Is3D) + { + GUI.color = new Color(1.0f, 1.0f, 1.0f, 0.1f); + } + + GUILayout.Label(arena, GUILayout.ExpandWidth(false)); + + if (Event.current.type == EventType.Repaint) + { + arenaRect = GUILayoutUtility.GetLastRect(); + } + + Vector2 center = arenaRect.center; + Rect rect2 = new Rect(center.x + eventPosition.x - 6, center.y + eventPosition.y - 6, 12, 12); + GUI.DrawTexture(rect2, emitter); + + GUI.color = originalColour; + + if (selectedEvent.Is3D) + { + bool useGUIEvent = false; + + switch (Event.current.type) + { + case EventType.MouseDown: + if (arenaRect.Contains(Event.current.mousePosition)) + { + isDragging = true; + useGUIEvent = true; + } + break; + case EventType.MouseUp: + if (isDragging) + { + isDragging = false; + useGUIEvent = true; + } + break; + case EventType.MouseDrag: + if (isDragging) + { + useGUIEvent = true; + } + break; + } + + if (useGUIEvent) + { + Vector2 newPosition = Event.current.mousePosition; + Vector2 delta = newPosition - center; + + float maximumDistance = (arena.width - emitter.width) / 2; + float distance = Math.Min(delta.magnitude, maximumDistance); + + delta.Normalize(); + eventPosition = delta * distance; + eventDistance = distance / maximumDistance * selectedEvent.MaxDistance; + + float angle = Mathf.Atan2(delta.y, delta.x); + eventOrientation = angle + Mathf.PI * 0.5f; + + Event.current.Use(); + } + } + + if (PreviewEventInstance.isValid()) + { + // Listener at origin + FMOD.ATTRIBUTES_3D pos = new FMOD.ATTRIBUTES_3D(); + pos.position.x = (float)Math.Sin(eventOrientation) * eventDistance; + pos.position.y = (float)Math.Cos(eventOrientation) * eventDistance; + pos.forward.x = 1.0f; + pos.up.z = 1.0f; + PreviewEventInstance.set3DAttributes(pos); + } + } + } + + [Serializable] + private class EventParameterControls + { + [NonSerialized] + private Dictionary parameterValues = new Dictionary(); + + [NonSerialized] + private Vector2 scrollPosition; + + [NonSerialized] + private bool showGlobalParameters; + + public Dictionary ParameterValues { get { return parameterValues; } } + + public void Reset() + { + parameterValues.Clear(); + } + + public void OnGUI(EditorEventRef selectedEvent) + { + scrollPosition = GUILayout.BeginScrollView(scrollPosition, + GUILayout.Height(EditorGUIUtility.singleLineHeight * 7f)); + + foreach (EditorParamRef paramRef in selectedEvent.LocalParameters) + { + if (!parameterValues.ContainsKey(paramRef.Name)) + { + parameterValues[paramRef.Name] = paramRef.Default; + } + + CreateParamRefSlider(paramRef); + } + + showGlobalParameters = selectedEvent.GlobalParameters.Count > 0 && + EditorGUI.Foldout(EditorGUILayout.GetControlRect(), showGlobalParameters, L10n.Tr("Global Parameters")); + + foreach (EditorParamRef paramRef in selectedEvent.GlobalParameters) + { + if (!parameterValues.ContainsKey(paramRef.Name)) + { + parameterValues[paramRef.Name] = paramRef.Default; + } + + if (showGlobalParameters) + { + CreateParamRefSlider(paramRef, true); + } + } + + GUILayout.EndScrollView(); + } + + public void CreateParamRefSlider(EditorParamRef paramRef, bool isGlobal = false) + { + if (paramRef.Type == ParameterType.Labeled) + { + parameterValues[paramRef.Name] = EditorGUILayout.IntPopup( + paramRef.Name, (int)parameterValues[paramRef.Name], paramRef.Labels, null); + } + else if (paramRef.Type == ParameterType.Discrete) + { + parameterValues[paramRef.Name] = EditorGUILayout.IntSlider( + paramRef.Name, (int)parameterValues[paramRef.Name], (int)paramRef.Min, (int)paramRef.Max); + } + else + { + parameterValues[paramRef.Name] = EditorGUILayout.Slider( + paramRef.Name, parameterValues[paramRef.Name], paramRef.Min, paramRef.Max); + } + + if (isGlobal) + { + EditorUtils.System.setParameterByID(paramRef.ID, parameterValues[paramRef.Name]); + } + else + { + if (PreviewEventInstance.isValid()) + { + PreviewEventInstance.setParameterByID(paramRef.ID, parameterValues[paramRef.Name]); + } + } + } + } + + [Serializable] + private class PreviewMeters + { + private Texture meterOn; + private Texture meterOff; + + private void AffirmResources() + { + if (meterOn == null) + { + meterOn = EditorUtils.LoadImage("LevelMeter.png"); + meterOff = EditorUtils.LoadImage("LevelMeterOff.png"); + } + } + + public void OnGUI(bool minimized, float[] metering) + { + AffirmResources(); + + int meterHeight = minimized ? 86 : 128; + int meterWidth = (int)((128 / (float)meterOff.height) * meterOff.width); + + List meterPositions = meterPositionsForSpeakerMode(speakerModeForChannelCount(metering.Length), meterWidth, 2, 6); + + const int MeterCountMaximum = 16; + + int minimumWidth = meterWidth * MeterCountMaximum; + + Rect fullRect = GUILayoutUtility.GetRect(minimumWidth, meterHeight, + GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + + float baseX = fullRect.x + (fullRect.width - (meterWidth * metering.Length)) / 2; + + for(int i = 0; i < metering.Length; i++) + { + Rect meterRect = new Rect(baseX + meterPositions[i], fullRect.y, meterWidth, fullRect.height); + + GUI.DrawTexture(meterRect, meterOff); + + float db = 20.0f * Mathf.Log10(metering[i] * Mathf.Sqrt(2.0f)); + db = Mathf.Clamp(db, -80.0f, 10.0f); + float visible = 0; + int[] segmentPixels = new int[] { 0, 18, 38, 60, 89, 130, 187, 244, 300 }; + float[] segmentDB = new float[] { -80.0f, -60.0f, -50.0f, -40.0f, -30.0f, -20.0f, -10.0f, 0, 10.0f }; + int segment = 1; + while (segmentDB[segment] < db) + { + segment++; + } + visible = segmentPixels[segment - 1] + ((db - segmentDB[segment - 1]) / (segmentDB[segment] - segmentDB[segment - 1])) * (segmentPixels[segment] - segmentPixels[segment - 1]); + + visible *= fullRect.height / (float)meterOff.height; + + Rect levelPosRect = new Rect(meterRect.x, fullRect.height - visible + meterRect.y, meterWidth, visible); + Rect levelUVRect = new Rect(0, 0, 1.0f, visible / fullRect.height); + GUI.DrawTextureWithTexCoords(levelPosRect, meterOn, levelUVRect); + } + } + + private FMOD.SPEAKERMODE speakerModeForChannelCount(int channelCount) + { + switch(channelCount) + { + case 1: + return FMOD.SPEAKERMODE.MONO; + case 4: + return FMOD.SPEAKERMODE.QUAD; + case 5: + return FMOD.SPEAKERMODE.SURROUND; + case 6: + return FMOD.SPEAKERMODE._5POINT1; + case 8: + return FMOD.SPEAKERMODE._7POINT1; + case 12: + return FMOD.SPEAKERMODE._7POINT1POINT4; + default: + return FMOD.SPEAKERMODE.STEREO; + } + } + + private List meterPositionsForSpeakerMode(FMOD.SPEAKERMODE mode, float meterWidth, float groupGap, float lfeGap) + { + List offsets = new List(); + + switch(mode) + { + case FMOD.SPEAKERMODE.MONO: // M + offsets.Add(0); + break; + + case FMOD.SPEAKERMODE.STEREO: // L R + offsets.Add(0); + offsets.Add(meterWidth); + break; + + case FMOD.SPEAKERMODE.QUAD: + switch(Settings.Instance.MeterChannelOrdering) + { + case MeterChannelOrderingType.Standard: + case MeterChannelOrderingType.SeparateLFE: // L R | LS RS + offsets.Add(0); // L + offsets.Add(meterWidth*1); // R + offsets.Add(meterWidth*2 + groupGap); // LS + offsets.Add(meterWidth*3 + groupGap); // RS + break; + case MeterChannelOrderingType.Positional: // LS | L R | RS + offsets.Add(meterWidth*1 + groupGap); // L + offsets.Add(meterWidth*2 + groupGap); // R + offsets.Add(0); // LS + offsets.Add(meterWidth*3 + groupGap*2); // RS + break; + } + break; + + case FMOD.SPEAKERMODE.SURROUND: + switch(Settings.Instance.MeterChannelOrdering) + { + case MeterChannelOrderingType.Standard: + case MeterChannelOrderingType.SeparateLFE: // L R | C | LS RS + offsets.Add(0); // L + offsets.Add(meterWidth*1); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(meterWidth*3 + groupGap*2); // LS + offsets.Add(meterWidth*4 + groupGap*2); // RS + break; + case MeterChannelOrderingType.Positional: // LS | L C R | RS + offsets.Add(meterWidth*1 + groupGap); // L + offsets.Add(meterWidth*3 + groupGap); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(0); // LS + offsets.Add(meterWidth*4 + groupGap*2); // RS + break; + } + break; + + case FMOD.SPEAKERMODE._5POINT1: + switch(Settings.Instance.MeterChannelOrdering) + { + case MeterChannelOrderingType.Standard: // L R | C | LFE | LS RS + offsets.Add(0); // L + offsets.Add(meterWidth*1); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(meterWidth*3 + groupGap*2); // LFE + offsets.Add(meterWidth*4 + groupGap*3); // LS + offsets.Add(meterWidth*5 + groupGap*3); // RS + break; + case MeterChannelOrderingType.SeparateLFE: // L R | C | LS RS || LFE + offsets.Add(0); // L + offsets.Add(meterWidth*1); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(meterWidth*5 + groupGap*2 + lfeGap); // LFE + offsets.Add(meterWidth*3 + groupGap*2); // LS + offsets.Add(meterWidth*4 + groupGap*2); // RS + break; + case MeterChannelOrderingType.Positional: // LS | L C R | RS || LFE + offsets.Add(meterWidth*1 + groupGap); // L + offsets.Add(meterWidth*3 + groupGap); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(meterWidth*5 + groupGap*2 + lfeGap); // LFE + offsets.Add(0); // LS + offsets.Add(meterWidth*4 + groupGap*2); // RS + break; + } + break; + + case FMOD.SPEAKERMODE._7POINT1: + switch(Settings.Instance.MeterChannelOrdering) + { + case MeterChannelOrderingType.Standard: // L R | C | LFE | LS RS | LSR RSR + offsets.Add(0); // L + offsets.Add(meterWidth*1); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(meterWidth*3 + groupGap*2); // LFE + offsets.Add(meterWidth*4 + groupGap*3); // LS + offsets.Add(meterWidth*5 + groupGap*3); // RS + offsets.Add(meterWidth*6 + groupGap*4); // LSR + offsets.Add(meterWidth*7 + groupGap*4); // RSR + break; + case MeterChannelOrderingType.SeparateLFE: // L R | C | LS RS | LSR RSR || LFE + offsets.Add(0); // L + offsets.Add(meterWidth*1); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(meterWidth*7 + groupGap*3 + lfeGap); // LFE + offsets.Add(meterWidth*3 + groupGap*2); // LS + offsets.Add(meterWidth*4 + groupGap*2); // RS + offsets.Add(meterWidth*5 + groupGap*3); // LSR + offsets.Add(meterWidth*6 + groupGap*3); // RSR + break; + case MeterChannelOrderingType.Positional: // LSR LS | L C R | RS RSR || LFE + offsets.Add(meterWidth*2 + groupGap); // L + offsets.Add(meterWidth*4 + groupGap); // R + offsets.Add(meterWidth*3 + groupGap); // C + offsets.Add(meterWidth*7 + groupGap*2 + lfeGap); // LFE + offsets.Add(meterWidth*1); // LS + offsets.Add(meterWidth*5 + groupGap*2); // RS + offsets.Add(0); // LSR + offsets.Add(meterWidth*6 + groupGap*2); // RSR + break; + } + break; + + case FMOD.SPEAKERMODE._7POINT1POINT4: + switch(Settings.Instance.MeterChannelOrdering) + { + case MeterChannelOrderingType.Standard: // L R | C | LFE | LS RS | LSR RSR | TFL TFR TBL TBR + offsets.Add(0); // L + offsets.Add(meterWidth*1); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(meterWidth*3 + groupGap*2); // LFE + offsets.Add(meterWidth*4 + groupGap*3); // LS + offsets.Add(meterWidth*5 + groupGap*3); // RS + offsets.Add(meterWidth*6 + groupGap*4); // LSR + offsets.Add(meterWidth*7 + groupGap*4); // RSR + offsets.Add(meterWidth*8 + groupGap*5); // TFL + offsets.Add(meterWidth*9 + groupGap*5); // TFR + offsets.Add(meterWidth*10 + groupGap*5); // TBL + offsets.Add(meterWidth*11 + groupGap*5); // TBR + break; + case MeterChannelOrderingType.SeparateLFE: // L R | C | LS RS | LSR RSR | TFL TFR TBL TBR || LFE + offsets.Add(0); // L + offsets.Add(meterWidth*1); // R + offsets.Add(meterWidth*2 + groupGap); // C + offsets.Add(meterWidth*11 + groupGap*4 + lfeGap); // LFE + offsets.Add(meterWidth*3 + groupGap*2); // LS + offsets.Add(meterWidth*4 + groupGap*2); // RS + offsets.Add(meterWidth*5 + groupGap*3); // LSR + offsets.Add(meterWidth*6 + groupGap*3); // RSR + offsets.Add(meterWidth*7 + groupGap*4); // TFL + offsets.Add(meterWidth*8 + groupGap*4); // TFR + offsets.Add(meterWidth*9 + groupGap*4); // TBL + offsets.Add(meterWidth*10 + groupGap*4); // TBR + break; + case MeterChannelOrderingType.Positional: // LSR LS | L C R | RS RSR | TBL TFL TFR TBR || LFE + offsets.Add(meterWidth*2 + groupGap); // L + offsets.Add(meterWidth*4 + groupGap); // R + offsets.Add(meterWidth*3 + groupGap); // C + offsets.Add(meterWidth*11 + groupGap*3 + lfeGap); // LFE + offsets.Add(meterWidth*1); // LS + offsets.Add(meterWidth*5 + groupGap*2); // RS + offsets.Add(0); // LSR + offsets.Add(meterWidth*6 + groupGap*2); // RSR + offsets.Add(meterWidth*8 + groupGap*3); // TFL + offsets.Add(meterWidth*9 + groupGap*3); // TFR + offsets.Add(meterWidth*7 + groupGap*3); // TBL + offsets.Add(meterWidth*10 + groupGap*3); // TBR + break; + } + break; + } + + return offsets; + } + } + + [Flags] + private enum TypeFilter + { + Event = 1, + Bank = 2, + Parameter = 4, + All = Event | Bank | Parameter, + } + + public void ChooseEvent(SerializedProperty property) + { + BeginInspectorPopup(property, TypeFilter.Event); + + SerializedProperty pathProperty = property.FindPropertyRelative(L10n.Tr("Path")); + + if (!string.IsNullOrEmpty(pathProperty.stringValue)) + { + treeView.JumpToEvent(pathProperty.stringValue); + } + } + + public void ChooseBank(SerializedProperty property) + { + BeginInspectorPopup(property, TypeFilter.Bank); + + if (!string.IsNullOrEmpty(property.stringValue)) + { + treeView.JumpToBank(property.stringValue); + } + } + + public void ChooseParameter(SerializedProperty property) + { + BeginInspectorPopup(property, TypeFilter.Parameter); + } + + public void FrameEvent(string path) + { + treeView.JumpToEvent(path); + } + + private void BeginInspectorPopup(SerializedProperty property, TypeFilter typeFilter) + { + treeView.TypeFilter = typeFilter; + outputProperty = property; + searchField.SetFocus(); + treeView.DragEnabled = false; + ReadEventCache(); + } + + private void BeginStandaloneWindow() + { + treeView.TypeFilter = TypeFilter.All; + outputProperty = null; + searchField.SetFocus(); + treeView.DragEnabled = true; + isStandaloneWindow = true; + } + + public void OnEnable() + { + if (treeViewState == null) + { + treeViewState = new TreeView.State(); + } + + searchField = new SearchField(); + treeView = new TreeView(treeViewState); + + // Delay accessing the event cache as this will cause an error if window is opened on Unity start up. + EditorApplication.delayCall += () => + { + ReadEventCache(); + + searchField.downOrUpArrowKeyPressed += treeView.SetFocus; + + SceneView.duringSceneGui += SceneUpdate; + + EditorApplication.hierarchyWindowItemOnGUI += HierarchyUpdate; + + if (isStandaloneWindow) + { + EditorUtils.LoadPreviewBanks(); + } + + IsOpen = true; + Repaint(); + }; + } + + public void OnDestroy() + { + if (PreviewEventInstance.isValid()) + { + EditorUtils.PreviewStop(PreviewEventInstance); + PreviewEventInstance.clearHandle(); + } + + if (isStandaloneWindow) + { + EditorUtils.UnloadPreviewBanks(); + } + + IsOpen = false; + } + + private static bool IsDraggable(UnityEngine.Object data) + { + return data is EditorEventRef || data is EditorBankRef || data is EditorParamRef; + } + + public static bool IsDroppable(UnityEngine.Object[] data) + { + return data.Length > 0 && IsDraggable(data[0]); + } + + // This is an event handler on the hierachy view to handle dragging our objects from the browser + private void HierarchyUpdate(int instance, Rect rect) + { + if (Event.current.type == EventType.DragPerform && rect.Contains(Event.current.mousePosition)) + { + if (IsDroppable(DragAndDrop.objectReferences)) + { + UnityEngine.Object data = DragAndDrop.objectReferences[0]; + + GameObject target = EditorUtility.InstanceIDToObject(instance) as GameObject; + + if (data is EditorEventRef) + { + Undo.SetCurrentGroupName(L10n.Tr("Add Studio Event Emitter")); + + StudioEventEmitter emitter = Undo.AddComponent(target); + + EditorEventRef eventRef = data as EditorEventRef; + emitter.EventReference.Path = eventRef.Path; + emitter.EventReference.Guid = eventRef.Guid; + } + else if (data is EditorBankRef) + { + Undo.SetCurrentGroupName(L10n.Tr("Add Studio Bank Loader")); + + StudioBankLoader loader = Undo.AddComponent(target); + loader.Banks = new List(); + loader.Banks.Add((data as EditorBankRef).Name); + } + else // data is EditorParamRef + { + Undo.SetCurrentGroupName(L10n.Tr("Add Studio Global Parameter Trigger")); + + StudioGlobalParameterTrigger trigger = Undo.AddComponent(target); + trigger.Parameter = (data as EditorParamRef).Name; + } + + Selection.activeObject = target; + + Event.current.Use(); + } + } + } + + // This is an event handler on the scene view to handle dragging our objects from the browser + // and creating new gameobjects + private void SceneUpdate(SceneView sceneView) + { + if (Event.current.type == EventType.DragPerform && IsDroppable(DragAndDrop.objectReferences)) + { + UnityEngine.Object data = DragAndDrop.objectReferences[0]; + GameObject newObject; + + if (data is EditorEventRef) + { + EditorEventRef eventRef = data as EditorEventRef; + + string path = eventRef.Path; + + string name = path.Substring(path.LastIndexOf("/") + 1); + newObject = new GameObject(name + " Emitter"); + + StudioEventEmitter emitter = newObject.AddComponent(); + emitter.EventReference.Path = path; + emitter.EventReference.Guid = eventRef.Guid; + + Undo.RegisterCreatedObjectUndo(newObject, L10n.Tr("Create Studio Event Emitter")); + } + else if (data is EditorBankRef) + { + newObject = new GameObject("Studio Bank Loader"); + + StudioBankLoader loader = newObject.AddComponent(); + loader.Banks = new List(); + loader.Banks.Add((data as EditorBankRef).Name); + + Undo.RegisterCreatedObjectUndo(newObject, L10n.Tr("Create Studio Bank Loader")); + } + else // data is EditorParamRef + { + string name = (data as EditorParamRef).Name; + + newObject = new GameObject(name + " Trigger"); + + StudioGlobalParameterTrigger trigger = newObject.AddComponent(); + trigger.Parameter = name; + + Undo.RegisterCreatedObjectUndo(newObject, L10n.Tr("Create Studio Global Parameter Trigger")); + } + + Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition); + object hit = HandleUtility.RaySnap(ray); + + if (hit != null) + { + newObject.transform.position = ((RaycastHit)hit).point; + } + else + { + newObject.transform.position = ray.origin + ray.direction * 10.0f; + } + + Selection.activeObject = newObject; + Event.current.Use(); + } + else if (Event.current.type == EventType.DragUpdated && IsDroppable(DragAndDrop.objectReferences)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + Event.current.Use(); + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs.meta new file mode 100644 index 00000000..c5714f4c --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5332ad2baabb58844975479e906001c8 +timeCreated: 1432613753 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventCache.cs b/Assets/Plugins/FMOD/src/Editor/EventCache.cs new file mode 100644 index 00000000..79e6c144 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventCache.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FMODUnity +{ + public class EventCache : ScriptableObject + { + [SerializeField] + public List EditorBanks; + [SerializeField] + public List EditorEvents; + [SerializeField] + public List EditorParameters; + [SerializeField] + public List MasterBanks; + [SerializeField] + public List StringsBanks; + [SerializeField] + private Int64 cacheTime; + [SerializeField] + public int cacheVersion; + + public DateTime CacheTime + { + get { return new DateTime(cacheTime); } + set { cacheTime = value.Ticks; } + } + + public EventCache() + { + EditorBanks = new List(); + EditorEvents = new List(); + EditorParameters = new List(); + MasterBanks = new List(); + StringsBanks = new List(); + cacheTime = 0; + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EventCache.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventCache.cs.meta new file mode 100644 index 00000000..13509d0c --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventCache.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d32cf7c32a3ed8347bac48ef5ed56d82 +timeCreated: 1432775088 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventManager.cs b/Assets/Plugins/FMOD/src/Editor/EventManager.cs new file mode 100644 index 00000000..db61ceda --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventManager.cs @@ -0,0 +1,1368 @@ +using UnityEngine; +using UnityEditor; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor.Build; +using System.Reflection; +using UnityEditor.Build.Reporting; +using UnityEngine.SceneManagement; + +namespace FMODUnity +{ + [InitializeOnLoad] + public class EventManager : MonoBehaviour + { + private const string FMODLabel = "FMOD"; + + private const string AssetsFolderName = "Assets"; + + private const string CacheAssetName = "FMODStudioCache"; + public static string CacheAssetFullName = EditorUtils.WritableAssetPath(CacheAssetName); + private static EventCache eventCache; + + private const string StringBankExtension = "strings.bank"; + private const string BankExtension = "bank"; + +#if UNITY_EDITOR + [MenuItem("FMOD/Refresh Banks", priority = 1)] + public static void RefreshBanks() + { + string result = UpdateCache(); + + if (eventCache != null) + { + OnCacheChange(); + if (Settings.Instance.ImportType == ImportType.AssetBundle) + { + UpdateBankStubAssets(EditorUserBuildSettings.activeBuildTarget); + } + } + + BankRefresher.HandleBankRefresh(result); + } +#endif + + private static void ClearCache() + { + eventCache.CacheTime = DateTime.MinValue; + eventCache.EditorBanks.Clear(); + eventCache.EditorEvents.Clear(); + eventCache.EditorParameters.Clear(); + eventCache.StringsBanks.Clear(); + eventCache.MasterBanks.Clear(); + if (Settings.Instance && Settings.Instance.BanksToLoad != null) + Settings.Instance.BanksToLoad.Clear(); + } + + private static void AffirmEventCache() + { + if (eventCache == null) + { + UpdateCache(); + } + } + + private static string UpdateCache() + { + if (eventCache == null) + { + eventCache = AssetDatabase.LoadAssetAtPath(CacheAssetFullName, typeof(EventCache)) as EventCache; + + // If new libraries need to be staged, or the staging process is in progress, clear the cache and exit. + if (StagingSystem.SourceLibsExist) + { + if (eventCache != null) + { + ClearCache(); + } + return null; + } + + if (eventCache == null || eventCache.cacheVersion != FMOD.VERSION.number) + { + RuntimeUtils.DebugLog("FMOD: Event cache is missing or in an old format; creating a new instance."); + + eventCache = ScriptableObject.CreateInstance(); + eventCache.cacheVersion = FMOD.VERSION.number; + + Directory.CreateDirectory(Path.GetDirectoryName(CacheAssetFullName)); + AssetDatabase.CreateAsset(eventCache, CacheAssetFullName); + } + } + + var settings = Settings.Instance; + var editorSettings = EditorSettings.Instance; + + if (string.IsNullOrEmpty(settings.SourceBankPath)) + { + ClearCache(); + return null; + } + + string defaultBankFolder = null; + + if (!settings.HasPlatforms) + { + defaultBankFolder = settings.SourceBankPath; + } + else + { + Platform platform = editorSettings.CurrentEditorPlatform; + + if (platform == settings.DefaultPlatform) + { + platform = settings.PlayInEditorPlatform; + } + + defaultBankFolder = RuntimeUtils.GetCommonPlatformPath(Path.Combine(settings.SourceBankPath, platform.BuildDirectory)); + } + + string[] bankPlatforms = EditorUtils.GetBankPlatforms(); + string[] bankFolders = new string[bankPlatforms.Length]; + for (int i = 0; i < bankPlatforms.Length; i++) + { + bankFolders[i] = RuntimeUtils.GetCommonPlatformPath(Path.Combine(settings.SourceBankPath, bankPlatforms[i])); + } + + // Get all banks and set cache time to most recent write time + List bankFileNames = new List(Directory.GetFiles(defaultBankFolder, "*.bank", SearchOption.AllDirectories)); + DateTime lastWriteTime = bankFileNames.Max(fileName => File.GetLastWriteTime(fileName)); + + // Exit early if cache is up to date + if (lastWriteTime == eventCache.CacheTime) + { + return null; + } + + eventCache.CacheTime = lastWriteTime; + + // Remove string banks from list + bankFileNames.RemoveAll(x => x.Contains(".strings")); + + List stringBanks = new List(0); + try + { + var files = Directory.GetFiles(defaultBankFolder, "*." + StringBankExtension, SearchOption.AllDirectories); + stringBanks = new List(files); + } + catch + { + } + + // Strip out OSX resource-fork files that appear on FAT32 + stringBanks.RemoveAll((x) => Path.GetFileName(x).StartsWith("._")); + + if (stringBanks.Count == 0) + { + ClearCache(); + return string.Format("Directory {0} doesn't contain any banks.\nBuild the banks in Studio or check the path in the settings.", defaultBankFolder); + } + + // Stop editor preview so no stale data being held + EditorUtils.StopAllPreviews(); + + bool reloadPreviewBanks = EditorUtils.PreviewBanksLoaded; + if (reloadPreviewBanks) + { + EditorUtils.UnloadPreviewBanks(); + } + + List reducedStringBanksList = new List(); + HashSet stringBankGuids = new HashSet(); + + foreach (string stringBankPath in stringBanks) + { + FMOD.Studio.Bank stringBank; + EditorUtils.CheckResult(EditorUtils.System.loadBankFile(stringBankPath, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out stringBank)); + + if (!stringBank.isValid()) + { + return string.Format("{0} is not a valid bank.", stringBankPath); + } + else + { + // Unload the strings bank + stringBank.unload(); + } + + FMOD.GUID stringBankGuid; + EditorUtils.CheckResult(stringBank.getID(out stringBankGuid)); + + if (!stringBankGuids.Add(stringBankGuid)) + { + // If we encounter multiple string banks with the same GUID then only use the first. This handles the scenario where + // a Studio project is cloned and extended for DLC with a new master bank name. + continue; + } + + reducedStringBanksList.Add(stringBankPath); + } + + stringBanks = reducedStringBanksList; + + // Reload the strings banks + List loadedStringsBanks = new List(); + + bool eventRenameOccurred = false; + + try + { + AssetDatabase.StartAssetEditing(); + + eventCache.EditorBanks.ForEach((x) => x.Exists = false); + HashSet masterBankFileNames = new HashSet(); + + foreach (string stringBankPath in stringBanks) + { + FMOD.Studio.Bank stringBank; + EditorUtils.CheckResult(EditorUtils.System.loadBankFile(stringBankPath, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out stringBank)); + + if (!stringBank.isValid()) + { + ClearCache(); + return string.Format("{0} is not a valid bank.", stringBankPath); + } + + loadedStringsBanks.Add(stringBank); + + FileInfo stringBankFileInfo = new FileInfo(stringBankPath); + + string masterBankFileName = Path.GetFileName(stringBankPath).Replace(StringBankExtension, BankExtension); + masterBankFileNames.Add(masterBankFileName); + + EditorBankRef stringsBankRef = eventCache.StringsBanks.Find(x => RuntimeUtils.GetCommonPlatformPath(stringBankPath) == x.Path); + + if (stringsBankRef == null) + { + stringsBankRef = ScriptableObject.CreateInstance(); + stringsBankRef.FileSizes = new List(); + AssetDatabase.AddObjectToAsset(stringsBankRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(stringsBankRef)); + eventCache.EditorBanks.Add(stringsBankRef); + eventCache.StringsBanks.Add(stringsBankRef); + } + + stringsBankRef.SetPath(stringBankPath, defaultBankFolder); + string studioPath; + stringBank.getPath(out studioPath); + stringsBankRef.SetStudioPath(studioPath); + stringsBankRef.LastModified = stringBankFileInfo.LastWriteTime; + stringsBankRef.Exists = true; + stringsBankRef.FileSizes.Clear(); + + if (Settings.Instance.HasPlatforms) + { + for (int i = 0; i < bankPlatforms.Length; i++) + { + stringsBankRef.FileSizes.Add(new EditorBankRef.NameValuePair(bankPlatforms[i], stringBankFileInfo.Length)); + } + } + else + { + stringsBankRef.FileSizes.Add(new EditorBankRef.NameValuePair("", stringBankFileInfo.Length)); + } + } + + eventCache.EditorParameters.ForEach((x) => x.Exists = false); + + foreach (string bankFileName in bankFileNames) + { + EditorBankRef bankRef = eventCache.EditorBanks.Find((x) => RuntimeUtils.GetCommonPlatformPath(bankFileName) == x.Path); + + // New bank we've never seen before + if (bankRef == null) + { + bankRef = ScriptableObject.CreateInstance(); + AssetDatabase.AddObjectToAsset(bankRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(bankRef)); + + bankRef.SetPath(bankFileName, defaultBankFolder); + bankRef.LastModified = DateTime.MinValue; + bankRef.FileSizes = new List(); + + eventCache.EditorBanks.Add(bankRef); + } + + bankRef.Exists = true; + + FileInfo bankFileInfo = new FileInfo(bankFileName); + + // Update events from this bank if it has been modified, + // or it is a master bank (so that we get any global parameters) + if (bankRef.LastModified != bankFileInfo.LastWriteTime + || masterBankFileNames.Contains(Path.GetFileName(bankFileName))) + { + bankRef.LastModified = bankFileInfo.LastWriteTime; + UpdateCacheBank(bankRef, ref eventRenameOccurred); + } + + // Update file sizes + bankRef.FileSizes.Clear(); + if (Settings.Instance.HasPlatforms) + { + for (int i = 0; i < bankPlatforms.Length; i++) + { + string platformBankPath = RuntimeUtils.GetCommonPlatformPath(bankFolders[i] + bankFileName.Replace(defaultBankFolder, "")); + var fileInfo = new FileInfo(platformBankPath); + if (fileInfo.Exists) + { + bankRef.FileSizes.Add(new EditorBankRef.NameValuePair(bankPlatforms[i], fileInfo.Length)); + } + } + } + else + { + string platformBankPath = RuntimeUtils.GetCommonPlatformPath(Path.Combine(Settings.Instance.SourceBankPath, bankFileName)); + var fileInfo = new FileInfo(platformBankPath); + if (fileInfo.Exists) + { + bankRef.FileSizes.Add(new EditorBankRef.NameValuePair("", fileInfo.Length)); + } + } + + if (masterBankFileNames.Contains(bankFileInfo.Name)) + { + if (!eventCache.MasterBanks.Exists(x => RuntimeUtils.GetCommonPlatformPath(bankFileName) == x.Path)) + { + eventCache.MasterBanks.Add(bankRef); + } + } + } + + // Remove any stale entries from bank, event and parameter lists + eventCache.EditorBanks.FindAll((bankRef) => !bankRef.Exists).ForEach((bankRef) => + { + eventCache.EditorEvents.ForEach((eventRef) => eventRef.Banks.Remove(bankRef)); + DestroyImmediate(bankRef, true); + }); + eventCache.EditorBanks.RemoveAll((x) => x == null); + eventCache.MasterBanks.RemoveAll((x) => x == null); + eventCache.StringsBanks.RemoveAll((x) => x == null); + + eventCache.EditorEvents.FindAll((eventRef) => eventRef.Banks.Count == 0).ForEach((eventRef) => + { + eventRef.Parameters.ForEach((paramRef) => DestroyImmediate(paramRef, true)); + DestroyImmediate(eventRef, true); + }); + eventCache.EditorEvents.RemoveAll((x) => x == null); + + eventCache.EditorParameters.FindAll((paramRef) => !paramRef.Exists).ForEach((paramRef) => + { + DestroyImmediate(paramRef, true); + }); + eventCache.EditorParameters.RemoveAll((x) => x == null); + + AssetDatabase.SaveAssets(); + } + finally + { + // Unload the strings banks + loadedStringsBanks.ForEach(x => x.unload()); + AssetDatabase.StopAssetEditing(); + + if (reloadPreviewBanks) + { + EditorUtils.LoadPreviewBanks(); + } + + RuntimeUtils.DebugLog("FMOD: Cache updated."); + } + + if (eventRenameOccurred) + { + EditorApplication.delayCall += ShowEventsRenamedDialog; + } + + return null; + } + + private static void ShowEventsRenamedDialog() + { + bool runUpdater = EditorUtility.DisplayDialog("Events Renamed", + string.Format("Some events have been renamed in FMOD Studio. Do you want to run {0} " + + "to find and update any references to them?", EventReferenceUpdater.MenuPath), "Yes", "No"); + + if (runUpdater) + { + EventReferenceUpdater.ShowWindow(); + } + } + + private static void UpdateCacheBank(EditorBankRef bankRef, ref bool renameOccurred) + { + // Clear out any cached events from this bank + eventCache.EditorEvents.ForEach((x) => x.Banks.Remove(bankRef)); + + FMOD.Studio.Bank bank; + FMOD.RESULT loadResult = EditorUtils.System.loadBankFile(bankRef.Path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out bank); + + if (loadResult == FMOD.RESULT.OK) + { + // Get studio path + string studioPath; + bank.getPath(out studioPath); + bankRef.SetStudioPath(studioPath); + + // Iterate all events in the bank and cache them + FMOD.Studio.EventDescription[] eventList; + var result = bank.getEventList(out eventList); + if (result == FMOD.RESULT.OK) + { + foreach (var eventDesc in eventList) + { + string path; + result = eventDesc.getPath(out path); + + FMOD.GUID guid; + eventDesc.getID(out guid); + + EditorEventRef eventRef = eventCache.EditorEvents.Find((x) => string.Compare(x.Path, path, StringComparison.CurrentCultureIgnoreCase) == 0); + if (eventRef == null) + { + eventRef = ScriptableObject.CreateInstance(); + AssetDatabase.AddObjectToAsset(eventRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(eventRef)); + eventRef.Banks = new List(); + eventCache.EditorEvents.Add(eventRef); + eventRef.Parameters = new List(); + + if (!renameOccurred) + { + EditorEventRef eventRefByGuid = eventCache.EditorEvents.Find((x) => x.Guid == guid); + + if (eventRefByGuid != null) + { + renameOccurred = true; + } + } + } + else if (eventRef.Guid != guid) + { + renameOccurred = true; + } + + eventRef.Banks.Add(bankRef); + eventRef.Guid = guid; + eventRef.Path = eventRef.name = path; + eventDesc.is3D(out eventRef.Is3D); + eventDesc.isOneshot(out eventRef.IsOneShot); + eventDesc.isStream(out eventRef.IsStream); + eventDesc.getMinMaxDistance(out eventRef.MinDistance, out eventRef.MaxDistance); + eventDesc.getLength(out eventRef.Length); + int paramCount = 0; + eventDesc.getParameterDescriptionCount(out paramCount); + eventRef.Parameters.ForEach((x) => x.Exists = false); + for (int paramIndex = 0; paramIndex < paramCount; paramIndex++) + { + FMOD.Studio.PARAMETER_DESCRIPTION param; + eventDesc.getParameterDescriptionByIndex(paramIndex, out param); + // Skip if readonly and not global + if ((param.flags & FMOD.Studio.PARAMETER_FLAGS.READONLY) != 0 && (param.flags & FMOD.Studio.PARAMETER_FLAGS.GLOBAL) == 0) + { + continue; + } + EditorParamRef paramRef = eventRef.Parameters.Find((x) => x.ID.Equals(param.id)); + if (paramRef == null) + { + paramRef = ScriptableObject.CreateInstance(); + AssetDatabase.AddObjectToAsset(paramRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(paramRef)); + eventRef.Parameters.Add(paramRef); + } + + InitializeParamRef(paramRef, param, (labelIndex) => { + string label; + eventDesc.getParameterLabelByIndex(paramIndex, labelIndex, out label); + return label; + }); + + paramRef.name = "parameter:/" + Path.GetFileName(path) + "/" + paramRef.Name; + paramRef.Exists = true; + } + eventRef.Parameters.FindAll((x) => !x.Exists).ForEach((x) => DestroyImmediate(x, true)); + eventRef.Parameters.RemoveAll((x) => x == null); + } + } + + // Update global parameter list for each bank + FMOD.Studio.PARAMETER_DESCRIPTION[] parameterDescriptions; + result = EditorUtils.System.getParameterDescriptionList(out parameterDescriptions); + if (result == FMOD.RESULT.OK) + { + for (int i = 0; i < parameterDescriptions.Length; i++) + { + FMOD.Studio.PARAMETER_DESCRIPTION param = parameterDescriptions[i]; + if ((param.flags & FMOD.Studio.PARAMETER_FLAGS.GLOBAL) == FMOD.Studio.PARAMETER_FLAGS.GLOBAL) + { + EditorParamRef paramRef = eventCache.EditorParameters.Find((x) => x.ID.Equals(param.id)); + if (paramRef == null) + { + paramRef = ScriptableObject.CreateInstance(); + AssetDatabase.AddObjectToAsset(paramRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(paramRef)); + eventCache.EditorParameters.Add(paramRef); + } + + InitializeParamRef(paramRef, param, (index) => { + string label; + EditorUtils.System.getParameterLabelByID(param.id, index, out label); + return label; + }); + + paramRef.name = "parameter:/" + param.name; + EditorUtils.System.lookupPath(param.guid, out paramRef.StudioPath); + paramRef.Exists = true; + } + } + } + bank.unload(); + } + else + { + RuntimeUtils.DebugLogError(string.Format("FMOD Studio: Unable to load {0}: {1}", bankRef.Name, FMOD.Error.String(loadResult))); + eventCache.CacheTime = DateTime.MinValue; + } + } + + private static void InitializeParamRef(EditorParamRef paramRef, FMOD.Studio.PARAMETER_DESCRIPTION description, + Func getLabel) + { + paramRef.Name = description.name; + paramRef.Min = description.minimum; + paramRef.Max = description.maximum; + paramRef.Default = description.defaultvalue; + paramRef.ID = description.id; + paramRef.IsGlobal = (description.flags & FMOD.Studio.PARAMETER_FLAGS.GLOBAL) != 0; + + if ((description.flags & FMOD.Studio.PARAMETER_FLAGS.LABELED) != 0) + { + paramRef.Type = ParameterType.Labeled; + paramRef.Labels = GetParameterLabels(description, getLabel); + } + else if ((description.flags & FMOD.Studio.PARAMETER_FLAGS.DISCRETE) != 0) + { + paramRef.Type = ParameterType.Discrete; + } + else + { + paramRef.Type = ParameterType.Continuous; + } + } + + private static string[] GetParameterLabels(FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription, + Func getLabel) + { + string[] labels = new string[(int)parameterDescription.maximum + 1]; + + for (int i = 0; i <= parameterDescription.maximum; ++i) + { + labels[i] = getLabel(i); + } + + return labels; + } + + static EventManager() + { + BuildStatusWatcher.OnBuildStarted += () => { + BuildTargetChanged(); + CopyToStreamingAssets(EditorUserBuildSettings.activeBuildTarget); + }; + BuildStatusWatcher.OnBuildEnded += () => { + UpdateBankStubAssets(EditorUserBuildSettings.activeBuildTarget); + }; + } + + public static void Startup() + { + EventReference.GuidLookupDelegate = (path) => { + EditorEventRef editorEventRef = EventFromPath(path); + + return (editorEventRef != null) ? editorEventRef.Guid : new FMOD.GUID(); + }; + + // Avoid throwing exceptions so we don't stop other startup code from running + try + { + RefreshBanks(); + } + catch (Exception e) + { + RuntimeUtils.DebugLogException(e); + } + } + + public static void ValidateEventReferences(Scene scene) + { + foreach (GameObject gameObject in scene.GetRootGameObjects()) + { + MonoBehaviour[] behaviours = gameObject.GetComponentsInChildren(true); + + foreach (MonoBehaviour behaviour in behaviours) + { + if (behaviour != null) + { + if (behaviour is StudioEventEmitter) + { + ValidateEventEmitter(behaviour as StudioEventEmitter, scene); + } + else + { + ValidateEventReferenceFields(behaviour, scene); + } + } + } + } + } + + private static readonly string UpdaterInstructions = + string.Format("Please run {0} to resolve this issue.", EventReferenceUpdater.MenuPath); + + private static void ValidateEventEmitter(StudioEventEmitter emitter, Scene scene) + { +#pragma warning disable 0618 // Suppress a warning about using the obsolete StudioEventEmitter.Event field + if (!string.IsNullOrEmpty(emitter.Event)) +#pragma warning restore 0618 + { + RuntimeUtils.DebugLogWarningFormat("FMOD: A Studio Event Emitter in scene '{0}' on GameObject '{1}' is using the " + + "obsolete Event field. {2}", + scene.name, EditorUtils.GameObjectPath(emitter), UpdaterInstructions); + } + + bool changed; + if (!ValidateEventReference(ref emitter.EventReference, emitter, scene, out changed)) + { + RuntimeUtils.DebugLogWarningFormat( + "FMOD: A Studio Event Emitter in scene '{0}' on GameObject '{1}' has an invalid event reference: {2}", + scene.name, EditorUtils.GameObjectPath(emitter), emitter.EventReference); + } + } + + private static void ValidateEventReferenceFields(MonoBehaviour behaviour, Scene scene) + { + Type type = behaviour.GetType(); + + FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + + foreach (FieldInfo field in fields) + { +#pragma warning disable 0618 // Suppress a warning about using the obsolete EventRefAttribute class + if (EditorUtils.HasAttribute(field)) +#pragma warning restore 0618 + { + RuntimeUtils.DebugLogWarningFormat("FMOD: A component of type {0} in scene '{1}' on GameObject '{2}' has an " + + "obsolete [EventRef] attribute on field {3}. {4}", + type.Name, scene.name, EditorUtils.GameObjectPath(behaviour), field.Name, + UpdaterInstructions); + } + else if (field.FieldType == typeof(EventReference)) + { + EventReference eventReference = (EventReference)field.GetValue(behaviour); + + bool changed; + if (!ValidateEventReference(ref eventReference, behaviour, scene, out changed)) + { + RuntimeUtils.DebugLogWarningFormat( + "FMOD: A component of type {0} in scene '{1}' on GameObject '{2}' has an " + + "invalid event reference in field '{3}': {4}", + type.Name, scene.name, EditorUtils.GameObjectPath(behaviour), field.Name, eventReference); + } + + if (changed) + { + field.SetValue(behaviour, eventReference); + } + } + } + } + + // Returns true if eventReference is valid, sets changed if eventReference was changed + private static bool ValidateEventReference(ref EventReference eventReference, + Component parent, Scene scene, out bool changed) + { + changed = false; + + if (eventReference.IsNull) + { + return true; + } + + EditorEventRef editorEventRef; + + EventLinkage eventLinkage = GetEventLinkage(eventReference); + + if (eventLinkage == EventLinkage.GUID) + { + editorEventRef = EventFromGUID(eventReference.Guid); + + if (editorEventRef == null) + { + return false; + } + + if (eventReference.Path != editorEventRef.Path) + { + RuntimeUtils.DebugLogWarningFormat( + "FMOD: EventReference path '{0}' doesn't match GUID {1} on object '{2}' in scene '{3}'. {4}", + eventReference.Path, eventReference.Guid, EditorUtils.GameObjectPath(parent), scene.name, + UpdaterInstructions); + } + + return true; + } + else if (eventLinkage == EventLinkage.Path) + { + editorEventRef = EventFromPath(eventReference.Path); + + if (editorEventRef == null) + { + return false; + } + + if (eventReference.Guid != editorEventRef.Guid) + { + RuntimeUtils.DebugLogWarningFormat( + "FMOD: Changing EventReference GUID to {0} to match path '{1}' on object '{2}' in scene '{3}'. {4}", + editorEventRef.Guid, eventReference.Path, EditorUtils.GameObjectPath(parent), scene.name, + UpdaterInstructions); + + eventReference.Guid = editorEventRef.Guid; + EditorUtility.SetDirty(parent); + + changed = true; + } + + return true; + } + else + { + throw new NotSupportedException("Unrecognized EventLinkage: " + eventLinkage); + } + } + + public static void CopyToStreamingAssets(BuildTarget buildTarget) + { + if (Settings.Instance.ImportType == ImportType.AssetBundle && BuildPipeline.isBuildingPlayer) + { + return; + } + + if (string.IsNullOrEmpty(Settings.Instance.SourceBankPath)) + return; + + Platform platform = EditorSettings.Instance.GetPlatform(buildTarget); + + if (platform == Settings.Instance.DefaultPlatform) + { + RuntimeUtils.DebugLogWarningFormat("FMOD Studio: copy banks for platform {0} : Unsupported platform", buildTarget); + return; + } + + string bankTargetFolder = + Settings.Instance.ImportType == ImportType.StreamingAssets + ? Settings.Instance.TargetPath + : Application.dataPath + (string.IsNullOrEmpty(Settings.Instance.TargetAssetPath) ? "" : '/' + Settings.Instance.TargetAssetPath); + bankTargetFolder = RuntimeUtils.GetCommonPlatformPath(bankTargetFolder); + Directory.CreateDirectory(bankTargetFolder); + + string bankTargetExtension = + Settings.Instance.ImportType == ImportType.StreamingAssets + ? ".bank" + : ".bytes"; + + string bankSourceFolder = + Settings.Instance.HasPlatforms + ? Settings.Instance.SourceBankPath + '/' + platform.BuildDirectory + : Settings.Instance.SourceBankPath; + bankSourceFolder = RuntimeUtils.GetCommonPlatformPath(bankSourceFolder); + + if (Path.GetFullPath(bankTargetFolder).TrimEnd('/').ToUpperInvariant() == + Path.GetFullPath(bankSourceFolder).TrimEnd('/').ToUpperInvariant()) + { + return; + } + + bool madeChanges = false; + + try + { + // Clean out any stale .bank files + string[] existingBankFiles = + Directory.GetFiles(bankTargetFolder, "*" + bankTargetExtension, SearchOption.AllDirectories); + + foreach (string bankFilePath in existingBankFiles) + { + string bankName = EditorBankRef.CalculateName(bankFilePath, bankTargetFolder); + + if (!eventCache.EditorBanks.Exists(x => x.Name == bankName)) + { + string assetPath = bankFilePath.Replace(Application.dataPath, AssetsFolderName); + + if (AssetHasLabel(assetPath, FMODLabel)) + { + AssetDatabase.MoveAssetToTrash(assetPath); + madeChanges = true; + } + } + } + + // Copy over any files that don't match timestamp or size or don't exist + AssetDatabase.StartAssetEditing(); + foreach (var bankRef in eventCache.EditorBanks) + { + string sourcePath = bankSourceFolder + "/" + bankRef.Name + ".bank"; + string targetPathRelative = bankRef.Name + bankTargetExtension; + string targetPathFull = bankTargetFolder + "/" + targetPathRelative; + + FileInfo sourceInfo = new FileInfo(sourcePath); + FileInfo targetInfo = new FileInfo(targetPathFull); + + if (!targetInfo.Exists || + sourceInfo.Length != targetInfo.Length || + sourceInfo.LastWriteTime != targetInfo.LastWriteTime) + { + if (targetInfo.Exists) + { + targetInfo.IsReadOnly = false; + } + else + { + EnsureFoldersExist(targetPathRelative, bankTargetFolder); + } + + File.Copy(sourcePath, targetPathFull, true); + targetInfo = new FileInfo(targetPathFull); + targetInfo.IsReadOnly = false; + targetInfo.LastWriteTime = sourceInfo.LastWriteTime; + + madeChanges = true; + + string assetString = targetPathFull.Replace(Application.dataPath, "Assets"); + AssetDatabase.ImportAsset(assetString); + UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath(assetString); + AssetDatabase.SetLabels(obj, new string[] { FMODLabel }); + } + } + + RemoveEmptyFMODFolders(bankTargetFolder); + } + catch (Exception exception) + { + RuntimeUtils.DebugLogErrorFormat("FMOD Studio: copy banks for platform {0} : copying banks from {1} to {2}", + platform.DisplayName, bankSourceFolder, bankTargetFolder); + RuntimeUtils.DebugLogException(exception); + return; + } + finally + { + AssetDatabase.StopAssetEditing(); + } + + if (madeChanges) + { + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + RuntimeUtils.DebugLogFormat("FMOD Studio: copy banks for platform {0} : copying banks from {1} to {2} succeeded", + platform.DisplayName, bankSourceFolder, bankTargetFolder); + } + } + + public static void UpdateBankStubAssets(BuildTarget buildTarget) + { + if (Settings.Instance.ImportType != ImportType.AssetBundle + || string.IsNullOrEmpty(Settings.Instance.SourceBankPath)) + { + return; + } + + Platform platform = EditorSettings.Instance.GetPlatform(buildTarget); + + if (platform == Settings.Instance.DefaultPlatform) + { + Debug.LogWarningFormat("FMOD: Updating bank stubs: Unsupported platform {0}", buildTarget); + return; + } + + string bankTargetFolder = Application.dataPath; + + if (!string.IsNullOrEmpty(Settings.Instance.TargetAssetPath)) + { + bankTargetFolder += "/" + Settings.Instance.TargetAssetPath; + } + + bankTargetFolder = RuntimeUtils.GetCommonPlatformPath(bankTargetFolder); + + string bankSourceFolder = Settings.Instance.SourceBankPath; + + if (Settings.Instance.HasPlatforms) + { + bankSourceFolder += "/" + platform.BuildDirectory; + } + + bankSourceFolder = RuntimeUtils.GetCommonPlatformPath(bankSourceFolder); + + if (Path.GetFullPath(bankTargetFolder).TrimEnd('/').ToUpperInvariant() == + Path.GetFullPath(bankSourceFolder).TrimEnd('/').ToUpperInvariant()) + { + return; + } + + bool madeChanges = false; + + Directory.CreateDirectory(bankTargetFolder); + + try + { + const string BankAssetExtension = ".bytes"; + + // Clean out any stale stubs + string[] existingBankFiles = + Directory.GetFiles(bankTargetFolder, "*" + BankAssetExtension, SearchOption.AllDirectories); + + foreach (string bankFilePath in existingBankFiles) + { + string bankName = EditorBankRef.CalculateName(bankFilePath, bankTargetFolder); + + if (!eventCache.EditorBanks.Exists(x => x.Name == bankName)) + { + string assetPath = bankFilePath.Replace(Application.dataPath, AssetsFolderName); + + if (AssetHasLabel(assetPath, FMODLabel)) + { + AssetDatabase.MoveAssetToTrash(assetPath); + madeChanges = true; + } + } + } + + // Create any stubs that don't exist, and ensure any that do exist have the correct data + AssetDatabase.StartAssetEditing(); + foreach (var bankRef in eventCache.EditorBanks) + { + string sourcePath = bankSourceFolder + "/" + bankRef.Name + ".bank"; + string targetPathRelative = bankRef.Name + BankAssetExtension; + string targetPathFull = bankTargetFolder + "/" + targetPathRelative; + + EnsureFoldersExist(targetPathRelative, bankTargetFolder); + + FileInfo targetInfo = new FileInfo(targetPathFull); + + string stubData = RuntimeManager.BankStubPrefix + bankRef.Name; + + // Minimise asset database refreshing by only writing the stub if necessary + bool writeStub; + + if (targetInfo.Exists && targetInfo.Length == stubData.Length) + { + using (StreamReader reader = targetInfo.OpenText()) + { + string contents = reader.ReadToEnd(); + writeStub = (contents != stubData); + } + } + else + { + writeStub = true; + } + + if (writeStub) + { + // Create or update the stub + using (StreamWriter writer = targetInfo.CreateText()) + { + writer.Write(stubData); + } + + madeChanges = true; + + if (!targetInfo.Exists) + { + string assetPath = targetPathFull.Replace(Application.dataPath, "Assets"); + AssetDatabase.ImportAsset(assetPath); + + UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath(assetPath); + AssetDatabase.SetLabels(obj, new string[] { FMODLabel }); + } + } + } + RemoveEmptyFMODFolders(bankTargetFolder); + } + catch (Exception exception) + { + Debug.LogErrorFormat("FMOD: Updating bank stubs in {0} to match {1}", + bankTargetFolder, bankSourceFolder); + Debug.LogException(exception); + return; + } + finally + { + AssetDatabase.StopAssetEditing(); + } + + if (madeChanges) + { + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + Debug.LogFormat("FMOD: Updated bank stubs in {0} to match {1}", bankTargetFolder, bankSourceFolder); + } + } + + private static void EnsureFoldersExist(string filePath, string basePath) + { + string dataPath = Application.dataPath + "/"; + + if (!basePath.StartsWith(dataPath)) + { + throw new ArgumentException( + string.Format("Base path {0} is not within the Assets folder", basePath), "basePath"); + } + + int lastSlash = filePath.LastIndexOf('/'); + + if (lastSlash == -1) + { + // No folders + return; + } + + string assetString = filePath.Substring(0, lastSlash); + + string[] folders = assetString.Split('/'); + string parentFolder = "Assets/" + basePath.Substring(dataPath.Length); + + for (int i = 0; i < folders.Length; ++i) + { + string folderPath = parentFolder + "/" + folders[i]; + + if (!AssetDatabase.IsValidFolder(folderPath)) + { + AssetDatabase.CreateFolder(parentFolder, folders[i]); + + var folder = AssetDatabase.LoadAssetAtPath(folderPath); + AssetDatabase.SetLabels(folder, new string[] { FMODLabel }); + } + + parentFolder = folderPath; + } + } + + private static void BuildTargetChanged() + { + RefreshBanks(); +#if UNITY_ANDROID +#if UNITY_2023_1_OR_NEWER + Settings.Instance.AndroidUseOBB = PlayerSettings.Android.splitApplicationBinary; +#else + Settings.Instance.AndroidUseOBB = PlayerSettings.Android.useAPKExpansionFiles; +#endif //UNITY_2023_1_OR_NEWER +#endif //UNITY_ANDROID + } + + private static void OnCacheChange() + { + List masterBanks = new List(); + List banks = new List(); + + var settings = Settings.Instance; + bool hasChanged = false; + + foreach (EditorBankRef bankRef in eventCache.MasterBanks) + { + masterBanks.Add(bankRef.Name); + } + + if (!CompareLists(masterBanks, settings.MasterBanks)) + { + settings.MasterBanks.Clear(); + settings.MasterBanks.AddRange(masterBanks); + hasChanged = true; + } + + foreach (var bankRef in eventCache.EditorBanks) + { + if (!eventCache.MasterBanks.Contains(bankRef) && + !eventCache.StringsBanks.Contains(bankRef)) + { + banks.Add(bankRef.Name); + } + } + banks.Sort((a, b) => string.Compare(a, b, StringComparison.CurrentCultureIgnoreCase)); + + if (!CompareLists(banks, settings.Banks)) + { + settings.Banks.Clear(); + settings.Banks.AddRange(banks); + hasChanged = true; + } + + if (hasChanged) + { + EditorUtility.SetDirty(settings); + } + } + + public static DateTime CacheTime + { + get + { + if (eventCache != null) + { + return eventCache.CacheTime; + } + else + { + return DateTime.MinValue; + } + } + } + + public static List Events + { + get + { + AffirmEventCache(); + return eventCache.EditorEvents; + } + } + + public static List Banks + { + get + { + AffirmEventCache(); + return eventCache.EditorBanks; + } + } + + public static List Parameters + { + get + { + AffirmEventCache(); + return eventCache.EditorParameters; + } + } + + public static List MasterBanks + { + get + { + AffirmEventCache(); + return eventCache.MasterBanks; + } + } + + public static bool IsLoaded + { + get + { + return Settings.Instance.SourceBankPath != null; + } + } + + public static bool IsValid + { + get + { + AffirmEventCache(); + return eventCache.CacheTime != DateTime.MinValue; + } + } + + public static bool IsInitialized + { + get + { + return eventCache != null; + } + } + + public static EventLinkage GetEventLinkage(EventReference eventReference) + { + if (Settings.Instance.EventLinkage == EventLinkage.Path) + { + if (string.IsNullOrEmpty(eventReference.Path) && !eventReference.Guid.IsNull) + { + return EventLinkage.GUID; + } + else + { + return EventLinkage.Path; + } + } + else // Assume EventLinkage.GUID + { + if (eventReference.Guid.IsNull && !string.IsNullOrEmpty(eventReference.Path)) + { + return EventLinkage.Path; + } + else + { + return EventLinkage.GUID; + } + } + } + + public static EditorEventRef EventFromPath(string pathOrGuid) + { + EditorEventRef eventRef; + if (pathOrGuid.StartsWith("{")) + { + eventRef = EventFromGUID(FMOD.GUID.Parse(pathOrGuid)); + } + else + { + eventRef = EventFromString(pathOrGuid); + } + return eventRef; + } + + public static EditorEventRef EventFromString(string path) + { + AffirmEventCache(); + return eventCache.EditorEvents.Find((x) => x.Path.Equals(path, StringComparison.CurrentCultureIgnoreCase)); + } + + public static EditorEventRef EventFromGUID(FMOD.GUID guid) + { + AffirmEventCache(); + return eventCache.EditorEvents.Find((x) => x.Guid == guid); + } + + public static EditorParamRef ParamFromPath(string name) + { + AffirmEventCache(); + return eventCache.EditorParameters.Find((x) => x.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)); + } + + public class ActiveBuildTargetListener : IActiveBuildTargetChanged + { + public int callbackOrder{ get { return 0; } } + public void OnActiveBuildTargetChanged(BuildTarget previousTarget, BuildTarget newTarget) + { + BuildTargetChanged(); + } + } + + public class PreprocessScene : IProcessSceneWithReport + { + public int callbackOrder { get { return 0; } } + + public void OnProcessScene(Scene scene, BuildReport report) + { + if (report == null) return; + + ValidateEventReferences(scene); + } + } + + private static bool CompareLists(List tempBanks, List banks) + { + if (tempBanks.Count != banks.Count) + return false; + + for (int i = 0; i < tempBanks.Count; i++) + { + if (tempBanks[i] != banks[i]) + return false; + } + return true; + } + + private static bool AssetHasLabel(string assetPath, string label) + { + UnityEngine.Object asset = AssetDatabase.LoadAssetAtPath(assetPath); + string[] labels = AssetDatabase.GetLabels(asset); + + return labels.Contains(label); + } + + public static void RemoveBanks(string basePath) + { + if (!Directory.Exists(basePath)) + { + return; + } + + string[] filePaths = Directory.GetFiles(basePath, "*", SearchOption.AllDirectories); + + foreach (string filePath in filePaths) + { + if (!filePath.EndsWith(".meta")) + { + string assetPath = filePath.Replace(Application.dataPath, AssetsFolderName); + + if (AssetHasLabel(assetPath, FMODLabel)) + { + AssetDatabase.MoveAssetToTrash(assetPath); + } + } + } + + RemoveEmptyFMODFolders(basePath); + + if (Directory.GetFileSystemEntries(basePath).Length == 0) + { + string baseFolder = basePath.Replace(Application.dataPath, AssetsFolderName); + AssetDatabase.MoveAssetToTrash(baseFolder); + } + } + + public static void MoveBanks(string from, string to) + { + if (!Directory.Exists(from)) + { + return; + } + + if (!Directory.Exists(to)) + { + Directory.CreateDirectory(to); + } + + string[] oldBankFiles = Directory.GetFiles(from); + + foreach (var oldBankFileName in oldBankFiles) + { + if (oldBankFileName.EndsWith(".meta")) + continue; + string assetString = oldBankFileName.Replace(Application.dataPath, "Assets"); + AssetDatabase.ImportAsset(assetString); + UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath(assetString); + string[] labels = AssetDatabase.GetLabels(obj); + foreach (string label in labels) + { + if (label.Equals("FMOD")) + { + AssetDatabase.MoveAsset(assetString, to); + break; + } + } + } + if (Directory.GetFiles(Path.GetDirectoryName(oldBankFiles[0])).Length == 0) + { + Directory.Delete(Path.GetDirectoryName(oldBankFiles[0])); + } + } + + public static void RemoveEmptyFMODFolders(string basePath) + { + string[] folderPaths = Directory.GetDirectories(basePath, "*", SearchOption.AllDirectories); + + // Process longest paths first so parent folders are cleared out when we get to them + Array.Sort(folderPaths, (a, b) => b.Length.CompareTo(a.Length)); + + foreach (string folderPath in folderPaths) + { + string assetPath = folderPath.Replace(Application.dataPath, AssetsFolderName); + + if (AssetHasLabel(assetPath, FMODLabel) && Directory.GetFileSystemEntries(folderPath).Length == 0) + { + AssetDatabase.MoveAssetToTrash(assetPath); + } + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EventManager.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventManager.cs.meta new file mode 100644 index 00000000..965dcb31 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1fc38201a5edb994c874a4a61e96053b +timeCreated: 1432600216 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs b/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs new file mode 100644 index 00000000..7e6ccbcb --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs @@ -0,0 +1,499 @@ +using System; +using System.Linq; +using System.Text; +using UnityEngine; +using UnityEditor; + +namespace FMODUnity +{ + [CustomPropertyDrawer(typeof(EventReference))] + public class EventReferenceDrawer : PropertyDrawer + { + private static readonly Texture RepairIcon = EditorUtils.LoadImage("Wrench.png"); + private static readonly Texture WarningIcon = EditorUtils.LoadImage("NotFound.png"); + private static readonly GUIContent NotFoundWarning = new GUIContent(L10n.Tr("Event Not Found"), WarningIcon); + + private static GUIStyle buttonStyle; + + private static Vector2 WarningSize() + { + return GUI.skin.label.CalcSize(NotFoundWarning); + } + + private static float GetBaseHeight() + { + return GUI.skin.textField.CalcSize(GUIContent.none).y; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + if (buttonStyle == null) + { + buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.padding.top = 1; + buttonStyle.padding.bottom = 1; + } + + Texture browseIcon = EditorUtils.LoadImage("SearchIconBlack.png"); + Texture openIcon = EditorUtils.LoadImage("BrowserIcon.png"); + Texture addIcon = EditorUtils.LoadImage("AddIcon.png"); + Texture copyIcon = EditorUtils.LoadImage("CopyIcon.png"); + + using (new EditorGUI.PropertyScope(position, label, property)) + { + HandleDragEvents(position, property); + + EventReference eventReference = property.GetEventReference(); + EditorEventRef editorEventRef = GetEditorEventRef(eventReference); + + float baseHeight = GetBaseHeight(); + + Rect headerRect = position; + headerRect.width = EditorGUIUtility.labelWidth; + headerRect.height = baseHeight; + + property.isExpanded = EditorGUI.Foldout(headerRect, property.isExpanded, label, true); + + Rect addRect = new Rect(position.xMax - addIcon.width - 7, position.y, addIcon.width + 7, baseHeight); + Rect openRect = new Rect(addRect.x - openIcon.width - 7, position.y, openIcon.width + 6, baseHeight); + Rect searchRect = new Rect(openRect.x - browseIcon.width - 9, position.y, browseIcon.width + 8, baseHeight); + Rect pathRect = position; + pathRect.xMin = headerRect.xMax; + pathRect.xMax = searchRect.x - 3; + pathRect.height = baseHeight; + + SerializedProperty pathProperty = GetPathProperty(property); + + using (var scope = new EditorGUI.ChangeCheckScope()) + { + EditorGUI.PropertyField(pathRect, pathProperty, GUIContent.none); + + if (scope.changed) + { + SetEvent(property, pathProperty.stringValue); + } + } + + if (GUI.Button(searchRect, new GUIContent(browseIcon, L10n.Tr("Search")), buttonStyle)) + { + var eventBrowser = ScriptableObject.CreateInstance(); + + eventBrowser.ChooseEvent(property); + var windowRect = position; + windowRect.xMin = pathRect.xMin; + windowRect.position = GUIUtility.GUIToScreenPoint(windowRect.position); + windowRect.height = openRect.height + 1; + windowRect.width = Mathf.Max(windowRect.width, 300f); + eventBrowser.ShowAsDropDown(windowRect, new Vector2(windowRect.width, 400)); + + } + if (GUI.Button(addRect, new GUIContent(addIcon, L10n.Tr("Create New Event in Studio")), buttonStyle)) + { + var addDropdown = EditorWindow.CreateInstance(); + + addDropdown.SelectEvent(property); + var windowRect = position; + windowRect.xMin = pathRect.xMin; + windowRect.position = GUIUtility.GUIToScreenPoint(windowRect.position); + windowRect.height = openRect.height + 1; + windowRect.width = Mathf.Max(windowRect.width, 300f); + addDropdown.ShowAsDropDown(windowRect, new Vector2(windowRect.width, 500)); + + } + if (GUI.Button(openRect, new GUIContent(openIcon, L10n.Tr("Open In Browser")), buttonStyle)) + { + EventBrowser.ShowWindow(); + EventBrowser eventBrowser = EditorWindow.GetWindow(); + eventBrowser.FrameEvent(pathProperty.stringValue); + } + + if (editorEventRef != null) + { + float labelY = headerRect.y + baseHeight; + + MismatchInfo mismatch = GetMismatch(eventReference, editorEventRef); + + if (mismatch != null) + { + Rect warningRect = pathRect; + warningRect.xMax = position.xMax; + warningRect.y = labelY; + warningRect.height = WarningSize().y; + + DrawMismatchUI(warningRect, openRect.x, openRect.width, mismatch, property); + + labelY = warningRect.yMax; + } + + if (property.isExpanded) + { + using (new EditorGUI.IndentLevelScope()) + { + Rect labelRect = EditorGUI.IndentedRect(headerRect); + labelRect.y = labelY; + + Rect valueRect = labelRect; + valueRect.xMin = labelRect.xMax; + valueRect.xMax = position.xMax - copyIcon.width - 7; + + GUI.Label(labelRect, new GUIContent("GUID")); + GUI.Label(valueRect, eventReference.Guid.ToString()); + + Rect copyRect = valueRect; + copyRect.xMin = valueRect.xMax; + copyRect.xMax = position.xMax; + + if (GUI.Button(copyRect, new GUIContent(copyIcon, L10n.Tr("Copy To Clipboard")))) + { + EditorGUIUtility.systemCopyBuffer = eventReference.Guid.ToString(); + } + + valueRect.xMax = position.xMax; + + labelRect.y += baseHeight; + valueRect.y += baseHeight; + + GUI.Label(labelRect, new GUIContent(L10n.Tr("Banks"))); + GUI.Label(valueRect, string.Join(", ", editorEventRef.Banks.Select(x => x.Name).ToArray())); + labelRect.y += baseHeight; + valueRect.y += baseHeight; + + GUI.Label(labelRect, new GUIContent(L10n.Tr("Panning"))); + GUI.Label(valueRect, editorEventRef.Is3D ? "3D" : "2D"); + labelRect.y += baseHeight; + valueRect.y += baseHeight; + + GUI.Label(labelRect, new GUIContent(L10n.Tr("Stream"))); + GUI.Label(valueRect, editorEventRef.IsStream.ToString()); + labelRect.y += baseHeight; + valueRect.y += baseHeight; + + GUI.Label(labelRect, new GUIContent(L10n.Tr("Oneshot"))); + GUI.Label(valueRect, editorEventRef.IsOneShot.ToString()); + labelRect.y += baseHeight; + valueRect.y += baseHeight; + } + } + } + else + { + EditorEventRef renamedEvent = GetRenamedEventRef(eventReference); + + if (renamedEvent != null) + { + MismatchInfo mismatch = new MismatchInfo() { + Message = string.Format(L10n.Tr("Moved to {0}"), renamedEvent.Path), + HelpText = string.Format( + L10n.Tr("This event has been moved in FMOD Studio.\nYou can click the repair button to update the path to the new location, or run the {0} command to scan your project for similar issues and fix them all."), + EventReferenceUpdater.MenuPath), + RepairTooltip = string.Format(L10n.Tr("Repair: set path to {0}"), renamedEvent.Path), + RepairAction = (p) => { + p.FindPropertyRelative("Path").stringValue = renamedEvent.Path; + }, + }; + + using (new EditorGUI.IndentLevelScope()) + { + Rect mismatchRect = pathRect; + + mismatchRect.xMin = position.xMin; + mismatchRect.xMax = position.xMax; + mismatchRect.y += baseHeight; + mismatchRect.height = baseHeight; + + mismatchRect = EditorGUI.IndentedRect(mismatchRect); + + DrawMismatchUI(mismatchRect, openRect.x, openRect.width, mismatch, property); + } + } + else + { + Rect labelRect = pathRect; + labelRect.xMax = position.xMax; + labelRect.y += baseHeight; + labelRect.height = WarningSize().y; + + GUI.Label(labelRect, NotFoundWarning); + } + } + } + } + + private static void HandleDragEvents(Rect position, SerializedProperty property) + { + Event e = Event.current; + + if (e.type == EventType.DragPerform && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef)) + { + EditorEventRef eventRef = DragAndDrop.objectReferences[0] as EditorEventRef; + + property.SetEventReference(eventRef.Guid, eventRef.Path); + + GUI.changed = true; + e.Use(); + } + } + + if (e.type == EventType.DragUpdated && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + } + + private class MismatchInfo + { + public string Message; + public string HelpText; + public string RepairTooltip; + public Action RepairAction; + } + + private static void DrawMismatchUI(Rect rect, float repairButtonX, float repairButtonWidth, + MismatchInfo mismatch, SerializedProperty property) + { + rect = EditorUtils.DrawHelpButton(rect, () => new SimpleHelp(mismatch.HelpText, 400)); + + Rect repairRect = new Rect(repairButtonX, rect.y, repairButtonWidth, GetBaseHeight()); + + if (GUI.Button(repairRect, new GUIContent(RepairIcon, mismatch.RepairTooltip), buttonStyle)) + { + mismatch.RepairAction(property); + } + + Rect labelRect = rect; + labelRect.xMax = repairRect.xMin; + + GUI.Label(labelRect, new GUIContent(mismatch.Message, WarningIcon)); + } + + private static MismatchInfo GetMismatch(EventReference eventReference, EditorEventRef editorEventRef) + { + if (EventManager.GetEventLinkage(eventReference) == EventLinkage.Path) + { + if (eventReference.Guid != editorEventRef.Guid) + { + return new MismatchInfo() { + Message = L10n.Tr("GUID doesn't match path"), + HelpText = string.Format( + L10n.Tr("The GUID on this EventReference doesn't match the path.\nYou can click the repair button to update the GUID to match the path, or run the {0} command to scan your project for similar issues and fix them all."), + EventReferenceUpdater.MenuPath), + RepairTooltip = string.Format(L10n.Tr("Repair: set GUID to {0}"), editorEventRef.Guid), + RepairAction = (property) => { + property.FindPropertyRelative("Guid").SetGuid(editorEventRef.Guid); + }, + }; + } + } + else // EventLinkage.GUID + { + if (eventReference.Path != editorEventRef.Path) + { + return new MismatchInfo() { + Message = L10n.Tr("Path doesn't match GUID"), + HelpText = string.Format( + L10n.Tr("The path on this EventReference doesn't match the GUID.\nYou can click the repair button to update the path to match the GUID, or run the {0} command to scan your project for similar issues and fix them all."), + EventReferenceUpdater.MenuPath), + RepairTooltip = string.Format(L10n.Tr("Repair: set path to '{0}'"), editorEventRef.Path), + RepairAction = (property) => { + property.FindPropertyRelative("Path").stringValue = editorEventRef.Path; + }, + }; + } + } + + return null; + } + + private static void SetEvent(SerializedProperty property, string path) + { + EditorEventRef eventRef = EventManager.EventFromPath(path); + + if (eventRef != null) + { + property.SetEventReference(eventRef.Guid, eventRef.Path); + } + else + { + property.SetEventReference(new FMOD.GUID(), path); + } + } + + private static SerializedProperty GetGuidProperty(SerializedProperty property) + { + return property.FindPropertyRelative("Guid"); + } + + private static SerializedProperty GetPathProperty(SerializedProperty property) + { + return property.FindPropertyRelative("Path"); + } + + private static EditorEventRef GetEditorEventRef(EventReference eventReference) + { + if (EventManager.GetEventLinkage(eventReference) == EventLinkage.Path) + { + return EventManager.EventFromPath(eventReference.Path); + } + else // Assume EventLinkage.GUID + { + return EventManager.EventFromGUID(eventReference.Guid); + } + } + + private static EditorEventRef GetRenamedEventRef(EventReference eventReference) + { + if (Settings.Instance.EventLinkage == EventLinkage.Path && !eventReference.Guid.IsNull) + { + EditorEventRef editorEventRef = EventManager.EventFromGUID(eventReference.Guid); + + if (editorEventRef != null && editorEventRef.Path != eventReference.Path) + { + return editorEventRef; + } + } + + return null; + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + float baseHeight = GetBaseHeight(); + + EventReference eventReference = property.GetEventReference(); + EditorEventRef editorEventRef = GetEditorEventRef(eventReference); + + if (editorEventRef == null) + { + return baseHeight + WarningSize().y; + } + else + { + float height; + + if (property.isExpanded) + { + height = baseHeight * 6; // 5 lines of info + } + else + { + height = baseHeight; + } + + if (GetMismatch(eventReference, editorEventRef) != null) + { + height += WarningSize().y; + } + + return height; + } + } + } + +#pragma warning disable 0618 // Suppress the warning about using the obsolete EventRefAttribute class + [CustomPropertyDrawer(typeof(EventRefAttribute))] +#pragma warning restore 0618 + public class LegacyEventRefDrawer : PropertyDrawer + { + private GUIStyle RichTextStyle; + + private static readonly string HelpText = + string.Format(L10n.Tr("This field has the [EventRef] attribute, which is obsolete.\nTo resolve this issue:\n* Add a field of type EventReference to this class\nSet the MigrateTo property on the [EventRef] attribute: [EventRef(MigrateTo=\"\")]\n Run the {0} command to automatically migrate values from this field to the EventReference field"), EventReferenceUpdater.MenuPath); + private static readonly Texture InfoIcon = EditorGUIUtility.IconContent("console.infoicon.sml").image; + private static readonly Texture WarningIcon = EditorUtils.LoadImage("NotFound.png"); + + private void AffirmStyles() + { + if (RichTextStyle == null) + { + RichTextStyle = new GUIStyle(GUI.skin.label) { richText = true }; + } + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + AffirmStyles(); + + label = EditorGUI.BeginProperty(position, label, property); + + Rect pathRect = position; + pathRect.height = EditorGUIUtility.singleLineHeight; + + pathRect = EditorGUI.PrefixLabel(pathRect, label); + EditorGUI.PropertyField(pathRect, property, GUIContent.none); + + using (new EditorGUI.IndentLevelScope()) + { + GUIContent content = StatusContent(property); + + Rect infoRect = EditorGUI.IndentedRect(position); + infoRect.y = pathRect.yMax; + infoRect.height = StatusSize(content).y; + + infoRect = EditorUtils.DrawHelpButton(infoRect, () => new SimpleHelp(HelpText, 400)); + + GUI.Label(infoRect, content, RichTextStyle); + } + + EditorGUI.EndProperty(); + } + + private GUIContent StatusContent(SerializedProperty property) + { +#pragma warning disable 0618 // Suppress the warning about using the obsolete EventRefAttribute class + string migrationTarget = (attribute as EventRefAttribute).MigrateTo; +#pragma warning restore 0618 + + if (string.IsNullOrEmpty(migrationTarget)) + { + return new GUIContent(L10n.Tr("[EventRef] is obsolete - use the EventReference type instead."), + WarningIcon); + + } + else + { + int parentPathLength = property.propertyPath.LastIndexOf('.'); + + if (parentPathLength >= 0) + { + migrationTarget = string.Format("{0}.{1}", property.propertyPath.Remove(parentPathLength), migrationTarget); + } + + SerializedProperty targetProperty = property.serializedObject.FindProperty(migrationTarget); + + if (targetProperty != null) + { + return new GUIContent(string.Format(L10n.Tr("Will be migrated to {0}"), targetProperty.displayName), + InfoIcon); + } + else + { + return new GUIContent(string.Format(L10n.Tr("Migration target {0} is missing"), migrationTarget), + WarningIcon); + } + } + } + + private Vector2 StatusSize(GUIContent content) + { + AffirmStyles(); + + return Vector2.Max(RichTextStyle.CalcSize(content), EditorUtils.GetHelpButtonSize()); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUIUtility.singleLineHeight + StatusSize(StatusContent(property)).y; + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs.meta new file mode 100644 index 00000000..7799839f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 29a86a77bf7568e499243d9b47b7e88e +timeCreated: 1432696197 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventReferenceUpdater.cs b/Assets/Plugins/FMOD/src/Editor/EventReferenceUpdater.cs new file mode 100644 index 00000000..3d9ddbc4 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventReferenceUpdater.cs @@ -0,0 +1,2458 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text.RegularExpressions; +using UnityEditor; +using UnityEditor.IMGUI.Controls; +using UnityEditor.Experimental.SceneManagement; +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.SceneManagement; +#if UNITY_INPUTSYSTEM_EXIST +using UnityEngine.InputSystem; +#endif + +namespace FMODUnity +{ + public class EventReferenceUpdater : EditorWindow + { + public const string MenuPath = "FMOD/Update Event References"; + + private const int EventReferenceTransitionVersion = 0x00020200; + + private const BindingFlags DefaultBindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; + + private static readonly string HelpText = + string.Format(L10n.Tr("Click Scan to search your project for obsolete event references.")); + + private readonly string[] SearchFolders = { + "Assets", + }; + + private SceneSetup[] sceneSetup; + + private IEnumerator processingState; + + private SearchProgress prefabProgress; + private SearchProgress sceneProgress; + private SearchProgress scriptableObjectProgress; + + [SerializeField] + private List assets = new List(); + + [SerializeField] + private List components = new List(); + + [SerializeField] + private List tasks = new List(); + + private int executableTaskCount = 0; + + private TreeViewState taskViewState = new TreeViewState(); + + private TaskView taskView; + + [NonSerialized] + private GUIContent status = GUIContent.none; + + [NonSerialized] + private Task selectedTask; + + [NonSerialized] + private Vector2 manualDescriptionScrollPosition; + + [NonSerialized] + private static GUIContent AssetContent = new GUIContent(L10n.Tr("Asset")); + private static GUIContent ComponentTypeContent = new GUIContent(L10n.Tr("Component Type")); + private static GUIContent GameObjectContent = new GUIContent(L10n.Tr("Game Object")); + + private string ExecuteButtonText() + { + return string.Format(L10n.Tr("Execute {0} Selected Tasks"), executableTaskCount); + } + + [MenuItem(MenuPath)] + public static void ShowWindow() + { + EventReferenceUpdater updater = GetWindow(L10n.Tr("FMOD Event Reference Updater")); + updater.minSize = new Vector2(800, 600); + + updater.SetStatus(HelpText); + + updater.Show(); + } + + public static bool IsUpToDate() + { + return Settings.Instance.LastEventReferenceScanVersion >= EventReferenceTransitionVersion; + } + + private void BeginSearching() + { + if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) + { + tasks.Clear(); + executableTaskCount = 0; + taskView.SetSelection(new List(), TreeViewSelectionOptions.FireSelectionChanged); + taskView.Reload(); + + processingState = SearchProject(); + } + } + + private void StopProcessing(bool isComplete) + { + processingState = null; + + if (isComplete) + { + if (tasks.Count == 0) + { + SetStatus(L10n.Tr("No required tasks found. Event references are up to date.")); + Settings.Instance.LastEventReferenceScanVersion = FMOD.VERSION.number; + EditorUtility.SetDirty(Settings.Instance); + + SetupWizardWindow.SetUpdateTaskComplete(SetupWizardWindow.UpdateTaskType.UpdateEventReferences); + } + else if (tasks.All(x => x.HasExecuted)) + { + SetStatus(L10n.Tr("Finished executing tasks. New tasks may now be required. Please re-scan your project.")); + } + else + { + SetStatus(L10n.Tr("Finished scanning. Please execute the tasks above.")); + } + } + else + { + SetStatus(L10n.Tr("Cancelled.")); + } + } + + private void BeginExecuting() + { + Task[] enabledTasks = tasks.Where(t => t.CanExecute()).ToArray(); + + if (enabledTasks.Length == 0) + { + return; + } + + Asset[] affectedAssets = enabledTasks.Select(t => assets[t.AssetIndex]).Distinct().ToArray(); + + int prefabCount = affectedAssets.Count(a => IsPrefab(a.Type)); + int sceneCount = affectedAssets.Count(a => a.Type == AssetType.Scene); + + string warningText = string.Format( + L10n.Tr("Executing these {0} tasks will change {1} prefabs and {2} scenes on disk.\n\nPlease ensure you have committed any outstanding changes to source control before continuing!"), + enabledTasks.Length, prefabCount, sceneCount); + + if (!EditorUtility.DisplayDialog(L10n.Tr("Confirm Bulk Changes"), warningText, ExecuteButtonText(), L10n.Tr("Cancel"))) + { + return; + } + + if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) + { + processingState = ExecuteTasks(enabledTasks); + } + } + + private void Cancel() + { + if (IsProcessing) + { + StopProcessing(false); + } + else + { + Close(); + } + } + + private bool IsProcessing { get { return processingState != null; } } + + private struct SearchProgress + { + private int maximum; + private int current; + + public float Fraction() + { + return (maximum > 0) ? (current / (float)maximum) : 1; + } + + public void Increment() + { + if (current < maximum) + { + ++current; + } + } + + public SearchProgress(int total) + { + this.maximum = total; + this.current = 0; + } + } + + private IEnumerator SearchProject() + { + string[] prefabGuids = AssetDatabase.FindAssets("t:GameObject", SearchFolders); + string[] sceneGuids = AssetDatabase.FindAssets("t:Scene", SearchFolders); + string[] scriptableObjectGuids = + AssetDatabase.FindAssets("t:ScriptableObject", SearchFolders).Distinct().ToArray(); + + prefabProgress = new SearchProgress(prefabGuids.Length); + sceneProgress = new SearchProgress(sceneGuids.Length); + scriptableObjectProgress = new SearchProgress(scriptableObjectGuids.Length); + + return SearchPrefabs(prefabGuids) + .Concat(SearchScriptableObjects(scriptableObjectGuids)) + .Concat(SearchScenes(sceneGuids)) + .GetEnumerator(); + } + + private IEnumerable SearchPrefabs(string[] guids) + { + foreach (string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + + yield return string.Format(L10n.Tr("Searching {0}"), path); + + GameObject prefab = AssetDatabase.LoadAssetAtPath(path); + + int assetIndex = -1; + + foreach (Task task in SearchGameObject(prefab, prefab)) + { + if (assetIndex < 0) + { + assetIndex = AddAsset(GetAssetType(prefab), path); + } + + task.AssetIndex = assetIndex; + + AddTask(task); + } + + prefabProgress.Increment(); + } + } + + private IEnumerable SearchScriptableObjects(string[] guids) + { + foreach (string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + + yield return string.Format(L10n.Tr("Searching {0}"), path); + + IEnumerable scriptableObjects = + AssetDatabase.LoadAllAssetsAtPath(path).OfType(); + + int assetIndex = -1; + + foreach (ScriptableObject scriptableObject in scriptableObjects) + { + int componentIndex = -1; + + foreach (Task task in GetUpdateTasks(scriptableObject)) + { + if (assetIndex < 0) + { + assetIndex = AddAsset(AssetType.ScriptableObject, path); + } + + if (componentIndex < 0) + { + componentIndex = AddComponent(scriptableObject); + } + + task.AssetIndex = assetIndex; + task.ComponentIndex = componentIndex; + + AddTask(task); + } + } + + scriptableObjectProgress.Increment(); + } + } + + private IEnumerable SearchScenes(string[] guids) + { + sceneSetup = EditorSceneManager.GetSceneManagerSetup(); + + foreach (string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + + yield return string.Format(L10n.Tr("Searching {0}"), path); + + Scene scene = SceneManager.GetSceneByPath(path); + + if (!scene.IsValid()) + { + scene = EditorSceneManager.OpenScene(path, OpenSceneMode.Single); + } + + int assetIndex = -1; + + foreach (GameObject gameObject in scene.GetRootGameObjects()) + { + foreach (Task task in SearchGameObject(gameObject, null)) + { + if (assetIndex < 0) + { + assetIndex = AddAsset(AssetType.Scene, path); + } + + task.AssetIndex = assetIndex; + + AddTask(task); + } + } + + sceneProgress.Increment(); + } + + if (sceneSetup.Length > 0) + { + EditorSceneManager.RestoreSceneManagerSetup(sceneSetup); + } + } + + private IEnumerable SearchGameObject(GameObject gameObject, GameObject root) + { + MonoBehaviour[] behaviours = gameObject.GetComponentsInChildren(true); + + foreach (MonoBehaviour behaviour in behaviours) + { + int componentIndex = -1; + + foreach (Task task in GetUpdateTasks(behaviour)) + { + if (componentIndex < 0) + { + componentIndex = AddComponent(behaviour, root); + } + + task.ComponentIndex = componentIndex; + + yield return task; + } + } + } + + private static IEnumerable GetUpdateTasks(UnityEngine.Object target) + { + if (target == null) + { + return Enumerable.Empty(); + } + else if (target is StudioEventEmitter) + { + return GetEmitterUpdateTasks(target as StudioEventEmitter); + } +#if UNITY_TIMELINE_EXIST + else if (target is FMODEventPlayable) + { + return GetPlayableUpdateTasks(target as FMODEventPlayable); + } +#endif + else + { + return GetGenericUpdateTasks(target); + } + } + + private static IEnumerable GetEmitterUpdateTasks(StudioEventEmitter emitter) + { + bool hasOwnEvent = true; + bool hasOwnEventReference = true; + + if (PrefabUtility.IsPartOfPrefabInstance(emitter)) + { + StudioEventEmitter sourceEmitter = PrefabUtility.GetCorrespondingObjectFromSource(emitter); + PropertyModification[] modifications = PrefabUtility.GetPropertyModifications(emitter); + + if (modifications != null) // GetPropertyModifications returns null if the prefab instance is disconnected + { + hasOwnEvent = modifications.Any( + m => m.target == sourceEmitter && m.propertyPath == "Event"); + + hasOwnEventReference = modifications.Any( + m => m.target == sourceEmitter && m.propertyPath.StartsWith("EventReference")); + } + } + + if (hasOwnEventReference) + { + Task updateTask = GetUpdateEventReferenceTask(emitter.EventReference, "EventReference"); + if (updateTask != null) + { + yield return updateTask; + } + + if (hasOwnEvent) + { +#pragma warning disable 0618 // Suppress warnings about using the obsolete StudioEventEmitter.Event field + if (!string.IsNullOrEmpty(emitter.Event)) +#pragma warning restore 0618 + { + if (emitter.EventReference.IsNull) + { + yield return Task.MoveEventToEventReference(emitter); + } + else + { + yield return Task.ClearEvent(emitter); + } + } + } + } + else if (hasOwnEvent) + { + yield return Task.MoveEventOverrideToEventReference(emitter); + } + } + + private static Task GetUpdateEventReferenceTask(EventReference eventReference, string fieldName, + string subObjectPath = null) + { + if (eventReference.IsNull) + { + return null; + } + + if (Settings.Instance.EventLinkage == EventLinkage.GUID) + { + EditorEventRef editorEventRef = EventManager.EventFromGUID(eventReference.Guid); + + if (editorEventRef == null) + { + return null; + } + + if (eventReference.Path != editorEventRef.Path) + { + return Task.UpdateEventReferencePath(subObjectPath, fieldName, eventReference.Path, + editorEventRef.Path, eventReference.Guid); + } + } + else if (Settings.Instance.EventLinkage == EventLinkage.Path) + { + EditorEventRef editorEventRef = EventManager.EventFromPath(eventReference.Path); + + if (editorEventRef != null) + { + if (eventReference.Guid != editorEventRef.Guid) + { + return Task.UpdateEventReferenceGuid(subObjectPath, fieldName, eventReference.Guid, + editorEventRef.Guid, eventReference.Path); + } + } + else if (!eventReference.Guid.IsNull) + { + editorEventRef = EventManager.EventFromGUID(eventReference.Guid); + + if (editorEventRef != null) + { + return Task.UpdateEventReferencePath(subObjectPath, fieldName, eventReference.Path, + editorEventRef.Path, eventReference.Guid); + } + } + } + else + { + throw new NotSupportedException("Unrecognized EventLinkage: " + Settings.Instance.EventLinkage); + } + + return null; + } + +#if UNITY_TIMELINE_EXIST + private static IEnumerable GetPlayableUpdateTasks(FMODEventPlayable playable) + { + Task updateTask = GetUpdateEventReferenceTask(playable.EventReference, "EventReference"); + if (updateTask != null) + { + yield return updateTask; + } + +#pragma warning disable 0618 // Suppress warnings about using the obsolete FMODEventPlayable.eventName field + if (!string.IsNullOrEmpty(playable.eventName)) +#pragma warning restore 0618 + { + if (playable.EventReference.IsNull) + { + yield return Task.MoveEventNameToEventReference(playable); + } + else + { + yield return Task.ClearEventName(playable); + } + } + } +#endif + +#pragma warning disable 0618 // Suppress a warning about using the obsolete EventRefAttribute class + private static bool IsEventRef(FieldInfo field) + { + return field.FieldType == typeof(string) && EditorUtils.HasAttribute(field); + } +#pragma warning restore 0618 + + private static T GetCustomAttribute(FieldInfo field) + where T : Attribute + { + return Attribute.GetCustomAttribute(field, typeof(T)) as T; + } + + private static readonly Assembly SystemAssembly = typeof(object).Assembly; + + private static IEnumerable GetGenericUpdateTasks(object target, string subObjectPath = null, IEnumerable parents = null) + { + Type targetType = target.GetType(); + FieldInfo[] fields = targetType.GetFields(DefaultBindingFlags); + + List oldFields = new List(); + List newFields = new List(); + List subObjectFields = new List(); + + foreach (FieldInfo f in fields) + { + if (IsEventRef(f)) + { + oldFields.Add(f); + } + else if (f.FieldType == typeof(EventReference)) + { + newFields.Add(f); + } + else if (typeof(System.Collections.IEnumerable).IsAssignableFrom(f.FieldType)) + { + subObjectFields.Add(f); + } + else if (f.FieldType.Assembly != SystemAssembly && !f.FieldType.IsEnum) + { + subObjectFields.Add(f); + } + } + + int initialOldFieldCount = oldFields.Count; + + // Remove empty [EventRef] fields + for (int i = 0; i < oldFields.Count; ) + { + FieldInfo oldField = oldFields[i]; + + if (string.IsNullOrEmpty(oldField.GetValue(target) as string)) + { + oldFields.RemoveAt(i); + + yield return Task.RemoveEmptyEventRefField(subObjectPath, oldField.Name, targetType.Name); + } + else + { + ++i; + } + } + + // Handle conflicts where multiple [EventRef] fields have the same migration target +#pragma warning disable 0618 // Suppress a warning about using the obsolete EventRefAttribute class + IGrouping[] conflictingGroups = oldFields + .GroupBy(f => GetCustomAttribute(f).MigrateTo) + .Where(g => !string.IsNullOrEmpty(g.Key) && g.Count() > 1) + .ToArray(); +#pragma warning restore 0618 + + foreach (IGrouping group in conflictingGroups) + { + foreach (FieldInfo field in group) + { + oldFields.Remove(field); + } + + yield return Task.FixMigrationTargetConflict(subObjectPath, targetType.Name, group.Select(f => f.Name)); + } + + // Handle [EventRef] fields with MigrateTo set +#pragma warning disable 0618 // Suppress a warning about using the obsolete EventRefAttribute class + for (int i = 0; i < oldFields.Count; ) + { + FieldInfo oldField = oldFields[i]; + + EventRefAttribute attribute = GetCustomAttribute(oldField); + + if (!string.IsNullOrEmpty(attribute.MigrateTo)) + { + oldFields.RemoveAt(i); + + string oldValue = oldField.GetValue(target) as string; + + FieldInfo newField = newFields.FirstOrDefault(f => f.Name == attribute.MigrateTo); + + if (newField != null) + { + EventReference newValue = (EventReference)newField.GetValue(target); + + if (newValue.IsNull) + { + yield return Task.MoveEventRefFieldToEventReferenceField(subObjectPath, oldValue, + oldField.Name, newField.Name); + } + else + { + yield return Task.RemoveEventRefField(subObjectPath, oldValue, oldField.Name, targetType.Name); + } + } + else + { + yield return Task.AddMigrationTarget(subObjectPath, oldValue, oldField.Name, targetType.Name, + attribute.MigrateTo); + } + } + else + { + ++i; + } + } +#pragma warning restore 0618 + + // Auto-migrate if there is a single old field that hasn't been handled already, + // and there is a single new field + if (initialOldFieldCount == 1 && oldFields.Count == 1 && newFields.Count == 1) + { + FieldInfo oldField = oldFields[0]; + + string oldValue = oldField.GetValue(target) as string; + + FieldInfo newField = newFields[0]; + + EventReference newValue = (EventReference)newField.GetValue(target); + + if (newValue.IsNull) + { + yield return Task.MoveEventRefFieldToEventReferenceField(subObjectPath, oldValue, + oldField.Name, newField.Name); + } + else + { + yield return Task.RemoveEventRefField(subObjectPath, oldValue, oldField.Name, targetType.Name); + } + + oldFields.RemoveAt(0); + } + + // Handle old fields with no migration target + foreach (FieldInfo oldField in oldFields) + { + yield return Task.AddMigrationTarget(subObjectPath, oldField.GetValue(target) as string, oldField.Name, + targetType.Name); + } + + // Check new fields for GUID/path mismatches + foreach (FieldInfo newField in newFields) + { + EventReference eventReference = (EventReference)newField.GetValue(target); + + Task updateTask = GetUpdateEventReferenceTask(eventReference, newField.Name, subObjectPath); + if (updateTask != null) + { + yield return updateTask; + } + } + + // Check sub-object fields + if (subObjectFields.Any()) + { + if (parents == null) + { + parents = Enumerable.Empty(); + } + + parents = parents.Append(target); + + foreach (FieldInfo subObjectField in subObjectFields) + { + object value = subObjectField.GetValue(target); + if (value == null || (value is UnityEngine.Object && !(value as UnityEngine.Object))) + { + continue; + } + + if (subObjectField.FieldType.IsValueType || !parents.Contains(value)) + { + if (value is System.Collections.IEnumerable && !(value is string)) + { + int index = 0; + System.Collections.IEnumerator valueEnumerator = null; + + try + { + valueEnumerator = (value as System.Collections.IEnumerable).GetEnumerator(); + } + catch (Exception ex) + { + RuntimeUtils.DebugLogWarningFormat("[FMOD] Failed to get enumerator for value in field '{0}': {1}", subObjectField.Name, ex.Message); + continue; + } + + for (;;) + { + object item = null; + try + { + if (!valueEnumerator.MoveNext()) + { + break; + } + item = valueEnumerator.Current; + } + catch (Exception) + { + break; + } + if (item != null && !item.GetType().IsPrimitive && !parents.Contains(item) + && item.GetType().Namespace != "UnityEngine.InputSystem") + { + foreach (Task t in GetGenericUpdateTasks(item, FieldPath(subObjectPath, subObjectField.Name, index), parents)) + { + yield return t; + } + } + index++; + } + } + else + { + foreach (Task t in GetGenericUpdateTasks(value, FieldPath(subObjectPath, subObjectField.Name), parents)) + { + yield return t; + } + } + } + } + } + } + + private IEnumerator ExecuteTasks(Task[] tasks) + { + sceneSetup = EditorSceneManager.GetSceneManagerSetup(); + + foreach (Task task in tasks) + { + yield return string.Format(L10n.Tr("Executing: {0}"), task); + + ExecuteTask(task, SavePolicy.AutoSave); + } + + EditorSceneManager.SaveOpenScenes(); + UpdateExecutableTaskCount(); + + if (sceneSetup.Length > 0) + { + EditorSceneManager.RestoreSceneManagerSetup(sceneSetup); + } + } + + private enum AssetType + { + Scene, + Prefab, + PrefabModel, + PrefabVariant, + ScriptableObject, + } + + private static bool IsPrefab(AssetType type) + { + return type == AssetType.Prefab + || type == AssetType.PrefabModel + || type == AssetType.PrefabVariant; + } + + private static AssetType GetAssetType(GameObject gameObject) + { + PrefabAssetType prefabType = PrefabUtility.GetPrefabAssetType(gameObject); + + if (prefabType == PrefabAssetType.Model) + { + return AssetType.PrefabModel; + } + else if (prefabType == PrefabAssetType.Variant) + { + return AssetType.PrefabVariant; + } + else + { + return AssetType.Prefab; + } + } + + private enum EnableState + { + Enabled, + Disabled, + Mixed, + } + + [Serializable] + private class Asset + { + public AssetType Type; + public string Path; + public EnableState EnableState; + } + + [Serializable] + private class Component + { + public GlobalObjectId GameObjectID; + public string Type; + public string Path; + public string ScriptPath; + } + + [Serializable] + private class Task + { + public bool Enabled = true; + public int AssetIndex; // index into the assets list + public int ComponentIndex; // index into the components list + + private Type type; + private string[] Data; + + private const string EmitterEventField = "Event"; + private const string EmitterEventReferenceField = "EventReference"; + private const string PlayableEventNameField = "eventName"; + private const string PlayableEventReferenceField = "eventReference"; + + private delegate string DescriptionDelegate(string[] data); + private delegate string ManualInstructionsDelegate(string[] data, Component component); + private delegate bool IsValidDelegate(string[] data, UnityEngine.Object target); + private delegate void ExecuteDelegate(string[] data, UnityEngine.Object target); + + private static readonly Delegates[] Implementations; + + private enum Type + { + EmitterClearEvent, + EmitterMoveEventToEventReference, + EmitterMoveEventOverrideToEventReference, + PlayableClearEventName, + PlayableMoveEventNameToEventReference, + GenericRemoveEventRefField, + GenericRemoveEmptyEventRefField, + GenericMoveEventRefFieldToEventReferenceField, + GenericAddMigrationTarget, + GenericUpdateEventReferencePath, + GenericUpdateEventReferenceGuid, + GenericFixMigrationTargetConflict, + + Count + } + + public bool HasExecuted { get; private set; } + + // Suppress warnings about using the obsolete StudioEventEmitter.Event and FMODEventPlayable.eventName fields +#pragma warning disable 0618 + public static Task ClearEvent(StudioEventEmitter emitter) + { + return new Task() + { + type = Type.EmitterClearEvent, + Data = new string[] { emitter.Event }, + }; + } + +#if UNITY_TIMELINE_EXIST + public static Task ClearEventName(FMODEventPlayable playable) + { + return new Task() + { + type = Type.PlayableClearEventName, + Data = new string[] { playable.eventName }, + }; + } +#endif + + public static Task MoveEventToEventReference(StudioEventEmitter emitter) + { + return new Task() + { + type = Type.EmitterMoveEventToEventReference, + Data = new string[] { emitter.Event }, + }; + } + + +#if UNITY_TIMELINE_EXIST + public static Task MoveEventNameToEventReference(FMODEventPlayable playable) + { + return new Task() + { + type = Type.PlayableMoveEventNameToEventReference, + Data = new string[] { playable.eventName }, + }; + } +#endif + + public static Task MoveEventOverrideToEventReference(StudioEventEmitter emitter) + { + return new Task() + { + type = Type.EmitterMoveEventOverrideToEventReference, + Data = new string[] { emitter.Event }, + }; + } +#pragma warning restore 0618 + + public static Task RemoveEventRefField(string subObjectPath, string value, string fieldName, string targetType) + { + return new Task() + { + type = Type.GenericRemoveEventRefField, + Data = new string[] { subObjectPath, value, fieldName, targetType }, + }; + } + + public static Task RemoveEmptyEventRefField(string subObjectPath, string fieldName, string targetType) + { + return new Task() + { + type = Type.GenericRemoveEmptyEventRefField, + Data = new string[] { subObjectPath, fieldName, targetType }, + }; + } + + public static Task MoveEventRefFieldToEventReferenceField( + string subObjectPath, string value, string oldFieldName, string newFieldName) + { + return new Task() + { + type = Type.GenericMoveEventRefFieldToEventReferenceField, + Data = new string[] { subObjectPath, value, oldFieldName, newFieldName }, + }; + } + + public static Task AddMigrationTarget(string subObjectPath, string value, string fieldName, string targetType, + string targetName = null) + { + return new Task() + { + type = Type.GenericAddMigrationTarget, + Data = new string[] { subObjectPath, value, fieldName, targetType, targetName }, + }; + } + + public static Task UpdateEventReferencePath(string subObjectPath, string fieldName, + string oldPath, string newPath, FMOD.GUID guid) + { + return new Task() + { + type = Type.GenericUpdateEventReferencePath, + Data = new string[] { subObjectPath, fieldName, oldPath, newPath, guid.ToString() }, + }; + } + + public static Task UpdateEventReferenceGuid(string subObjectPath, string fieldName, + FMOD.GUID oldGuid, FMOD.GUID newGuid, string path) + { + return new Task() + { + type = Type.GenericUpdateEventReferenceGuid, + Data = new string[] { subObjectPath, fieldName, oldGuid.ToString(), newGuid.ToString(), path }, + }; + } + + public static Task FixMigrationTargetConflict(string subObjectPath, string targetType, + IEnumerable fieldNames) + { + return new Task() + { + type = Type.GenericFixMigrationTargetConflict, + Data = (new string[] { subObjectPath, targetType }).Concat(fieldNames).ToArray(), + }; + } + + private struct Delegates + { + public DescriptionDelegate Description; + public ManualInstructionsDelegate ManualInstructions; + public IsValidDelegate IsValid; + public ExecuteDelegate Execute; + } + + private static void Implement(Type type, + DescriptionDelegate Description, + IsValidDelegate IsValid, + ExecuteDelegate Execute, + ManualInstructionsDelegate ManualInstructions = null) + { + Implementations[(int)type] = new Delegates() { + Description = Description, + IsValid = IsValid, + Execute = Execute, + ManualInstructions = ManualInstructions, + }; + } + + private Delegates GetDelegates() + { + return Implementations[(int)type]; + } + + static Task() + { + Implementations = new Delegates[(int)Type.Count]; + + // Suppress warnings about using the obsolete StudioEventEmitter.Event + // and FMODEventPlayable.eventName fields +#pragma warning disable 0618 + + Implement(Type.EmitterClearEvent, + Description: (data) => { + return string.Format(L10n.Tr("Clear '{0}' from the {1} field"), data[0], EmitterEventField); + }, + IsValid: (data, target) => { + StudioEventEmitter emitter = target as StudioEventEmitter; + return emitter != null && emitter.Event == data[0] && !emitter.EventReference.IsNull; + }, + Execute: (data, target) => { + StudioEventEmitter emitter = target as StudioEventEmitter; + + emitter.Event = string.Empty; + EditorUtility.SetDirty(emitter); + } + ); + Implement(Type.EmitterMoveEventToEventReference, + Description: (data) => { + return string.Format(L10n.Tr("Move '{0}' from {1} to {2}"), + data[0], EmitterEventField, EmitterEventReferenceField); + }, + IsValid: (data, target) => { + StudioEventEmitter emitter = target as StudioEventEmitter; + return emitter != null && emitter.Event == data[0] && emitter.EventReference.IsNull; + }, + Execute: (data, target) => { + StudioEventEmitter emitter = target as StudioEventEmitter; + + emitter.EventReference.Path = emitter.Event; + emitter.Event = string.Empty; + + EditorEventRef eventRef = EventManager.EventFromPath(emitter.EventReference.Path); + + if (eventRef != null) + { + emitter.EventReference.Guid = eventRef.Guid; + } + + EditorUtility.SetDirty(emitter); + } + ); + Implement(Type.EmitterMoveEventOverrideToEventReference, + Description: (data) => { + return string.Format(L10n.Tr("Move prefab override '{0}' from {1} to {2}"), + data[0], EmitterEventField, EmitterEventReferenceField); + }, + IsValid: (data, target) => { + if (!PrefabUtility.IsPartOfPrefabInstance(target)) + { + return false; + } + + StudioEventEmitter emitter = target as StudioEventEmitter; + + if (emitter == null) + { + return false; + } + + StudioEventEmitter sourceEmitter = PrefabUtility.GetCorrespondingObjectFromSource(emitter); + + if (sourceEmitter == null) + { + return false; + } + + PropertyModification[] modifications = PrefabUtility.GetPropertyModifications(emitter); + PropertyModification eventOverride = modifications.FirstOrDefault( + m => m.target == sourceEmitter && m.propertyPath == "Event"); + + if (eventOverride == null || eventOverride.value != data[0]) + { + return false; + } + + bool hasEventReferenceOverride = modifications.Any( + m => m.target == sourceEmitter && m.propertyPath.StartsWith("EventReference")); + + if (hasEventReferenceOverride) + { + return false; + } + + return true; + }, + Execute: (data, target) => { + StudioEventEmitter emitter = target as StudioEventEmitter; + + string path = emitter.Event; + + // Clear the Event override + StudioEventEmitter sourceEmitter = PrefabUtility.GetCorrespondingObjectFromSource(emitter); + PropertyModification[] modifications = PrefabUtility.GetPropertyModifications(emitter); + + modifications = modifications + .Where(m => !(m.target == sourceEmitter && m.propertyPath == "Event")) + .ToArray(); + + PrefabUtility.SetPropertyModifications(emitter, modifications); + + // Set the EventReference override + emitter.EventReference.Path = path; + + EditorEventRef eventRef = EventManager.EventFromPath(path); + + if (eventRef != null) + { + emitter.EventReference.Guid = eventRef.Guid; + } + + EditorUtility.SetDirty(emitter); + } + ); + +#if UNITY_TIMELINE_EXIST + Implement(Type.PlayableClearEventName, + Description: (data) => { + return string.Format(L10n.Tr("Clear '{0}' from the {1} field"), data[0], PlayableEventNameField); + }, + IsValid: (data, target) => { + FMODEventPlayable playable = target as FMODEventPlayable; + return playable != null && playable.eventName == data[0] && !playable.EventReference.IsNull; + }, + Execute: (data, target) => { + FMODEventPlayable playable = target as FMODEventPlayable; + + playable.eventName = string.Empty; + EditorUtility.SetDirty(playable); + } + ); + Implement(Type.PlayableMoveEventNameToEventReference, + Description: (data) => { + return string.Format(L10n.Tr("Move '{0}' from {1} to {2}"), + data[0], PlayableEventNameField, PlayableEventReferenceField); + }, + IsValid: (data, target) => { + FMODEventPlayable playable = target as FMODEventPlayable; + return playable != null && playable.eventName == data[0] && playable.EventReference.IsNull; + }, + Execute: (data, target) => { + FMODEventPlayable playable = target as FMODEventPlayable; + + playable.EventReference.Path = playable.eventName; + playable.eventName = string.Empty; + + EditorEventRef eventRef = EventManager.EventFromPath(playable.EventReference.Path); + + if (eventRef != null) + { + playable.EventReference.Guid = eventRef.Guid; + } + + EditorUtility.SetDirty(playable); + } + ); +#endif + Implement(Type.GenericRemoveEventRefField, + Description: (data) => { + return string.Format(L10n.Tr("Remove field {0}"), FieldPath(data[0], data[2])); + }, + ManualInstructions: (data, component) => { + string subObjectPath = data[0]; + string value = data[1]; + string fieldName = data[2]; + string targetType = data[3]; + + string fieldPath = FieldPath(subObjectPath, fieldName); + + return string.Format( + L10n.Tr("The {0} field on component {1} has value '{2}', but the corresponding EventReference field already has a value.\n* Ensure no other instances of the {3} type are using the {4} field\n* Edit the definition of the {3} type and remove the {4} field"), + fieldPath, component.Type, value, targetType, fieldName); + }, + IsValid: (data, rootObject) => { + object target = FindSubObject(rootObject, data[0]); + + System.Type targetType = target.GetType(); + FieldInfo field = targetType.GetField(data[2]); + + return field != null && IsEventRef(field) && (field.GetValue(target) as string) == data[1]; + }, + Execute: null + ); + Implement(Type.GenericRemoveEmptyEventRefField, + Description: (data) => { + return string.Format(L10n.Tr("Remove empty field {0}"), FieldPath(data[0], data[1])); + }, + ManualInstructions: (data, component) => { + string subObjectPath = data[0]; + string fieldName = data[1]; + string targetType = data[2]; + + string fieldPath = FieldPath(subObjectPath, fieldName); + + return string.Format( + L10n.Tr("The {0} field on component {1} is empty.\n* Ensure no other instances of the {2} type are using the {3} field\n* Edit the definition of the {2} type and remove the {3} field"), + fieldPath, component.Type, targetType, fieldName); + }, + IsValid: (data, rootObject) => { + object target = FindSubObject(rootObject, data[0]); + + System.Type targetType = target.GetType(); + FieldInfo field = targetType.GetField(data[1]); + + return field != null && IsEventRef(field) + && string.IsNullOrEmpty(field.GetValue(target) as string); + }, + Execute: null + ); + Implement(Type.GenericMoveEventRefFieldToEventReferenceField, + Description: (data) => { + string subObjectPath = data[0]; + string value = data[1]; + string oldFieldPath = FieldPath(subObjectPath, data[2]); + string newFieldPath = FieldPath(subObjectPath, data[3]); + + return string.Format(L10n.Tr("Move '{0}' from {1} to {2}"), + value, oldFieldPath, newFieldPath); + }, + IsValid: (data, rootObject) => { + string subObjectPath = data[0]; + string value = data[1]; + string oldFieldName = data[2]; + string newFieldName = data[3]; + + object target = FindSubObject(rootObject, subObjectPath); + System.Type targetType = target.GetType(); + + FieldInfo oldField = targetType.GetField(oldFieldName, DefaultBindingFlags); + FieldInfo newField = targetType.GetField(newFieldName, DefaultBindingFlags); + + if (oldField == null || newField == null + || !IsEventRef(oldField) + || newField.FieldType != typeof(EventReference)) + { + return false; + } + + string oldValue = oldField.GetValue(target) as string; + EventReference newValue = (EventReference)newField.GetValue(target); + + return oldValue == value && newValue.IsNull; + }, + Execute: (data, rootObject) => { + string subObjectPath = data[0]; + string path = data[1]; + string oldFieldName = data[2]; + string newFieldName = data[3]; + + object target = FindSubObject(rootObject, subObjectPath); + System.Type type = target.GetType(); + + FieldInfo oldField = type.GetField(oldFieldName, DefaultBindingFlags); + FieldInfo newField = type.GetField(newFieldName, DefaultBindingFlags); + + EventReference eventReference = new EventReference() { Path = path }; + + EditorEventRef eventRef = EventManager.EventFromPath(path); + + if (eventRef != null) + { + eventReference.Guid = eventRef.Guid; + } + + oldField.SetValue(target, string.Empty); + newField.SetValue(target, eventReference); + + EditorUtility.SetDirty(rootObject); + } + ); + Implement(Type.GenericAddMigrationTarget, + Description: (data) => { + string value = data[1]; + string fieldPath = FieldPath(data[0], data[2]); + string targetName = data[4]; + + if (!string.IsNullOrEmpty(targetName)) + { + return string.Format( + L10n.Tr("Add an EventReference field named {0} to hold '{1}' from {2}"), + targetName, value, fieldPath); + } + else + { + return string.Format(L10n.Tr("Add an EventReference field to hold '{0}' from {1}"), + value, fieldPath); + } + }, + ManualInstructions: (data, component) => { + string fieldName = data[2]; + string targetType = data[3]; + string targetName = data[4]; + string fieldPath = FieldPath(data[0], fieldName); + + string script; + + if (targetType != null) + { + script = string.Format(L10n.Tr("the definition of the {0} type"), targetType); + } + else + { + script = component.ScriptPath; + } + + if (!string.IsNullOrEmpty(targetName)) + { + return string.Format( + L10n.Tr("The {0} field on component {1} has an [EventRef(MigrateTo=\"{2}\")] attribute, but the {2} field doesn't exist.\n* Edit {3} and add an EventReference field named {2}:\n public EventReference {2};\n* Re-scan your project"), + fieldPath, component.Type, targetName, script); + } + else + { + return string.Format( + L10n.Tr("The {0} field on component {1} has an [EventRef] attribute with no migration target specified.\n* Edit {2} and add an EventReference field:\n public EventReference ;\n* Change the [EventRef] attribute on the {3} field to:\n [EventRef(MigrateTo=\"\")]\n* Re-scan your project."), + fieldPath, component.Type, script, fieldName); + } + }, + IsValid: (data, rootObject) => { + string value = data[1]; + string oldFieldName = data[2]; + + object target = FindSubObject(rootObject, data[0]); + + System.Type targetType = target.GetType(); + FieldInfo oldField = targetType.GetField(oldFieldName, DefaultBindingFlags); + + return oldField != null && IsEventRef(oldField) + && (oldField.GetValue(target) as string) == value; + }, + Execute: null + ); + Implement(Type.GenericUpdateEventReferencePath, + Description: (data) => { + return string.Format( + L10n.Tr("Change the path on field {0} from '{1}' to '{2}' (to match GUID {3})"), + FieldPath(data[0], data[1]), data[2], data[3], data[4]); + }, + IsValid: (data, rootObject) => { + object target = FindSubObject(rootObject, data[0]); + + System.Type targetType = target.GetType(); + FieldInfo field = targetType.GetField(data[1], DefaultBindingFlags); + + if (field == null || field.FieldType != typeof(EventReference)) + { + return false; + } + + EventReference value = (EventReference)field.GetValue(target); + + return value.Path == data[2] && value.Guid.ToString() == data[4]; + }, + Execute: (data, rootObject) => { + object target = FindSubObject(rootObject, data[0]); + + System.Type targetType = target.GetType(); + FieldInfo field = targetType.GetField(data[1], DefaultBindingFlags); + + EventReference value = (EventReference)field.GetValue(target); + value.Path = data[3]; + + field.SetValue(target, value); + + EditorUtility.SetDirty(rootObject); + } + ); + Implement(Type.GenericUpdateEventReferenceGuid, + Description: (data) => { + return string.Format( + L10n.Tr("Change the GUID on field {0} from {1} to {2} (to match path '{3}')"), + FieldPath(data[0], data[1]), data[2], data[3], data[4]); + }, + IsValid: (data, rootObject) => { + object target = FindSubObject(rootObject, data[0]); + + System.Type targetType = target.GetType(); + FieldInfo field = targetType.GetField(data[1], DefaultBindingFlags); + + if (field == null || field.FieldType != typeof(EventReference)) + { + return false; + } + + EventReference value = (EventReference)field.GetValue(target); + + return value.Guid.ToString() == data[2] && value.Path == data[4]; + }, + Execute: (data, rootObject) => { + object target = FindSubObject(rootObject, data[0]); + + System.Type targetType = target.GetType(); + FieldInfo field = targetType.GetField(data[1], DefaultBindingFlags); + + EventReference value = (EventReference)field.GetValue(target); + value.Guid = FMOD.GUID.Parse(data[3]); + + field.SetValue(target, value); + + EditorUtility.SetDirty(rootObject); + } + ); + Implement(Type.GenericFixMigrationTargetConflict, + Description: (data) => { + string subObjectPath = data[0]; + IEnumerable fieldPaths = data.Skip(2).Select(field => FieldPath(subObjectPath, field)); + + return string.Format(L10n.Tr("Fix conflicting migration targets on fields {0}"), + EditorUtils.SeriesString(", ", L10n.Tr(" and "), fieldPaths)); + }, + ManualInstructions: (data, component) => { + return string.Format( + L10n.Tr("Fields {0} on the {1} type have [EventRef] attributes with the same MigrateTo value.\n* Edit the definition of the {1} type and make sure all [EventRef] attributes have different MigrateTo values\n* Re-scan your project"), + EditorUtils.SeriesString(", ", L10n.Tr(" and "), data.Skip(2)), data[1]); + }, + IsValid: (data, target) => { + return true; + }, + Execute: null + ); + +#pragma warning restore 0618 + } + + public override string ToString() + { + return GetDelegates().Description(Data); + } + + public string PlainDescription() + { + return Regex.Replace(ToString(), "", string.Empty); + } + + public string ManualInstructions(Component component) + { + Delegates delegates = GetDelegates(); + + if (delegates.ManualInstructions != null) + { + return delegates.ManualInstructions(Data, component); + } + else + { + return null; + } + } + + public bool CanExecute() + { + return Enabled && !IsManual() && !HasExecuted; + } + + public bool IsManual() + { + return GetDelegates().Execute == null; + } + + public bool IsValid(UnityEngine.Object target) + { + return GetDelegates().IsValid(Data, target); + } + + public bool Execute(UnityEngine.Object target) + { + if (IsValid(target)) + { + Delegates delegates = GetDelegates(); + + if (delegates.Execute != null) + { + delegates.Execute(Data, target); + HasExecuted = true; + } + + return true; + } + else + { + return false; + } + } + } + + private static string FieldPath(string subObjectPath, string fieldName) + { + if (subObjectPath != null) + { + return string.Format("{0}.{1}", subObjectPath, fieldName); + } + else + { + return fieldName; + } + } + + private static string FieldPath(string subObjectPath, string fieldName, int index) + { + if (subObjectPath != null) + { + return string.Format("{0}.{1}[{2}]", subObjectPath, fieldName, index); + } + else + { + return string.Format("{0}[{1}]", fieldName, index); + } + } + + private static object FindSubObject(object o, string path) + { + if (path == null) + { + return o; + } + + object result = o; + + foreach (string pathElement in path.Split('.')) + { + Type type = result.GetType(); + + Regex regex = new Regex(@"(\w+)\[(\d+)\]$"); + Match match = regex.Match(pathElement); + int index = -1; + string fieldName = pathElement; + + if (match.Success) + { + fieldName = match.Groups[1].Value; + index = int.Parse(match.Groups[2].Value); + } + + FieldInfo field = type.GetField(fieldName, DefaultBindingFlags); + + if (field == null) + { + return null; + } + + result = field.GetValue(result); + + if (index >= 0) + { + System.Collections.IEnumerable enumerable = result as System.Collections.IEnumerable; + + result = null; + + if (enumerable != null) + { + int i = 0; + + foreach (object obj in enumerable) + { + if (index == i) + { + result = obj; + break; + } + i++; + } + } + } + + if (result == null) + { + return null; + } + } + + return result; + } + + private void ExecuteTask(Task task, SavePolicy savePolicy) + { + Asset asset = assets[task.AssetIndex]; + + if (asset.Type == AssetType.ScriptableObject) + { + ExecuteScriptableObjectTask(task, savePolicy); + } + else + { + ExecuteGameObjectTask(task, savePolicy); + } + } + + private void ExecuteScriptableObjectTask(Task task, SavePolicy savePolicy) + { + Asset asset = assets[task.AssetIndex]; + Component component = components[task.ComponentIndex]; + + IEnumerable scriptableObjects = + AssetDatabase.LoadAllAssetsAtPath(asset.Path).OfType(); + + foreach (ScriptableObject scriptableObject in scriptableObjects) + { + if (scriptableObject.GetType().Name == component.Type) + { + if (task.Execute(scriptableObject)) + { + break; + } + } + } + } + + private void ExecuteGameObjectTask(Task task, SavePolicy savePolicy) + { + GameObject gameObject = LoadTargetGameObject(task, savePolicy); + + if (gameObject == null) + { + return; + } + + Selection.activeGameObject = gameObject; + EditorGUIUtility.PingObject(gameObject); + + Component component = components[task.ComponentIndex]; + + foreach (MonoBehaviour behaviour in gameObject.GetComponents()) + { + if (behaviour.GetType().Name == component.Type) + { + if (task.Execute(behaviour)) + { + break; + } + } + } + } + + private enum SavePolicy + { + AskToSave, + AutoSave, + } + + private GameObject LoadTargetGameObject(Task task, SavePolicy savePolicy) + { + Asset asset = assets[task.AssetIndex]; + Component component = components[task.ComponentIndex]; + + if (IsPrefab(asset.Type)) + { + GameObject prefab = AssetDatabase.LoadAssetAtPath(asset.Path); + + if (prefab == null) + { + return null; + } + + if (!AssetDatabase.OpenAsset(prefab)) + { + return null; + } + + return GlobalObjectId.GlobalObjectIdentifierToObjectSlow(component.GameObjectID) as GameObject; + } + else if (asset.Type == AssetType.Scene) + { + Scene scene = SceneManager.GetSceneByPath(asset.Path); + + if (!scene.IsValid()) + { + if (savePolicy == SavePolicy.AskToSave) + { + if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) + { + return null; + } + } + else if (savePolicy == SavePolicy.AutoSave) + { + EditorSceneManager.SaveOpenScenes(); + } + else + { + throw new ArgumentException("Unrecognized SavePolicy: " + savePolicy, "savePolicy"); + } + + scene = EditorSceneManager.OpenScene(asset.Path, OpenSceneMode.Single); + + if (!scene.IsValid()) + { + return null; + } + } + + return GlobalObjectId.GlobalObjectIdentifierToObjectSlow(component.GameObjectID) as GameObject; + } + else + { + return null; + } + } + + private int AddAsset(AssetType type, string path) + { + Asset asset = new Asset() { + Type = type, + Path = path, + }; + + assets.Add(asset); + + return assets.Count - 1; + } + + private int AddComponent(MonoBehaviour behaviour, GameObject root) + { + MonoScript script = MonoScript.FromMonoBehaviour(behaviour); + + Component component = new Component() { + GameObjectID = GlobalObjectId.GetGlobalObjectIdSlow(behaviour.gameObject), + Type = behaviour.GetType().Name, + Path = EditorUtils.GameObjectPath(behaviour, root), + ScriptPath = AssetDatabase.GetAssetPath(script), + }; + + components.Add(component); + + return components.Count - 1; + } + + private int AddComponent(ScriptableObject scriptableObject) + { + MonoScript script = MonoScript.FromScriptableObject(scriptableObject); + + Component component = new Component() { + Type = scriptableObject.GetType().Name, + ScriptPath = AssetDatabase.GetAssetPath(script), + }; + + components.Add(component); + + return components.Count - 1; + } + + private void UpdateExecutableTaskCount() + { + executableTaskCount = tasks.Count(t => t.CanExecute()); + } + + private void AddTask(Task task) + { + tasks.Add(task); + UpdateExecutableTaskCount(); + taskView.Reload(); + taskView.ExpandAll(); + } + + private void UpdateProcessing() + { + if (processingState != null) + { + if (processingState.MoveNext()) + { + SetStatus(processingState.Current); + } + else + { + StopProcessing(true); + } + + Repaint(); + } + } + + private void OnEnable() + { + taskView = new TaskView(taskViewState, tasks, assets, components); + taskView.Reload(); + taskView.taskSelected += OnTaskSelected; + taskView.taskDoubleClicked += OnTaskDoubleClicked; + taskView.taskEnableStateChanged += OnTaskEnableStateChanged; + taskView.assetEnableStateChanged += ApplyAssetEnableStateToTasks; + + EditorApplication.update += UpdateProcessing; + } + + private void OnDisable() + { + EditorApplication.update -= UpdateProcessing; + } + + private void OnTaskSelected(Task task) + { + selectedTask = task; + } + + private void OnTaskDoubleClicked(Task task) + { + Asset asset = assets[task.AssetIndex]; + + if (asset.Type == AssetType.ScriptableObject) + { + UnityEngine.Object target = AssetDatabase.LoadAssetAtPath(asset.Path); + + if (target == null) + { + return; + } + + if (!AssetDatabase.OpenAsset(target)) + { + return; + } + + Component component = components[task.ComponentIndex]; + + IEnumerable scriptableObjects = + AssetDatabase.LoadAllAssetsAtPath(asset.Path).OfType(); + + foreach (ScriptableObject scriptableObject in scriptableObjects) + { + if (scriptableObject.GetType().Name == component.Type + && task.IsValid(scriptableObject)) + { + Selection.activeObject = scriptableObject; + } + } + } + else + { + GameObject gameObject = LoadTargetGameObject(task, SavePolicy.AskToSave); + + if (gameObject == null) + { + return; + } + + Selection.activeGameObject = gameObject; + EditorGUIUtility.PingObject(gameObject); + } + } + + private void OnTaskEnableStateChanged(Task task) + { + UpdateAssetEnableState(task.AssetIndex); + UpdateExecutableTaskCount(); + } + + private void UpdateAssetEnableState(int assetIndex) + { + Asset asset = assets[assetIndex]; + + asset.EnableState = tasks + .Where(t => t.AssetIndex == assetIndex) + .Select(t => t.Enabled ? EnableState.Enabled : EnableState.Disabled) + .Aggregate((current, next) => (current == next) ? current : EnableState.Mixed); + } + + private void ApplyAssetEnableStateToTasks(Asset asset) + { + int assetIndex = assets.IndexOf(asset); + + foreach (Task task in tasks.Where(t => t.AssetIndex == assetIndex)) + { + task.Enabled = (asset.EnableState == EnableState.Enabled); + } + + UpdateExecutableTaskCount(); + } + + private class Styles + { + public static GUIStyle RichText; + public static GUIStyle RichTextBox; + public static GUIStyle TreeViewRichText; + + private static bool Initialized = false; + + public static void Affirm() + { + if (!Initialized) + { + Initialized = true; + + RichText = new GUIStyle(GUI.skin.label) { richText = true }; + RichTextBox = new GUIStyle(EditorStyles.helpBox) { richText = true }; + TreeViewRichText = new GUIStyle(TreeView.DefaultStyles.label) { richText = true }; + } + } + } + + private class Icons + { + public static Texture2D Scene; + public static Texture2D Prefab; + public static Texture2D PrefabModel; + public static Texture2D PrefabVariant; + public static Texture2D ScriptableObject; + public static Texture2D GameObject; + + private static bool Initialized = false; + + public static void Affirm() + { + if (!Initialized) + { + Initialized = true; + + Scene = EditorGUIUtility.IconContent("SceneAsset Icon").image as Texture2D; + Prefab = EditorGUIUtility.IconContent("Prefab Icon").image as Texture2D; + PrefabModel = EditorGUIUtility.IconContent("PrefabModel Icon").image as Texture2D; + PrefabVariant = EditorGUIUtility.IconContent("PrefabVariant Icon").image as Texture2D; + ScriptableObject = EditorGUIUtility.IconContent("ScriptableObject Icon").image as Texture2D; + GameObject = EditorGUIUtility.IconContent("GameObject Icon").image as Texture2D; + } + } + + public static Texture2D GetAssetIcon(AssetType type) + { + Affirm(); + + if (type == AssetType.Scene) + { + return Scene; + } + else if (type == AssetType.Prefab) + { + return Prefab; + } + else if (type == AssetType.PrefabModel) + { + return PrefabModel; + } + else if (type == AssetType.PrefabVariant) + { + return PrefabVariant; + } + else if (type == AssetType.ScriptableObject) + { + return ScriptableObject; + } + else + { + throw new ArgumentException("Unrecognized AssetType: " + type, "type"); + } + } + + public static Texture2D GetComponentIcon(Component component) + { + return AssetDatabase.GetCachedIcon(component.ScriptPath) as Texture2D; + } + } + + private void SetStatus(string text) + { + status = new GUIContent(text, EditorGUIUtility.IconContent("console.infoicon.sml").image); + } + + private void OnGUI() + { + Styles.Affirm(); + + float buttonHeight = EditorGUIUtility.singleLineHeight * 2; + + // Task List + using (var scope = new EditorGUILayout.VerticalScope(GUILayout.ExpandHeight(true))) + { + taskView.DrawLayout(scope.rect); + } + + // Selected Task + if (selectedTask != null) + { + Asset asset = assets[selectedTask.AssetIndex]; + Component component = components[selectedTask.ComponentIndex]; + + DrawSelectableLabel(selectedTask.PlainDescription(), EditorStyles.wordWrappedLabel); + + using (new EditorGUI.IndentLevelScope()) + { + EditorGUILayout.LabelField(AssetContent, + new GUIContent(asset.Path, Icons.GetAssetIcon(asset.Type))); + EditorGUILayout.LabelField(ComponentTypeContent, + new GUIContent(component.Type, Icons.GetComponentIcon(component))); + + if (!string.IsNullOrEmpty(component.Path)) + { + EditorGUILayout.LabelField(GameObjectContent, new GUIContent(component.Path, Icons.GameObject)); + } + + if (selectedTask.IsManual()) + { + Rect buttonsRect = EditorGUILayout.GetControlRect(false, buttonHeight); + buttonsRect = EditorGUI.IndentedRect(buttonsRect); + + GUIContent openScriptContent = new GUIContent(L10n.Tr("Open ") + component.ScriptPath); + + Rect openScriptRect = buttonsRect; + openScriptRect.width = GUI.skin.button.CalcSize(openScriptContent).x; + + if (GUI.Button(openScriptRect, openScriptContent)) + { + MonoScript script = AssetDatabase.LoadAssetAtPath(component.ScriptPath); + AssetDatabase.OpenAsset(script); + } + + GUIContent viewDocumentationContent = new GUIContent(L10n.Tr("View Documentation")); + + Rect viewDocumentationRect = buttonsRect; + viewDocumentationRect.x = openScriptRect.xMax + GUI.skin.button.margin.left; + viewDocumentationRect.width = GUI.skin.button.CalcSize(viewDocumentationContent).x; + + if (GUI.Button(viewDocumentationRect, viewDocumentationContent)) + { + EditorUtils.OpenOnlineDocumentation("unity", "tools", "manual-tasks"); + } + + using (var scope = new EditorGUILayout.ScrollViewScope(manualDescriptionScrollPosition, GUILayout.Height(100))) + { + manualDescriptionScrollPosition = scope.scrollPosition; + + DrawSelectableLabel(selectedTask.ManualInstructions(component), EditorStyles.wordWrappedLabel); + } + } + else + { + GUIContent buttonContent = new GUIContent(L10n.Tr("Execute")); + + Rect buttonRect = EditorGUILayout.GetControlRect(false, buttonHeight); + buttonRect.width = EditorGUIUtility.labelWidth; + buttonRect = EditorGUI.IndentedRect(buttonRect); + + if (GUI.Button(buttonRect, buttonContent)) + { + ExecuteTask(selectedTask, SavePolicy.AskToSave); + } + } + } + } + + // Status + if (IsProcessing) + { + DrawProgressBar(L10n.Tr("Prefabs"), prefabProgress); + DrawProgressBar(L10n.Tr("ScriptableObjects"), scriptableObjectProgress); + DrawProgressBar(L10n.Tr("Scenes"), sceneProgress); + } + + GUILayout.Label(status, Styles.RichTextBox); + + // Buttons + using (new EditorGUILayout.HorizontalScope()) + { + if (GUILayout.Button(L10n.Tr("Cancel"), GUILayout.Height(buttonHeight))) + { + Cancel(); + } + + using (new EditorGUI.DisabledScope(IsProcessing)) + { + if (GUILayout.Button(L10n.Tr("Scan"), GUILayout.Height(buttonHeight))) + { + BeginSearching(); + } + + using (new EditorGUI.DisabledScope(executableTaskCount == 0)) + { + if (GUILayout.Button(ExecuteButtonText(), GUILayout.Height(buttonHeight))) + { + BeginExecuting(); + } + } + } + } + + if (focusedWindow == this + && Event.current.type == EventType.KeyDown + && Event.current.keyCode == KeyCode.Escape) + { + Cancel(); + Event.current.Use(); + } + } + + private static void DrawProgressBar(string label, SearchProgress progress) + { + Rect rect = EditorGUILayout.GetControlRect(); + EditorGUI.ProgressBar(rect, progress.Fraction(), label); + } + + private static void DrawSelectableLabel(string text, GUIStyle style) + { + float height = style.CalcHeight(new GUIContent(text), EditorGUIUtility.currentViewWidth); + + EditorGUILayout.SelectableLabel(text, style, GUILayout.Height(height)); + } + + private class TaskView : TreeView + { + private List tasks; + private List assets; + private List components; + + public delegate void TaskEventHandler(Task task); + + public event TaskEventHandler taskSelected; + public event TaskEventHandler taskDoubleClicked; + public event TaskEventHandler taskEnableStateChanged; + + public delegate void AssetEventHandler(Asset asset); + + public event AssetEventHandler assetEnableStateChanged; + + public TaskView(TreeViewState state, List tasks, List assets, List components) + : base(state, new MultiColumnHeader(CreateHeaderState())) + { + this.tasks = tasks; + this.assets = assets; + this.components = components; + + showAlternatingRowBackgrounds = true; + showBorder = true; + + multiColumnHeader.ResizeToFit(); + } + + public static MultiColumnHeaderState CreateHeaderState() + { + MultiColumnHeaderState.Column[] columns = new MultiColumnHeaderState.Column[] { + new MultiColumnHeaderState.Column() + { + headerContent = new GUIContent(L10n.Tr("Target")), + width = 225, + autoResize = false, + allowToggleVisibility = false, + canSort = false, + }, + new MultiColumnHeaderState.Column() { + headerContent = new GUIContent(L10n.Tr("Task")), + autoResize = true, + allowToggleVisibility = false, + canSort = false, + }, + new MultiColumnHeaderState.Column() + { + headerContent = new GUIContent(L10n.Tr("Status")), + width = 175, + autoResize = false, + allowToggleVisibility = false, + canSort = false, + } + }; + + return new MultiColumnHeaderState(columns); + } + + public void DrawLayout(Rect rect) + { + extraSpaceBeforeIconAndLabel = ToggleWidth(); + + OnGUI(rect); + } + + public enum Column + { + Asset, + Task, + Status, + } + + private class AssetItem : TreeViewItem + { + public Asset asset; + } + + private class TaskItem : TreeViewItem + { + public Task task; + } + + protected override TreeViewItem BuildRoot() + { + TreeViewItem root = new TreeViewItem(-1, -1); + + if (tasks.Count > 0) + { + int index = 0; + + AssetItem assetItem = null; + + foreach (Task task in tasks) + { + Asset asset = assets[task.AssetIndex]; + + if (assetItem == null || assetItem.asset != asset) + { + assetItem = new AssetItem() { + id = index++, + asset = asset, + displayName = asset.Path, + icon = Icons.GetAssetIcon(asset.Type), + }; + + root.AddChild(assetItem); + } + + TreeViewItem taskItem = new TaskItem() { + id = index++, + task = task, + }; + + assetItem.AddChild(taskItem); + } + } + else + { + TreeViewItem item = new TreeViewItem(0); + item.displayName = L10n.Tr("No tasks."); + + root.AddChild(item); + } + + SetupDepthsFromParentsAndChildren(root); + + return root; + } + + protected override bool CanMultiSelect(TreeViewItem item) + { + return false; + } + + protected override void SelectionChanged(IList selectedIds) + { + base.SelectionChanged(selectedIds); + + if (taskSelected != null) + { + if (selectedIds.Count > 0) + { + TaskItem item = FindItem(selectedIds[0], rootItem) as TaskItem; + + if (item != null) + { + taskSelected(item.task); + return; + } + } + + taskSelected(null); + } + } + + protected override void SingleClickedItem(int id) + { + TreeViewItem item = FindItem(id, rootItem); + + if (!(item is TaskItem)) + { + SetExpanded(id, !IsExpanded(id)); + } + else + { + base.SingleClickedItem(id); + } + } + + protected override void DoubleClickedItem(int id) + { + if (taskDoubleClicked != null) + { + TaskItem item = FindItem(id, rootItem) as TaskItem; + + if (item == null) + { + return; + } + + taskDoubleClicked(item.task); + } + } + + protected override void RowGUI(RowGUIArgs args) + { + TreeViewItem item = args.item; + + if (item is TaskItem) + { + Task task = (item as TaskItem).task; + + Rect toggleRect = args.rowRect; + toggleRect.x = GetContentIndent(item); + toggleRect.width = ToggleWidth(); + + TaskToggle(toggleRect, task); + + for (int i = 0; i < args.GetNumVisibleColumns(); ++i) + { + Rect rect = args.GetCellRect(i); + + if (i == 0) + { + rect.xMin = toggleRect.xMax; + } + + CellGUI(rect, task, args.GetColumn(i), args.selected, args.focused); + } + } + else if (item is AssetItem) + { + base.RowGUI(args); + + Rect rect = args.rowRect; + rect.x = GetContentIndent(item); + rect.width = ToggleWidth(); + + AssetToggle(rect, (item as AssetItem).asset); + } + else + { + base.RowGUI(args); + } + } + + private static float ToggleWidth() + { + return GUI.skin.toggle.CalcSize(GUIContent.none).x; + } + + private void AssetToggle(Rect rect, Asset asset) + { + using (var scope = new EditorGUI.ChangeCheckScope()) + { + EditorGUI.showMixedValue = (asset.EnableState == EnableState.Mixed); + + bool enabled = EditorGUI.Toggle(rect, asset.EnableState == EnableState.Enabled); + + EditorGUI.showMixedValue = false; + + if (scope.changed) + { + asset.EnableState = enabled ? EnableState.Enabled : EnableState.Disabled; + + if (assetEnableStateChanged != null) + { + assetEnableStateChanged(asset); + } + } + } + } + + private void TaskToggle(Rect rect, Task task) + { + if (!task.IsManual()) + { + using (var scope = new EditorGUI.ChangeCheckScope()) + { + task.Enabled = EditorGUI.Toggle(rect, task.Enabled); + + if (scope.changed && taskEnableStateChanged != null) + { + taskEnableStateChanged(task); + } + } + } + } + + private void CellGUI(Rect rect, Task task, int columnIndex, bool selected, bool focused) + { + Component component = components[task.ComponentIndex]; + + switch ((Column)columnIndex) + { + case Column.Asset: + if (Event.current.type == EventType.Repaint) + { + Texture2D typeIcon = Icons.GetComponentIcon(components[task.ComponentIndex]); + + using (new GUI.GroupScope(rect)) + { + Rect iconRect = new Rect(0, 0, rect.height, rect.height); + + GUI.DrawTexture(iconRect, typeIcon, ScaleMode.ScaleToFit); + + GUIContent type = new GUIContent(component.Type); + + bool hasGameObjectPath = !string.IsNullOrEmpty(component.Path); + + if (hasGameObjectPath) + { + type.text += L10n.Tr(" on"); + } + + Rect typeRect = new Rect(iconRect.xMax, 0, + DefaultStyles.label.CalcSize(type).x, rect.height); + + DefaultGUI.Label(typeRect, type.text, selected, focused); + + if (hasGameObjectPath) + { + iconRect.x = typeRect.xMax; + + GUI.DrawTexture(iconRect, Icons.GameObject, ScaleMode.ScaleToFit); + + GUIContent gameObject = new GUIContent(component.Path); + + Rect gameObjectRect = new Rect(iconRect.xMax, 0, + DefaultStyles.label.CalcSize(gameObject).x, rect.height); + + DefaultGUI.Label(gameObjectRect, gameObject.text, selected, focused); + } + } + } + + break; + case Column.Task: + if (Event.current.type == EventType.Repaint) + { + string text = task.ToString(); + + if (task.IsManual()) + { + text = L10n.Tr("Manual task: ") + text; + } + + Styles.TreeViewRichText.Draw(rect, text, false, false, selected, focused); + } + break; + case Column.Status: + if (Event.current.type == EventType.Repaint) + { + if (task.IsManual()) + { + DefaultGUI.Label(rect, L10n.Tr("Manual Changes Required"), selected, focused); + } + else + { + DefaultGUI.Label(rect, task.HasExecuted ? L10n.Tr("Complete") : L10n.Tr("Pending"), selected, focused); + } + } + break; + } + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EventReferenceUpdater.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventReferenceUpdater.cs.meta new file mode 100644 index 00000000..8c442394 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventReferenceUpdater.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b58df65bd3bb6649801b24a7a942ccb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/FMODEventPlayableEditor.cs b/Assets/Plugins/FMOD/src/Editor/FMODEventPlayableEditor.cs new file mode 100644 index 00000000..26cacd75 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FMODEventPlayableEditor.cs @@ -0,0 +1,501 @@ +#if UNITY_TIMELINE_EXIST + +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.Timeline; +using UnityEngine; +using UnityEngine.Timeline; +using System; +using System.Linq; +using System.Reflection; + +namespace FMODUnity +{ + [CustomEditor(typeof(FMODEventPlayable))] + public class FMODEventPlayableEditor : Editor + { + private FMODEventPlayable eventPlayable; + private EditorEventRef editorEventRef; + private List missingInitialParameterValues = new List(); + private List missingParameterAutomations = new List(); + + private SerializedProperty parametersProperty; + private SerializedProperty parameterLinksProperty; + private SerializedProperty parameterAutomationProperty; + + private ListView parameterLinksView; + private ListView initialParameterValuesView; + + private string eventPath; + + public void OnEnable() + { + eventPlayable = target as FMODEventPlayable; + + parametersProperty = serializedObject.FindProperty("Parameters"); + parameterLinksProperty = serializedObject.FindProperty("Template.ParameterLinks"); + parameterAutomationProperty = serializedObject.FindProperty("Template.ParameterAutomation"); + + parameterLinksView = new ListView(parameterLinksProperty); + parameterLinksView.drawElementWithLabelCallback = DrawParameterLink; + parameterLinksView.onCanAddCallback = (list) => missingParameterAutomations.Count > 0; + parameterLinksView.onAddDropdownCallback = DoAddParameterLinkMenu; + parameterLinksView.onRemoveCallback = (list) => DeleteParameterAutomation(list.index); + + initialParameterValuesView = new ListView(parametersProperty); + initialParameterValuesView.drawElementWithLabelCallback = DrawInitialParameterValue; + initialParameterValuesView.onCanAddCallback = (list) => missingInitialParameterValues.Count > 0; + initialParameterValuesView.onAddDropdownCallback = DoAddInitialParameterValueMenu; + initialParameterValuesView.onRemoveCallback = (list) => DeleteInitialParameterValue(list.index); + + RefreshEventRef(); + + Undo.undoRedoPerformed += OnUndoRedo; + } + + public void OnDestroy() + { + Undo.undoRedoPerformed -= OnUndoRedo; + } + + private void OnUndoRedo() + { + RefreshMissingParameterLists(); + + // This is in case the undo/redo modified any curves on the Playable's clip + RefreshTimelineEditor(); + } + + private void RefreshEventRef() + { + if (eventPath != eventPlayable.EventReference.Path) + { + eventPath = eventPlayable.EventReference.Path; + + if (!string.IsNullOrEmpty(eventPath)) + { + editorEventRef = EventManager.EventFromPath(eventPath); + } + else + { + editorEventRef = null; + } + + if (editorEventRef != null) + { + eventPlayable.UpdateEventDuration( + editorEventRef.IsOneShot ? editorEventRef.Length : float.PositiveInfinity); + } + + ValidateParameterSettings(); + RefreshMissingParameterLists(); + } + } + + private void ValidateParameterSettings() + { + if (editorEventRef != null) + { + List namesToDelete = new List(); + + for (int i = 0; i < parametersProperty.arraySize; ++i) + { + SerializedProperty current = parametersProperty.GetArrayElementAtIndex(i); + SerializedProperty name = current.FindPropertyRelative("Name"); + + EditorParamRef paramRef = editorEventRef.LocalParameters.FirstOrDefault(p => p.Name == name.stringValue); + + if (paramRef != null) + { + SerializedProperty value = current.FindPropertyRelative("Value"); + value.floatValue = Mathf.Clamp(value.floatValue, paramRef.Min, paramRef.Max); + } + else + { + namesToDelete.Add(name.stringValue); + } + } + + foreach(string name in namesToDelete) + { + DeleteInitialParameterValue(name); + } + + namesToDelete.Clear(); + + for (int i = 0; i < parameterLinksProperty.arraySize; ++i) + { + SerializedProperty current = parameterLinksProperty.GetArrayElementAtIndex(i); + SerializedProperty name = current.FindPropertyRelative("Name"); + + if (!editorEventRef.LocalParameters.Any(p => p.Name == name.stringValue)) + { + namesToDelete.Add(name.stringValue); + } + } + + foreach(string name in namesToDelete) + { + DeleteParameterAutomation(name); + } + } + } + + private void RefreshMissingParameterLists() + { + if (editorEventRef != null) + { + serializedObject.Update(); + + missingInitialParameterValues = + editorEventRef.LocalParameters.Where(p => !InitialParameterValueExists(p.Name)).ToList(); + missingParameterAutomations = + editorEventRef.LocalParameters.Where(p => !ParameterLinkExists(p.Name)).ToList(); + } + else + { + missingInitialParameterValues.Clear(); + missingParameterAutomations.Clear(); + } + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + RefreshEventRef(); + + var eventReference = serializedObject.FindProperty("EventReference"); + var stopType = serializedObject.FindProperty("StopType"); + + const string EventReferenceLabel = "Event"; + + EditorUtils.DrawLegacyEvent(serializedObject.FindProperty("eventName"), EventReferenceLabel); + + EditorGUILayout.PropertyField(eventReference, new GUIContent(EventReferenceLabel)); + EditorGUILayout.PropertyField(stopType, new GUIContent("Stop Mode")); + + DrawInitialParameterValues(); + DrawParameterAutomations(); + + eventPlayable.OnValidate(); + + serializedObject.ApplyModifiedProperties(); + } + + private void DrawInitialParameterValues() + { + if (editorEventRef != null) + { + parametersProperty.isExpanded = + EditorGUILayout.Foldout(parametersProperty.isExpanded, "Initial Parameter Values", true); + + if (parametersProperty.isExpanded) + { + initialParameterValuesView.DrawLayout(); + } + } + } + + private void DoAddInitialParameterValueMenu(Rect rect, UnityEditorInternal.ReorderableList list) + { + GenericMenu menu = new GenericMenu(); + menu.AddItem(new GUIContent("All"), false, () => + { + foreach (EditorParamRef parameter in missingInitialParameterValues) + { + AddInitialParameterValue(parameter); + } + }); + + menu.AddSeparator(string.Empty); + + foreach (EditorParamRef parameter in missingInitialParameterValues) + { + string text = parameter.Name; + + if (ParameterLinkExists(parameter.Name)) + { + text += " (automated)"; + } + + menu.AddItem(new GUIContent(text), false, + (userData) => + { + AddInitialParameterValue(userData as EditorParamRef); + }, + parameter); + } + + menu.DropDown(rect); + } + + private void DrawInitialParameterValue(Rect rect, float labelRight, int index, bool active, bool focused) + { + if (editorEventRef == null) + { + return; + } + + SerializedProperty property = parametersProperty.GetArrayElementAtIndex(index); + + string name = property.FindPropertyRelative("Name").stringValue; + + EditorParamRef paramRef = editorEventRef.LocalParameters.FirstOrDefault(p => p.Name == name); + + if (paramRef == null) + { + return; + } + + Rect nameLabelRect = rect; + nameLabelRect.xMax = labelRight; + + Rect sliderRect = rect; + sliderRect.xMin = nameLabelRect.xMax; + + SerializedProperty valueProperty = property.FindPropertyRelative("Value"); + + GUI.Label(nameLabelRect, name); + + using (new NoIndentScope()) + { + valueProperty.floatValue = + EditorGUI.Slider(sliderRect, valueProperty.floatValue, paramRef.Min, paramRef.Max); + } + } + + private void DrawParameterAutomations() + { + if (editorEventRef != null) + { + parameterLinksProperty.isExpanded = + EditorGUILayout.Foldout(parameterLinksProperty.isExpanded, "Parameter Automations", true); + + if (parameterLinksProperty.isExpanded) + { + parameterLinksView.DrawLayout(); + } + } + } + + private void DoAddParameterLinkMenu(Rect rect, UnityEditorInternal.ReorderableList list) + { + GenericMenu menu = new GenericMenu(); + menu.AddItem(new GUIContent("All"), false, () => + { + foreach (EditorParamRef parameter in missingParameterAutomations) + { + AddParameterAutomation(parameter.Name); + } + }); + + menu.AddSeparator(string.Empty); + + foreach (EditorParamRef parameter in missingParameterAutomations) + { + string text = parameter.Name; + + if (InitialParameterValueExists(parameter.Name)) + { + text += " (has initial value)"; + } + + menu.AddItem(new GUIContent(text), false, + (userData) => + { + AddParameterAutomation(userData as string); + }, + parameter.Name); + } + + menu.DropDown(rect); + } + + private void DrawParameterLink(Rect rect, float labelRight, int index, bool active, bool focused) + { + if (editorEventRef == null) + { + return; + } + + SerializedProperty linkProperty = parameterLinksProperty.GetArrayElementAtIndex(index); + + string name = linkProperty.FindPropertyRelative("Name").stringValue; + + EditorParamRef paramRef = editorEventRef.LocalParameters.FirstOrDefault(p => p.Name == name); + + if (paramRef == null) + { + return; + } + + int slot = linkProperty.FindPropertyRelative("Slot").intValue; + + string slotName = string.Format("Slot{0:D2}", slot); + SerializedProperty valueProperty = parameterAutomationProperty.FindPropertyRelative(slotName); + + GUIStyle slotStyle = GUI.skin.label; + + Rect slotRect = rect; + slotRect.width = slotStyle.CalcSize(new GUIContent("slot 00:")).x; + + Rect nameRect = rect; + nameRect.xMin = slotRect.xMax; + nameRect.xMax = labelRight; + + Rect valueRect = rect; + valueRect.xMin = nameRect.xMax; + + using (new EditorGUI.PropertyScope(rect, GUIContent.none, valueProperty)) + { + GUI.Label(slotRect, string.Format("slot {0:D2}:", slot), slotStyle); + GUI.Label(nameRect, name); + + using (new NoIndentScope()) + { + valueProperty.floatValue = + EditorGUI.Slider(valueRect, valueProperty.floatValue, paramRef.Min, paramRef.Max); + } + } + } + + private bool InitialParameterValueExists(string name) + { + return parametersProperty.ArrayContains("Name", p => p.stringValue == name); + } + + private bool ParameterLinkExists(string name) + { + return parameterLinksProperty.ArrayContains("Name", p => p.stringValue == name); + } + + private void AddInitialParameterValue(EditorParamRef editorParamRef) + { + serializedObject.Update(); + + if (!InitialParameterValueExists(editorParamRef.Name)) + { + DeleteParameterAutomation(editorParamRef.Name); + + parametersProperty.ArrayAdd(p => { + p.FindPropertyRelative("Name").stringValue = editorParamRef.Name; + p.FindPropertyRelative("Value").floatValue = editorParamRef.Default; + }); + + serializedObject.ApplyModifiedProperties(); + + RefreshMissingParameterLists(); + } + } + + private void DeleteInitialParameterValue(string name) + { + serializedObject.Update(); + + int index = parametersProperty.FindArrayIndex("Name", p => p.stringValue == name); + + if (index >= 0) + { + DeleteInitialParameterValue(index); + } + } + + private void DeleteInitialParameterValue(int index) + { + serializedObject.Update(); + + parametersProperty.DeleteArrayElementAtIndex(index); + + serializedObject.ApplyModifiedProperties(); + RefreshMissingParameterLists(); + } + + private void AddParameterAutomation(string name) + { + serializedObject.Update(); + + if (!ParameterLinkExists(name)) + { + int slot = -1; + + for (int i = 0; i < AutomatableSlots.Count; ++i) + { + if (!parameterLinksProperty.ArrayContains("Slot", p => p.intValue == i)) + { + slot = i; + break; + } + } + + if (slot >= 0) + { + DeleteInitialParameterValue(name); + + parameterLinksProperty.ArrayAdd(p => { + p.FindPropertyRelative("Name").stringValue = name; + p.FindPropertyRelative("Slot").intValue = slot; + }); + + serializedObject.ApplyModifiedProperties(); + + RefreshMissingParameterLists(); + RefreshTimelineEditor(); + } + } + } + + private void DeleteParameterAutomation(string name) + { + serializedObject.Update(); + + int index = parameterLinksProperty.FindArrayIndex("Name", p => p.stringValue == name); + + if (index >= 0) + { + DeleteParameterAutomation(index); + } + } + + private void DeleteParameterAutomation(int index) + { + serializedObject.Update(); + + if (eventPlayable.OwningClip.hasCurves) + { + SerializedProperty linkProperty = parameterLinksProperty.GetArrayElementAtIndex(index); + SerializedProperty slotProperty = linkProperty.FindPropertyRelative("Slot"); + + AnimationClip curvesClip = eventPlayable.OwningClip.curves; + + Undo.RecordObject(curvesClip, string.Empty); + AnimationUtility.SetEditorCurve(curvesClip, GetParameterCurveBinding(slotProperty.intValue), null); + } + + parameterLinksProperty.DeleteArrayElementAtIndex(index); + + serializedObject.ApplyModifiedProperties(); + + RefreshMissingParameterLists(); + + RefreshTimelineEditor(); + } + + private static EditorCurveBinding GetParameterCurveBinding(int index) + { + EditorCurveBinding result = new EditorCurveBinding() { + path = string.Empty, + type = typeof(FMODEventPlayable), + propertyName = string.Format("parameterAutomation.slot{0:D2}", index), + }; + + return result; + } + + private static void RefreshTimelineEditor() + { + TimelineEditor.Refresh(RefreshReason.ContentsAddedOrRemoved); + } + } +} +#endif diff --git a/Assets/Plugins/FMOD/src/Editor/FMODEventPlayableEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/FMODEventPlayableEditor.cs.meta new file mode 100644 index 00000000..ecbaeb44 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FMODEventPlayableEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fa325be8441506c4bb1462c8333ccce9 +timeCreated: 1523230773 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/FMODEventTrackEditor.cs b/Assets/Plugins/FMOD/src/Editor/FMODEventTrackEditor.cs new file mode 100644 index 00000000..328af4e6 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FMODEventTrackEditor.cs @@ -0,0 +1,38 @@ +#if UNITY_TIMELINE_EXIST + +using UnityEditor; +using UnityEditor.Timeline; +using UnityEngine; +using UnityEngine.Timeline; + +namespace FMODUnity +{ + [CustomTimelineEditor(typeof(FMODEventTrack))] + public class FMODEventTrackEditor : TrackEditor + { + private static readonly Texture2D icon = EditorUtils.LoadImage("StudioIcon.png"); + + public override TrackDrawOptions GetTrackOptions(TrackAsset track, Object binding) + { + TrackDrawOptions options = base.GetTrackOptions(track, binding); + options.icon = icon; + + return options; + } + } + + // This custom property drawer is here to draw the volume property at the + // top level of the inspector, rather than in a Template foldout. + [CustomPropertyDrawer(typeof(FMODEventMixerBehaviour))] + public class FMODEventMixerBehaviourInspector : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + SerializedProperty volumeProperty = property.FindPropertyRelative("volume"); + + EditorGUI.PropertyField(position, volumeProperty); + } + } +} + +#endif diff --git a/Assets/Plugins/FMOD/src/Editor/FMODEventTrackEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/FMODEventTrackEditor.cs.meta new file mode 100644 index 00000000..7696ab24 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FMODEventTrackEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31e1c5e7d70e58f45ae86764f7c3ec2f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef b/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef new file mode 100644 index 00000000..8ed4a9ff --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef @@ -0,0 +1,47 @@ +{ + "name": "FMODUnityEditor", + "references": [ + "FMODUnity", + "Unity.Timeline.Editor", + "Unity.Timeline", + "Unity.VisualScripting.Core", + "Unity.VisualScripting.Core.Editor", + "Unity.VisualScripting.Flow.Editor", + "Unity.ScriptableBuildPipeline.Editor", + "Unity.InputSystem" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_2021_3_OR_NEWER" + ], + "versionDefines": [ + { + "name": "com.unity.timeline", + "expression": "1.0.0", + "define": "UNITY_TIMELINE_EXIST" + }, + { + "name": "com.unity.addressables", + "expression": "1.0.0", + "define": "UNITY_ADDRESSABLES_EXIST" + }, + { + "name": "com.unity.visualscripting", + "expression": "1.0.0", + "define": "UNITY_VISUALSCRIPTING_EXIST" + }, + { + "name": "com.unity.inputsystem", + "expression": "1.0.0", + "define": "UNITY_INPUTSYSTEM_EXIST" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef.meta b/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef.meta new file mode 100644 index 00000000..ceb2e409 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: aab3caaf43456d6449a3e035348ff798 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/FileReorganizer.cs b/Assets/Plugins/FMOD/src/Editor/FileReorganizer.cs new file mode 100644 index 00000000..508bd97b --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FileReorganizer.cs @@ -0,0 +1,1380 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEditor.IMGUI.Controls; +using UnityEngine; + +namespace FMODUnity +{ + public class FileReorganizer : EditorWindow, ISerializationCallbackReceiver + { + public const string ReorganizerMenuItemPath = "FMOD/Reorganize Plugin Files"; + + [SerializeField] + private List tasks = new List(); + + [SerializeField] + private int taskCount; + + [SerializeField] + private int currentTask; + + private TaskView taskView; + + [SerializeField] + private TreeViewState taskViewState = new TreeViewState(); + + [SerializeField] + private MultiColumnHeaderState taskHeaderState; + + [SerializeField] + private bool reloadingFromSerializedState = false; + + [NonSerialized] + private GUIContent statusContent = GUIContent.none; + + private IEnumerator processingState; + + [MenuItem(ReorganizerMenuItemPath)] + public static void ShowWindow() + { + FileReorganizer reorganizer = GetWindow(L10n.Tr("FMOD File Reorganizer")); + reorganizer.minSize = new Vector2(850, 600); + + reorganizer.PopulateTasks(); + + reorganizer.Show(); + } + + [Serializable] + private class Task + { + public int step = int.MaxValue; + + private Task() + { + } + + public static Task Move(string source, string destination, Platform platform) + { + return new Task() { + type = Type.Move, + status = Status.Pending, + platform = platform, + source = source, + destination = destination, + statusText = string.Format(L10n.Tr("{0} will be moved to\n{1}"), source, destination), + }; + } + + public static Task RemoveFolder(string path) + { + return new Task() { + type = Type.RemoveFolder, + status = Status.Pending, + source = path, + statusText = string.Format(L10n.Tr("{0} will be removed if it is empty"), path), + }; + } + + public static Task Missing(string path, Platform platform) + { + return new Task() { + type = Type.Missing, + status = Status.Missing, + platform = platform, + source = path, + statusText = string.Format( + L10n.Tr("{0} is missing.\nYou may need to reinstall the {1} support package from {2}."), + path, platform.DisplayName, EditorSettings.DownloadURL), + }; + } + + public static Task RemoveAsset(string path, Platform platform) + { + return new Task() { + type = Type.RemoveAsset, + status = Status.Pending, + platform = platform, + source = path, + statusText = string.Format(L10n.Tr("{0} will be removed"), path), + }; + } + + public Platform platform { get; private set; } + public string source { get; private set; } + public string destination { get; private set; } + + public enum Status + { + Pending, + Succeeded, + Failed, + Missing, + } + + public Status status { get; private set; } + public string statusText { get; private set; } + + public void SetSucceeded(string message) + { + status = Status.Succeeded; + statusText = message; + } + + public void SetFailed(string message) + { + status = Status.Failed; + statusText = message; + } + + public enum Type + { + Move, + RemoveFolder, + RemoveAsset, + Missing, + } + + public Type type { get; private set; } + + public string platformName { get { return (platform != null) ? platform.DisplayName : string.Empty; } } + } + + public void OnBeforeSerialize() + { + taskViewState = taskView.state; + taskHeaderState = taskView.multiColumnHeader.state; + } + + public void OnAfterDeserialize() + { + } + + private void OnEnable() + { + { + MultiColumnHeaderState newHeaderState = TaskView.CreateHeaderState(); + + if (MultiColumnHeaderState.CanOverwriteSerializedFields(taskHeaderState, newHeaderState)) + { + MultiColumnHeaderState.OverwriteSerializedFields(taskHeaderState, newHeaderState); + } + + taskHeaderState = newHeaderState; + } + + MultiColumnHeader taskHeader = new MultiColumnHeader(taskHeaderState); + + taskView = new TaskView(taskViewState, taskHeader, tasks); + taskView.taskSelected += OnTaskSelected; + + taskView.Reload(); + + if (reloadingFromSerializedState) + { + taskView.SortRows(); + } + else + { + taskHeader.ResizeToFit(); + taskHeader.SetSorting((int)TaskView.Column.Step, true); + } + + reloadingFromSerializedState = true; + + EditorApplication.update += ProcessNextTask; + } + + private void OnDestroy() + { + EditorApplication.update -= ProcessNextTask; + + StopProcessing(); + } + + private void PopulateTasks() + { + tasks.Clear(); + + TaskGenerator.Generate(tasks); + + SetTaskSequence(); + UpdateTaskCount(); + SetDefaultStatus(); + + taskView.Reload(); + taskView.SortRows(); + } + + public static bool IsUpToDate() + { + List tasks = new List(); + + TaskGenerator.Generate(tasks); + + return !tasks.Any(t => t.type != Task.Type.Missing); + } + + private void SetDefaultStatus() + { + int missingCount = tasks.Count(t => t.type == Task.Type.Missing); + + if (missingCount > 0) + { + string message; + + if (missingCount == 1) + { + message = L10n.Tr("There is a file missing. Select it above for more information."); + } + else + { + message = string.Format( + L10n.Tr("There are {0} files missing. Select them above for more information."), missingCount); + } + + statusContent = new GUIContent(message, Resources.StatusIcon[Task.Status.Missing]); + } + else + { + statusContent = GUIContent.none; + } + } + + private void SetTaskSequence() + { + int step = 1; + + foreach (Task task in tasks.Where(t => t.type == Task.Type.Move)) + { + task.step = step; + ++step; + } + + foreach (Task task in tasks.Where(t => t.type == Task.Type.RemoveAsset)) + { + task.step = step; + ++step; + } + + // Sort folder tasks in reverse path order, so subfolders are processed before their parents + foreach (Task task in tasks.Where(t => t.type == Task.Type.RemoveFolder).OrderByDescending(t => t.source)) + { + task.step = step; + ++step; + } + + tasks.Sort((a, b) => a.step.CompareTo(b.step)); + } + + private void UpdateTaskCount() + { + taskCount = tasks.Count(t => t.status == Task.Status.Pending); + } + + private class TaskView : TreeView + { + private List tasks; + + public delegate void TaskSelectedHandler(Task task); + + public event TaskSelectedHandler taskSelected; + + public TaskView(TreeViewState state, MultiColumnHeader header, List tasks) + : base(state, header) + { + this.tasks = tasks; + + showAlternatingRowBackgrounds = true; + + header.sortingChanged += SortRows; + } + + public static MultiColumnHeaderState CreateHeaderState() + { + MultiColumnHeaderState.Column[] columns = new MultiColumnHeaderState.Column[] { + new MultiColumnHeaderState.Column() + { + headerContent = new GUIContent(L10n.Tr("Task #")), + width = 50, + autoResize = false, + allowToggleVisibility = false, + }, + new MultiColumnHeaderState.Column() + { + headerContent = new GUIContent(L10n.Tr("Status")), + width = 100, + autoResize = false, + allowToggleVisibility = false, + }, + new MultiColumnHeaderState.Column() { + headerContent = new GUIContent(L10n.Tr("Platform")), + width = 150, + autoResize = false, + allowToggleVisibility = false, + }, + new MultiColumnHeaderState.Column() + { + headerContent = new GUIContent(L10n.Tr("Description")), + minWidth = 500, + allowToggleVisibility = false, + }, + }; + + return new MultiColumnHeaderState(columns); + } + + public enum Column + { + Step, + Status, + Platform, + Description, + } + + private class TaskItem : TreeViewItem + { + public Task task; + } + + protected override TreeViewItem BuildRoot() + { + TreeViewItem root = new TreeViewItem(-1, -1); + + if (tasks.Count > 0) + { + int index = 0; + + foreach (Task task in tasks) + { + TreeViewItem taskItem = new TaskItem() { + id = index++, + task = task, + }; + + root.AddChild(taskItem); + } + } + else + { + TreeViewItem item = new TreeViewItem(0); + item.displayName = L10n.Tr("Nothing to do here."); + + root.AddChild(item); + } + + SetupDepthsFromParentsAndChildren(root); + + return root; + } + + protected override bool CanMultiSelect(TreeViewItem item) + { + return false; + } + + protected override void SelectionChanged(IList selectedIds) + { + base.SelectionChanged(selectedIds); + + if (taskSelected != null) + { + if (selectedIds.Count > 0) + { + TaskItem item = FindItem(selectedIds[0], rootItem) as TaskItem; + + if (item != null) + { + taskSelected(item.task); + return; + } + } + + taskSelected(null); + } + } + + public void SortRows() + { + SortRows(multiColumnHeader); + } + + private void SortRows(MultiColumnHeader header) + { + IList rows = GetRows(); + int[] sortedColumns = header.state.sortedColumns; + + if (sortedColumns.Length > 0 && rows.Count > 1) + { + int firstColumn = sortedColumns[0]; + + IOrderedEnumerable query = + InitialQuery(rows, (Column)firstColumn, header.IsSortedAscending(firstColumn)); + + for (int i = 1; i < sortedColumns.Length; ++i) + { + query = SubQuery(query, sortedColumns[i], header.IsSortedAscending(sortedColumns[i])); + } + + // We need to execute the query before clearing rows, otherwise it returns nothing + List newRows = query.ToList(); + + rows.Clear(); + + foreach (TreeViewItem item in newRows) + { + rows.Add(item); + } + } + + RefreshCustomRowHeights(); + } + + private IOrderedEnumerable InitialQuery(IList rows, Column column, bool ascending) + { + switch (column) + { + case Column.Step: + return Sort(rows, r => (r as TaskItem).task.step, ascending); + case Column.Status: + return Sort(rows, r => (r as TaskItem).task.status, ascending); + case Column.Platform: + return Sort(rows, r => (r as TaskItem).task.platformName, ascending); + case Column.Description: + return Sort(rows, r => (r as TaskItem).task.source, ascending); + default: + throw new ArgumentException("Unrecognised column: " + column); + } + } + + private static IOrderedEnumerable SubQuery( + IOrderedEnumerable query, int column, bool ascending) + { + switch ((Column)column) + { + case Column.Step: + return SubSort(query, r => (r as TaskItem).task.step, ascending); + case Column.Status: + return SubSort(query, r => (r as TaskItem).task.status, ascending); + case Column.Platform: + return SubSort(query, r => (r as TaskItem).task.platformName, ascending); + case Column.Description: + return SubSort(query, r => (r as TaskItem).task.source, ascending); + default: + throw new ArgumentException("Unrecognised column: " + column); + } + } + + protected override float GetCustomRowHeight(int row, TreeViewItem item) + { + if (item is TaskItem) + { + Task task = (item as TaskItem).task; + + if (task.type == Task.Type.Move) + { + return EditorGUIUtility.singleLineHeight * 2; + } + else + { + return Resources.StatusHeight(); + } + } + else + { + return base.GetCustomRowHeight(row, item); + } + } + + protected override void RowGUI(RowGUIArgs args) + { + if (args.item is TaskItem) + { + TaskItem taskItem = args.item as TaskItem; + + for (int i = 0; i < args.GetNumVisibleColumns(); ++i) + { + CellGUI(args.GetCellRect(i), taskItem.task, args.GetColumn(i)); + } + } + else + { + base.RowGUI(args); + } + } + + private void CellGUI(Rect rect, Task task, int columnIndex) + { + switch ((Column)columnIndex) + { + case Column.Step: + if (task.step != int.MaxValue) + { + GUI.Label(rect, task.step.ToString(), Resources.StepStyle()); + } + break; + case Column.Status: + GUI.Label(rect, Resources.StatusContent[task.status], Resources.StatusColumnStyle()); + break; + case Column.Platform: + GUI.Label(rect, task.platformName, Resources.PlatformStyle()); + break; + case Column.Description: + DrawDescription(rect, task); + break; + } + } + + private void DrawDescription(Rect rect, Task task) + { + switch (task.type) + { + case Task.Type.Move: + DrawMoveDescription(rect, task); + break; + case Task.Type.RemoveFolder: + DrawRemoveFolderDescription(rect, task); + break; + case Task.Type.RemoveAsset: + DrawRemoveAssetDescription(rect, task); + break; + case Task.Type.Missing: + DrawMissingDescription(rect, task); + break; + } + } + + private void DrawMoveDescription(Rect rect, Task task) + { + Rect sourcePrefixRect = new Rect(rect.x, rect.y, Resources.PrefixSize().x, Resources.PrefixSize().y); + + Rect destinationPrefixRect = sourcePrefixRect; + destinationPrefixRect.y = sourcePrefixRect.yMax; + + Rect sourceRect = sourcePrefixRect; + sourceRect.x = sourcePrefixRect.xMax; + sourceRect.xMax = rect.xMax; + + Rect destinationRect = destinationPrefixRect; + destinationRect.x = destinationPrefixRect.xMax; + destinationRect.xMax = rect.xMax; + + EditorGUI.BeginDisabledGroup(true); + + GUI.Label(sourcePrefixRect, Resources.SourcePrefix, Resources.PrefixStyle()); + GUI.Label(destinationPrefixRect, Resources.DestinationPrefix, Resources.PrefixStyle()); + + EditorGUI.EndDisabledGroup(); + + DrawAssetPath(sourceRect, task.source); + DrawAssetPath(destinationRect, task.destination); + } + + private void DrawRemoveFolderDescription(Rect rect, Task task) + { + Rect prefixRect = new Rect(rect.x, rect.y, Resources.PrefixSize().x, Resources.PrefixSize().y); + + Rect pathRect = prefixRect; + pathRect.x = prefixRect.xMax; + pathRect.width = Resources.AssetPathStyle().CalcSize(new GUIContent(task.source)).x; + + Rect suffixRect = prefixRect; + suffixRect.x = pathRect.xMax; + suffixRect.xMax = rect.xMax; + + EditorGUI.BeginDisabledGroup(true); + + GUI.Label(prefixRect, Resources.RemovePrefix, Resources.PrefixStyle()); + + EditorGUI.EndDisabledGroup(); + + DrawAssetPath(pathRect, task.source); + + EditorGUI.BeginDisabledGroup(true); + + GUI.Label(suffixRect, L10n.Tr("if empty"), Resources.SuffixStyle()); + + EditorGUI.EndDisabledGroup(); + } + + private void DrawRemoveAssetDescription(Rect rect, Task task) + { + Rect prefixRect = new Rect(rect.x, rect.y, Resources.PrefixSize().x, Resources.PrefixSize().y); + + Rect pathRect = prefixRect; + pathRect.x = prefixRect.xMax; + pathRect.width = Resources.AssetPathStyle().CalcSize(new GUIContent(task.source)).x; + + EditorGUI.BeginDisabledGroup(true); + + GUI.Label(prefixRect, Resources.RemovePrefix, Resources.PrefixStyle()); + + EditorGUI.EndDisabledGroup(); + + DrawAssetPath(pathRect, task.source); + } + + private void DrawMissingDescription(Rect rect, Task task) + { + Rect sourceRect = rect; + sourceRect.xMin += Resources.PrefixSize().x; + + DrawAssetPath(sourceRect, task.source); + } + } + + private static IOrderedEnumerable Sort(IEnumerable enumerable, + Func keySelector, bool ascending) + { + if (ascending) + { + return enumerable.OrderBy(keySelector); + } + else + { + return enumerable.OrderByDescending(keySelector); + } + } + + private static IOrderedEnumerable SubSort(IOrderedEnumerable enumerable, + Func keySelector, bool ascending) + { + if (ascending) + { + return enumerable.ThenBy(keySelector); + } + else + { + return enumerable.ThenByDescending(keySelector); + } + } + + private class Resources + { + private static GUIStyle statusColumnStyle; + + private static GUIStyle statusBarStyle; + + private static float statusHeight; + + private static GUIStyle stepStyle; + + public static readonly GUIContent SourcePrefix = new GUIContent("Move"); + public static readonly GUIContent DestinationPrefix = new GUIContent("to"); + public static readonly GUIContent RemovePrefix = new GUIContent(L10n.Tr("Remove")); + + private static Vector2 prefixSize; + + private static GUIStyle prefixStyle; + + private static GUIStyle suffixStyle; + + private static GUIStyle assetPathStyle; + + private static bool cacheInitialized = false; + + public static readonly Dictionary StatusIcon = + new Dictionary() { + { Task.Status.Pending, EditorGUIUtility.FindTexture("TestNormal") }, + { Task.Status.Succeeded, EditorGUIUtility.FindTexture("TestPassed") }, + { Task.Status.Failed, EditorGUIUtility.FindTexture("TestFailed") }, + { Task.Status.Missing, EditorGUIUtility.FindTexture("console.warnicon.sml") }, + }; + + public static readonly Dictionary StatusContent = + new Dictionary() { + { Task.Status.Pending, new GUIContent(L10n.Tr("Pending"), StatusIcon[Task.Status.Pending]) }, + { Task.Status.Succeeded, new GUIContent(L10n.Tr("Succeeded"), StatusIcon[Task.Status.Succeeded]) }, + { Task.Status.Failed, new GUIContent(L10n.Tr("Failed"), StatusIcon[Task.Status.Failed]) }, + { Task.Status.Missing, new GUIContent(L10n.Tr("Missing"), StatusIcon[Task.Status.Missing]) }, + }; + + public static GUIStyle StatusColumnStyle() + { + AffirmCache(); + return statusColumnStyle; + } + + public static GUIStyle StatusBarStyle() + { + AffirmCache(); + return statusBarStyle; + } + + public static GUIStyle PlatformStyle() + { + return StatusColumnStyle(); + } + + public static float StatusHeight() + { + if (statusHeight == 0) + { + foreach (var current in StatusIcon) + { + statusHeight = Math.Max(statusHeight, current.Value.height + 4); + } + } + + return statusHeight; + } + + public static GUIStyle StepStyle() + { + AffirmCache(); + return stepStyle; + } + + public static Vector2 PrefixSize() + { + AffirmCache(); + return prefixSize; + } + + public static GUIStyle PrefixStyle() + { + AffirmCache(); + return prefixStyle; + } + + public static GUIStyle SuffixStyle() + { + AffirmCache(); + return suffixStyle; + } + + public static GUIStyle AssetPathStyle() + { + AffirmCache(); + return assetPathStyle; + } + + private static void AffirmCache() + { + if (!cacheInitialized) + { + cacheInitialized = true; + + statusColumnStyle = new GUIStyle(GUI.skin.label) { + alignment = TextAnchor.MiddleLeft, + }; + + statusBarStyle = new GUIStyle(GUI.skin.label) { + alignment = TextAnchor.UpperLeft, + wordWrap = true, + }; + + stepStyle = new GUIStyle(GUI.skin.label) { + alignment = TextAnchor.MiddleRight, + }; + + prefixStyle = new GUIStyle(GUI.skin.label) { + alignment = TextAnchor.MiddleRight, + }; + + suffixStyle = new GUIStyle(GUI.skin.label) { + alignment = TextAnchor.MiddleLeft, + }; + + assetPathStyle = new GUIStyle(GUI.skin.label); + + prefixSize = prefixStyle.CalcSize(SourcePrefix); + prefixSize = Vector2.Max(prefixSize, prefixStyle.CalcSize(DestinationPrefix)); + prefixSize = Vector2.Max(prefixSize, prefixStyle.CalcSize(RemovePrefix)); + } + } + } + + private void OnTaskSelected(Task task) + { + if (task != null) + { + statusContent = new GUIContent(task.statusText, Resources.StatusIcon[task.status]); + } + else + { + SetDefaultStatus(); + } + } + + private void OnGUI() + { + if (focusedWindow == this + && Event.current.type == EventType.KeyDown + && Event.current.keyCode == KeyCode.Escape) + { + Cancel(); + Event.current.Use(); + } + + // Task list + GUILayout.BeginVertical(GUI.skin.box); + + Rect treeViewRect = GUILayoutUtility.GetRect(0, 0, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + + taskView.OnGUI(treeViewRect); + + GUILayout.EndVertical(); + + // Status bar + GUILayout.BeginHorizontal(GUI.skin.box, GUILayout.Height(EditorGUIUtility.singleLineHeight * 2)); + + GUILayout.Label(statusContent.image, GUILayout.ExpandWidth(false)); + EditorGUILayout.SelectableLabel(statusContent.text, Resources.StatusBarStyle()); + + GUILayout.EndHorizontal(); + + // Buttons + float buttonHeight = EditorGUIUtility.singleLineHeight * 2; + + GUILayout.BeginHorizontal(); + + if (GUILayout.Button(L10n.Tr("Cancel"), GUILayout.Height(buttonHeight))) + { + Cancel(); + } + + EditorGUI.BeginDisabledGroup(IsProcessing()); + + if (GUILayout.Button(L10n.Tr("Refresh"), GUILayout.Height(buttonHeight))) + { + PopulateTasks(); + } + + EditorGUI.EndDisabledGroup(); + + if (IsProcessing()) + { + EditorGUI.BeginDisabledGroup(true); + + GUILayout.Button(string.Format(L10n.Tr("Processing Task {0} of {1}"), currentTask, taskCount), GUILayout.Height(buttonHeight)); + + EditorGUI.EndDisabledGroup(); + } + else + { + if (GUILayout.Button(string.Format(L10n.Tr("Process {0} Tasks"), taskCount), GUILayout.Height(buttonHeight))) + { + StartProcessing(); + } + } + + GUILayout.EndHorizontal(); + } + + private void Cancel() + { + if (IsProcessing()) + { + StopProcessing(); + } + else + { + Close(); + } + } + + private static void DrawAssetPath(Rect rect, string path) + { + GUIStyle pathStyle = Resources.AssetPathStyle(); + GUIContent pathContent = new GUIContent(path); + + Rect pathRect = rect; + pathRect.width = pathStyle.CalcSize(pathContent).x; + + GUI.Label(pathRect, pathContent, pathStyle); + EditorGUIUtility.AddCursorRect(pathRect, MouseCursor.Link); + + if (Event.current.type == EventType.MouseDown + && pathRect.Contains(Event.current.mousePosition)) + { + SelectAssetOrParentFolder(path); + Event.current.Use(); + } + } + + private static void SelectAssetOrParentFolder(string path) + { + while (!AssetExists(path)) + { + path = EditorUtils.GetParentFolder(path); + + if (string.IsNullOrEmpty(path)) + { + return; + } + } + + Selection.activeObject = AssetDatabase.LoadAssetAtPath(path); + } + + private void OnInspectorUpdate() + { + ProcessNextTask(); + } + + private struct TaskGenerator + { + private const string AssetsFolder = "Assets"; + private const string FMODRoot = "Assets/Plugins/FMOD"; + private const string FMODSource = FMODRoot + "/src"; + + private static readonly string[] BaseFolders = { + FMODSource, + FMODRoot, + "Assets/Plugins", + "Assets", + }; + + private static readonly MoveRecord[] looseAssets = { + // Release 1.10 layout + new MoveRecord() { source = FMODRoot + "/fmodplugins.cpp", destination = "obsolete" }, + new MoveRecord() { source = "Assets/Editor/FMODMigrationUtil.cs", destination = "obsolete" }, + new MoveRecord() { source = "Assets/GoogleVR", destination = "addons" }, + new MoveRecord() { source = "Assets/ResonanceAudio", destination = "addons" }, + new MoveRecord() { source = "Assets/Resources/FMODStudioSettings.asset", destination = "Resources" }, + new MoveRecord() { source = "Assets/FMODStudioCache.asset", destination = "Resources" }, + + // Release 2.0 layout + new MoveRecord() { source = FMODRoot + "/src/Runtime/fmodplugins.cpp", destination = "obsolete" }, + + // Release 2.1 layout + new MoveRecord() { source = FMODRoot + "/src/Runtime/fmod_static_plugin_support.h", destination = "obsolete" }, + new MoveRecord() { source = FMODRoot + "/src/Runtime/CodeGeneration.cs", destination = "src/Editor" }, + + // Release 2.2 layout + new MoveRecord() { source = FMODRoot + "/src/fmodplugins.cpp", destination = "obsolete" }, + new MoveRecord() { source = FMODRoot + "/src/fmod_static_plugin_support.h", destination = "obsolete" }, + new MoveRecord() { source = FMODSource + "/CodeGeneration.cs", destination = "src/Editor" }, + + // Release 2.3 layout + new MoveRecord() { source = FMODRoot + "/platforms/html5/lib/libfmodstudiounityplugin.bc", destination = "obsolete" }, + new MoveRecord() { source = FMODRoot + "/platforms/html5/lib/libfmodstudiounitypluginL.bc", destination = "obsolete" }, + }; + + private static readonly string[] fmodFoldersToCleanUp = { + "Assets/Plugins/FMOD/Runtime", + "Assets/Plugins/FMOD/lib", + }; + private static readonly string[] publicFoldersToCleanUp = { + "Assets/Plugins/Editor", + }; + + private List tasks; + + public static void Generate(List tasks) + { + TaskGenerator generator = new TaskGenerator() { tasks = tasks }; + + Settings.Instance.Platforms.ForEach(generator.GenerateTasksForPlatform); + generator.GenerateTasksForLooseAssets(); + generator.GenerateTasksForCodeFolders(); + generator.GenerateTasksForLegacyCodeFiles(); + generator.GenerateTasksForFolderCleanup(); + } + + private void GenerateTasksForPlatform(Platform platform) + { + IEnumerable files = platform.GetSourceFileInfo().Cast(); + + foreach (BuildTarget buildTarget in platform.GetBuildTargets()) + { + files = files.Concat(platform.GetBinaryFileInfo(buildTarget, Platform.BinaryType.All).Cast()); + } + + foreach (Platform.FileInfo info in files) + { + string newPath = info.LatestLocation(); + + if (!AssetExists(newPath)) + { + bool foundPath = false; + string oldPath = null; + + foreach (string path in info.OldLocations()) + { + oldPath = path; + + if (tasks.Any(t => t.source == oldPath)) + { + foundPath = true; + break; + } + + if (AssetExists(oldPath)) + { + tasks.Add(Task.Move(oldPath, newPath, platform)); + + foundPath = true; + break; + } + } + + if (oldPath != null) + { + string oldFolder = EditorUtils.GetParentFolder(oldPath); + string newFolder = EditorUtils.GetParentFolder(newPath); + + if (newFolder != oldFolder) + { + AddFolderTasks(oldFolder); + } + } + + if (!foundPath && ((info.type & Platform.BinaryType.Optional) == 0) + && !tasks.Any(t => t.source == newPath)) + { + tasks.Add(Task.Missing(newPath, platform)); + } + } + } + + foreach (string path in platform.GetObsoleteAssetPaths()) + { + if (AssetExists(path) && !tasks.Any(t => t.source == path)) + { + tasks.Add(Task.RemoveAsset(path, platform)); + } + } + } + + private void AddFolderTasks(string path) + { + string baseFolder = BaseFolders.First(f => path.StartsWith(f)); + + string currentFolder = path; + + // Find the last folder in the path that exists, without leaving the base folder + while (currentFolder.StartsWith(baseFolder) && !AssetDatabase.IsValidFolder(currentFolder)) + { + currentFolder = EditorUtils.GetParentFolder(currentFolder); + } + + while (currentFolder.StartsWith(baseFolder) && currentFolder != baseFolder) + { + AddFolderTask(currentFolder); + currentFolder = EditorUtils.GetParentFolder(currentFolder); + } + } + + private void AddFolderTask(string path) + { + if (!tasks.Any(t => t.type == Task.Type.RemoveFolder && t.source == path)) + { + tasks.Add(Task.RemoveFolder(path)); + } + } + + private struct MoveRecord + { + public string source; + public string destination; + } + + private static readonly MoveRecord[] codeFolders = { + // Release 2.0 layout + new MoveRecord() { source = FMODSource + "/Runtime", destination = "src" }, + new MoveRecord() { source = FMODSource + "/Runtime/Timeline", destination = "src" }, + new MoveRecord() { source = FMODSource + "/Runtime/wrapper", destination = "src" }, + new MoveRecord() { source = FMODSource + "/Editor/Timeline", destination = "src/Editor" }, + + // Release 1.10 layout + new MoveRecord() { source = FMODRoot + "/Timeline", destination = "src" }, + new MoveRecord() { source = FMODRoot + "/Wrapper", destination = "src" }, + new MoveRecord() { source = "Assets/Plugins/Editor/FMOD", destination = "src/Editor" }, + new MoveRecord() { source = "Assets/Plugins/Editor/FMOD/Timeline", destination = "src/Editor" }, + }; + + private void AddMoveTask(string source, string destination) + { + if (!tasks.Any(t => t.source == source)) + { + tasks.Add(Task.Move(source, destination, null)); + } + } + + private void GenerateTasksForCodeFolders() + { + foreach (MoveRecord folder in codeFolders) + { + if (AssetDatabase.IsValidFolder(folder.source)) + { + foreach (string sourcePath in FindFileAssets(folder.source)) + { + string filename = Path.GetFileName(sourcePath); + + AddMoveTask( + sourcePath, $"{RuntimeUtils.PluginBasePath}/{folder.destination}/{filename}"); + + } + + AddFolderTask(folder.source); + } + } + } + + private void GenerateTasksForLooseAssets() + { + foreach (MoveRecord asset in looseAssets) + { + string filename = Path.GetFileName(asset.source); + string destinationPath = $"{RuntimeUtils.PluginBasePath}/{asset.destination}/{filename}"; + + if (AssetExists(asset.source) && !AssetExists(destinationPath)) + { + AddMoveTask(asset.source, destinationPath); + AddFolderTasks(EditorUtils.GetParentFolder(asset.source)); + } + else if (AssetDatabase.IsValidFolder(asset.source) && AssetDatabase.IsValidFolder(destinationPath)) + { + GenerateFolderMergeTasks(asset.source, destinationPath); + AddFolderTasks(asset.source); + } + } + } + + private void GenerateFolderMergeTasks(string sourceFolder, string destinationFolder) + { + IEnumerable assetPaths = AssetDatabase.FindAssets(string.Empty, new string[] { sourceFolder }) + .Select(g => AssetDatabase.GUIDToAssetPath(g)) + .Where(p => !AssetDatabase.IsValidFolder(p) || IsFolderEmpty(p)); + + foreach (string sourcePath in assetPaths) + { + int prefixLength = sourceFolder.Length; + + if (!sourceFolder.EndsWith("/")) + { + ++prefixLength; + } + + string relativePath = sourcePath.Substring(prefixLength); + string destinationPath = string.Format("{0}/{1}", destinationFolder, relativePath); + + if (!AssetExists(destinationPath)) + { + AddMoveTask(sourcePath, destinationPath); + AddFolderTasks(EditorUtils.GetParentFolder(sourcePath)); + } + else if (AssetDatabase.IsValidFolder(sourcePath)) + { + AddFolderTasks(sourcePath); + } + } + } + + private void GenerateTasksForLegacyCodeFiles() + { + foreach (string path in FindFileAssets(FMODRoot).Where(p => p.EndsWith(".cs"))) + { + string destinationPath = $"{RuntimeUtils.PluginBasePath}/src/{Path.GetFileName(path)}"; + + if (!AssetExists(destinationPath)) + { + AddMoveTask(path, destinationPath); + } + } + } + + private void GenerateTasksForFolderCleanup() + { + foreach (string folder in publicFoldersToCleanUp) + { + if (AssetDatabase.IsValidFolder(folder)) + { + AddFolderTask(folder); + } + } + foreach (string folder in fmodFoldersToCleanUp) + { + SearchSubFolders(folder); + } + } + + private void SearchSubFolders(string folder) + { + if (AssetDatabase.IsValidFolder(folder)) + { + var subdirs = AssetDatabase.GetSubFolders(folder); + foreach (var subfolder in subdirs) + { + SearchSubFolders(subfolder); + AddFolderTask(subfolder); + } + AddFolderTask(folder); + } + } + + private static IEnumerable FindFileAssets(string folder) + { + if (AssetDatabase.IsValidFolder(folder)) + { + return AssetDatabase.FindAssets(string.Empty, new string[] { folder }) + .Select(g => AssetDatabase.GUIDToAssetPath(g)) + .Where(p => (EditorUtils.GetParentFolder(p) == folder) && !AssetDatabase.IsValidFolder(p)); + } + else + { + return Enumerable.Empty(); + } + } + } + + private void StartProcessing() + { + if (!IsProcessing()) + { + EditorApplication.LockReloadAssemblies(); + + currentTask = 0; + processingState = ProcessMoveTasks() + .Concat(ProcessRemoveAssetTasks()) + .Concat(ProcessRemoveFolderTasks()) + .GetEnumerator(); + } + } + + private void StopProcessing() + { + if (IsProcessing()) + { + processingState = null; + UpdateTaskCount(); + SetDefaultStatus(); + + EditorApplication.UnlockReloadAssemblies(); + + if (taskCount == 0) + { + SetupWizardWindow.SetUpdateTaskComplete(SetupWizardWindow.UpdateTaskType.ReorganizePluginFiles); + } + } + } + + private bool IsProcessing() + { + return processingState != null; + } + + private void ProcessNextTask() + { + if (processingState != null) + { + if (processingState.MoveNext()) + { + statusContent = new GUIContent(processingState.Current); + Repaint(); + } + else + { + StopProcessing(); + } + } + } + + private IEnumerable ProcessMoveTasks() + { + foreach (Task task in tasks.Where(t => t.type == Task.Type.Move && t.status == Task.Status.Pending)) + { + EditorUtils.EnsureFolderExists(EditorUtils.GetParentFolder(task.destination)); + + currentTask = task.step; + + yield return string.Format(L10n.Tr("Moving {0} to {1}"), task.source, task.destination); + + string result = AssetDatabase.MoveAsset(task.source, task.destination); + + if (string.IsNullOrEmpty(result)) + { + task.SetSucceeded(string.Format(L10n.Tr("{0} was moved to\n{1}"), task.source, task.destination)); + } + else + { + task.SetFailed(string.Format(L10n.Tr("{0} could not be moved to\n{1}: '{2}'"), + task.source, task.destination, result)); + } + + yield return task.statusText; + } + } + + private static bool AssetExists(string path) + { + return EditorUtils.AssetExists(path); + } + + private IEnumerable ProcessRemoveAssetTasks() + { + foreach (Task task in tasks.Where(t => t.type == Task.Type.RemoveAsset && t.status == Task.Status.Pending)) + { + currentTask = task.step; + + if (AssetDatabase.MoveAssetToTrash(task.source)) + { + task.SetSucceeded(string.Format(L10n.Tr("{0} was removed"), task.source)); + } + else + { + task.SetFailed(string.Format(L10n.Tr("{0} could not be removed"), task.source)); + } + + yield return task.statusText; + } + } + + private static bool IsFolderEmpty(string path) + { + return AssetDatabase.FindAssets(string.Empty, new string[] { path }).Length == 0; + } + + private IEnumerable ProcessRemoveFolderTasks() + { + foreach (Task task in tasks.Where(t => t.type == Task.Type.RemoveFolder && t.status == Task.Status.Pending)) + { + currentTask = task.step; + + foreach (string result in RemoveFolderIfEmpty(task)) + { + yield return result; + } + } + } + + private static IEnumerable RemoveFolderIfEmpty(Task task) + { + if (!Directory.Exists(Application.dataPath + "/../" + task.source)) + { + task.SetSucceeded(string.Format(L10n.Tr("{0} has already been removed"), task.source)); + yield break; + } + + if (!AssetDatabase.IsValidFolder(task.source)) + { + task.SetFailed(string.Format(L10n.Tr("{0} is not a valid folder"), task.source)); + yield break; + } + + if (!IsFolderEmpty(task.source)) + { + task.SetFailed(string.Format(L10n.Tr("{0} is not empty"), task.source)); + yield break; + } + + yield return string.Format(L10n.Tr("Removing empty folder {0}"), task.source); + + if (AssetDatabase.MoveAssetToTrash(task.source)) + { + task.SetSucceeded(string.Format(L10n.Tr("{0} was removed"), task.source)); + } + else + { + task.SetFailed(string.Format(L10n.Tr("{0} could not be removed"), task.source)); + } + + yield return task.statusText; + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/FileReorganizer.cs.meta b/Assets/Plugins/FMOD/src/Editor/FileReorganizer.cs.meta new file mode 100644 index 00000000..fc3232b3 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FileReorganizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3349615af02d64e4e8d1026e228c4a25 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs b/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs new file mode 100644 index 00000000..1d0fbf73 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs @@ -0,0 +1,190 @@ +using System; +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; + +namespace FMODUnity +{ + public class FindAndReplace : EditorWindow + { + private bool levelScope = true; + private bool prefabScope; + private string findText; + private string replaceText; + private string message = ""; + private MessageType messageType = MessageType.None; + private int lastMatch = -1; + private List emitters; + + private bool first = true; + + [MenuItem("FMOD/Find and Replace", priority = 2)] + private static void ShowFindAndReplace() + { + var window = CreateInstance(); + window.titleContent = new GUIContent(L10n.Tr("FMOD Find and Replace")); + window.OnHierarchyChange(); + var position = window.position; + window.maxSize = window.minSize = position.size = new Vector2(400, 170); + window.position = position; + window.ShowUtility(); + } + + private void OnHierarchyChange() + { + emitters = new List(Resources.FindObjectsOfTypeAll()); + + if (!levelScope) + { + emitters.RemoveAll(x => PrefabUtility.GetPrefabAssetType(x) == PrefabAssetType.NotAPrefab); + } + + if (!prefabScope) + { + emitters.RemoveAll(x => PrefabUtility.GetPrefabAssetType(x) != PrefabAssetType.NotAPrefab); + } + } + + private void OnGUI() + { + bool doFind = false; + if ((Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Return)) + { + Event.current.Use(); + doFind = true; + } + + GUI.SetNextControlName(L10n.Tr("find")); + EditorGUILayout.PrefixLabel(L10n.Tr("Find:")); + EditorGUI.BeginChangeCheck(); + findText = EditorGUILayout.TextField(findText); + if (EditorGUI.EndChangeCheck()) + { + lastMatch = -1; + message = null; + } + EditorGUILayout.PrefixLabel(L10n.Tr("Replace:")); + replaceText = EditorGUILayout.TextField(replaceText); + + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + levelScope = EditorGUILayout.ToggleLeft(L10n.Tr("Current Level"), levelScope, GUILayout.ExpandWidth(false)); + prefabScope = EditorGUILayout.ToggleLeft(L10n.Tr("Prefabs"), prefabScope, GUILayout.ExpandWidth(false)); + if (EditorGUI.EndChangeCheck()) + { + OnHierarchyChange(); + } + EditorGUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + if (GUILayout.Button(L10n.Tr("Find")) || doFind) + { + message = ""; + { + FindNext(); + } + if (lastMatch == -1) + { + message = L10n.Tr("Finished Search"); + messageType = MessageType.Warning; + } + } + if (GUILayout.Button(L10n.Tr("Replace"))) + { + message = ""; + if (lastMatch == -1) + { + FindNext(); + } + else + { + Replace(); + } + if (lastMatch == -1) + { + message = L10n.Tr("Finished Search"); + messageType = MessageType.Warning; + } + } + if (GUILayout.Button(L10n.Tr("Replace All"))) + { + if (EditorUtility.DisplayDialog(L10n.Tr("Replace All"), L10n.Tr("Are you sure you wish to replace all in the current hierachy?"), L10n.Tr("yes"), L10n.Tr("no"))) + { + ReplaceAll(); + } + } + GUILayout.EndHorizontal(); + if (!string.IsNullOrEmpty(message)) + { + EditorGUILayout.HelpBox(message, messageType); + } + else + { + EditorGUILayout.HelpBox("\n\n", MessageType.None); + } + + if (first) + { + first = false; + EditorGUI.FocusTextInControl(L10n.Tr("find")); + } + } + + private void FindNext() + { + for (int i = lastMatch + 1; i < emitters.Count; i++) + { + if (emitters[i].EventReference.Path.IndexOf(findText, 0, StringComparison.CurrentCultureIgnoreCase) >= 0) + { + lastMatch = i; + EditorGUIUtility.PingObject(emitters[i]); + Selection.activeGameObject = emitters[i].gameObject; + message = L10n.Tr("Found object"); + messageType = MessageType.Info; + return; + } + } + lastMatch = -1; + } + + private void ReplaceAll() + { + int replaced = 0; + for (int i = 0; i < emitters.Count; i++) + { + if (ReplaceText(emitters[i])) + { + replaced++; + } + } + + message = string.Format(L10n.Tr("{0} replaced"), replaced); + messageType = MessageType.Info; + } + + private bool ReplaceText(StudioEventEmitter emitter) + { + int findLength = findText.Length; + int replaceLength = replaceText.Length; + int position = 0; + var serializedObject = new SerializedObject(emitter); + var pathProperty = serializedObject.FindProperty(L10n.Tr("Event")); + string path = pathProperty.stringValue; + position = path.IndexOf(findText, position, StringComparison.CurrentCultureIgnoreCase); + while (position >= 0) + { + path = path.Remove(position, findLength).Insert(position, replaceText); + position += replaceLength; + position = path.IndexOf(findText, position, StringComparison.CurrentCultureIgnoreCase); + } + pathProperty.stringValue = path; + return serializedObject.ApplyModifiedProperties(); + } + + private void Replace() + { + ReplaceText(emitters[lastMatch]); + FindNext(); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs.meta b/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs.meta new file mode 100644 index 00000000..5070d34f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a3d0ed60438564241a4e62b152836893 +timeCreated: 1453876443 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/ListView.cs b/Assets/Plugins/FMOD/src/Editor/ListView.cs new file mode 100644 index 00000000..2a59df0b --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/ListView.cs @@ -0,0 +1,45 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + public class ListView : UnityEditorInternal.ReorderableList + { + private const float ElementPadding = 2; + + public DrawElementWithLabelDelegate drawElementWithLabelCallback; + + public delegate void DrawElementWithLabelDelegate(Rect rect, float labelRight, int index, + bool active, bool focused); + + private float labelRight; + + public ListView(SerializedProperty property) + : base(property.serializedObject, property, true, false, true, true) + { + headerHeight = 3; + elementHeight = EditorGUIUtility.singleLineHeight + ElementPadding; + drawElementCallback = DrawElementWrapper; + } + + public void DrawLayout() + { + Rect rect = EditorGUILayout.GetControlRect(false, GetHeight()); + + labelRight = rect.x + EditorGUIUtility.labelWidth; + + DoList(EditorGUI.IndentedRect(rect)); + } + + private void DrawElementWrapper(Rect rect, int index, bool active, bool focused) + { + if (drawElementWithLabelCallback != null) + { + rect.height -= ElementPadding; + + drawElementWithLabelCallback(rect, labelRight, index, active, focused); + } + } + } +} + diff --git a/Assets/Plugins/FMOD/src/Editor/ListView.cs.meta b/Assets/Plugins/FMOD/src/Editor/ListView.cs.meta new file mode 100644 index 00000000..4452efb0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/ListView.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1573bef36bd46e34f8f2b4dad628a461 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/Localization.cs b/Assets/Plugins/FMOD/src/Editor/Localization.cs new file mode 100644 index 00000000..934bd587 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/Localization.cs @@ -0,0 +1,3 @@ +#if UNITY_2020_2_OR_NEWER +[assembly: UnityEditor.Localization] +#endif \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/Localization.cs.meta b/Assets/Plugins/FMOD/src/Editor/Localization.cs.meta new file mode 100644 index 00000000..c1e678d7 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/Localization.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3090e47fa3df08f469c1d65999e47956 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs b/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs new file mode 100644 index 00000000..af4ce289 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs @@ -0,0 +1,81 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomPropertyDrawer(typeof(ParamRefAttribute))] + public class ParamRefDrawer : PropertyDrawer + { + public bool MouseDrag(Event e) + { + bool isDragging = false; + + if (e.type == EventType.DragPerform) + { + isDragging = true; + } + + return isDragging; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + Texture browseIcon = EditorUtils.LoadImage("SearchIconBlack.png"); + Texture openIcon = EditorUtils.LoadImage("BrowserIcon.png"); + Texture addIcon = EditorUtils.LoadImage("AddIcon.png"); + + EditorGUI.BeginProperty(position, label, property); + SerializedProperty pathProperty = property; + + Event e = Event.current; + if (MouseDrag(e) && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorParamRef)) + { + pathProperty.stringValue = ((EditorParamRef)DragAndDrop.objectReferences[0]).Name; + GUI.changed = true; + e.Use(); + } + } + if (e.type == EventType.DragUpdated && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorParamRef)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + + float baseHeight = GUI.skin.textField.CalcSize(new GUIContent()).y; + + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + + GUIStyle buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.padding.top = 1; + buttonStyle.padding.bottom = 1; + + Rect addRect = new Rect(position.x + position.width - addIcon.width - 7, position.y, addIcon.width + 7, baseHeight); + Rect openRect = new Rect(addRect.x - openIcon.width - 7, position.y, openIcon.width + 6, baseHeight); + Rect searchRect = new Rect(openRect.x - browseIcon.width - 9, position.y, browseIcon.width + 8, baseHeight); + Rect pathRect = new Rect(position.x, position.y, searchRect.x - position.x - 3, baseHeight); + + EditorGUI.PropertyField(pathRect, pathProperty, GUIContent.none); + + if (GUI.Button(searchRect, new GUIContent(browseIcon, "Search"), buttonStyle)) + { + var eventBrowser = ScriptableObject.CreateInstance(); + + eventBrowser.ChooseParameter(property); + var windowRect = position; + windowRect.position = GUIUtility.GUIToScreenPoint(windowRect.position); + windowRect.height = openRect.height + 1; + eventBrowser.ShowAsDropDown(windowRect, new Vector2(windowRect.width, 400)); + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs.meta b/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs.meta new file mode 100644 index 00000000..fa3237da --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ea88808aa26cd614db1c5c1dcbb14d4e +timeCreated: 1444197074 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs b/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs new file mode 100644 index 00000000..f36eae96 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs @@ -0,0 +1,2812 @@ +using UnityEngine; +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.IMGUI.Controls; +using UnityEditorInternal; +using System.IO; +using System; +using System.Linq; +using System.Text.RegularExpressions; + +namespace FMODUnity +{ + [CustomEditor(typeof(Settings))] + public class SettingsEditor : Editor + { + private static readonly string[] ToggleDisplay = new string[] { L10n.Tr("Disabled"), L10n.Tr("Enabled"), L10n.Tr("Development Build Only"), }; + + private static readonly string[] OverlayLocations = new string[] { L10n.Tr("TopLeft"), L10n.Tr("TopCenter"), L10n.Tr("TopRight"), L10n.Tr("BottomLeft"), L10n.Tr("BottomCenter"), L10n.Tr("BottomRight"), L10n.Tr("Center"), L10n.Tr("VR") }; + + private static readonly string[] FrequencyDisplay = new string[] { + L10n.Tr("Platform Default"), + "22.05 kHz", + "24 kHz", + "32 kHz", + "44.1 kHz", + "48 kHz" + }; + + private static readonly int[] FrequencyValues = new int[] { 0, 22050, 24000, 32000, 44100, 48000 }; + + private static readonly string[] SpeakerModeDisplay = new string[] { + L10n.Tr("Stereo"), + L10n.Tr("Surround 5.1"), + L10n.Tr("Surround 7.1"), + L10n.Tr("Surround 7.1.4") + }; + + private static readonly FMOD.SPEAKERMODE[] SpeakerModeValues = new FMOD.SPEAKERMODE[] { + FMOD.SPEAKERMODE.STEREO, + FMOD.SPEAKERMODE._5POINT1, + FMOD.SPEAKERMODE._7POINT1, + FMOD.SPEAKERMODE._7POINT1POINT4 + }; + + private static readonly string[] ThreadTypeDisplay = new string[] { + L10n.Tr("Mixer"), + L10n.Tr("Feeder"), + L10n.Tr("Stream"), + L10n.Tr("File"), + L10n.Tr("Nonblocking"), + L10n.Tr("Record"), + L10n.Tr("Geometry"), + L10n.Tr("Profiler"), + L10n.Tr("Studio Update"), + L10n.Tr("Studio Load Bank"), + L10n.Tr("Studio Load Sample"), + L10n.Tr("Convolution 1"), + L10n.Tr("Convolution 2") + }; + + private bool hasBankSourceChanged = false; + private bool hasBankTargetChanged = false; + + private bool expandThreadAffinity; + private bool expandCodecChannels; + private bool expandDynamicPlugins; + private bool expandStaticPlugins; + + private static Section sExpandedSections; + + private SerializedProperty automaticEventLoading; + private SerializedProperty automaticSampleLoading; + private SerializedProperty bankLoadType; + private SerializedProperty banksToLoad; + private SerializedProperty enableMemoryTracking; + private SerializedProperty encryptionKey; + private SerializedProperty hasSourceProject; + private SerializedProperty hasPlatforms; + private SerializedProperty importType; + private SerializedProperty loggingLevel; + private SerializedProperty meterChannelOrdering; + private SerializedProperty sourceBankPath; + private SerializedProperty sourceProjectPath; + private SerializedProperty stopEventsOutsideMaxDistance; + private SerializedProperty enableErrorCallback; + private SerializedProperty targetAssetPath; + private SerializedProperty targetBankFolder; + private SerializedProperty bankRefreshCooldown; + private SerializedProperty showBankRefreshWindow; + private SerializedProperty eventLinkage; + + [NonSerialized] + private bool resourcesLoaded = false; + + private GUIStyle mainHeaderStyle; + private GUIStyle sectionHeaderStyle; + private GUIStyle platformHeaderStyle; + private GUIStyle dropdownStyle; + private GUIStyle inheritedPropertyLabelStyle; + private GUIStyle overriddenPropertyLabelStyle; + private GUIStyle inheritedPropertyFoldoutStyle; + private GUIStyle overriddenPropertyFoldoutStyle; + + private GUIContent mainHeaderIcon; + + private Texture2D propertyOverrideIndicator; + + private const int THREAD_AFFINITY_CORES_PER_ROW = 8; + + private const string EditPlatformUndoMessage = "Edit FMOD Platform Properties"; + + private PlatformPropertyStringListView staticPluginsView; + private PlatformPropertyStringListView dynamicPluginsView; + + private static readonly int[] LoggingValues = new int[] { + (int)FMOD.DEBUG_FLAGS.NONE, + (int)FMOD.DEBUG_FLAGS.ERROR, + (int)FMOD.DEBUG_FLAGS.WARNING, + (int)FMOD.DEBUG_FLAGS.LOG, + }; + + private static readonly string[] LoggingDisplay = new string[] { + L10n.Tr("None"), + L10n.Tr("Error"), + L10n.Tr("Warning"), + L10n.Tr("Log"), + }; + + private static readonly int[] BankLoadTypeValues = new int[] { + (int)BankLoadType.All, + (int)BankLoadType.Specified, + (int)BankLoadType.None + }; + + private static readonly string[] BankLoadTypeDisplay = new string[] { + L10n.Tr("All"), + L10n.Tr("Specified"), + L10n.Tr("None"), + }; + + private static readonly int[] MeterChannelOrderingeValues = new int[] { + (int)MeterChannelOrderingType.Standard, + (int)MeterChannelOrderingType.SeparateLFE, + (int)MeterChannelOrderingType.Positional + }; + + private static readonly string[] MeterChannelOrderingeDisplay = new string[] { + L10n.Tr("Standard"), + L10n.Tr("SeparateLFE"), + L10n.Tr("Positional"), + }; + private ReorderableList banksToLoadView; + + private PlatformsView platformsView; + private TreeViewState platformTreeViewState = new TreeViewState(); + + private string lastSourceBankPath; + + private static readonly GUIContent BankRefreshLabel = new GUIContent(L10n.Tr("Refresh Banks")); + + private static readonly GUIContent[] BankRefreshCooldownLabels = new GUIContent[] { + new GUIContent(L10n.Tr("After 1 second")), + new GUIContent(L10n.Tr("After 5 seconds")), + new GUIContent(L10n.Tr("After 10 seconds")), + new GUIContent(L10n.Tr("After 20 seconds")), + new GUIContent(L10n.Tr("After 30 seconds")), + new GUIContent(L10n.Tr("After 1 minute")), + new GUIContent(L10n.Tr("Prompt Me")), + new GUIContent(L10n.Tr("Manually")), + }; + + private static readonly int[] BankRefreshCooldownValues = new int[] { + 1, + 5, + 10, + 20, + 30, + 60, + Settings.BankRefreshPrompt, + Settings.BankRefreshManual, + }; + + internal enum SourceType : uint + { + FMODStudioProject = 0, + SinglePlatformBuild, + MultiplePlatformBuild + } + + [Flags] + private enum Section + { + BankImport = 1 << 0, + Initialization = 1 << 1, + Behavior = 1 << 2, + UserInterface = 1 << 3, + PlatformSpecific = 1 << 4, + } + + private void OnEnable() + { + automaticEventLoading = serializedObject.FindProperty("AutomaticEventLoading"); + automaticSampleLoading = serializedObject.FindProperty("AutomaticSampleLoading"); + bankLoadType = serializedObject.FindProperty("BankLoadType"); + banksToLoad = serializedObject.FindProperty("BanksToLoad"); + enableMemoryTracking = serializedObject.FindProperty("EnableMemoryTracking"); + encryptionKey = serializedObject.FindProperty("EncryptionKey"); + hasSourceProject = serializedObject.FindProperty("HasSourceProject"); + hasPlatforms = serializedObject.FindProperty("HasPlatforms"); + importType = serializedObject.FindProperty("ImportType"); + loggingLevel = serializedObject.FindProperty("LoggingLevel"); + meterChannelOrdering = serializedObject.FindProperty("MeterChannelOrdering"); + sourceBankPath = serializedObject.FindProperty("sourceBankPath"); + sourceProjectPath = serializedObject.FindProperty("sourceProjectPath"); + stopEventsOutsideMaxDistance = serializedObject.FindProperty("StopEventsOutsideMaxDistance"); + enableErrorCallback = serializedObject.FindProperty("EnableErrorCallback"); + targetAssetPath = serializedObject.FindProperty("TargetAssetPath"); + targetBankFolder = serializedObject.FindProperty("TargetBankFolder"); + bankRefreshCooldown = serializedObject.FindProperty("BankRefreshCooldown"); + showBankRefreshWindow = serializedObject.FindProperty("ShowBankRefreshWindow"); + eventLinkage = serializedObject.FindProperty("EventLinkage"); + + platformsView = new PlatformsView(target as Settings, platformTreeViewState); + + banksToLoadView = new ReorderableList(banksToLoad); + banksToLoadView.onAddDropdownCallback = (rect, list) => { + GenericMenu menu = new GenericMenu(); + + menu.AddItem(new GUIContent(L10n.Tr("Browse")), false, BrowseForBankToLoad); + menu.AddItem(new GUIContent(L10n.Tr("Add All")), false, AddAllBanksToLoad); + + menu.DropDown(rect); + }; + + staticPluginsView = new PlatformPropertyStringListView(Platform.PropertyAccessors.StaticPlugins); + dynamicPluginsView = new PlatformPropertyStringListView(Platform.PropertyAccessors.Plugins); + + Undo.undoRedoPerformed += OnUndoRedo; + } + + private void OnDestroy() + { + Undo.undoRedoPerformed -= OnUndoRedo; + } + + private void OnUndoRedo() + { + platformsView.ForceReload(); + + RefreshBanks(); + + Repaint(); + } + + private void AffirmResources() + { + if (!resourcesLoaded) + { + resourcesLoaded = true; + + mainHeaderStyle = new GUIStyle(EditorStyles.label) { + fontStyle = FontStyle.Bold, + fontSize = 18, + }; + mainHeaderStyle.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black; + + sectionHeaderStyle = new GUIStyle(GUI.skin.FindStyle("Foldout")) { + fontStyle = FontStyle.Bold, + }; + + platformHeaderStyle = new GUIStyle(GUI.skin.label) { + richText = true, + }; + + dropdownStyle = new GUIStyle(GUI.skin.FindStyle("dropdownButton")); + dropdownStyle.fixedHeight = 0; + + inheritedPropertyLabelStyle = GUI.skin.label; + + overriddenPropertyLabelStyle = new GUIStyle(inheritedPropertyLabelStyle) { + fontStyle = FontStyle.Bold, + }; + + inheritedPropertyFoldoutStyle = EditorStyles.foldout; + + overriddenPropertyFoldoutStyle = new GUIStyle(inheritedPropertyFoldoutStyle) { + fontStyle = FontStyle.Bold, + }; + + mainHeaderIcon = new GUIContent(EditorUtils.LoadImage("StudioIcon.png")); + + propertyOverrideIndicator = new Texture2D(2, 1); + + Color darkBlue; + ColorUtility.TryParseHtmlString("#1974a5", out darkBlue); + + Color blue; + ColorUtility.TryParseHtmlString("#0f81be", out blue); + + propertyOverrideIndicator.SetPixel(0, 0, darkBlue); + propertyOverrideIndicator.SetPixel(1, 0, blue); + + propertyOverrideIndicator.Apply(); + } + } + + private Rect DrawPlatformPropertyLabel(string label, Platform platform, + params Platform.PropertyOverrideControl[] properties) + { + PlatformPropertyLabelData data; + PreparePlatformPropertyLabel(platform, properties, out data); + + GUI.Label(data.labelRect, label, data.overridden ? overriddenPropertyLabelStyle : inheritedPropertyLabelStyle); + + DecoratePlatformPropertyLabel(data, platform, properties); + + return data.remainderRect; + } + + private Rect DrawPlatformPropertyFoldout(string label, ref bool expand, Platform platform, + params Platform.PropertyOverrideControl[] properties) + { + PlatformPropertyLabelData data; + PreparePlatformPropertyLabel(platform, properties, out data); + + using (new NoIndentScope()) + { + expand = EditorGUI.Foldout(data.labelRect, expand, label, true, + data.overridden ? overriddenPropertyFoldoutStyle : inheritedPropertyFoldoutStyle); + } + + DecoratePlatformPropertyLabel(data, platform, properties); + + return data.remainderRect; + } + + private struct PlatformPropertyLabelData + { + public bool hasParent; + public bool overridden; + public Rect labelRect; + public Rect remainderRect; + } + + private void PreparePlatformPropertyLabel(Platform platform, Platform.PropertyOverrideControl[] properties, + out PlatformPropertyLabelData data) + { + AffirmResources(); + + Rect rect = EditorGUILayout.GetControlRect(); + + data.hasParent = (platform.Parent != null || platform is PlatformPlayInEditor); + data.overridden = data.hasParent && properties.Any(p => p.HasValue(platform)); + data.labelRect = LabelRect(rect); + data.remainderRect = new Rect(rect) { xMin = data.labelRect.xMax }; + } + + private void DecoratePlatformPropertyLabel(PlatformPropertyLabelData data, Platform platform, + Platform.PropertyOverrideControl[] properties) + { + if (data.hasParent) + { + if (data.overridden) + { + Rect indicatorRect = new Rect(data.labelRect) { x = 1, width = 2 }; + GUI.DrawTexture(indicatorRect, propertyOverrideIndicator); + } + + if (Event.current.type == EventType.MouseUp + && Event.current.button == 1 + && data.labelRect.Contains(Event.current.mousePosition)) + { + GenericMenu menu = new GenericMenu(); + + GUIContent revertContent = new GUIContent(L10n.Tr("Revert")); + + if (data.overridden) + { + menu.AddItem(revertContent, false, () => { + Undo.RecordObject(platform, L10n.Tr("Revert FMOD Platform Properties")); + + foreach (Platform.PropertyOverrideControl property in properties) + { + property.Clear(platform); + } + }); + } + else + { + menu.AddDisabledItem(revertContent); + } + + menu.ShowAsContext(); + } + } + } + + private static int DrawPopup(Rect position, int selectedIndex, string[] displayedOptions) + { + using (new NoIndentScope()) + { + return EditorGUI.Popup(position, selectedIndex, displayedOptions); + } + } + + private void DisplayTriStateBool(string label, Platform platform, Platform.PropertyAccessor property) + { + Rect rect = DrawPlatformPropertyLabel(label, platform, property); + + EditorGUI.BeginChangeCheck(); + + int next = DrawPopup(rect, (int)property.Get(platform), ToggleDisplay); + + if (EditorGUI.EndChangeCheck()) + { + property.Set(platform, (TriStateBool)next); + } + } + + private void DisplayPositionRect(string label, Platform platform, Platform.PropertyAccessor property) + { + Rect rect = DrawPlatformPropertyLabel(label, platform, property); + EditorGUI.BeginChangeCheck(); + int next = DrawPopup(rect, (int)property.Get(platform), OverlayLocations); + if (EditorGUI.EndChangeCheck()) + { + property.Set(platform, (ScreenPosition)next); + } + } + + private void DisplayDebugFontSelection(string label, Platform platform, Platform.PropertyAccessor property) + { + Rect rect = DrawPlatformPropertyLabel(label, platform, property); + EditorGUI.BeginChangeCheck(); + int next = EditorGUI.IntField(rect, property.Get(platform)); + if (EditorGUI.EndChangeCheck()) + { + property.Set(platform, Mathf.Min(next, 20)); + } + } + + private void DisplayOutputMode(string label, Platform platform) + { + if (platform.ValidOutputTypes != null) + { + string[] valuesChild = new string[platform.ValidOutputTypes.Length + 3]; + string[] valuesChildEnum = new string[platform.ValidOutputTypes.Length + 3]; + valuesChild[0] = string.Format(L10n.Tr("Auto")); + valuesChild[1] = string.Format(L10n.Tr("No Sound")); + valuesChild[2] = string.Format(L10n.Tr("Wav Writer")); + valuesChildEnum[0] = Enum.GetName(typeof(FMOD.OUTPUTTYPE), FMOD.OUTPUTTYPE.AUTODETECT); + valuesChildEnum[1] = Enum.GetName(typeof(FMOD.OUTPUTTYPE), FMOD.OUTPUTTYPE.NOSOUND); + valuesChildEnum[2] = Enum.GetName(typeof(FMOD.OUTPUTTYPE), FMOD.OUTPUTTYPE.WAVWRITER); + for (int i = 0; i < platform.ValidOutputTypes.Length; i++) + { + valuesChild[i + 3] = platform.ValidOutputTypes[i].displayName; + valuesChildEnum[i + 3] = Enum.GetName(typeof(FMOD.OUTPUTTYPE), platform.ValidOutputTypes[i].outputType); + } + int currentIndex = Array.IndexOf(valuesChildEnum, platform.OutputTypeName); + if (currentIndex == -1) + { + currentIndex = 0; + platform.OutputTypeName = Enum.GetName(typeof(FMOD.OUTPUTTYPE), FMOD.OUTPUTTYPE.AUTODETECT); + } + int next = EditorGUILayout.Popup(label, currentIndex, valuesChild); + platform.OutputTypeName = valuesChildEnum[next]; + } + } + + private void DisplayThreadAffinity(string label, Platform platform) + { + if (platform.CoreCount > 0 && DisplayThreadAffinityFoldout(label, platform)) + { + using (new EditorGUI.IndentLevelScope()) + { + DisplayThreadAffinityGroups(platform); + } + } + } + + private bool DisplayThreadAffinityFoldout(string label, Platform platform) + { + Rect headerRect = EditorGUILayout.GetControlRect(); + + Rect labelRect = headerRect; + labelRect.width = EditorGUIUtility.labelWidth; + + expandThreadAffinity = EditorGUI.Foldout(labelRect, expandThreadAffinity, label, true); + + bool useDefaults = !platform.ThreadAffinitiesProperty.HasValue; + + EditorGUI.BeginChangeCheck(); + + Rect toggleRect = headerRect; + toggleRect.xMin = labelRect.xMax; + + useDefaults = GUI.Toggle(toggleRect, useDefaults, L10n.Tr("Use Defaults")); + + if (EditorGUI.EndChangeCheck()) + { + if (useDefaults) + { + platform.ThreadAffinitiesProperty.Value.Clear(); + platform.ThreadAffinitiesProperty.HasValue = false; + } + else + { + platform.ThreadAffinitiesProperty.Value = new List(); + platform.ThreadAffinitiesProperty.HasValue = true; + + foreach (ThreadAffinityGroup group in platform.DefaultThreadAffinities) + { + platform.ThreadAffinitiesProperty.Value.Add(new ThreadAffinityGroup(group)); + } + } + } + + return expandThreadAffinity; + } + + private void DisplayThreadAffinityGroups(Platform platform) + { + GUIStyle affinityStyle = EditorStyles.miniButton; + float affinityWidth = affinityStyle.CalcSize(new GUIContent("00")).x; + + GUIContent anyButtonContent = new GUIContent(L10n.Tr("Any")); + float anyButtonWidth = affinityStyle.CalcSize(anyButtonContent).x; + + float threadsWidth = EditorGUIUtility.labelWidth; + float affinitiesWidth = affinityWidth * THREAD_AFFINITY_CORES_PER_ROW + anyButtonWidth; + + bool editable = platform.ThreadAffinitiesProperty.HasValue; + + if (platform.ThreadAffinities.Any()) + { + DisplayThreadAffinitiesHeader(threadsWidth, affinitiesWidth); + + using (new EditorGUI.DisabledScope(!editable)) + { + ThreadAffinityGroup groupToDelete = null; + + foreach (ThreadAffinityGroup group in platform.ThreadAffinities) + { + bool delete; + DisplayThreadAffinityGroup(group, platform, threadsWidth, affinitiesWidth, + anyButtonWidth, anyButtonContent, affinityStyle, affinityWidth, out delete); + + if (delete) + { + groupToDelete = group; + } + } + + if (groupToDelete != null) + { + platform.ThreadAffinitiesProperty.Value.Remove(groupToDelete); + } + } + } + else + { + Rect messageRect = EditorGUILayout.GetControlRect(); + messageRect.width = threadsWidth + affinitiesWidth; + messageRect = EditorGUI.IndentedRect(messageRect); + + GUI.Label(messageRect, L10n.Tr("List is Empty")); + } + + if (editable) + { + Rect addButtonRect = EditorGUILayout.GetControlRect(); + addButtonRect.width = threadsWidth + affinitiesWidth; + addButtonRect = EditorGUI.IndentedRect(addButtonRect); + + if (GUI.Button(addButtonRect, L10n.Tr("Add"))) + { + platform.ThreadAffinitiesProperty.Value.Add(new ThreadAffinityGroup()); + } + } + } + + private void DisplayThreadAffinitiesHeader(float threadsWidth, float affinitiesWidth) + { + Rect controlRect = EditorGUILayout.GetControlRect(false, EditorGUIUtility.singleLineHeight); + + Rect threadsRect = controlRect; + threadsRect.width = threadsWidth; + + threadsRect = EditorGUI.IndentedRect(threadsRect); + + GUI.Label(threadsRect, L10n.Tr("Threads")); + + Rect coresRect = controlRect; + coresRect.x = threadsRect.xMax; + coresRect.width = affinitiesWidth; + + GUI.Label(coresRect, L10n.Tr("Cores")); + } + + private void DisplayThreadAffinityGroup(ThreadAffinityGroup group, Platform platform, + float threadsWidth, float affinitiesWidth, float anyButtonWidth, GUIContent anyButtonContent, + GUIStyle affinityStyle, float affinityWidth, out bool delete) + { + delete = false; + + GUIStyle editButtonStyle = EditorStyles.popup; + + GUIContent editButtonContent = new GUIContent(L10n.Tr("Edit")); + Rect editButtonRect = new Rect(Vector2.zero, editButtonStyle.CalcSize(editButtonContent)); + + float threadsHeight = group.threads.Count * EditorGUIUtility.singleLineHeight; + + bool editable = platform.ThreadAffinitiesProperty.HasValue; + + if (editable) + { + threadsHeight += EditorGUIUtility.standardVerticalSpacing + editButtonRect.height; + } + + float affinitiesHeight = + Mathf.Ceil(platform.CoreCount / (float)THREAD_AFFINITY_CORES_PER_ROW) * EditorGUIUtility.singleLineHeight; + + Rect controlRect = EditorGUILayout.GetControlRect(false, Math.Max(threadsHeight, affinitiesHeight)); + + Rect threadsRect = controlRect; + threadsRect.width = threadsWidth; + + threadsRect = EditorGUI.IndentedRect(threadsRect); + + GUIStyle boxStyle = EditorStyles.textArea; + + GUI.Box(threadsRect, string.Empty, boxStyle); + + Rect threadRect = threadsRect; + threadRect.height = EditorGUIUtility.singleLineHeight; + + foreach (ThreadType thread in group.threads) + { + GUI.Label(threadRect, ThreadTypeDisplay[(int)thread]); + threadRect.y += threadRect.height; + } + + if (editable) + { + editButtonRect.y = threadsRect.yMax - editButtonRect.height - editButtonStyle.margin.bottom; + editButtonRect.center = new Vector2(threadsRect.center.x, editButtonRect.center.y); + + if (EditorGUI.DropdownButton(editButtonRect, editButtonContent, FocusType.Passive, editButtonStyle)) + { + ThreadListEditor.Show(editButtonRect, group, platform, this); + } + } + + Rect affinitiesRect = controlRect; + affinitiesRect.xMin = threadsRect.xMax; + affinitiesRect.width = affinitiesWidth; + + GUI.Box(affinitiesRect, string.Empty, boxStyle); + + Rect anyButtonRect = affinitiesRect; + anyButtonRect.height = affinitiesHeight; + anyButtonRect.width = anyButtonWidth; + + if (GUI.Toggle(anyButtonRect, group.affinity == ThreadAffinity.Any, anyButtonContent, affinityStyle)) + { + group.affinity = ThreadAffinity.Any; + } + + Rect affinityRect = affinitiesRect; + affinityRect.x = anyButtonRect.xMax; + affinityRect.height = EditorGUIUtility.singleLineHeight; + affinityRect.width = affinityWidth; + + for (int i = 0; i < platform.CoreCount; ++i) + { + ThreadAffinity mask = (ThreadAffinity)(1U << i); + + if (GUI.Toggle(affinityRect, (group.affinity & mask) == mask, i.ToString(), affinityStyle)) + { + group.affinity |= mask; + } + else + { + group.affinity &= ~mask; + } + + if (i % THREAD_AFFINITY_CORES_PER_ROW == THREAD_AFFINITY_CORES_PER_ROW - 1) + { + affinityRect.x = anyButtonRect.xMax; + affinityRect.y += affinityRect.height; + } + else + { + affinityRect.x += affinityRect.width; + } + } + + if (editable) + { + GUIStyle deleteButtonStyle = GUI.skin.button; + GUIContent deleteButtonContent = new GUIContent(L10n.Tr("Delete")); + + Rect deleteButtonRect = controlRect; + deleteButtonRect.x = affinitiesRect.xMax; + deleteButtonRect.width = deleteButtonStyle.CalcSize(deleteButtonContent).x; + + if (GUI.Button(deleteButtonRect, deleteButtonContent, deleteButtonStyle)) + { + delete = true; + } + } + } + + private class ThreadListEditor : EditorWindow + { + private ThreadAffinityGroup group; + private Platform platform; + private Editor parent; + + public static void Show(Rect buttonRect, ThreadAffinityGroup group, Platform platform, Editor parent) + { + ThreadListEditor editor = CreateInstance(); + editor.group = group; + editor.platform = platform; + editor.parent = parent; + + Rect rect = new Rect(GUIUtility.GUIToScreenPoint(buttonRect.position), buttonRect.size); + + editor.ShowAsDropDown(rect, CalculateSize()); + } + + private static GUIStyle FrameStyle { get { return GUI.skin.box; } } + private static GUIStyle ThreadStyle { get { return EditorStyles.toggle; } } + + private static Vector2 CalculateSize() + { + Vector2 result = Vector2.zero; + + Array enumValues = Enum.GetValues(typeof(ThreadType)); + + foreach (ThreadType thread in enumValues) + { + Vector2 size = ThreadStyle.CalcSize(new GUIContent(ThreadTypeDisplay[(int)thread])); + result.x = Mathf.Max(result.x, size.x); + } + + result.y = enumValues.Length * EditorGUIUtility.singleLineHeight + + (enumValues.Length - 1) * EditorGUIUtility.standardVerticalSpacing; + + result.x += FrameStyle.padding.horizontal; + result.y += FrameStyle.padding.vertical; + + return result; + } + + private void OnGUI() + { + Rect frameRect = new Rect(0, 0, position.width, position.height); + + GUI.Box(frameRect, string.Empty, FrameStyle); + + Rect threadRect = FrameStyle.padding.Remove(frameRect); + threadRect.height = EditorGUIUtility.singleLineHeight; + + foreach (ThreadType thread in Enum.GetValues(typeof(ThreadType))) + { + EditorGUI.BeginChangeCheck(); + + bool include = EditorGUI.ToggleLeft(threadRect, ThreadTypeDisplay[(int)thread], group.threads.Contains(thread)); + + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObject(platform,L10n.Tr(EditPlatformUndoMessage)); + + if (include) + { + // Make sure each thread is only in one group + foreach (ThreadAffinityGroup other in platform.ThreadAffinities) + { + other.threads.Remove(thread); + } + + group.threads.Add(thread); + group.threads.Sort(); + } + else + { + group.threads.Remove(thread); + } + + parent.Repaint(); + } + + threadRect.y = threadRect.yMax + EditorGUIUtility.standardVerticalSpacing; + } + } + } + + private void DisplayCodecChannels(string label, Platform platform) + { + if (platform is PlatformGroup || platform is PlatformDefault) + { + return; + } + + if (DisplayCodecChannelsFoldout(label, platform)) + { + using (new EditorGUI.IndentLevelScope()) + { + bool editable = platform.CodecChannelsProperty.HasValue; + + using (new EditorGUI.DisabledScope(!editable)) + { + foreach (CodecChannelCount channelCount in platform.CodecChannels) + { + EditorGUI.BeginChangeCheck(); + + int channels = EditorGUILayout.IntSlider(channelCount.format.ToString(), channelCount.channels, 0, 256); + + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObject(platform, L10n.Tr("Edit Codec Channels")); + + channelCount.channels = channels; + } + } + } + } + } + } + + private bool DisplayCodecChannelsFoldout(string label, Platform platform) + { + Rect controlRect = EditorGUILayout.GetControlRect(); + + Rect labelRect = controlRect; + labelRect.width = EditorGUIUtility.labelWidth; + + expandCodecChannels = EditorGUI.Foldout(labelRect, expandCodecChannels, label, true); + + bool useDefaults = !platform.CodecChannelsProperty.HasValue; + + EditorGUI.BeginChangeCheck(); + + Rect toggleRect = controlRect; + toggleRect.xMin = labelRect.xMax; + + useDefaults = GUI.Toggle(toggleRect, useDefaults, L10n.Tr("Use Defaults")); + + if (EditorGUI.EndChangeCheck()) + { + if (useDefaults) + { + platform.CodecChannelsProperty.Value = null; + platform.CodecChannelsProperty.HasValue = false; + } + else + { + platform.CodecChannelsProperty.Value = new List(); + platform.CodecChannelsProperty.HasValue = true; + + foreach (CodecChannelCount channelCount in platform.DefaultCodecChannels) + { + platform.CodecChannelsProperty.Value.Add(new CodecChannelCount(channelCount)); + } + } + } + + return expandCodecChannels; + } + + private void DisplaySampleRate(string label, Platform platform) + { + Platform.PropertyAccessor property = Platform.PropertyAccessors.SampleRate; + + Rect rect = DrawPlatformPropertyLabel(label, platform, property); + + EditorGUI.BeginChangeCheck(); + + int currentIndex = Math.Max(0, Array.IndexOf(FrequencyValues, platform.SampleRate)); + int nextIndex = DrawPopup(rect, currentIndex, FrequencyDisplay); + + if (EditorGUI.EndChangeCheck()) + { + property.Set(platform, FrequencyValues[nextIndex]); + } + } + + private void DisplayProjectPlatform(string label, Platform platform) + { + Rect rect = DrawPlatformPropertyLabel(label, platform, + Platform.PropertyAccessors.BuildDirectory, Platform.PropertyAccessors.SpeakerMode); + + int speakerModeIndex = Math.Max(0, Array.IndexOf(SpeakerModeValues, platform.SpeakerMode)); + string speakerModeName = SpeakerModeDisplay[speakerModeIndex]; + + if (GUI.Button(rect, string.Format("{0} ({1})", platform.BuildDirectory, speakerModeName))) + { + PopupWindow.Show(rect, new ProjectPlatformSelector(platform, this)); + } + } + + private class ProjectPlatformSelector : PopupWindowContent + { + private Platform platform; + private SettingsEditor settingsEditor; + private string[] outputSubdirectories; + + private GUIStyle headerStyle; + private GUIStyle toggleStyle; + + private GUIContent subdirectoryHeader = new GUIContent(L10n.Tr("Output sub-directory:")); + private GUIContent speakerModeHeader = new GUIContent(L10n.Tr("Surround speaker mode:")); + + private const float InterColumnSpace = 25; + + private Vector2 subdirectorySize; + private Vector2 speakerModeSize; + private Vector2 helpButtonSize; + + private Vector2 windowSize; + + public ProjectPlatformSelector(Platform platform, SettingsEditor settingsEditor) + { + this.platform = platform; + this.settingsEditor = settingsEditor; + + headerStyle = GUI.skin.label; + + toggleStyle = new GUIStyle(EditorStyles.radioButton); + toggleStyle.margin.left = headerStyle.margin.left; + + outputSubdirectories = EditorUtils.GetBankPlatforms(); + + Vector2 subdirectoryHeaderSize = headerStyle.CalcSize(subdirectoryHeader); + + subdirectorySize = ToggleGroupSize(outputSubdirectories); + subdirectorySize.x = Math.Max(subdirectoryHeaderSize.x, subdirectorySize.x); + subdirectorySize.y += subdirectoryHeaderSize.y + headerStyle.margin.bottom; + + Vector2 speakerModeHeaderSize = headerStyle.CalcSize(speakerModeHeader); + + speakerModeSize = ToggleGroupSize(SpeakerModeDisplay); + speakerModeSize.x = Math.Max(speakerModeHeaderSize.x, speakerModeSize.x); + speakerModeSize.y += speakerModeHeaderSize.y + headerStyle.margin.bottom; + + helpButtonSize = EditorUtils.GetHelpButtonSize(); + + float width = headerStyle.margin.left + subdirectorySize.x + InterColumnSpace + speakerModeSize.x + + helpButtonSize.x; + float height = Math.Max(subdirectorySize.y, speakerModeSize.y); + + windowSize = new Vector2(width, height); + } + + private Vector2 ToggleGroupSize(IEnumerable labels) + { + Vector2 totalSize = Vector2.zero; + + foreach (string label in labels) + { + Vector2 size = toggleStyle.CalcSize(new GUIContent(label)); + + totalSize.x = Math.Max(totalSize.x, size.x); + totalSize.y += size.y + toggleStyle.margin.top; + } + + totalSize.y += toggleStyle.margin.bottom; + + return totalSize; + } + + public override Vector2 GetWindowSize() + { + return windowSize; + } + + public override void OnGUI(Rect rect) + { + float y = rect.y + headerStyle.margin.top; + + Rect subdirectoryRect = new Rect(rect.x + headerStyle.margin.left, y, subdirectorySize.x, rect.height); + + using (new GUILayout.AreaScope(subdirectoryRect)) + { + GUILayout.Label(subdirectoryHeader, headerStyle); + + foreach (string buildDirectory in outputSubdirectories) + { + bool selected = (platform.BuildDirectory == buildDirectory); + + EditorGUI.BeginChangeCheck(); + + selected = GUILayout.Toggle(selected, buildDirectory, toggleStyle); + + if (EditorGUI.EndChangeCheck() && selected) + { + Undo.RecordObject(platform, L10n.Tr("Edit FMOD Platform Settings")); + + Platform.PropertyAccessors.BuildDirectory.Set(platform, buildDirectory); + + // Ensure SpeakerMode is also overridden + Platform.PropertyAccessors.SpeakerMode.Set(platform, platform.SpeakerMode); + + settingsEditor.Repaint(); + } + } + } + + Rect speakerModeRect = new Rect(subdirectoryRect.xMax + InterColumnSpace, y, speakerModeSize.x, rect.height); + + using (new GUILayout.AreaScope(speakerModeRect)) + { + GUILayout.Label(speakerModeHeader, headerStyle); + + for (int i = 0; i < SpeakerModeValues.Length; ++i) + { + bool selected = (platform.SpeakerMode == SpeakerModeValues[i]); + + EditorGUI.BeginChangeCheck(); + + selected = GUILayout.Toggle(selected, SpeakerModeDisplay[i], toggleStyle); + + if (EditorGUI.EndChangeCheck() && selected) + { + Undo.RecordObject(platform, L10n.Tr("Edit FMOD Platform Settings")); + + Platform.PropertyAccessors.SpeakerMode.Set(platform, SpeakerModeValues[i]); + + // Ensure BuildDirectory is also overridden + Platform.PropertyAccessors.BuildDirectory.Set(platform, platform.BuildDirectory); + + settingsEditor.Repaint(); + } + } + } + + Rect helpButtonRect = new Rect(speakerModeRect.xMax, y, helpButtonSize.x, helpButtonSize.y); + EditorUtils.DrawHelpButton(helpButtonRect, () => new SimpleHelp(L10n.Tr("Select the output sub-directory and surround speaker mode that match the project platform settings in the FMOD Studio build preferences."))); + } + } + + private void DisplaySpeakerMode(string label, Platform platform) + { + Rect rect = EditorUtils.DrawHelpButtonLayout(() => new SimpleHelp(L10n.Tr("Select the speaker mode that matches the project platform settings in the FMOD Studio build preferences."))); + + Rect labelRect = LabelRect(rect); + + GUI.Label(labelRect, label); + + Rect speakerModeRect = rect; + speakerModeRect.xMin = labelRect.xMax; + + int currentIndex = Math.Max(0, Array.IndexOf(SpeakerModeValues, platform.SpeakerMode)); + + int next = DrawPopup(speakerModeRect, currentIndex, SpeakerModeDisplay); + + Platform.PropertyAccessors.SpeakerMode.Set(platform, SpeakerModeValues[next]); + } + + private void DisplayCallbackHandler(string label, Platform platform) + { + Platform.PropertyAccessor property = Platform.PropertyAccessors.CallbackHandler; + + Rect rect = DrawPlatformPropertyLabel(label, platform, property); + + using (new NoIndentScope()) + { + EditorGUI.BeginChangeCheck(); + + PlatformCallbackHandler next = EditorGUI.ObjectField(rect, property.Get(platform), + typeof(PlatformCallbackHandler), false) as PlatformCallbackHandler; + + if (EditorGUI.EndChangeCheck()) + { + property.Set(platform, next); + } + } + } + + private void DisplayInt(string label, Platform platform, Platform.PropertyAccessor property, int min, int max) + { + int currentValue = property.Get(platform); + + Rect rect = DrawPlatformPropertyLabel(label, platform, property); + + using (new NoIndentScope()) + { + EditorGUI.BeginChangeCheck(); + + int next = EditorGUI.IntSlider(rect, currentValue, min, max); + + if (EditorGUI.EndChangeCheck()) + { + property.Set(platform, next); + } + } + } + + private void DisplayLiveUpdatePort(string label, Platform platform, Platform.PropertyAccessor property) + { + Rect rect = DrawPlatformPropertyLabel(label, platform, property); + + GUIContent resetContent = new GUIContent(L10n.Tr("Reset")); + + Rect resetRect = rect; + resetRect.xMin = resetRect.xMax - GUI.skin.button.CalcSize(resetContent).x; + + Rect textRect = rect; + textRect.xMax = resetRect.xMin; + + using (new NoIndentScope()) + { + EditorGUI.BeginChangeCheck(); + + int next = EditorGUI.IntField(textRect, property.Get(platform)); + + if (GUI.Button(resetRect, resetContent)) + { + next = 9264; + } + + if (EditorGUI.EndChangeCheck()) + { + property.Set(platform, next); + } + } + } + + private void DisplayPlatform(Platform platform) + { + if (!platform.Active) + { + return; + } + + DisplayPlatformHeader(platform); + + Undo.RecordObject(platform,L10n.Tr(EditPlatformUndoMessage)); + + Settings settings = target as Settings; + + using (new EditorGUI.IndentLevelScope()) + { + EditorGUI.BeginChangeCheck(); + DisplayTriStateBool(L10n.Tr("Live Update"), platform, Platform.PropertyAccessors.LiveUpdate); + + if (platform.IsLiveUpdateEnabled) + { + DisplayLiveUpdatePort(L10n.Tr("Live Update Port"), platform, Platform.PropertyAccessors.LiveUpdatePort); + } + + DisplayTriStateBool(L10n.Tr("Debug Overlay"), platform, Platform.PropertyAccessors.Overlay); + if (platform.IsOverlayEnabled) + { + DisplayPositionRect(L10n.Tr("Debug Location"), platform, Platform.PropertyAccessors.OverlayPosition); + DisplayDebugFontSelection(L10n.Tr("Font size"), platform, Platform.PropertyAccessors.OverlayFontSize); + } + + DisplayOutputMode(L10n.Tr("Output Mode"), platform); + DisplaySampleRate(L10n.Tr("Sample Rate"), platform); + + if (settings.HasPlatforms) + { + DisplayProjectPlatform(L10n.Tr("Project Platform"), platform); + } + else if (platform is PlatformDefault) + { + DisplaySpeakerMode(L10n.Tr("Speaker Mode"), platform); + } + + DisplayCallbackHandler(L10n.Tr("Callback Handler"), platform); + + DisplayInt(L10n.Tr("Virtual Channel Count"), platform, Platform.PropertyAccessors.VirtualChannelCount, 1, 2048); + DisplayInt(L10n.Tr("Real Channel Count"), platform, Platform.PropertyAccessors.RealChannelCount, 1, 256); + + DisplayCodecChannels(L10n.Tr("Codec Counts"), platform); + + DisplayDSPBufferSettings(platform); + + string warning = null; + + BuildTargetGroup buildTargetGroup = + BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget); + NamedBuildTarget namedBuildTarget = NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup); + ScriptingImplementation scriptingBackend = PlayerSettings.GetScriptingBackend(namedBuildTarget); + + if (scriptingBackend != ScriptingImplementation.IL2CPP) + { + warning = L10n.Tr("Only supported on the IL2CPP scripting backend"); + } + + DisplayPlugins(L10n.Tr("Static Plugins"), staticPluginsView, platform, ref expandStaticPlugins, warning); + + DisplayPlugins(L10n.Tr("Dynamic Plugins"), dynamicPluginsView, platform, ref expandDynamicPlugins); + + DisplayThreadAffinity(L10n.Tr("Thread Affinity"), platform); + + if (EditorGUI.EndChangeCheck()) + { + EditorUtility.SetDirty(target); + } + } + } + + private void DisplayPlatformHeader(Platform platform) + { + string type; + + if (platform is PlatformGroup) + { + type = L10n.Tr("platform group"); + } + else if (platform.IsIntrinsic) + { + type = L10n.Tr("built-in platform"); + } + else + { + type = L10n.Tr("platform"); + } + + if (platform.Parent != null || platform is PlatformPlayInEditor) + { + Platform parent; + GUIContent labelContent; + + if (platform is PlatformPlayInEditor) + { + labelContent = new GUIContent(string.Format("{0}: {1} " + L10n.Tr("inheriting from Unity build target: "), + platform.DisplayName, type)); + parent = EditorSettings.Instance.CurrentEditorPlatform; + + while (!parent.Active) + { + parent = parent.Parent; + } + } + else + { + labelContent = new GUIContent(string.Format("{0}: {1} " + L10n.Tr("inheriting from"), platform.DisplayName, type)); + parent = platform.Parent; + } + + Rect rect = EditorGUILayout.GetControlRect(); + + GUIContent buttonContent = new GUIContent(string.Format("{0}", parent.DisplayName)); + GUIContent iconContent = EditorGUIUtility.IconContent("UnityEditor.FindDependencies"); + + Rect labelRect = LabelRect(rect); + labelRect.width = platformHeaderStyle.CalcSize(labelContent).x; + + Rect buttonRect = rect; + buttonRect.x = labelRect.xMax; + buttonRect.width = platformHeaderStyle.CalcSize(buttonContent).x; + + Rect iconRect = rect; + iconRect.x = buttonRect.xMax; + iconRect.width = iconContent.image.width; + iconRect.height = iconContent.image.height; + iconRect.y += (rect.height - iconRect.height) / 2; + + buttonRect.width += iconRect.width; + + GUI.Label(labelRect, labelContent, platformHeaderStyle); + + if (GUI.Button(buttonRect, buttonContent, platformHeaderStyle)) + { + platformsView.SelectAndFramePlatform(parent); + } + + if (Event.current.type == EventType.Repaint) + { + GUI.DrawTexture(iconRect, iconContent.image); + } + + EditorGUIUtility.AddCursorRect(buttonRect, MouseCursor.Link); + } + else + { + string text = string.Format("{0}: {1}", platform.DisplayName, type); + EditorGUILayout.LabelField(text, platformHeaderStyle); + } + } + + private void DisplayDSPBufferSettings(Platform platform) + { + Rect rect = DrawPlatformPropertyLabel(L10n.Tr("DSP Buffer Settings"), platform, + Platform.PropertyAccessors.DSPBufferLength, Platform.PropertyAccessors.DSPBufferCount); + + bool useAutoDSPBufferSettings = DisplayAutoDSPBufferSettings(rect, platform); + + if (!useAutoDSPBufferSettings) + { + DisplayDSPBufferFields(platform); + } + } + + private bool DisplayAutoDSPBufferSettings(Rect rect, Platform platform) + { + Platform.PropertyAccessor lengthProperty = Platform.PropertyAccessors.DSPBufferLength; + Platform.PropertyAccessor countProperty = Platform.PropertyAccessors.DSPBufferCount; + + GUIStyle style = GUI.skin.toggle; + + GUIContent content = new GUIContent(L10n.Tr("Auto")); + rect.width = style.CalcSize(content).x; + + bool useAutoDSPBufferSettings = lengthProperty.Get(platform) == 0 && countProperty.Get(platform) == 0; + + EditorGUI.BeginChangeCheck(); + + useAutoDSPBufferSettings = GUI.Toggle(rect, useAutoDSPBufferSettings, content, style); + + if (EditorGUI.EndChangeCheck()) + { + if (useAutoDSPBufferSettings) + { + lengthProperty.Set(platform, 0); + countProperty.Set(platform, 0); + + } + else + { + // set a helpful default value (real default is 0 for auto behaviour) + lengthProperty.Set(platform, 512); + countProperty.Set(platform, 4); + } + } + + return useAutoDSPBufferSettings; + } + + private void DisplayDSPBufferFields(Platform platform) + { + Platform.PropertyAccessor lengthProperty = Platform.PropertyAccessors.DSPBufferLength; + Platform.PropertyAccessor countProperty = Platform.PropertyAccessors.DSPBufferCount; + + using (new EditorGUI.IndentLevelScope()) + { + EditorGUI.BeginChangeCheck(); + + int nextLength = Mathf.Max(EditorGUILayout.IntField(L10n.Tr("DSP Buffer Length"), lengthProperty.Get(platform)), 8); + int nextCount = Mathf.Max(EditorGUILayout.IntField(L10n.Tr("DSP Buffer Count"), countProperty.Get(platform)), 2); + + if (EditorGUI.EndChangeCheck()) + { + lengthProperty.Set(platform, nextLength); + countProperty.Set(platform, nextCount); + } + } + } + + private void DisplayPlugins(string title, PlatformPropertyStringListView view, Platform platform, + ref bool expand, string warning = null) + { + List plugins = view.property.Get(platform); + + string fullTitle = string.Format("{0}: {1}", title, plugins.Count); + + DrawPlatformPropertyFoldout(fullTitle, ref expand, platform, view.property); + + if (expand) + { + using (new EditorGUI.IndentLevelScope()) + { + if (warning != null) + { + EditorGUILayout.HelpBox(warning, MessageType.Warning); + } + + view.platform = platform; + view.DrawLayout(); + } + } + } + + protected override void OnHeaderGUI() + { + AffirmResources(); + + GUIContent text = new GUIContent(L10n.Tr("FMOD Settings")); + + Vector2 textSize = mainHeaderStyle.CalcSize(text); + + Vector2 iconSize = GUI.skin.label.CalcSize(mainHeaderIcon); + + Rect rect = EditorGUILayout.GetControlRect(false, (Math.Max(textSize.y, iconSize.y)) * 1.75f); + + Rect iconRect = rect; + iconRect.width = iconSize.x; + iconRect.height = iconSize.y; + iconRect.y += (rect.height - iconRect.height) / 2; + + Rect textRect = rect; + textRect.xMin = iconRect.xMax; + textRect.height = textSize.y; + textRect.y += (rect.height - textRect.height) / 2; + + GUI.Label(iconRect, mainHeaderIcon); + GUI.Label(textRect, text, mainHeaderStyle); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + string invalidSourceMessage = CheckValidSource(); + + DrawImportSection(invalidSourceMessage); + + if (invalidSourceMessage != null) + { + serializedObject.ApplyModifiedProperties(); + return; + } + + EditorGUILayout.Separator(); + + DrawInitializationSection(); + + EditorGUILayout.Separator(); + + DrawBehaviorSection(); + + EditorGUILayout.Separator(); + + DrawUserInterfaceSection(); + + EditorGUILayout.Separator(); + + DrawPlatforms(); + + serializedObject.ApplyModifiedProperties(); + + ApplyPendingActions(); + } + + private bool DrawSectionHeaderLayout(Section section, string title) + { + Rect rect = EditorGUILayout.GetControlRect(); + + return DrawSectionHeader(rect, section, title); + } + + private bool DrawSectionHeader(Rect rect, Section section, string title) + { + AffirmResources(); + + bool expanded = (section & sExpandedSections) == section; + + expanded = EditorGUI.Foldout(rect, expanded, title, true, sectionHeaderStyle); + + sExpandedSections = expanded ? (sExpandedSections | section) : (sExpandedSections & ~section); + + return expanded; + } + + private void DrawImportSection(string invalidSourceMessage) + { + if (DrawSectionHeaderLayout(Section.BankImport, L10n.Tr("Bank Import"))) + { + using (new EditorGUI.IndentLevelScope()) + { + DrawSourceSelection(invalidSourceMessage); + + if (invalidSourceMessage != null) + { + return; + } + + DrawTargetSelection(); + } + } + } + + private void DrawSourceSelection(string invalidSourceMessage) + { + Rect popupRect = EditorUtils.DrawHelpButtonLayout(() => new SourceSelectionHelp()); + + hasBankSourceChanged = false; + + SourceType sourceType = hasSourceProject.boolValue + ? SourceType.FMODStudioProject + : (hasPlatforms.boolValue ? SourceType.MultiplePlatformBuild : SourceType.SinglePlatformBuild); + + sourceType = (SourceType)EditorGUI.EnumPopup(popupRect, L10n.Tr("Source Type"), sourceType); + + if (sourceType == SourceType.FMODStudioProject) + { + string oldPath = sourceProjectPath.stringValue; + + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUI.BeginChangeCheck(); + string newPath = EditorGUILayout.TextField(L10n.Tr("Studio Project Path"), sourceProjectPath.stringValue); + if (EditorGUI.EndChangeCheck()) + { + if (newPath.EndsWith(".fspro")) + { + sourceProjectPath.stringValue = newPath; + } + } + + if (GUILayout.Button(L10n.Tr("Browse"), GUILayout.ExpandWidth(false))) + { + GUI.FocusControl(null); + EditorApplication.delayCall += BrowseForSourceProjectPathAndRefresh; + } + } + + // Cache in settings for runtime access in play-in-editor mode + sourceBankPath.stringValue = GetBankDirectory(serializedObject); + hasPlatforms.boolValue = true; + hasSourceProject.boolValue = true; + + // First time project path is set or changes, copy to streaming assets + if (sourceProjectPath.stringValue != oldPath) + { + hasBankSourceChanged = true; + } + } + else if (sourceType == SourceType.SinglePlatformBuild || sourceType == SourceType.MultiplePlatformBuild) + { + string oldPath = sourceBankPath.stringValue; + + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.PropertyField(sourceBankPath, new GUIContent(L10n.Tr("Build Path"))); + + if (GUILayout.Button(L10n.Tr("Browse"), GUILayout.ExpandWidth(false))) + { + GUI.FocusControl(null); + EditorApplication.delayCall += BrowseForSourceBankPathAndRefresh; + } + } + + hasPlatforms.boolValue = (sourceType == SourceType.MultiplePlatformBuild); + hasSourceProject.boolValue = false; + + // First time project path is set or changes, copy to streaming assets + if (sourceBankPath.stringValue != oldPath) + { + hasBankSourceChanged = true; + } + } + + if (invalidSourceMessage != null) + { + EditorGUILayout.HelpBox(invalidSourceMessage, MessageType.Error, true); + } + } + + private void BrowseForSourceProjectPathAndRefresh() + { + if (BrowseForSourceProjectPath(serializedObject)) + { + Repaint(); + } + } + + private void BrowseForSourceBankPathAndRefresh() + { + if (BrowseForSourceBankPath(serializedObject, hasPlatforms.boolValue)) + { + Repaint(); + } + } + + private string CheckValidSource() + { + bool validSource; + string invalidMessage; + EditorUtils.ValidateSource(out validSource, out invalidMessage); + + if (validSource) + { + return null; + } + else + { + sExpandedSections |= Section.BankImport; + + return invalidMessage + L10n.Tr("\n\nFor detailed setup instructions, please see the FMOD/Help/Getting Started menu item."); + } + } + + private class SourceSelectionHelp : HelpContent + { + private GUIStyle style; + + private readonly GUIContent introduction = new GUIContent(L10n.Tr("Choose how to access your FMOD Studio content:")); + + private readonly ListEntry[] listEntries = { + new ListEntry(L10n.Tr("FMOD Studio Project"), + L10n.Tr("If you have the complete FMOD Studio project.") + ), + new ListEntry(L10n.Tr("Single Platform Build"), + L10n.Tr("If you have the contents of the Build folder for a single platform.") + ), + new ListEntry(L10n.Tr("Multiple Platform Build"), + L10n.Tr("If you have the contents of the Build folder for multiple platforms, with each platform in its own subdirectory.") + ), + }; + + protected override void Prepare() + { + style = new GUIStyle(GUI.skin.label) { + richText = true, + wordWrap = true, + }; + } + + private struct ListEntry + { + public ListEntry(string label, string description) + { + this.label = new GUIContent(label); + this.description = new GUIContent(description); + } + + public GUIContent label; + public GUIContent description; + } + + protected override Vector2 GetContentSize() + { + Vector2 size = new Vector2(440, 0); + + size.y += style.margin.top; + size.y += style.CalcHeight(introduction, size.x); + + foreach (ListEntry entry in listEntries) + { + size.y += style.margin.top; + size.y += style.CalcHeight(entry.description, size.x - EditorGUIUtility.labelWidth); + } + + size.y += style.margin.bottom; + + return size; + } + + protected override void DrawContent() + { + EditorGUILayout.LabelField(introduction, style); + + using (new EditorGUI.IndentLevelScope()) + { + foreach (ListEntry entry in listEntries) + { + EditorGUILayout.LabelField(entry.label, entry.description, style); + } + } + } + } + + private static string GetBankDirectory(SerializedObject serializedObject) + { + var sourceProjectPath = serializedObject.FindProperty("sourceProjectPath"); + var sourceBankPath = serializedObject.FindProperty("sourceBankPath"); + var hasSourceProject = serializedObject.FindProperty("HasSourceProject"); + + if (hasSourceProject.boolValue && !string.IsNullOrEmpty(sourceProjectPath.stringValue)) + { + string projectFolder = Path.GetDirectoryName(sourceProjectPath.stringValue); + return RuntimeUtils.GetCommonPlatformPath(Path.Combine(projectFolder, EditorUtils.BuildFolder)); + } + else if (!string.IsNullOrEmpty(sourceBankPath.stringValue)) + { + return RuntimeUtils.GetCommonPlatformPath(Path.GetFullPath(sourceBankPath.stringValue)); + } + else + { + return null; + } + } + + private void DrawTargetSelection() + { + Settings settings = target as Settings; + + hasBankTargetChanged = false; + + string[] importTypeNames = {L10n.Tr("Streaming Asset"), L10n.Tr("Asset Bundle") }; + int importTypeIndex = importType.enumValueIndex; + + int newImportTypeIndex = EditorGUILayout.Popup(L10n.Tr("Import Type"), importTypeIndex, importTypeNames); + + if (newImportTypeIndex != importType.enumValueIndex) + { + bool deleteBanks = EditorUtility.DisplayDialog( + L10n.Tr("FMOD Bank Import Type Changed"), + string.Format(L10n.Tr("Do you want to delete the {0} banks in {1} "), importTypeNames[importTypeIndex], settings.TargetPath), + L10n.Tr("Yes"), L10n.Tr("No")); + + if (deleteBanks) + { + // Delete the old banks + EventManager.RemoveBanks(settings.TargetPath); + } + + hasBankTargetChanged = true; + importType.enumValueIndex = newImportTypeIndex; + } + + // ----- Asset Sub Directory ------------- + SerializedProperty targetSubFolder; + string label; + + if (importType.intValue == (int)ImportType.AssetBundle) + { + targetSubFolder = targetAssetPath; + label =L10n.Tr("FMOD Asset Sub Folder"); + } + else + { + targetSubFolder = targetBankFolder; + label = L10n.Tr("FMOD Bank Sub Folder"); + } + + string newSubFolder = EditorGUILayout.DelayedTextField(label, targetSubFolder.stringValue); + + if (newSubFolder != targetSubFolder.stringValue) + { + EventManager.RemoveBanks(settings.TargetPath); + targetSubFolder.stringValue = newSubFolder; + hasBankTargetChanged = true; + } + + DisplayBankRefreshSettings(bankRefreshCooldown, showBankRefreshWindow, true); + + EditorGUILayout.PropertyField(eventLinkage, new GUIContent(L10n.Tr("Event Linkage"))); + } + + private void DrawBehaviorSection() + { + if (DrawSectionHeaderLayout(Section.Behavior, L10n.Tr("Behavior"))) + { + using (new EditorGUI.IndentLevelScope()) + { + EditorGUILayout.PropertyField(stopEventsOutsideMaxDistance, + new GUIContent(L10n.Tr("Stop Events Outside Max Distance"))); + } + } + } + + private void DrawUserInterfaceSection() + { + if (DrawSectionHeaderLayout(Section.UserInterface, L10n.Tr("User Interface"))) + { + using (new EditorGUI.IndentLevelScope()) + { + EditorGUI.BeginChangeCheck(); + + meterChannelOrdering.intValue = EditorGUILayout.IntPopup(L10n.Tr("Meter Channel Ordering"), + meterChannelOrdering.intValue, MeterChannelOrderingeDisplay, MeterChannelOrderingeValues); + + if (EditorGUI.EndChangeCheck() && EventBrowser.IsOpen) + { + EditorWindow.GetWindow("FMOD Events", false).Repaint(); + } + } + } + } + + private void DrawInitializationSection() + { + if (DrawSectionHeaderLayout(Section.Initialization, L10n.Tr("Initialization"))) + { + using (new EditorGUI.IndentLevelScope()) + { + loggingLevel.intValue = EditorGUILayout.IntPopup(L10n.Tr("Logging Level"), + loggingLevel.intValue, LoggingDisplay, LoggingValues); + + EditorGUILayout.PropertyField(enableErrorCallback, + new GUIContent(L10n.Tr("Enable API Error Logging"))); + + EditorGUILayout.PropertyField(enableMemoryTracking, new GUIContent(L10n.Tr("Enable Memory Tracking"))); + + using (new EditorGUI.DisabledScope(importType.intValue == (int)ImportType.AssetBundle)) + { + bankLoadType.intValue = EditorGUILayout.IntPopup(L10n.Tr("Load Banks"), + bankLoadType.intValue, BankLoadTypeDisplay, BankLoadTypeValues); + + switch ((BankLoadType)bankLoadType.intValue) + { + case BankLoadType.All: + break; + case BankLoadType.Specified: + automaticEventLoading.boolValue = false; + DisplayBanksToLoad(); + break; + case BankLoadType.None: + automaticEventLoading.boolValue = false; + break; + default: + break; + } + + using (new EditorGUI.DisabledScope(bankLoadType.intValue == (int)BankLoadType.None)) + { + EditorGUILayout.PropertyField(automaticSampleLoading, new GUIContent(L10n.Tr("Load Bank Sample Data"))); + } + + EditorGUILayout.DelayedTextField(encryptionKey, new GUIContent(L10n.Tr("Bank Encryption Key"))); + } + } + } + } + + private void DisplayBanksToLoad() + { + banksToLoad.isExpanded = EditorGUILayout.Foldout(banksToLoad.isExpanded, L10n.Tr("Specified Banks"), true); + + if (banksToLoad.isExpanded) + { + using (new EditorGUI.IndentLevelScope()) + { + banksToLoadView.DrawLayout(); + } + } + } + + private void BrowseForBankToLoad() + { + string bankDirectory = CurrentBankDirectory(); + string path = EditorUtility.OpenFilePanel(L10n.Tr("Locate Bank"), bankDirectory, "bank"); + + if (!string.IsNullOrEmpty(path)) + { + serializedObject.Update(); + + path = RuntimeUtils.GetCommonPlatformPath(path); + path = path.Replace(bankDirectory, ""); + path = Regex.Replace(path, "\\.bank$", ""); + + banksToLoad.ArrayAdd(p => p.stringValue = path); + + serializedObject.ApplyModifiedProperties(); + + Repaint(); + } + } + + private void AddAllBanksToLoad() + { + string sourceDir = CurrentBankDirectory(); + string[] banksFound = Directory.GetFiles(sourceDir, "*.bank", SearchOption.AllDirectories); + + serializedObject.Update(); + + for (int i = 0; i < banksFound.Length; i++) + { + string bankLongName = RuntimeUtils.GetCommonPlatformPath(Path.GetFullPath(banksFound[i])); + string bankShortName = bankLongName.Replace(sourceDir, ""); + bankShortName = Regex.Replace(bankShortName, "\\.bank$", ""); + + if (!banksToLoad.ArrayContains(p => p.stringValue == bankShortName)) + { + banksToLoad.ArrayAdd(p => p.stringValue = bankShortName); + } + } + + serializedObject.ApplyModifiedProperties(); + + Repaint(); + } + + private string CurrentBankDirectory() + { + Settings settings = target as Settings; + + string bankDirectory; + + if (settings.HasPlatforms) + { + bankDirectory = string.Format("{0}/{1}/", + settings.SourceBankPath, EditorSettings.Instance.CurrentEditorPlatform.BuildDirectory); + } + else + { + bankDirectory = settings.SourceBankPath + "/"; + } + + return RuntimeUtils.GetCommonPlatformPath(Path.GetFullPath(bankDirectory)); + } + + private void DrawPlatforms() + { + platformsView.ReloadIfNecessary(); + + if (DrawSectionHeaderLayout(Section.PlatformSpecific, L10n.Tr("Platform Specific"))) + { + using (new EditorGUI.IndentLevelScope()) + { + platformsView.DrawLayout(); + + Platform selectedPlatform = platformsView.SelectedPlatform; + + if (selectedPlatform != null) + { + DisplayPlatform(selectedPlatform); + } + } + } + } + + private class PlatformsView : TreeView + { + private const float RowPadding = 2; + + private Settings settings; + + private static UnityEditorInternal.ReorderableList.Defaults s_Defaults; + + private const float HeaderHeight = 3; + private const float BodyHeight = 150; + private const float FooterHeight = 13; + private const float TotalHeight = HeaderHeight + BodyHeight + FooterHeight; + + private const float ButtonWidth = 25; + private const float ButtonHeight = 16; + private const float ButtonMarginTop = 0; + + private const float FooterMarginRight = 10; + + private static readonly RectOffset BodyPadding = new RectOffset(1, 2, 1, 4); + private static readonly RectOffset FooterPadding = new RectOffset(4, 4, 0, 0); + + private static readonly Vector2 DragHandleSize = new Vector2(10, 7); + private static readonly Vector2 DragHandlePadding = new Vector2(5, 6); + + public PlatformsView(Settings settings, TreeViewState state) : base(state) + { + this.settings = settings; + rowHeight = EditorGUIUtility.singleLineHeight + RowPadding; + } + + public Platform SelectedPlatform + { + get + { + IList selection = GetSelection(); + + if (selection.Count != 1) + { + return null; + } + + PlatformItem selectedItem = FindItem(selection[0], rootItem) as PlatformItem; + + if (selectedItem == null) + { + return null; + } + + return selectedItem.platform; + } + } + + private static UnityEditorInternal.ReorderableList.Defaults defaultBehaviours + { + get + { + if (s_Defaults == null) + { + s_Defaults = new UnityEditorInternal.ReorderableList.Defaults(); + } + + return s_Defaults; + } + } + + public void DrawLayout() + { + Rect rect = EditorGUILayout.GetControlRect(false, TotalHeight); + rect = EditorGUI.IndentedRect(rect); + + Rect headerRect = rect; + headerRect.height = HeaderHeight; + + Rect bodyRect = rect; + bodyRect.y = headerRect.yMax; + bodyRect.height = BodyHeight; + + Rect footerRect = rect; + footerRect.xMax -= FooterMarginRight; + footerRect.y = bodyRect.yMax; + footerRect.height = FooterHeight; + + Rect removeRect = footerRect; + removeRect.x = footerRect.xMax - FooterPadding.right - ButtonWidth; + removeRect.y += ButtonMarginTop; + removeRect.width = ButtonWidth; + removeRect.height = ButtonHeight; + + Rect addRect = footerRect; + addRect.x = removeRect.x - ButtonWidth; + addRect.y += ButtonMarginTop; + addRect.width = ButtonWidth; + addRect.height = ButtonHeight; + + footerRect.xMin = addRect.xMin - FooterPadding.left; + footerRect.xMax = removeRect.xMax + FooterPadding.right; + + defaultBehaviours.DrawHeaderBackground(headerRect); + + if (Event.current.type == EventType.Repaint) + { + defaultBehaviours.boxBackground.Draw(bodyRect, false, false, false, false); + } + + Rect contentRect = BodyPadding.Remove(bodyRect); + + using (new NoIndentScope()) + { + base.OnGUI(contentRect); + } + + if (Event.current.type == EventType.Repaint) + { + defaultBehaviours.footerBackground.Draw(footerRect, false, false, false, false); + } + + if (GUI.Button(addRect, defaultBehaviours.iconToolbarPlusMore, defaultBehaviours.preButton)) + { + DoAddMenu(addRect); + } + + using (new EditorGUI.DisabledScope(SelectedPlatform == null)) + { + if (GUI.Button(removeRect, defaultBehaviours.iconToolbarMinus, defaultBehaviours.preButton)) + { + DeleteSelectedPlatform(); + } + } + } + + private void DoAddMenu(Rect rect) + { + GenericMenu menu = new GenericMenu(); + + menu.AddItem(new GUIContent(L10n.Tr("New Group")), false, AddGroup); + + menu.AddSeparator(string.Empty); + + IEnumerable missingPlatforms = settings.Platforms + .Where(p => !p.Active) + .OrderBy(p => p.DisplayName, new NaturalComparer()); + + foreach (Platform platform in missingPlatforms) + { + menu.AddItem(new GUIContent(platform.DisplayName), false, AddPlatform, platform.Identifier); + } + + menu.DropDown(rect); + } + + private void AddPlatform(object data) + { + string identifier = data as string; + + Platform platform = settings.FindPlatform(identifier); + + const string UndoMessage = "Add FMOD Platform"; + + Undo.RecordObjects(new UnityEngine.Object[] { settings, platform, platform.Parent }, L10n.Tr(UndoMessage)); + + platform.DisplaySortOrder = UpdateSortOrderForChildren(platform.Parent, platform, L10n.Tr(UndoMessage)); + + settings.AddPlatformProperties(platform); + + ForceReload(); + + SelectAndFramePlatform(platform); + } + + private void AddGroup() + { + const string UndoMessage = "Add FMOD Platform Group"; + + Undo.RecordObjects(new UnityEngine.Object[] { settings, settings.DefaultPlatform }, L10n.Tr(UndoMessage)); + + int sortOrder = UpdateSortOrderForChildren(settings.DefaultPlatform, null, L10n.Tr(UndoMessage)); + + PlatformGroup group = EditorSettings.Instance.AddPlatformGroup(L10n.Tr("New Group"), sortOrder); + + Undo.RegisterCreatedObjectUndo(group, UndoMessage); + + ForceReload(); + + SelectAndFramePlatform(group); + + // Bring up the rename UI + DoubleClickedItem(group.Identifier.GetHashCode()); + } + + private int UpdateSortOrderForChildren(Platform platform, Platform skipChild, string undoMessage) + { + int sortOrder = 0; + + foreach (string childID in platform.ChildIdentifiers) + { + Platform child = settings.FindPlatform(childID); + + if (child.Active && child != skipChild) + { + Undo.RecordObject(child, undoMessage); + + child.DisplaySortOrder = sortOrder; + ++sortOrder; + } + } + + return sortOrder; + } + + // Removes a platform from the inheritance hierarchy and clears its properties, thus hiding + // it in the UI. Also destroys the platform if it is a group. + private void DeleteSelectedPlatform() + { + Platform platform = SelectedPlatform; + + if (platform == null || platform == settings.DefaultPlatform || platform == settings.PlayInEditorPlatform) + { + return; + } + + + const string UndoMessage = "Delete FMOD Platform"; + + Undo.RecordObjects(new UnityEngine.Object[] { platform, platform.Parent, settings }, L10n.Tr(UndoMessage)); + + while (platform.ChildIdentifiers.Count > 0) + { + Platform child = settings.FindPlatform(platform.ChildIdentifiers[platform.ChildIdentifiers.Count - 1]); + + SetPlatformParent(L10n.Tr(UndoMessage), settings, child, platform.Parent, (int)platform.DisplaySortOrder + 1); + } + + if (platform is PlatformGroup) + { + PlatformGroup group = platform as PlatformGroup; + + settings.SetPlatformParent(group, null); + settings.RemovePlatform(group.Identifier); + + Undo.DestroyObjectImmediate(group); + } + else + { + platform.ClearProperties(); + + Undo.RecordObject(settings.DefaultPlatform, UndoMessage); + + settings.SetPlatformParent(platform, settings.DefaultPlatform); + } + + ForceReload(); + } + + public void SelectAndFramePlatform(Platform platform) + { + SetSelection(new List() { platform.Identifier.GetHashCode() }, + TreeViewSelectionOptions.RevealAndFrame); + } + + protected override void RowGUI(RowGUIArgs args) + { + if (Event.current.type == EventType.Repaint) + { + defaultBehaviours.elementBackground.Draw(args.rowRect, false, args.selected, args.selected, args.focused); + + if (IsItemDraggable(args.item)) + { + Rect dragRect = new Rect(args.rowRect.position + DragHandlePadding, DragHandleSize); + + defaultBehaviours.draggingHandle.Draw(dragRect, false, false, false, false); + } + + GUIContent labelContent = new GUIContent(args.label); + + GUIStyle labelStyle = GUI.skin.label; + + Rect labelRect = args.rowRect; + CenterRectUsingSingleLineHeight(ref labelRect); + + labelRect.x = GetContentIndent(args.item); + labelRect.width = GUI.skin.label.CalcSize(labelContent).x; + + Texture renameIcon = EditorGUIUtility.IconContent("SettingsIcon").image; + + bool canRename = CanRename(args.item); + + if (canRename) + { + labelContent.tooltip = L10n.Tr("Double-click to rename"); + labelRect.width += renameIcon.width; + } + + GUI.Label(labelRect, labelContent); + + if (canRename && Event.current.type == EventType.Repaint) + { + Rect iconRect = new Rect() { + x = labelRect.xMax - renameIcon.width, + y = labelRect.yMax - labelStyle.padding.bottom - renameIcon.height, + width = renameIcon.width, + height = renameIcon.height, + }; + + GUI.DrawTexture(iconRect, renameIcon, ScaleMode.ScaleToFit, + true, 0, labelStyle.normal.textColor, 0, 0); + } + } + } + + public void ForceReload() + { + Reload(); + ExpandAll(); + } + + public void ReloadIfNecessary() + { + if (!isInitialized) + { + ForceReload(); + } + } + + protected override bool CanMultiSelect(TreeViewItem item) + { + return false; + } + + protected override bool CanChangeExpandedState(TreeViewItem item) + { + return false; + } + + protected override TreeViewItem BuildRoot() + { + TreeViewItem root = new TreeViewItem(-1, -1); + + root.AddChild(CreateItem(settings.PlayInEditorPlatform)); + + TreeViewItem defaultItem = CreateItem(settings.DefaultPlatform); + root.AddChild(defaultItem); + + CreateItems(defaultItem, settings.DefaultPlatform.ChildIdentifiers); + + SetupDepthsFromParentsAndChildren(root); + + return root; + } + + private class PlatformItem : TreeViewItem + { + public Platform platform; + + public PlatformItem(Platform platform) + : base(platform.Identifier.GetHashCode(), 0, platform.DisplayName) + { + this.platform = platform; + } + } + + private void CreateItems(TreeViewItem parent, IEnumerable platformIdentifiers) + { + foreach (string identifier in platformIdentifiers) + { + Platform platform = settings.FindPlatform(identifier); + + if (platform.Active) + { + TreeViewItem item = CreateItem(platform); + parent.AddChild(item); + + CreateItems(item, platform.ChildIdentifiers); + } + } + } + + private static TreeViewItem CreateItem(Platform platform) + { + return new PlatformItem(platform); + } + + protected override void DoubleClickedItem(int id) + { + TreeViewItem item = FindItem(id, rootItem); + + if (CanRename(item)) + { + BeginRename(item); + } + } + + protected override bool CanRename(TreeViewItem item) + { + PlatformItem platformItem = item as PlatformItem; + return (platformItem != null) && (platformItem.platform is PlatformGroup); + } + + protected override void RenameEnded(RenameEndedArgs args) + { + if (!args.acceptedRename || string.IsNullOrEmpty(args.newName)) + { + return; + } + + PlatformItem item = FindItem(args.itemID, rootItem) as PlatformItem; + + if (item == null) + { + return; + } + + PlatformGroup group = item.platform as PlatformGroup; + + if (group == null) + { + return; + } + + // Undo.RecordObject doesn't capture PlatformGroup.displayName, maybe due to inheritance? + // This means we need to use the SerializedObject interface instead. + SerializedObject serializedGroup = new SerializedObject(group); + SerializedProperty displayName = serializedGroup.FindProperty("displayName"); + + displayName.stringValue = args.newName; + + serializedGroup.ApplyModifiedProperties(); + + item.displayName = args.newName; + } + + protected override bool CanStartDrag(CanStartDragArgs args) + { + return IsItemDraggable(args.draggedItem); + } + + private bool IsItemDraggable(TreeViewItem draggedItem) + { + PlatformItem item = draggedItem as PlatformItem; + + return (item != null) && !item.platform.IsIntrinsic; + } + + protected override void SetupDragAndDrop(SetupDragAndDropArgs args) + { + PlatformItem item = FindItem(args.draggedItemIDs[0], rootItem) as PlatformItem; + + if (item != null) + { + DragAndDrop.PrepareStartDrag(); + DragAndDrop.objectReferences = new UnityEngine.Object[] { item.platform }; + DragAndDrop.StartDrag(L10n.Tr("Change FMOD Platform Inheritance")); + } + } + + protected override DragAndDropVisualMode HandleDragAndDrop(DragAndDropArgs args) + { + if (DragAndDrop.objectReferences.Length != 1) + { + return DragAndDropVisualMode.None; + } + + Platform draggedPlatform = DragAndDrop.objectReferences[0] as Platform; + + if (draggedPlatform == null) + { + return DragAndDropVisualMode.None; + } + + PlatformItem parentItem = args.parentItem as PlatformItem; + + if (parentItem == null) + { + return DragAndDropVisualMode.None; + } + + Platform parent = parentItem.platform; + + if (parent is PlatformPlayInEditor) + { + return DragAndDropVisualMode.None; + } + + switch (args.dragAndDropPosition) + { + case DragAndDropPosition.UponItem: + return HandleDragOverPlatform(draggedPlatform, parent, args.performDrop); + case DragAndDropPosition.BetweenItems: + return HandleDragBetweenChildren(draggedPlatform, parent, args.insertAtIndex, args.performDrop); + case DragAndDropPosition.OutsideItems: + return DragAndDropVisualMode.Move; + default: + return DragAndDropVisualMode.None; + } + } + + private DragAndDropVisualMode HandleDragOverPlatform(Platform draggedPlatform, Platform parent, bool performDrop) + { + if (parent == draggedPlatform) + { + return DragAndDropVisualMode.Move; + } + + if (parent.InheritsFrom(draggedPlatform)) + { + return DragAndDropVisualMode.None; + } + + if (performDrop) + { + SetPlatformParent(L10n.Tr("Set FMOD Platform Inheritance"), settings, draggedPlatform, parent); + ForceReload(); + } + + return DragAndDropVisualMode.Link; + } + + private DragAndDropVisualMode HandleDragBetweenChildren(Platform draggedPlatform, Platform parent, + int insertAtIndex, bool performDrop) + { + if (parent.InheritsFrom(draggedPlatform)) + { + return DragAndDropVisualMode.None; + } + + if (performDrop) + { + SetPlatformParent(L10n.Tr("Set FMOD Platform Inheritance"), settings, draggedPlatform, parent, insertAtIndex); + ForceReload(); + } + + return DragAndDropVisualMode.Move; + } + } + + private class ReorderableList : UnityEditorInternal.ReorderableList + { + private const float ElementPadding = 2; + + public ReorderableList(SerializedProperty property) + : base(property.serializedObject, property, true, false, true, true) + { + headerHeight = 3; + elementHeight = EditorGUIUtility.singleLineHeight + ElementPadding; + drawElementCallback = DrawElement; + } + + public void DrawLayout() + { + Rect rect = EditorGUILayout.GetControlRect(false, GetHeight()); + rect = EditorGUI.IndentedRect(rect); + + DoList(rect); + } + + private void DrawElement(Rect rect, int index, bool active, bool focused) + { + using (new NoIndentScope()) + { + rect.height -= ElementPadding; + + EditorGUI.PropertyField(rect, serializedProperty.GetArrayElementAtIndex(index), GUIContent.none); + } + } + } + + private class PlatformPropertyStringListView : UnityEditorInternal.ReorderableList + { + private const float ElementPadding = 2; + + public Platform platform; + + private List displayList; + + public PlatformPropertyStringListView(Platform.PropertyAccessor> property) + : base(null, typeof(string), true, false, true, true) + { + this.property = property; + + displayList = new List(); + list = displayList; + + headerHeight = 3; + elementHeight = EditorGUIUtility.singleLineHeight + ElementPadding; + + drawElementCallback = DrawElement; + onAddCallback = AddElement; + onRemoveCallback = RemoveElement; + onReorderCallback = OnReorder; + } + + public Platform.PropertyAccessor> property { get; private set; } + + // We need this because ReorderableList modifies the list before calling + // onReorderCallback, meaning we can't call AffirmOverriddenList + // soon enough. + public void DrawLayout() + { + if (IsReloadNeeded()) + { + displayList.Clear(); + displayList.AddRange(property.Get(platform)); + } + + Rect rect = EditorGUILayout.GetControlRect(false, GetHeight()); + rect = EditorGUI.IndentedRect(rect); + + DoList(rect); + } + + public bool IsReloadNeeded() + { + List propertyList = property.Get(platform); + + if (displayList.Count != propertyList.Count) + { + return true; + } + + for (int i = 0; i < displayList.Count; ++i) + { + if (displayList[i] != propertyList[i]) + { + return true; + } + } + + return false; + } + + private void DrawElement(Rect rect, int index, bool active, bool focused) + { + using (new NoIndentScope()) + { + rect.height -= ElementPadding; + + EditorGUI.BeginChangeCheck(); + + string newValue = EditorGUI.TextField(rect, list[index] as string); + + if (EditorGUI.EndChangeCheck()) + { + displayList[index] = newValue; + AffirmOverriddenList()[index] = newValue; + } + } + } + + private void AddElement(UnityEditorInternal.ReorderableList list) + { + AffirmOverriddenList().Add(string.Empty); + } + + private void RemoveElement(UnityEditorInternal.ReorderableList list) + { + AffirmOverriddenList().RemoveAt(list.index); + } + + private void OnReorder(UnityEditorInternal.ReorderableList list) + { + List propertyList = AffirmOverriddenList(); + + propertyList.Clear(); + propertyList.AddRange(displayList); + } + + private List AffirmOverriddenList() + { + if (!property.HasValue(platform)) + { + List newList = new List(property.Get(platform)); + + property.Set(platform, newList); + } + + return property.Get(platform); + } + } + + // If insertAtIndex == -1, insert at the end + private static void SetPlatformParent(string undoMessage, Settings settings, Platform child, Platform parent, int insertAtIndex = -1) + { + if (parent == child.Parent) + { + if (insertAtIndex > child.DisplaySortOrder) + { + --insertAtIndex; + } + + if (insertAtIndex == child.DisplaySortOrder) + { + return; + } + } + + Undo.RecordObjects(new[] { child, child.Parent, parent }, undoMessage); + + int index = 0; + + for (int i = 0; i < parent.ChildIdentifiers.Count; ++i) + { + Platform sibling = settings.FindPlatform(parent.ChildIdentifiers[i]); + + if (sibling.Active && sibling != child) + { + if (index == insertAtIndex) + { + ++index; + } + + Undo.RecordObject(sibling, undoMessage); + + sibling.DisplaySortOrder = index; + ++index; + } + } + + if (insertAtIndex == -1) + { + insertAtIndex = index; + } + + child.DisplaySortOrder = insertAtIndex; + + settings.SetPlatformParent(child, parent); + } + + private void ApplyPendingActions() + { + if (hasBankSourceChanged || hasBankTargetChanged) + { + RefreshBanks(); + } + } + + private void RefreshBanks() + { + Settings settings = target as Settings; + + if (lastSourceBankPath != settings.SourceBankPath) + { + lastSourceBankPath = settings.SourceBankPath; + EventManager.RefreshBanks(); + } + } + + public static void DisplayBankRefreshSettings(SerializedProperty cooldown, SerializedProperty showWindow, + bool inInspector) + { + Rect controlRect = EditorGUILayout.GetControlRect(false, EditorGUIUtility.singleLineHeight); + + Rect labelRect; + + if (inInspector) + { + labelRect = LabelRect(controlRect); + } + else + { + labelRect = EditorGUI.IndentedRect(controlRect); + labelRect.width = GUI.skin.label.CalcSize(BankRefreshLabel).x; + } + + + Rect popupRect = controlRect; + popupRect.x = labelRect.xMax; + popupRect.width = BankRefreshCooldownLabels.Max(l => EditorStyles.popup.CalcSize(l).x); + + using (new NoIndentScope()) + { + GUI.Label(labelRect, BankRefreshLabel); + + cooldown.intValue = EditorGUI.IntPopup(popupRect, cooldown.intValue, + BankRefreshCooldownLabels, BankRefreshCooldownValues); + + if (cooldown.intValue >= 0) + { + Rect toggleRect = controlRect; + toggleRect.xMin = popupRect.xMax + GUI.skin.toggle.margin.left; + + showWindow.boolValue = EditorGUI.ToggleLeft(toggleRect, L10n.Tr("Show Status Window"), showWindow.boolValue); + } + } + } + + private static Rect LabelRect(Rect controlRect) + { + Rect result = controlRect; + result.width = EditorGUIUtility.labelWidth; + result = EditorGUI.IndentedRect(result); + + return result; + } + + public static bool BrowseForSourceProjectPath(SerializedObject serializedObject) + { + serializedObject.Update(); + var sourceProjectPath = serializedObject.FindProperty("sourceProjectPath"); + var sourceBankPath = serializedObject.FindProperty("sourceBankPath"); + var hasSourceProject = serializedObject.FindProperty("HasSourceProject"); + var hasPlatforms = serializedObject.FindProperty("HasPlatforms"); + + string newPath = EditorUtility.OpenFilePanel(L10n.Tr("Locate Studio Project"), sourceProjectPath.stringValue, "fspro"); + + if (string.IsNullOrEmpty(newPath)) + { + return false; + } + else + { + hasSourceProject.boolValue = true; + hasPlatforms.boolValue = true; + newPath = MakePathRelative(newPath); + sourceProjectPath.stringValue = newPath; + sourceBankPath.stringValue = GetBankDirectory(serializedObject); + serializedObject.ApplyModifiedProperties(); + EventManager.RefreshBanks(); + return true; + } + } + + public static bool BrowseForSourceBankPath(SerializedObject serializedObject, bool multiPlatform = false) + { + serializedObject.Update(); + var sourceBankPath = serializedObject.FindProperty("sourceBankPath"); + var hasSourceProject = serializedObject.FindProperty("HasSourceProject"); + var hasPlatforms = serializedObject.FindProperty("HasPlatforms"); + + string newPath = EditorUtility.OpenFolderPanel(L10n.Tr("Locate Build Folder"), sourceBankPath.stringValue, null); + + if (string.IsNullOrEmpty(newPath)) + { + return false; + } + else + { + hasSourceProject.boolValue = false; + hasPlatforms.boolValue = multiPlatform; + newPath = MakePathRelative(newPath); + sourceBankPath.stringValue = newPath; + serializedObject.ApplyModifiedProperties(); + EventManager.RefreshBanks(); + return true; + } + } + + private static string MakePathRelative(string path) + { + if (string.IsNullOrEmpty(path)) + return ""; + string fullPath = Path.GetFullPath(path); + string fullProjectPath = Path.GetFullPath(Environment.CurrentDirectory + Path.DirectorySeparatorChar); + + // If the path contains the Unity project path remove it and return the result + if (fullPath.Contains(fullProjectPath)) + { + fullPath = fullPath.Replace(fullProjectPath, ""); + } + // If not, attempt to find a relative path on the same drive + else if (Path.GetPathRoot(fullPath) == Path.GetPathRoot(fullProjectPath)) + { + // Remove trailing slash from project path for split count simplicity + if (fullProjectPath.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.CurrentCulture)) fullProjectPath = fullProjectPath.Substring(0, fullProjectPath.Length - 1); + + string[] fullPathSplit = fullPath.Split(Path.DirectorySeparatorChar); + string[] projectPathSplit = fullProjectPath.Split(Path.DirectorySeparatorChar); + int minNumSplits = Mathf.Min(fullPathSplit.Length, projectPathSplit.Length); + int numCommonElements = 0; + for (int i = 0; i < minNumSplits; i++) + { + if (fullPathSplit[i] == projectPathSplit[i]) + { + numCommonElements++; + } + else + { + break; + } + } + string result = ""; + int fullPathSplitLength = fullPathSplit.Length; + for (int i = numCommonElements; i < fullPathSplitLength; i++) + { + result += fullPathSplit[i]; + if (i < fullPathSplitLength - 1) + { + result += '/'; + } + } + + int numAdditionalElementsInProjectPath = projectPathSplit.Length - numCommonElements; + for (int i = 0; i < numAdditionalElementsInProjectPath; i++) + { + result = "../" + result; + } + + fullPath = result; + } + + return fullPath.Replace(Path.DirectorySeparatorChar, '/'); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs.meta new file mode 100644 index 00000000..ec905269 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 353a9c870c318f74fa5fdcd475129bae +timeCreated: 1432530253 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/SetupWizard.cs b/Assets/Plugins/FMOD/src/Editor/SetupWizard.cs new file mode 100644 index 00000000..bc00c0f5 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/SetupWizard.cs @@ -0,0 +1,1147 @@ +using FMOD.Studio; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEditor.IMGUI.Controls; +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace FMODUnity +{ + public class SetupWizardWindow : EditorWindow + { + private static SetupWizardWindow instance; + + private static readonly List pageNames = new List + { + L10n.Tr("Welcome"), + L10n.Tr("Updating"), + L10n.Tr("Linking"), + L10n.Tr("Listener"), + L10n.Tr("Unity Audio"), + L10n.Tr("Unity Sources"), + L10n.Tr("Source Control"), + L10n.Tr("End") + }; + + private static readonly List pageComplete = new List(new bool[(int)PAGES.Max]); + + private static readonly List updateTasks = new List() { + UpdateTask.Create( + type: UpdateTaskType.ReorganizePluginFiles, + name: L10n.Tr("Reorganize Plugin Files"), + description: L10n.Tr("Move FMOD for Unity files to match the latest layout."), + execute: FileReorganizer.ShowWindow, + checkComplete: FileReorganizer.IsUpToDate + ), + UpdateTask.Create( + type: UpdateTaskType.UpdateEventReferences, + name: L10n.Tr("Update Event References"), + description: L10n.Tr("Find event references that use the obsolete [EventRef] attribute and update them to use the EventReference type."), + execute: EventReferenceUpdater.ShowWindow, + checkComplete: EventReferenceUpdater.IsUpToDate + ), + }; + + private static bool updateTaskStatusChecked = false; + + private PAGES currentPage = PAGES.Welcome; + + private AudioListener[] unityListeners; + private StudioListener[] fmodListeners; + private Vector2 scroll1, scroll2, pageScrollPos; + private Vector2 stagingDetailsScroll; + private bool bFoundUnityListener; + private bool bFoundFmodListener; + + private AudioSource[] unityAudioSources; + + private GUIStyle titleStyle; + private GUIStyle titleLeftStyle; + private GUIStyle bodyStyle; + private GUIStyle buttonStyle; + private GUIStyle navButtonStyle; + private GUIStyle sourceButtonStyle; + private GUIStyle descriptionStyle; + private GUIStyle crumbStyle; + private GUIStyle columnStyle; + private Color crumbDefault; + private Color crumbHighlight; + + private const string logoBlack = "FMODLogoBlack.png"; + private const string logoWhite = "FMODLogoWhite.png"; + + private Texture2D logoTexture; + private Texture2D tickTexture; + private Texture2D crossTexture; + private GUIStyle iconStyle; + + private SimpleTreeView m_SimpleTreeView; + private TreeViewState m_TreeViewState; + + private bool bStudioLinked; + + private static StagingSystem.UpdateStep nextStagingStep; + + private static bool IsStagingUpdateInProgress => nextStagingStep != null; + + private const string IgnoreFileText = +@"# Never ignore DLLs in the FMOD subfolder. +!/[Aa]ssets/Plugins/FMOD/**/lib/* + +# Don't ignore images and gizmos used by FMOD in the Unity Editor. +!/[Aa]ssets/Gizmos/FMOD/* +!/[Aa]ssets/Editor Default Resources/FMOD/* + +# Ignore the Cache folder since it is updated locally. +/[Aa]ssets/Plugins/FMOD/Cache/* + +# Ignore bank files in the StreamingAssets folder. +/[Aa]ssets/StreamingAssets/**/*.bank +/[Aa]ssets/StreamingAssets/**/*.bank.meta + +# If the source bank files are kept outside of the StreamingAssets folder then these can be ignored. +# Log files can be ignored. +fmod_editor.log"; + + private enum PAGES : int + { + Welcome = 0, + Updating, + Linking, + Listener, + UnityAudio, + UnitySources, + SourceControl, + End, + Max + } + + public enum UpdateTaskType + { + ReorganizePluginFiles, + UpdateEventReferences, + } + + private class UpdateTask + { + public UpdateTaskType Type; + public string Name; + public string Description; + public bool IsComplete; + public Action Execute; + public Func CheckComplete; + + public static UpdateTask Create(UpdateTaskType type, string name, string description, + Action execute, Func checkComplete) + { + return new UpdateTask() { + Type = type, + Name = name, + Description = description, + Execute = execute, + CheckComplete = checkComplete + }; + } + } + + public static void SetUpdateTaskComplete(UpdateTaskType type) + { + foreach (UpdateTask task in updateTasks.Where(t => t.Type == type)) + { + task.IsComplete = true; + } + } + + private static void CheckUpdateTaskStatus() + { + if (!updateTaskStatusChecked) + { + updateTaskStatusChecked = true; + + foreach (UpdateTask task in updateTasks) + { + task.IsComplete = task.CheckComplete(); + } + } + } + + private static void DoNextStagingStep() + { + nextStagingStep.Execute(); + nextStagingStep = StagingSystem.GetNextUpdateStep(); + } + + public static void Startup() + { + if (EditorApplication.isPlayingOrWillChangePlaymode) + return; + + Settings settings = Settings.Instance; + + if (settings.CurrentVersion != FMOD.VERSION.number) + { + // We're updating an existing installation; unhide the setup wizard if needed + + CheckUpdateTaskStatus(); + + if (settings.HideSetupWizard && updateTasks.Any(t => !t.IsComplete)) + { + settings.HideSetupWizard = false; + } + + settings.CurrentVersion = FMOD.VERSION.number; + EditorUtility.SetDirty(settings); + } + + nextStagingStep = StagingSystem.Startup(); + + if (!settings.HideSetupWizard || IsStagingUpdateInProgress) + { + ShowAssistant(); + } + } + + [MenuItem("FMOD/Setup Wizard")] + public static void ShowAssistant() + { + instance = (SetupWizardWindow)GetWindow(typeof(SetupWizardWindow), true, L10n.Tr("FMOD Setup Wizard")); + instance.ShowUtility(); + instance.minSize = new Vector2(600, 400); + var position = new Rect(Vector2.zero, new Vector2(800, 600)); + Vector2 screenCenter = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height) / 2; + position.center = screenCenter / EditorGUIUtility.pixelsPerPoint; + instance.position = position; + } + + private void OnEnable() + { + CheckUpdateTaskStatus(); + + logoTexture = EditorUtils.LoadImage(EditorGUIUtility.isProSkin ? logoWhite : logoBlack); + + crossTexture = EditorUtils.LoadImage("CrossYellow.png"); + tickTexture = EditorUtils.LoadImage("TickGreen.png"); + + titleStyle = new GUIStyle(); + titleStyle.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black; + titleStyle.wordWrap = true; + titleStyle.fontStyle = FontStyle.Bold; + titleStyle.alignment = TextAnchor.MiddleCenter; + + bodyStyle = new GUIStyle(titleStyle); + crumbStyle = new GUIStyle(titleStyle); + crumbDefault = EditorGUIUtility.isProSkin ? Color.gray : Color.gray; + crumbHighlight = EditorGUIUtility.isProSkin ? Color.white : Color.black; + + scroll1 = scroll2 = new Vector2(); + + iconStyle = new GUIStyle(); + iconStyle.alignment = TextAnchor.MiddleCenter; + + CheckUpdatesComplete(); + CheckStudioLinked(); + CheckListeners(); + CheckSources(); + CheckUnityAudio(); + } + + private void OnGUI() + { + if (buttonStyle == null) + { + buttonStyle = new GUIStyle("Button"); + buttonStyle.fixedHeight = 30; + + sourceButtonStyle = new GUIStyle("button"); + sourceButtonStyle.fixedWidth = 150; + sourceButtonStyle.fixedHeight = 35; + sourceButtonStyle.margin = new RectOffset(); + + descriptionStyle = new GUIStyle(titleStyle); + descriptionStyle.fontStyle = FontStyle.Normal; + descriptionStyle.alignment = TextAnchor.MiddleLeft; + descriptionStyle.margin = new RectOffset(5,0,0,0); + + titleLeftStyle = new GUIStyle(descriptionStyle); + titleLeftStyle.fontStyle = FontStyle.Bold; + + descriptionStyle.fixedWidth = 350; + columnStyle = new GUIStyle(); + columnStyle.margin.left = 50; + columnStyle.margin.right = 50; + } + + // Draw Header + EditorGUILayout.Space(); + GUILayout.Box(logoTexture, titleStyle); + EditorGUILayout.Space(); + + if (IsStagingUpdateInProgress) + { + StagingUpdatePage(); + return; + } + + using (new EditorGUILayout.HorizontalScope()) + { + Breadcrumbs(); + + // Draw Body + using (new EditorGUILayout.VerticalScope("box", GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true))) + { + using (var scrollView = new EditorGUILayout.ScrollViewScope(pageScrollPos)) + { + pageScrollPos = scrollView.scrollPosition; + + EditorGUILayout.Space(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + + switch (currentPage) + { + case PAGES.Welcome: WelcomePage(); break; + case PAGES.Updating: UpdatingPage(); break; + case PAGES.Linking: LinkingPage(); break; + case PAGES.Listener: ListenerPage(); break; + case PAGES.UnityAudio: DisableUnityAudioPage(); break; + case PAGES.UnitySources: UnitySources(); break; + case PAGES.SourceControl: SourceControl(); break; + case PAGES.End: EndPage(); break; + } + } + + Buttons(); + + if (currentPage == PAGES.Welcome) + { + EditorGUILayout.Space(); + EditorGUILayout.Space(); + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + + using (var check = new EditorGUI.ChangeCheckScope()) + { + bool hide = Settings.Instance.HideSetupWizard; + + hide = EditorGUILayout.Toggle(L10n.Tr("Do not display this again"), hide); + + if (check.changed) + { + Settings.Instance.HideSetupWizard = hide; + EditorUtility.SetDirty(Settings.Instance); + } + } + GUILayout.FlexibleSpace(); + } + } + else + { + EditorGUILayout.Space(); + EditorGUILayout.Space(); + } + EditorGUILayout.Space(); + EditorGUILayout.Space(); + } + } + } + + private void OnInspectorUpdate() + { + switch (currentPage) + { + case PAGES.Welcome: break; + case PAGES.Updating: CheckUpdatesComplete();break; + case PAGES.Linking: CheckStudioLinked();break; + case PAGES.Listener: CheckListeners(); break; + case PAGES.UnityAudio: break; + case PAGES.UnitySources:CheckSources(); break; + case PAGES.SourceControl: break; + case PAGES.End: break; + case PAGES.Max: break; + default: break; + } + } + + private void CheckUpdatesComplete() + { + pageComplete[(int)PAGES.Updating] = updateTasks.All(t => t.IsComplete); + } + + private void CheckStudioLinked() + { + pageComplete[(int)PAGES.Linking] = IsStudioLinked(); + } + + private bool IsStudioLinked() + { + return !string.IsNullOrEmpty(Settings.Instance.SourceBankPath); + } + + private void CheckListeners() + { + var UListeners = Resources.FindObjectsOfTypeAll(); + var FListeners = Resources.FindObjectsOfTypeAll(); + if ((unityListeners == null || fmodListeners == null) || (!unityListeners.SequenceEqual(UListeners) || !fmodListeners.SequenceEqual(FListeners))) + { + unityListeners = UListeners; + bFoundUnityListener = unityListeners.Length > 0; + fmodListeners = FListeners; + bFoundFmodListener = fmodListeners.Length > 0; + Repaint(); + } + pageComplete[(int)PAGES.Listener] = (!bFoundUnityListener && bFoundFmodListener); + } + + private void CheckSources() + { + var ASources = Resources.FindObjectsOfTypeAll(); + if (unityAudioSources == null || !ASources.SequenceEqual(unityAudioSources)) + { + unityAudioSources = ASources; + if (m_SimpleTreeView != null && unityAudioSources.Length > 0) + { + m_SimpleTreeView.Reload(); + } + } + pageComplete[(int)PAGES.UnitySources] = ASources != null ? (ASources.Length == 0) : true; + } + + private void CheckUnityAudio() + { + var audioManager = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/AudioManager.asset")[0]; + var serializedManager = new SerializedObject(audioManager); + var prop = serializedManager.FindProperty("m_DisableAudio"); + pageComplete[(int)PAGES.UnityAudio] = prop.boolValue; + } + + private void WelcomePage() + { + GUILayout.FlexibleSpace(); + + string message = string.Format(L10n.Tr("Welcome to FMOD for Unity {0}."), + EditorUtils.VersionString(FMOD.VERSION.number)); + + EditorGUILayout.LabelField(message, titleStyle); + + EditorGUILayout.Space(); + + EditorGUILayout.LabelField(L10n.Tr("This setup wizard will help you configure your project to use FMOD."), titleStyle); + + GUILayout.FlexibleSpace(); + } + + private void Breadcrumbs() + { + using (new EditorGUILayout.VerticalScope("box", GUILayout.Width(150))) + { + crumbStyle.alignment = TextAnchor.MiddleCenter; + Color oldColor = GUI.backgroundColor; + EditorGUILayout.Space(); + + for (int i = 0; i < pageNames.Count; i++) + { + if (i > 0 && i < pageNames.Count - 1) + { + GUI.backgroundColor = (pageComplete[i] ? Color.green : Color.yellow); + } + crumbStyle.normal.textColor = (i == (int)currentPage ? crumbHighlight : crumbDefault); + using (var b = new EditorGUILayout.HorizontalScope("button", GUILayout.Height(22))) + { + if (GUI.Button(b.rect, pageNames[i], crumbStyle)) + { + currentPage = (PAGES)i; + } + EditorGUILayout.Space(); + } + GUI.backgroundColor = oldColor; + } + GUILayout.FlexibleSpace(); + } + } + + private void UpdatingPage() + { + EditorGUILayout.LabelField(L10n.Tr("If you are updating an existing FMOD installation, you may need to perform some update tasks."), titleLeftStyle); + + GUILayout.FlexibleSpace(); + + EditorGUILayout.LabelField(L10n.Tr("Choose an update task to perform:"), titleStyle); + + EditorGUILayout.Space(); + + using (new EditorGUILayout.VerticalScope("box")) + { + float buttonWidth = 0; + + foreach (UpdateTask task in updateTasks) + { + buttonWidth = Math.Max(buttonWidth, buttonStyle.CalcSize(new GUIContent(task.Name)).x); + } + + float buttonHeight = buttonStyle.CalcSize(GUIContent.none).y; + + foreach (UpdateTask task in updateTasks) + { + using (new GUILayout.HorizontalScope()) + { + EditorGUILayout.Space(); + + GUILayout.Label(task.IsComplete ? tickTexture : crossTexture, iconStyle, + GUILayout.Height(buttonHeight)); + + if (GUILayout.Button(task.Name, buttonStyle, GUILayout.Width(buttonWidth))) + { + task.Execute(); + } + + GUILayout.Label(task.Description, descriptionStyle, GUILayout.MinHeight(buttonHeight)); + + GUILayout.FlexibleSpace(); + } + EditorGUILayout.Space(); + } + } + + GUILayout.FlexibleSpace(); + } + + private void LinkingPage() + { + EditorGUILayout.LabelField(L10n.Tr("In order to access your FMOD Studio content you need to locate the FMOD Studio Project or the .bank files that FMOD Studio produces, and configure a few other settings."), titleLeftStyle); + GUILayout.FlexibleSpace(); + + EditorGUILayout.LabelField(L10n.Tr("Choose how to access your FMOD Studio content:"), titleLeftStyle); + + EditorGUILayout.Space(); + using (new GUILayout.VerticalScope("box")) + { + float indent = 5; + var serializedObject = new SerializedObject(Settings.Instance); + + var boxStyle = new GUIStyle(); + boxStyle.fixedHeight = 10; + using (new GUILayout.HorizontalScope()) + { + GUILayout.Space(indent); + if (GUILayout.Button(L10n.Tr("FMOD Studio Project"), sourceButtonStyle)) + { + SettingsEditor.BrowseForSourceProjectPath(serializedObject); + } + GUILayout.Label(L10n.Tr("If you have the complete FMOD Studio Project."), descriptionStyle, GUILayout.Height(sourceButtonStyle.fixedHeight)); + + GUILayout.FlexibleSpace(); + } + EditorGUILayout.Space(); + using (new GUILayout.HorizontalScope()) + { + GUILayout.Space(indent); + if (GUILayout.Button("Single Platform Build", sourceButtonStyle)) + { + SettingsEditor.BrowseForSourceBankPath(serializedObject); + } + EditorGUILayout.LabelField(L10n.Tr("If you have the contents of the Build folder for a single platform."), + descriptionStyle, GUILayout.Height(sourceButtonStyle.fixedHeight)); + GUILayout.FlexibleSpace(); + } + EditorGUILayout.Space(); + + using (new GUILayout.HorizontalScope()) + { + GUILayout.Space(indent); + if (GUILayout.Button(L10n.Tr("Multiple Platform Build"), sourceButtonStyle)) + { + SettingsEditor.BrowseForSourceBankPath(serializedObject, true); + } + EditorGUILayout.LabelField(L10n.Tr("If you have the contents of the Build folder for multiple platforms, with each platform in its own subdirectory."), descriptionStyle, GUILayout.Height(sourceButtonStyle.fixedHeight)); + GUILayout.FlexibleSpace(); + } + EditorGUILayout.Space(); + } + + if (IsStudioLinked()) + { + EditorGUILayout.Space(); + + Color oldColor = GUI.backgroundColor; + GUI.backgroundColor = Color.green; + + using (new GUILayout.HorizontalScope("box")) + { + GUILayout.FlexibleSpace(); + + GUILayout.Label(tickTexture, iconStyle, GUILayout.Height(EditorGUIUtility.singleLineHeight * 2)); + + EditorGUILayout.Space(); + + using (new GUILayout.VerticalScope()) + { + Settings settings = Settings.Instance; + + if (settings.HasSourceProject) + { + EditorGUILayout.LabelField(L10n.Tr("Using the FMOD Studio project at:"), descriptionStyle); + EditorGUILayout.LabelField(settings.SourceProjectPath, descriptionStyle); + } + else if (settings.HasPlatforms) + { + EditorGUILayout.LabelField(L10n.Tr("Using the multiple platform build at:"), descriptionStyle); + EditorGUILayout.LabelField(settings.SourceBankPath, descriptionStyle); + } + else + { + EditorGUILayout.LabelField(L10n.Tr("Using the single platform build at:"), descriptionStyle); + EditorGUILayout.LabelField(settings.SourceBankPath, descriptionStyle); + } + } + + GUILayout.FlexibleSpace(); + } + + GUI.backgroundColor = oldColor; + } + + GUILayout.FlexibleSpace(); + } + + private void ListenerPage() + { + EditorGUILayout.LabelField(L10n.Tr("If you do not intend to use the built in Unity audio, you can choose to replace the Audio Listener with the FMOD Studio Listener.\n"), titleLeftStyle); + EditorGUILayout.LabelField(L10n.Tr("Adding the FMOD Studio Listener component to the main camera provides the FMOD Engine with the information it needs to play 3D events correctly."), titleLeftStyle); + EditorGUILayout.Space(); + GUILayout.FlexibleSpace(); + + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + + // Display found objects containing Unity listeners + DisplayListeners(unityListeners, ref scroll1); + + // Show FMOD Listeners + DisplayListeners(fmodListeners, ref scroll2); + + GUILayout.FlexibleSpace(); + } + + using (new EditorGUILayout.HorizontalScope()) + { + using (new EditorGUI.DisabledGroupScope(!bFoundUnityListener)) + { + GUILayout.FlexibleSpace(); + + if (GUILayout.Button(L10n.Tr("Replace Unity Listener(s) with FMOD Audio Listener."), buttonStyle)) + { + for (int i = 0; i < unityListeners.Length; i++) + { + var listener = unityListeners[i]; + if (listener) + { + RuntimeUtils.DebugLog("[FMOD Assistant] Replacing Unity Listener with FMOD Listener on " + listener.gameObject.name); + if (listener.GetComponent() == null) + { + listener.gameObject.AddComponent(typeof(StudioListener)); + } + DestroyImmediate(unityListeners[i]); + EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene()); + Repaint(); + } + } + } + } + GUILayout.FlexibleSpace(); + } + } + + private void DisplayListeners(T[] listeners, ref Vector2 scrollPos) + { + using (new EditorGUILayout.VerticalScope("box")) + { + bool bUnityListenerType = false; + if (typeof(T) == typeof(AudioListener)) + { + bUnityListenerType = true; + } + + if (listeners != null && listeners.Length > 0) + { + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + EditorGUILayout.LabelField((bUnityListenerType ? "Unity" : "FMOD") + L10n.Tr(" Listener(s) found: ") + listeners.Length, titleStyle, GUILayout.ExpandWidth(true)); + GUILayout.FlexibleSpace(); + } + + using (var scrollView = new EditorGUILayout.ScrollViewScope(scrollPos, GUILayout.ExpandWidth(true))) + { + scrollPos = scrollView.scrollPosition; + foreach (T l in listeners) + { + var listener = l as Component; + if (listener != null && GUILayout.Button(listener.gameObject.name, GUILayout.ExpandWidth(true))) + { + Selection.activeGameObject = listener.gameObject; + EditorGUIUtility.PingObject(listener); + } + } + } + GUILayout.FlexibleSpace(); + } + else + { + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + EditorGUILayout.LabelField((bUnityListenerType ? "Unity" : "FMOD") + L10n.Tr(" Listener(s) found: ") + listeners.Length, titleStyle); + GUILayout.FlexibleSpace(); + } + GUILayout.FlexibleSpace(); + } + } + } + + private void DisableUnityAudioPage() + { + EditorGUILayout.LabelField(L10n.Tr("We recommend that you disable the built-in Unity audio for all platforms, to prevent it from consuming system audio resources that the FMOD Engine needs."), titleStyle); + GUILayout.FlexibleSpace(); + + var audioManager = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/AudioManager.asset")[0]; + var serializedManager = new SerializedObject(audioManager); + var prop = serializedManager.FindProperty("m_DisableAudio"); + + using (new EditorGUILayout.HorizontalScope()) + { + using (new EditorGUI.DisabledGroupScope(prop.boolValue)) + { + GUILayout.FlexibleSpace(); + if (GUILayout.Button(prop.boolValue ? L10n.Tr("Built in audio has been disabled") : L10n.Tr("Disable built in audio"), buttonStyle)) + { + prop.boolValue = true; + serializedManager.ApplyModifiedProperties(); + RuntimeUtils.DebugLog("[FMOD Assistant] Built in Unity audio has been disabled."); + Repaint(); + } + + } + GUILayout.FlexibleSpace(); + } + pageComplete[(int)PAGES.UnityAudio] = prop.boolValue; + + GUILayout.FlexibleSpace(); + } + + private void UnitySources() + { + if (unityAudioSources != null && unityAudioSources.Length > 0) + { + EditorGUILayout.LabelField(L10n.Tr("Listed below are all the Unity Audio Sources found in the currently loaded scenes and the Assets directory.\nSelect an Audio Source and replace it with an FMOD Studio Event Emitter."), titleStyle); + EditorGUILayout.Space(); + + if (m_SimpleTreeView == null) + { + if (m_TreeViewState == null) + { + m_TreeViewState = new TreeViewState(); + } + m_SimpleTreeView = new SimpleTreeView(m_TreeViewState); + } + + m_SimpleTreeView.Drawlayout(); + } + else + { + GUILayout.FlexibleSpace(); + EditorGUILayout.LabelField(L10n.Tr("No Unity Audio Sources have been found!"), titleStyle); + GUILayout.FlexibleSpace(); + } + } + + private void SourceControl() + { + EditorGUILayout.LabelField(L10n.Tr("There are a number of files produced by FMOD for Unity that should be ignored by source control. Here is an example of what you should add to your source control ignore file:"), titleLeftStyle); + GUILayout.FlexibleSpace(); + + using (new EditorGUILayout.VerticalScope("box")) + { + EditorGUILayout.TextArea(IgnoreFileText, GUILayout.Width(568)); + } + + pageComplete[(int)PAGES.SourceControl] = true; + } + + private void EndPage() + { + GUILayout.FlexibleSpace(); + bool completed = true; + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + using (new EditorGUILayout.VerticalScope()) + { + for (int i = 1; i < pageNames.Count - 1; i++) + { + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField(pageNames[i], titleStyle); + EditorGUILayout.Space(); + GUILayout.Label(pageComplete[i] ? tickTexture : crossTexture, iconStyle, GUILayout.ExpandWidth(false)); + + if (pageComplete[i] == false) + { + completed = false; + } + } + GUILayout.Space(8); + } + } + GUILayout.FlexibleSpace(); + } + + string msg = ""; + if (completed) + { + // All complete + msg = L10n.Tr("FMOD for Unity has been set up successfully!"); + } + // Essential + else if (pageComplete[(int)PAGES.Linking]) + { + // Partial complete (linking done) + msg = L10n.Tr("FMOD for Unity has been partially set up."); + } + else + { + // Linking not done + msg = L10n.Tr("FMOD for Unity has not finished being set up.\nLinking to a project or banks is required."); + } + + GUILayout.FlexibleSpace(); + EditorGUILayout.LabelField(msg, titleStyle); + GUILayout.FlexibleSpace(); + + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + + if (GUILayout.Button(L10n.Tr(" Integration Manual "), buttonStyle)) + { + EditorUtils.OnlineManual(); + } + + + if (GUILayout.Button(L10n.Tr(" FMOD Settings "), buttonStyle)) + { + EditorSettings.EditSettings(); + } + GUILayout.Space(18); + + GUILayout.FlexibleSpace(); + } + + if (completed) + { + Settings.Instance.HideSetupWizard = true; + } + } + + private void Buttons() + { + GUILayout.FlexibleSpace(); + using (new EditorGUILayout.HorizontalScope()) + { + navButtonStyle = new GUIStyle("Button"); + navButtonStyle.fixedHeight = 45; + navButtonStyle.fixedWidth = 75; + + GUILayout.FlexibleSpace(); + if (currentPage != 0) + { + if (GUILayout.Button(L10n.Tr("Back"), navButtonStyle)) + { + if (currentPage != 0) + { + currentPage--; + } + } + } + + string button2Text = "Next"; + if (currentPage == 0) button2Text = L10n.Tr("Start"); + else if (currentPage == PAGES.End) button2Text = L10n.Tr("Close"); + else button2Text = L10n.Tr("Next"); + + if (GUILayout.Button(button2Text, navButtonStyle)) + { + if (currentPage == PAGES.End) + { + this.Close(); + } + currentPage++; + } + + GUILayout.FlexibleSpace(); + } + } + + private void StagingUpdatePage() + { + GUILayout.Space(25); + + string message = string.Format(L10n.Tr("Welcome to FMOD for Unity {0}."), + EditorUtils.VersionString(FMOD.VERSION.number)); + + EditorGUILayout.LabelField(message, titleStyle); + + EditorGUILayout.Space(); + + EditorGUILayout.LabelField( + L10n.Tr("To complete the installation, we need to update the FMOD native libraries.\n") + + L10n.Tr("This involves a few steps:"), titleStyle); + + EditorGUILayout.Space(); + + float nameWidth = 200; + + using (new GUILayout.VerticalScope(columnStyle)) + { + + foreach (StagingSystem.UpdateStep step in StagingSystem.UpdateSteps) + { + bool complete = step.Stage < nextStagingStep.Stage; + + Color oldColor = GUI.backgroundColor; + GUI.backgroundColor = complete ? Color.green : Color.yellow; + + using (new GUILayout.HorizontalScope(GUI.skin.box)) + { + GUILayout.Label(complete ? tickTexture : crossTexture, iconStyle); + + EditorGUILayout.LabelField(step.Name, titleLeftStyle, GUILayout.Width(nameWidth)); + EditorGUILayout.LabelField(step.Description, descriptionStyle); + } + + GUI.backgroundColor = oldColor; + } + + EditorGUILayout.Space(); + + EditorGUILayout.LabelField(L10n.Tr("Next step:"), titleStyle); + + using (new GUILayout.HorizontalScope()) + { + GUILayout.FlexibleSpace(); + + if (GUILayout.Button(nextStagingStep.Name, buttonStyle, GUILayout.ExpandWidth(false))) + { + EditorApplication.delayCall += DoNextStagingStep; + } + + GUILayout.FlexibleSpace(); + } + + EditorGUILayout.Space(); + + using (var scope = new EditorGUILayout.ScrollViewScope(stagingDetailsScroll)) + { + stagingDetailsScroll = scope.scrollPosition; + GUIStyle longDescStyle = descriptionStyle; + longDescStyle.fixedWidth = 0; + EditorGUILayout.LabelField(nextStagingStep.Details, longDescStyle); + } + } + } + } + + public class SimpleTreeView : TreeView + { + private const float BodyHeight = 200; + + public SimpleTreeView(TreeViewState state) : base(state) + { + Reload(); + Repaint(); + ExpandAll(); + } + + protected override bool CanMultiSelect(TreeViewItem item) + { + return false; + } + + protected override bool CanChangeExpandedState(TreeViewItem item) + { + return !(item is AudioSourceItem); + } + + protected override void SelectionChanged(IList selectedIds) + { + base.SelectionChanged(selectedIds); + + if (selectedIds.Count > 0) + { + var item = FindItem(selectedIds[0], rootItem); + GameObject go = null; + if (item.hasChildren) + { + if (item is ParentItem) + { + go = ((ParentItem)item).gameObject; + } + } + else + { + go = ((ParentItem)((AudioSourceItem)item).parent).gameObject; + } + Selection.activeGameObject = go; + } + } + + protected override TreeViewItem BuildRoot() + { + var root = new TreeViewItem (-1, -1); + + CreateItems(root, Resources.FindObjectsOfTypeAll()); + showAlternatingRowBackgrounds = true; + showBorder = true; + SetupDepthsFromParentsAndChildren(root); + + return root; + } + + private class AudioSourceItem : TreeViewItem + { + const string audioIcon = "AudioSource Icon"; + public AudioSourceItem(AudioSource source) : base(source.GetHashCode()) + { + displayName = (source.clip ? source.clip.name : "None"); + icon = (Texture2D)EditorGUIUtility.IconContent(audioIcon).image; + } + } + + private class ParentItem : TreeViewItem + { + public GameObject gameObject; + const string goIcon = "GameObject Icon"; + const string prefabIcon = "Prefab Icon"; + const string prefabModelIcon = "PrefabModel Icon"; + const string prefabVariantIcon = "PrefabVariant Icon"; + + public ParentItem(GameObject go) : base(go.GetHashCode(), 0, go.name) + { + gameObject = go; + var foundAudio = gameObject.GetComponents(); + for (int i = 0; i < foundAudio.Length; i++) + { + AddChild(new AudioSourceItem(foundAudio[i])); + } + + switch (PrefabUtility.GetPrefabAssetType(go)) + { + case PrefabAssetType.NotAPrefab: + icon = (Texture2D)EditorGUIUtility.IconContent(goIcon).image; + break; + case PrefabAssetType.Regular: + icon = (Texture2D)EditorGUIUtility.IconContent(prefabIcon).image; + break; + case PrefabAssetType.Model: + icon = (Texture2D)EditorGUIUtility.IconContent(prefabModelIcon).image; + break; + case PrefabAssetType.Variant: + icon = (Texture2D)EditorGUIUtility.IconContent(prefabVariantIcon).image; + break; + } + } + } + + private class SceneItem : TreeViewItem + { + public Scene m_scene; + const string sceneIcon = "SceneAsset Icon"; + const string folderIcon = "Folder Icon"; + + public SceneItem(Scene scene) : base (scene.GetHashCode()) + { + m_scene = scene; + if (m_scene.IsValid()) + { + displayName = m_scene.name; + icon = (Texture2D)EditorGUIUtility.IconContent(sceneIcon).image; + } + else + { + displayName = "Assets"; + icon = (Texture2D)EditorGUIUtility.IconContent(folderIcon).image; + } + } + } + + private void CreateItems(TreeViewItem root, AudioSource[] audioSources) + { + for(int i = 0; i < audioSources.Length; i++) + { + AudioSource audioSource = audioSources[i]; + + GameObject obj = audioSource.gameObject; + var sourceItem = FindItem(obj.GetHashCode(), root); + if (sourceItem == null) + { + List gameObjects = new List(); + gameObjects.Add(obj); + while (obj.transform.parent != null) + { + obj = obj.transform.parent.gameObject; + gameObjects.Add(obj); + } + gameObjects.Reverse(); + + var parentItem = FindItem(obj.scene.GetHashCode(), root); + if (parentItem == null) + { + parentItem = new SceneItem(obj.scene); + root.AddChild(parentItem); + } + + foreach (var go in gameObjects) + { + var objItem = FindItem(go.GetHashCode(), root); + if (objItem == null) + { + objItem = new ParentItem(go); + parentItem.AddChild(objItem); + } + parentItem = objItem; + } + } + } + } + + public void Drawlayout() + { + Rect rect = EditorGUILayout.GetControlRect(false, BodyHeight); + rect = EditorGUI.IndentedRect(rect); + + OnGUI(rect); + Toolbar(); + } + + public void Toolbar() + { + using (new EditorGUILayout.HorizontalScope()) + { + var style = "miniButton"; + if (GUILayout.Button(L10n.Tr("Expand All"), style)) + { + ExpandAll(); + } + + if (GUILayout.Button(L10n.Tr("Collapse All"), style)) + { + CollapseAll(); + } + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/SetupWizard.cs.meta b/Assets/Plugins/FMOD/src/Editor/SetupWizard.cs.meta new file mode 100644 index 00000000..d26e2f02 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/SetupWizard.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aa9a0c70fef01fb43b8eff668bfa0e9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs new file mode 100644 index 00000000..510d2593 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs @@ -0,0 +1,101 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioBankLoader))] + [CanEditMultipleObjects] + public class StudioBankLoaderEditor : Editor + { + public override void OnInspectorGUI() + { + var load = serializedObject.FindProperty("LoadEvent"); + var unload = serializedObject.FindProperty("UnloadEvent"); + var tag = serializedObject.FindProperty("CollisionTag"); + var banks = serializedObject.FindProperty("Banks"); + var preload = serializedObject.FindProperty("PreloadSamples"); + + EditorGUILayout.PropertyField(load, new GUIContent(L10n.Tr("Load"))); + EditorGUILayout.PropertyField(unload, new GUIContent(L10n.Tr("Unload"))); + + if ((load.enumValueIndex >= 3 && load.enumValueIndex <= 6) || + (unload.enumValueIndex >= 3 && unload.enumValueIndex <= 6)) + { + tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue); + } + + EditorGUILayout.PropertyField(preload, new GUIContent(L10n.Tr("Preload Sample Data"))); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(L10n.Tr("Banks")); + EditorGUILayout.BeginVertical(); + if (GUILayout.Button(L10n.Tr("Add Bank"), GUILayout.ExpandWidth(false))) + { + banks.InsertArrayElementAtIndex(banks.arraySize); + SerializedProperty newBank = banks.GetArrayElementAtIndex(banks.arraySize - 1); + newBank.stringValue = ""; + + EventBrowser browser = CreateInstance(); + + browser.titleContent = new GUIContent(L10n.Tr("Select FMOD Bank")); + + browser.ChooseBank(newBank); + browser.ShowUtility(); + } + + Texture deleteTexture = EditorUtils.LoadImage("Delete.png"); + GUIContent deleteContent = new GUIContent(deleteTexture, "Delete Bank"); + + var buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.padding.top = buttonStyle.padding.bottom = 1; + buttonStyle.margin.top = 2; + buttonStyle.padding.left = buttonStyle.padding.right = 4; + buttonStyle.fixedHeight = GUI.skin.textField.CalcSize(new GUIContent()).y; + + for (int i = 0; i < banks.arraySize; i++) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(banks.GetArrayElementAtIndex(i), GUIContent.none); + + if (GUILayout.Button(deleteContent, buttonStyle, GUILayout.ExpandWidth(false))) + { + banks.DeleteArrayElementAtIndex(i); + } + EditorGUILayout.EndHorizontal(); + } + EditorGUILayout.EndVertical(); + + EditorGUILayout.EndHorizontal(); + + Event e = Event.current; + if (e.type == EventType.DragPerform) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef)) + { + int pos = banks.arraySize; + banks.InsertArrayElementAtIndex(pos); + var pathProperty = banks.GetArrayElementAtIndex(pos); + + pathProperty.stringValue = ((EditorBankRef)DragAndDrop.objectReferences[0]).Name; + + e.Use(); + } + } + if (e.type == EventType.DragUpdated) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs.meta new file mode 100644 index 00000000..6c10c5dd --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f7f61e03a350e1e428dba6c562f3d64a +timeCreated: 1434691856 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs new file mode 100644 index 00000000..8f0bd187 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs @@ -0,0 +1,532 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioEventEmitter))] + [CanEditMultipleObjects] + public class StudioEventEmitterEditor : Editor + { + private ParameterValueView parameterValueView; + + public void OnEnable() + { + parameterValueView = new ParameterValueView(serializedObject); + } + + public void OnSceneGUI() + { + var emitter = target as StudioEventEmitter; + + EditorEventRef editorEvent = EventManager.EventFromGUID(emitter.EventReference.Guid); + if (editorEvent != null && editorEvent.Is3D) + { + EditorGUI.BeginChangeCheck(); + float minDistance = emitter.OverrideAttenuation ? emitter.OverrideMinDistance : editorEvent.MinDistance; + float maxDistance = emitter.OverrideAttenuation ? emitter.OverrideMaxDistance : editorEvent.MaxDistance; + minDistance = Handles.RadiusHandle(Quaternion.identity, emitter.transform.position, minDistance); + maxDistance = Handles.RadiusHandle(Quaternion.identity, emitter.transform.position, maxDistance); + if (EditorGUI.EndChangeCheck() && emitter.OverrideAttenuation) + { + Undo.RecordObject(emitter, "Change Emitter Bounds"); + emitter.OverrideMinDistance = Mathf.Clamp(minDistance, 0, emitter.OverrideMaxDistance); + emitter.OverrideMaxDistance = Mathf.Max(emitter.OverrideMinDistance, maxDistance); + } + } + } + + public override void OnInspectorGUI() + { + var begin = serializedObject.FindProperty("EventPlayTrigger"); + var end = serializedObject.FindProperty("EventStopTrigger"); + var tag = serializedObject.FindProperty("CollisionTag"); + var eventReference = serializedObject.FindProperty("EventReference"); + var eventPath = eventReference.FindPropertyRelative("Path"); + var fadeout = serializedObject.FindProperty("AllowFadeout"); + var once = serializedObject.FindProperty("TriggerOnce"); + var preload = serializedObject.FindProperty("Preload"); + var nonRigidbodyVelocity = serializedObject.FindProperty("NonRigidbodyVelocity"); + var overrideAtt = serializedObject.FindProperty("OverrideAttenuation"); + var minDistance = serializedObject.FindProperty("OverrideMinDistance"); + var maxDistance = serializedObject.FindProperty("OverrideMaxDistance"); + + EditorGUILayout.PropertyField(begin, new GUIContent(L10n.Tr("Event Play Trigger"))); + EditorGUILayout.PropertyField(end, new GUIContent(L10n.Tr("Event Stop Trigger"))); + + if ((begin.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && begin.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D) || + (end.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && end.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D)) + { + tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue); + } + + EditorGUI.BeginChangeCheck(); + + const string EventReferenceLabel = "Event"; + + EditorUtils.DrawLegacyEvent(serializedObject.FindProperty("Event"), EventReferenceLabel); + + EditorGUILayout.PropertyField(eventReference, new GUIContent(L10n.Tr(EventReferenceLabel))); + + EditorEventRef editorEvent = EventManager.EventFromPath(eventPath.stringValue); + + if (EditorGUI.EndChangeCheck()) + { + EditorUtils.UpdateParamsOnEmitter(serializedObject, eventPath.stringValue); + } + + // Attenuation + if (editorEvent != null) + { + { + EditorGUI.BeginDisabledGroup(editorEvent == null || !editorEvent.Is3D); + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(overrideAtt, new GUIContent(L10n.Tr("Override Attenuation"))); + if (EditorGUI.EndChangeCheck() || + (minDistance.floatValue == -1 && maxDistance.floatValue == -1) || // never been initialiased + !overrideAtt.boolValue && + (minDistance.floatValue != editorEvent.MinDistance || maxDistance.floatValue != editorEvent.MaxDistance) + ) + { + minDistance.floatValue = editorEvent.MinDistance; + maxDistance.floatValue = editorEvent.MaxDistance; + } + EditorGUI.BeginDisabledGroup(!overrideAtt.boolValue); + EditorGUIUtility.labelWidth = 30; + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(minDistance, new GUIContent("Min")); + if (EditorGUI.EndChangeCheck()) + { + minDistance.floatValue = Mathf.Clamp(minDistance.floatValue, 0, maxDistance.floatValue); + } + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(maxDistance, new GUIContent("Max")); + if (EditorGUI.EndChangeCheck()) + { + maxDistance.floatValue = Mathf.Max(minDistance.floatValue, maxDistance.floatValue); + } + EditorGUIUtility.labelWidth = 0; + EditorGUI.EndDisabledGroup(); + EditorGUILayout.EndHorizontal(); + EditorGUI.EndDisabledGroup(); + } + + parameterValueView.OnGUI(editorEvent, !eventReference.hasMultipleDifferentValues); + + fadeout.isExpanded = EditorGUILayout.Foldout(fadeout.isExpanded, L10n.Tr("Advanced Controls")); + if (fadeout.isExpanded) + { + EditorGUILayout.PropertyField(preload, new GUIContent(L10n.Tr("Preload Sample Data"))); + EditorGUILayout.PropertyField(fadeout, new GUIContent(L10n.Tr("Allow Fadeout When Stopping"))); + EditorGUILayout.PropertyField(once, new GUIContent(L10n.Tr("Trigger Once"))); + EditorGUILayout.PropertyField(nonRigidbodyVelocity, new GUIContent(L10n.Tr("Non-Rigidbody Velocity"))); + } + } + + serializedObject.ApplyModifiedProperties(); + } + + private class ParameterValueView + { + // The "Params" property from the SerializedObject we're editing in the inspector, + // so we can expand/collapse it or revert to prefab. + private SerializedProperty paramsProperty; + + // This holds one SerializedObject for each object in the current selection. + private List serializedTargets = new List(); + + // Mappings from EditorParamRef to initial parameter value property for all properties + // found in the current selection. + private List propertyRecords = new List(); + + // Any parameters that are in the current event but are missing from some objects in + // the current selection, so we can put them in the "Add" menu. + private List missingParameters = new List(); + + // A mapping from EditorParamRef to the initial parameter value properties in the + // current selection that have the same name. + // We need this because some objects may be missing some properties, and properties with + // the same name may be at different array indices in different objects. + private class PropertyRecord + { + public string name { get { return paramRef.Name; } } + public EditorParamRef paramRef; + public List valueProperties; + } + + public ParameterValueView(SerializedObject serializedObject) + { + paramsProperty = serializedObject.FindProperty("Params"); + + foreach (UnityEngine.Object target in serializedObject.targetObjects) + { + serializedTargets.Add(new SerializedObject(target)); + } + } + + // Rebuilds the propertyRecords and missingParameters collections. + private void RefreshPropertyRecords(EditorEventRef eventRef) + { + propertyRecords.Clear(); + + foreach (SerializedObject serializedTarget in serializedTargets) + { + SerializedProperty paramsProperty = serializedTarget.FindProperty("Params"); + + foreach (SerializedProperty parameterProperty in paramsProperty) + { + string name = parameterProperty.FindPropertyRelative("Name").stringValue; + SerializedProperty valueProperty = parameterProperty.FindPropertyRelative("Value"); + + PropertyRecord record = propertyRecords.Find(r => r.name == name); + + if (record != null) + { + record.valueProperties.Add(valueProperty); + } + else + { + EditorParamRef paramRef = eventRef.LocalParameters.Find(p => p.Name == name); + + if (paramRef != null) + { + propertyRecords.Add( + new PropertyRecord() { + paramRef = paramRef, + valueProperties = new List() { valueProperty }, + }); + } + } + } + } + + // Only sort if there is a multi-selection. If there is only one object selected, + // the user can revert to prefab, and the behaviour depends on the array order, + // so it's helpful to show the true order. + if (serializedTargets.Count > 1) + { + propertyRecords.Sort((a, b) => EditorUtility.NaturalCompare(a.name, b.name)); + } + + missingParameters.Clear(); + missingParameters.AddRange(eventRef.LocalParameters.Where( + p => { + PropertyRecord record = propertyRecords.Find(r => r.name == p.Name); + return record == null || record.valueProperties.Count < serializedTargets.Count; + })); + } + + public void OnGUI(EditorEventRef eventRef, bool matchingEvents) + { + foreach (SerializedObject serializedTarget in serializedTargets) + { + serializedTarget.Update(); + } + + if (Event.current.type == EventType.Layout) + { + RefreshPropertyRecords(eventRef); + } + + DrawHeader(matchingEvents); + + if (paramsProperty.isExpanded) + { + if (matchingEvents) + { + DrawValues(); + } + else + { + GUILayout.Box("Cannot change parameters when different events are selected", GUILayout.ExpandWidth(true)); + } + } + + foreach (SerializedObject serializedTarget in serializedTargets) + { + serializedTarget.ApplyModifiedProperties(); + } + } + + private void DrawHeader(bool enableAddButton) + { + Rect controlRect = EditorGUILayout.GetControlRect(); + + Rect titleRect = controlRect; + titleRect.width = EditorGUIUtility.labelWidth; + + // Let the user revert the whole Params array to prefab by context-clicking the title. + EditorGUI.BeginProperty(titleRect, GUIContent.none, paramsProperty); + + paramsProperty.isExpanded = EditorGUI.Foldout(titleRect, paramsProperty.isExpanded, + L10n.Tr("Initial Parameter Values")); + + EditorGUI.EndProperty(); + + Rect buttonRect = controlRect; + buttonRect.xMin = titleRect.xMax; + + EditorGUI.BeginDisabledGroup(!enableAddButton); + + DrawAddButton(buttonRect); + + EditorGUI.EndDisabledGroup(); + } + + private void DrawAddButton(Rect position) + { + EditorGUI.BeginDisabledGroup(missingParameters.Count == 0); + + if (EditorGUI.DropdownButton(position, new GUIContent(L10n.Tr("Add")), FocusType.Passive)) + { + GenericMenu menu = new GenericMenu(); + menu.AddItem(new GUIContent(L10n.Tr("All")), false, () => + { + foreach (EditorParamRef parameter in missingParameters) + { + AddParameter(parameter); + } + }); + + menu.AddSeparator(string.Empty); + + foreach (EditorParamRef parameter in missingParameters) + { + menu.AddItem(new GUIContent(parameter.Name), false, + (userData) => + { + AddParameter(userData as EditorParamRef); + }, + parameter); + } + + menu.DropDown(position); + } + + EditorGUI.EndDisabledGroup(); + } + + private void DrawValues() + { + // We use this to defer deletion so we don't mess with arrays while using + // SerializedProperties that refer to array elements, as this can throw exceptions. + string parameterToDelete = null; + + foreach (PropertyRecord record in propertyRecords) + { + if (record.valueProperties.Count == serializedTargets.Count) + { + bool delete; + DrawValue(record, out delete); + + if (delete) + { + parameterToDelete = record.name; + } + } + } + + if (parameterToDelete != null) + { + DeleteParameter(parameterToDelete); + } + } + + private void DrawValue(PropertyRecord record, out bool delete) + { + delete = false; + + GUIContent removeLabel = new GUIContent(L10n.Tr("Remove")); + + Rect position = EditorGUILayout.GetControlRect(); + + Rect nameLabelRect = position; + nameLabelRect.width = EditorGUIUtility.labelWidth; + + Rect removeButtonRect = position; + removeButtonRect.width = EditorStyles.miniButton.CalcSize(removeLabel).x; + removeButtonRect.x = position.xMax - removeButtonRect.width; + + Rect sliderRect = position; + sliderRect.xMin = nameLabelRect.xMax; + sliderRect.xMax = removeButtonRect.xMin - EditorStyles.miniButton.margin.left; + + GUIContent nameLabel = new GUIContent(record.name); + + float value = 0; + bool mixedValues = false; + + // We use EditorGUI.BeginProperty when there is a single object selected, so + // the user can revert the value to prefab by context-clicking the name. + // We handle multi-selections ourselves, so that we can deal with + // mismatched arrays nicely. + if (record.valueProperties.Count == 1) + { + value = record.valueProperties[0].floatValue; + EditorGUI.BeginProperty(position, nameLabel, record.valueProperties[0]); + } + else + { + bool first = true; + + foreach (SerializedProperty property in record.valueProperties) + { + if (first) + { + value = property.floatValue; + first = false; + } + else if (property.floatValue != value) + { + mixedValues = true; + break; + } + } + } + + EditorGUI.LabelField(nameLabelRect, nameLabel); + + if (record.paramRef.Type == ParameterType.Labeled) + { + EditorGUI.BeginChangeCheck(); + + EditorGUI.showMixedValue = mixedValues; + + int newValue = EditorGUI.Popup(sliderRect, (int)value, record.paramRef.Labels); + + EditorGUI.showMixedValue = false; + + if (EditorGUI.EndChangeCheck()) + { + foreach (SerializedProperty property in record.valueProperties) + { + property.floatValue = newValue; + } + } + } + else if (record.paramRef.Type == ParameterType.Discrete) + { + EditorGUI.BeginChangeCheck(); + + EditorGUI.showMixedValue = mixedValues; + + int newValue = EditorGUI.IntSlider(sliderRect, (int)value, (int)record.paramRef.Min, (int)record.paramRef.Max); + + EditorGUI.showMixedValue = false; + + if (EditorGUI.EndChangeCheck()) + { + foreach (SerializedProperty property in record.valueProperties) + { + property.floatValue = newValue; + } + } + } + else + { + EditorGUI.BeginChangeCheck(); + + EditorGUI.showMixedValue = mixedValues; + + float newValue = EditorGUI.Slider(sliderRect, value, record.paramRef.Min, record.paramRef.Max); + + EditorGUI.showMixedValue = false; + + if (EditorGUI.EndChangeCheck()) + { + foreach (SerializedProperty property in record.valueProperties) + { + property.floatValue = newValue; + } + } + } + + delete = GUI.Button(removeButtonRect, removeLabel, EditorStyles.miniButton); + + if (record.valueProperties.Count == 1) + { + EditorGUI.EndProperty(); + } + else + { + // Context menu to set all values from one object in the multi-selection. + if (mixedValues && Event.current.type == EventType.ContextClick + && nameLabelRect.Contains(Event.current.mousePosition)) + { + GenericMenu menu = new GenericMenu(); + + foreach (SerializedProperty sourceProperty in record.valueProperties) + { + UnityEngine.Object targetObject = sourceProperty.serializedObject.targetObject; + + menu.AddItem(new GUIContent(string.Format(L10n.Tr("Set to Value of '{0}'"), targetObject.name)), false, + (userData) => CopyValueToAll(userData as SerializedProperty, record.valueProperties), + sourceProperty); + } + + menu.DropDown(position); + + } + } + } + + // Copy the value from the source property to all target properties. + private void CopyValueToAll(SerializedProperty sourceProperty, List targetProperties) + { + foreach (SerializedProperty targetProperty in targetProperties) + { + if (targetProperty != sourceProperty) + { + targetProperty.floatValue = sourceProperty.floatValue; + targetProperty.serializedObject.ApplyModifiedProperties(); + } + } + } + + // Add an initial value for the given parameter to all selected objects that don't have one. + private void AddParameter(EditorParamRef parameter) + { + foreach (SerializedObject serializedTarget in serializedTargets) + { + StudioEventEmitter emitter = serializedTarget.targetObject as StudioEventEmitter; + + if (Array.FindIndex(emitter.Params, p => p.Name == parameter.Name) < 0) + { + SerializedProperty paramsProperty = serializedTarget.FindProperty("Params"); + + int index = paramsProperty.arraySize; + paramsProperty.InsertArrayElementAtIndex(index); + + SerializedProperty arrayElement = paramsProperty.GetArrayElementAtIndex(index); + + arrayElement.FindPropertyRelative("Name").stringValue = parameter.Name; + arrayElement.FindPropertyRelative("Value").floatValue = parameter.Default; + + serializedTarget.ApplyModifiedProperties(); + } + } + } + + // Delete initial parameter values for the given name from all selected objects. + private void DeleteParameter(string name) + { + foreach (SerializedObject serializedTarget in serializedTargets) + { + SerializedProperty paramsProperty = serializedTarget.FindProperty("Params"); + + foreach (SerializedProperty child in paramsProperty) + { + if (child.FindPropertyRelative("Name").stringValue == name) + { + child.DeleteCommand(); + break; + } + } + } + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs.meta new file mode 100644 index 00000000..043c1cab --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2b044fd4ebf2c42468e1f41d5e2b879c +timeCreated: 1434696182 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs new file mode 100644 index 00000000..7fde703d --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs @@ -0,0 +1,14 @@ +using UnityEngine; +using UnityEditor; + +namespace FMODUnity +{ + public class StudioEventEmitterGizoDrawer + { + [DrawGizmo(GizmoType.Selected | GizmoType.Active | GizmoType.NotInSelectionHierarchy | GizmoType.Pickable)] + private static void DrawGizmo(StudioEventEmitter studioEmitter, GizmoType gizmoType) + { + Gizmos.DrawIcon(studioEmitter.transform.position, "AudioSource Gizmo", true, Color.yellow); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs.meta new file mode 100644 index 00000000..0296f941 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f09ba26caab55e048a2e596ff75b3eab +timeCreated: 1433142677 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs new file mode 100644 index 00000000..578471be --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioGlobalParameterTrigger))] + public class StudioGlobalParameterTriggerEditor : Editor + { + private SerializedProperty param; + private SerializedProperty trigger; + private SerializedProperty tag; + private SerializedProperty value; + + private SerializedProperty data1, data2; + + private static GUIContent NotFoundWarning; + + private string currentPath; + + [SerializeField] + private EditorParamRef editorParamRef; + + private void OnEnable() + { + param = serializedObject.FindProperty("Parameter"); + trigger = serializedObject.FindProperty("TriggerEvent"); + tag = serializedObject.FindProperty("CollisionTag"); + value = serializedObject.FindProperty("Value"); + } + + public override void OnInspectorGUI() + { + if (NotFoundWarning == null) + { + Texture warningIcon = EditorUtils.LoadImage("NotFound.png"); + NotFoundWarning = new GUIContent(L10n.Tr("Parameter Not Found"), warningIcon); + } + + EditorGUILayout.PropertyField(trigger, new GUIContent(L10n.Tr("Trigger"))); + if (trigger.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && trigger.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D) + { + tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue); + } + + EditorGUILayout.PropertyField(param, new GUIContent(L10n.Tr("Parameter"))); + + if (param.stringValue != currentPath) + { + currentPath = param.stringValue; + + if (string.IsNullOrEmpty(param.stringValue)) + { + editorParamRef = null; + } + else + { + editorParamRef = EventManager.ParamFromPath(param.stringValue); + value.floatValue = Mathf.Clamp(value.floatValue, editorParamRef.Min, editorParamRef.Max); + } + } + + if (editorParamRef != null) + { + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.PrefixLabel(L10n.Tr("Override Value")); + value.floatValue = EditorUtils.DrawParameterValueLayout(value.floatValue, editorParamRef); + } + } + else + { + Rect rect = EditorGUILayout.GetControlRect(); + rect.xMin += EditorGUIUtility.labelWidth; + + GUI.Label(rect, NotFoundWarning); + } + + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs.meta new file mode 100644 index 00000000..7728f876 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a901681b5558f247b4c227fb425c010 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs new file mode 100644 index 00000000..82e7aed0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs @@ -0,0 +1,32 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioListener))] + [CanEditMultipleObjects] + public class StudioListenerEditor : Editor + { + private SerializedProperty attenuationObject; + private SerializedProperty nonRigidbodyVelocity; + + private void OnEnable() + { + attenuationObject = serializedObject.FindProperty("attenuationObject"); + nonRigidbodyVelocity = serializedObject.FindProperty("nonRigidbodyVelocity"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + EditorGUI.BeginDisabledGroup(true); + int index = ((StudioListener)serializedObject.targetObject).ListenerNumber; + EditorGUILayout.IntSlider(L10n.Tr("Listener Index"), index, 0, FMOD.CONSTANTS.MAX_LISTENERS - 1); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.PropertyField(attenuationObject, new GUIContent(L10n.Tr("Attenuation Object"))); + EditorGUILayout.PropertyField(nonRigidbodyVelocity, new GUIContent(L10n.Tr("Non-Rigidbody Velocity"))); + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs.meta new file mode 100644 index 00000000..27ef28e4 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 847f8505c25f5cf42adba68a26f2cda6 +timeCreated: 1445576758 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs new file mode 100644 index 00000000..d3fdce50 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs @@ -0,0 +1,153 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioParameterTrigger))] + public class StudioParameterTriggerEditor : Editor + { + private StudioEventEmitter targetEmitter; + private SerializedProperty emitters; + private SerializedProperty trigger; + private SerializedProperty tag; + + private bool[] expanded; + + private void OnEnable() + { + emitters = serializedObject.FindProperty("Emitters"); + trigger = serializedObject.FindProperty("TriggerEvent"); + tag = serializedObject.FindProperty("CollisionTag"); + targetEmitter = null; + for (int i = 0; i < emitters.arraySize; i++) + { + targetEmitter = emitters.GetArrayElementAtIndex(i).FindPropertyRelative("Target").objectReferenceValue as StudioEventEmitter; + if (targetEmitter != null) + { + expanded = new bool[targetEmitter.GetComponents().Length]; + break; + } + } + } + + public override void OnInspectorGUI() + { + var newTargetEmitter = EditorGUILayout.ObjectField(L10n.Tr("Target"), targetEmitter, typeof(StudioEventEmitter), true) as StudioEventEmitter; + if (newTargetEmitter != targetEmitter) + { + emitters.ClearArray(); + targetEmitter = newTargetEmitter; + + if (targetEmitter == null) + { + serializedObject.ApplyModifiedProperties(); + return; + } + + List newEmitters = new List(); + targetEmitter.GetComponents(newEmitters); + expanded = new bool[newEmitters.Count]; + foreach (var emitter in newEmitters) + { + emitters.InsertArrayElementAtIndex(0); + emitters.GetArrayElementAtIndex(0).FindPropertyRelative("Target").objectReferenceValue = emitter; + } + } + + if (targetEmitter == null) + { + return; + } + + EditorGUILayout.PropertyField(trigger, new GUIContent(L10n.Tr("Trigger"))); + + if (trigger.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && trigger.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D) + { + tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue); + } + + var localEmitters = new List(); + targetEmitter.GetComponents(localEmitters); + + int emitterIndex = 0; + foreach (var emitter in localEmitters) + { + SerializedProperty emitterProperty = null; + for(int i = 0; i < emitters.arraySize; i++) + { + if (emitters.GetArrayElementAtIndex(i).FindPropertyRelative("Target").objectReferenceValue == emitter) + { + emitterProperty = emitters.GetArrayElementAtIndex(i); + break; + } + } + + // New emitter component added to game object since we last looked + if (emitterProperty == null) + { + emitters.InsertArrayElementAtIndex(0); + emitterProperty = emitters.GetArrayElementAtIndex(0); + emitterProperty.FindPropertyRelative("Target").objectReferenceValue = emitter; + } + + if (!emitter.EventReference.IsNull) + { + expanded[emitterIndex] = EditorGUILayout.Foldout(expanded[emitterIndex], emitter.EventReference.Path); + if (expanded[emitterIndex]) + { + var eventRef = EventManager.EventFromGUID(emitter.EventReference.Guid); + + foreach (var paramRef in eventRef.LocalParameters) + { + bool set = false; + int index = -1; + for (int i = 0; i < emitterProperty.FindPropertyRelative("Params").arraySize; i++) + { + if (emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(i).FindPropertyRelative("Name").stringValue == paramRef.Name) + { + index = i; + set = true; + break; + } + } + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(paramRef.Name); + bool newSet = GUILayout.Toggle(set, ""); + if (!set && newSet) + { + index = 0; + emitterProperty.FindPropertyRelative("Params").InsertArrayElementAtIndex(0); + emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(0).FindPropertyRelative("Name").stringValue = paramRef.Name; + emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(0).FindPropertyRelative("Value").floatValue = 0; + } + if (set && !newSet) + { + emitterProperty.FindPropertyRelative("Params").DeleteArrayElementAtIndex(index); + } + set = newSet; + + if (set) + { + var valueProperty = emitterProperty.FindPropertyRelative("Params") + .GetArrayElementAtIndex(index).FindPropertyRelative("Value"); + valueProperty.floatValue = + EditorUtils.DrawParameterValueLayout(valueProperty.floatValue, paramRef); + } + else + { + using (new EditorGUI.DisabledScope(true)) + { + EditorUtils.DrawParameterValueLayout(0, paramRef); + } + } + EditorGUILayout.EndHorizontal(); + } + } + } + emitterIndex++; + } + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs.meta new file mode 100644 index 00000000..fc4e483c --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dc94d213814ef1a42b0ca8ee00dd4728 +timeCreated: 1451968823 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/zh_hans.po b/Assets/Plugins/FMOD/src/Editor/zh_hans.po new file mode 100644 index 00000000..5aaaf653 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/zh_hans.po @@ -0,0 +1,1708 @@ +msgid "" +msgstr "" +"Project-Id-Version: FMOD for Unity\n" +"POT-Creation-Date: 2024-12-12 11:21+1100\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: zh_hans\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.5\n" +"X-Poedit-KeywordsList: ;L10n.Tr\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: .\n" + +#: BankRefreshWindow.cs:29 +msgid "FMOD Bank Refresh Status" +msgstr "FMOD 事件库刷新状态" + +#: BankRefreshWindow.cs:141 +#, csharp-format +msgid "The FMOD source banks changed {0} ago." +msgstr "FMOD 源事件库在 {0} 前发生了更改。" + +#: BankRefreshWindow.cs:148 +msgid "Refreshing banks now..." +msgstr "正在刷新事件库..." + +#: BankRefreshWindow.cs:153 +msgid "Refreshing banks" +msgstr "刷新事件库中" + +#: BankRefreshWindow.cs:161 +msgid "Would you like to refresh banks?" +msgstr "是否刷新事件库?" + +#: BankRefreshWindow.cs:168 +msgid "The FMOD banks are up to date." +msgstr "FMOD 事件库已是最新。" + +#: BankRefreshWindow.cs:172 +msgid "Bank refresh failed:" +msgstr "事件库刷新失败:" + +#: BankRefreshWindow.cs:181 +msgid "Closing" +msgstr "关闭中" + +#: BankRefreshWindow.cs:190 +#, csharp-format +msgid "{0} in {1}..." +msgstr "{0} 在 {1} 内..." + +#: BankRefreshWindow.cs:203 EventReferenceUpdater.cs:151 +#: EventReferenceUpdater.cs:2055 FileReorganizer.cs:835 +msgid "Cancel" +msgstr "取消" + +#: BankRefreshWindow.cs:226 SetupWizard.cs:874 +msgid "Close" +msgstr "关闭" + +#: BankRefreshWindow.cs:231 +msgid "Refresh Banks Now" +msgstr "立即刷新事件库" + +#: EditorUtils.cs:58 +msgid "The FMOD Studio project path must be set to an .fspro file." +msgstr "FMOD Studio 项目路径必须设置为 .fspro 文件。" + +#: EditorUtils.cs:64 +#, csharp-format +msgid "The FMOD Studio project path '{0}' does not exist." +msgstr "FMOD Studio 项目路径 '{0}' 不存在。" + +#: EditorUtils.cs:77 +#, csharp-format +msgid "The FMOD Studio project '{0}' does not contain any built banks. Please build your project in FMOD Studio." +msgstr "FMOD Studio 项目 '{0}' 不包含任何已构建的事件库。请在 FMOD Studio 中构建您的项目。" + +#: EditorUtils.cs:86 +msgid "The build path has not been set." +msgstr "构建路径尚未设置。" + +#: EditorUtils.cs:92 +#, csharp-format +msgid "The build path '{0}' does not exist." +msgstr "构建路径 '{0}' 不存在。" + +#: EditorUtils.cs:101 +#, csharp-format +msgid "Build path '{0}' does not contain any platform sub-directories. Please check that the build path is correct." +msgstr "构建路径 '{0}' 不包含任何平台子目录。请检查构建路径是否正确。" + +#: EditorUtils.cs:110 +#, csharp-format +msgid "Build path '{0}' does not contain any built banks." +msgstr "构建路径 '{0}' 不包含任何已构建的事件库。" + +#: EditorUtils.cs:155 +msgid "hour" +msgstr "小时" + +#: EditorUtils.cs:155 +msgid "hours" +msgstr "小时" + +#: EditorUtils.cs:159 +msgid "minute" +msgstr "分钟" + +#: EditorUtils.cs:159 +msgid "minutes" +msgstr "分钟" + +#: EditorUtils.cs:163 +msgid "second" +msgstr "秒" + +#: EditorUtils.cs:163 +msgid "seconds" +msgstr "秒" + +#: EditorUtils.cs:167 +msgid "a moment" +msgstr "片刻" + +#: EditorUtils.cs:270 +msgid "Legacy Event" +msgstr "旧版事件" + +#: EditorUtils.cs:275 EventRefDrawer.cs:476 +#, csharp-format +msgid "Will be migrated to {0}" +msgstr "将迁移到 {0}" + +#: EditorUtils.cs:688 +#, csharp-format +msgid "" +"Version: {0}\n" +"Build Number: {1}\n" +"\n" +"Copyright © Firelight Technologies Pty, Ltd. 2014-2025 \n" +"\n" +"See LICENSE.TXT for additional license information." +msgstr "" +"版本号: {0}\n" +"构建编号: {1}\n" +"\n" +"版权所有 © Firelight Technologies Pty, Ltd. 2014-2025 \n" +"\n" +"有关更多许可信息,请参见 LICENSE.TXT。" + +#: EditorUtils.cs:692 +msgid "FMOD Studio Unity Integration" +msgstr "FMOD Studio Unity 集成" + +#: EditorUtils.cs:1028 +msgid "Name Conflict" +msgstr "名称冲突" + +#: EditorUtils.cs:1028 +#, csharp-format +msgid "The event {0} already exists under {1}" +msgstr "事件 {0} 已经存在于 {1} 下" + +#: EditorUtils.cs:1387 +msgid "Disable Existing Native Libraries" +msgstr "禁用现有的原生库" + +#: EditorUtils.cs:1388 +msgid "Disable the existing FMOD native libraries so that Unity will not load them at startup time." +msgstr "禁用现有的 FMOD 原生库,以防 Unity 在启动时加载它们。" + +#: EditorUtils.cs:1400 +#, csharp-format +msgid "This will disable these native libraries:{0}" +msgstr "这将禁用以下原生库:{0}" + +#: EditorUtils.cs:1423 +msgid "Restart Unity" +msgstr "重启 Unity" + +#: EditorUtils.cs:1424 +msgid "Restart Unity so that it releases its lock on the existing FMOD native libraries." +msgstr "重启 Unity 以释放其对现有 FMOD 原生库的锁定。" + +#: EditorUtils.cs:1426 +msgid "This will restart Unity. You will be prompted to save your work if you have unsaved scene modifications." +msgstr "这将重启 Unity。系统将会提示您保存你的工作,如果你有未保存的场景修改。" + +#: EditorUtils.cs:1438 +msgid "Copy New Native Libraries" +msgstr "复制新的原生库" + +#: EditorUtils.cs:1439 +msgid "Copy the new FMOD native libraries to the correct location and enable them." +msgstr "将新的 FMOD 原生库复制到正确的位置并启用它们。" + +#: EditorUtils.cs:1468 +#, csharp-format +msgid "" +"This will do the following:\n" +"* {0}" +msgstr "" +"这将执行以下操作:\n" +"* {0}" + +#: EventBrowser.cs:263 +msgid "Events" +msgstr "事件" + +#: EventBrowser.cs:266 +msgid "Snapshots" +msgstr "快照" + +#: EventBrowser.cs:272 EventBrowser.cs:917 EventRefDrawer.cs:156 +#: StudioBankLoaderEditor.cs:30 +msgid "Banks" +msgstr "事件库" + +#: EventBrowser.cs:277 EventBrowser.cs:1249 +msgid "Global Parameters" +msgstr "全局参数" + +#: EventBrowser.cs:492 +msgid "New FMOD Studio Emitter" +msgstr "新 FMOD Studio Emitter" + +#: EventBrowser.cs:496 +msgid "New FMOD Studio Bank Loader" +msgstr "新增 Studio Bank Loader" + +#: EventBrowser.cs:500 +msgid "New FMOD Studio Global Parameter Trigger" +msgstr "新 FMOD Studio Global Parameter Trigger" + +#: EventBrowser.cs:915 EventBrowser.cs:935 EventBrowser.cs:942 +msgid "Full Path" +msgstr "完整路径" + +#: EventBrowser.cs:920 EventRefDrawer.cs:161 +msgid "Panning" +msgstr "声像" + +#: EventBrowser.cs:921 EventRefDrawer.cs:171 +msgid "Oneshot" +msgstr "一次性" + +#: EventBrowser.cs:924 +msgid "Length" +msgstr "长度" + +#: EventBrowser.cs:926 EventBrowser.cs:928 +msgid "Streaming" +msgstr "流式传输" + +#: EventBrowser.cs:946 +msgid "Platform Bank Sizes" +msgstr "平台事件库大小" + +#: EventBrowser.cs:971 +msgid "Name" +msgstr "名称" + +#: EventBrowser.cs:974 +msgid "Minimum" +msgstr "最小值" + +#: EventBrowser.cs:975 +msgid "Maximum" +msgstr "最大值" + +#: EventBrowser.cs:1083 +msgid "Show Event in FMOD Studio" +msgstr "在 FMOD Studio 中显示事件" + +#: EventBrowser.cs:1566 +msgid "Path" +msgstr "路径" + +#: EventBrowser.cs:1682 +msgid "Add Studio Event Emitter" +msgstr "新增 Studio Event Emitter" + +#: EventBrowser.cs:1692 +msgid "Add Studio Bank Loader" +msgstr "新增 Studio Bank Loader" + +#: EventBrowser.cs:1700 +msgid "Add Studio Global Parameter Trigger" +msgstr "新增 Studio Global Parameter Triggerr" + +#: EventBrowser.cs:1735 +msgid "Create Studio Event Emitter" +msgstr "新建 Studio Event Emitter" + +#: EventBrowser.cs:1745 +msgid "Create Studio Bank Loader" +msgstr "新建 Studio Bank Loader" + +#: EventBrowser.cs:1756 +msgid "Create Studio Global Parameter Trigger" +msgstr "新建 Studio Global Parameter Triggerr" + +#: EventRefDrawer.cs:14 +msgid "Event Not Found" +msgstr "未找到事件" + +#: EventRefDrawer.cs:77 +msgid "Search" +msgstr "搜寻" + +#: EventRefDrawer.cs:90 +msgid "Create New Event in Studio" +msgstr "在 Studio 里创建新事件" + +#: EventRefDrawer.cs:103 +msgid "Open In Browser" +msgstr "在浏览器里打开" + +#: EventRefDrawer.cs:146 +msgid "Copy To Clipboard" +msgstr "复制到剪贴板" + +#: EventRefDrawer.cs:166 SettingsEditor.cs:49 +msgid "Stream" +msgstr "流" + +#: EventRefDrawer.cs:185 +#, csharp-format +msgid "Moved to {0}" +msgstr "移动到 {0}" + +#: EventRefDrawer.cs:187 +#, csharp-format +msgid "" +"This event has been moved in FMOD Studio.\n" +"You can click the repair button to update the path to the new location, or run the {0} command to scan your project for similar issues and fix them all." +msgstr "" +"此事件在 FMOD Studio 中已被移动。\n" +"您可以点击修复按钮来更新路径到新位置,或者运行 {0} 命令来扫描您的项目中类似的问题并全部修复。" + +#: EventRefDrawer.cs:189 +#, csharp-format +msgid "Repair: set path to {0}" +msgstr "修复:将路径设置为 {0}" + +#: EventRefDrawer.cs:287 +msgid "GUID doesn't match path" +msgstr "GUID 与路径不匹配" + +#: EventRefDrawer.cs:289 +#, csharp-format +msgid "" +"The GUID on this EventReference doesn't match the path.\n" +"You can click the repair button to update the GUID to match the path, or run the {0} command to scan your project for similar issues and fix them all." +msgstr "" +"此 EventReference 上的 GUID 与路径不匹配。\n" +"您可以点击修复按钮来更新 GUID 以匹配路径,或者运行 {0} 命令扫描项目中的类似问题并全部修复。" + +#: EventRefDrawer.cs:291 +#, csharp-format +msgid "Repair: set GUID to {0}" +msgstr "修复:将GUID设置为 {0}" + +#: EventRefDrawer.cs:303 +msgid "Path doesn't match GUID" +msgstr "路径与 GUID 不匹配" + +#: EventRefDrawer.cs:305 +#, csharp-format +msgid "" +"The path on this EventReference doesn't match the GUID.\n" +"You can click the repair button to update the path to match the GUID, or run the {0} command to scan your project for similar issues and fix them all." +msgstr "" +"此 EventReference 上的路径与 GUID 不匹配。\n" +"您可以点击修复按钮来更新路径以匹配 GUID,或者运行 {0} 命令扫描项目中的类似问题并全部修复。" + +#: EventRefDrawer.cs:307 +#, csharp-format +msgid "Repair: set path to '{0}'" +msgstr "修复:将路径设置为 '{0}'" + +#: EventRefDrawer.cs:411 +#, csharp-format +msgid "" +"This field has the [EventRef] attribute, which is obsolete.\n" +"To resolve this issue:\n" +"* Add a field of type EventReference to this class\n" +"Set the MigrateTo property on the [EventRef] attribute: [EventRef(MigrateTo=\"\")]\n" +" Run the {0} command to automatically migrate values from this field to the EventReference field" +msgstr "" +"此字段具有 [EventRef] 属性,该属性已过时。\n" +"要解决此问题:\n" +"* 在此类中添加一个类型为 EventReference 的字段\n" +"* 在 [EventRef] 属性上设置 MigrateTo 属性:[EventRef(MigrateTo=\"\")]\n" +" 运行 {0} 命令以自动将此字段中的值迁移到 EventReference 字段" + +#: EventRefDrawer.cs:459 +msgid "[EventRef] is obsolete - use the EventReference type instead." +msgstr "[EventRef] 已过时 - 请改用 EventReference 类型。" + +#: EventRefDrawer.cs:481 +#, csharp-format +msgid "Migration target {0} is missing" +msgstr "迁移目标 {0} 丢失" + +#: EventReferenceUpdater.cs:27 +msgid "Click Scan to search your project for obsolete event references." +msgstr "点击扫描搜索该项目中的过时事件引用。" + +#: EventReferenceUpdater.cs:66 +msgid "Asset" +msgstr "资产" + +#: EventReferenceUpdater.cs:67 +msgid "Component Type" +msgstr "组件类型" + +#: EventReferenceUpdater.cs:68 +msgid "Game Object" +msgstr "游戏对象" + +#: EventReferenceUpdater.cs:72 +#, csharp-format +msgid "Execute {0} Selected Tasks" +msgstr "执行 {0} 个已选择的任务" + +#: EventReferenceUpdater.cs:78 +msgid "FMOD Event Reference Updater" +msgstr "FMOD 事件引用更新器" + +#: EventReferenceUpdater.cs:112 +msgid "No required tasks found. Event references are up to date." +msgstr "未找到所需任务。事件引用已是最新。" + +#: EventReferenceUpdater.cs:120 +msgid "Finished executing tasks. New tasks may now be required. Please re-scan your project." +msgstr "任务执行完毕。现在可能会有新的任务需要被执行。请重新扫描您的项目。。" + +#: EventReferenceUpdater.cs:124 +msgid "Finished scanning. Please execute the tasks above." +msgstr "扫描完成。请执行上方的任务。" + +#: EventReferenceUpdater.cs:129 +msgid "Cancelled." +msgstr "已取消。" + +#: EventReferenceUpdater.cs:148 +#, csharp-format +msgid "" +"Executing these {0} tasks will change {1} prefabs and {2} scenes on disk.\n" +"\n" +"Please ensure you have committed any outstanding changes to source control before continuing!" +msgstr "" +"执行这 {0} 项任务将更改磁盘上的 {1} 个预制体和 {2} 个场景。\n" +"\n" +"在继续之前,请确保您已提交任何未完成的更改到版本控制中!" + +#: EventReferenceUpdater.cs:151 +msgid "Confirm Bulk Changes" +msgstr "确认批量更改" + +#: EventReferenceUpdater.cs:224 EventReferenceUpdater.cs:252 +#: EventReferenceUpdater.cs:294 +#, csharp-format +msgid "Searching {0}" +msgstr "正在搜索 {0}" + +#: EventReferenceUpdater.cs:739 +#, csharp-format +msgid "Executing: {0}" +msgstr "执行 {0} 中" + +#: EventReferenceUpdater.cs:1011 EventReferenceUpdater.cs:1125 +#, csharp-format +msgid "Clear '{0}' from the {1} field" +msgstr "从 {1} 字段中清除 ‘{0}’" + +#: EventReferenceUpdater.cs:1026 EventReferenceUpdater.cs:1140 +#: EventReferenceUpdater.cs:1223 +#, csharp-format +msgid "Move '{0}' from {1} to {2}" +msgstr "将 ‘{0}’{1} 移动到 {2}" + +#: EventReferenceUpdater.cs:1051 +#, csharp-format +msgid "Move prefab override '{0}' from {1} to {2}" +msgstr "将预制体覆盖 ‘{0}’{1} 移动到 {2}" + +#: EventReferenceUpdater.cs:1166 +#, csharp-format +msgid "Remove field {0}" +msgstr "移除字段 {0}" + +#: EventReferenceUpdater.cs:1177 +#, csharp-format +msgid "" +"The {0} field on component {1} has value '{2}', but the corresponding EventReference field already has a value.\n" +"* Ensure no other instances of the {3} type are using the {4} field\n" +"* Edit the definition of the {3} type and remove the {4} field" +msgstr "" +"组件 {1} 上的 {0} 字段的值为‘{2}’,但对应的 EventReference 字段已经有值。\n" +"* 确保没有其他 {3} 类型的实例在使用 {4} 字段\n" +"* 编辑 {3} 类型的定义并移除 {4} 字段" + +#: EventReferenceUpdater.cs:1192 +#, csharp-format +msgid "Remove empty field {0}" +msgstr "移除空字段 {0}" + +#: EventReferenceUpdater.cs:1202 +#, csharp-format +msgid "" +"The {0} field on component {1} is empty.\n" +"* Ensure no other instances of the {2} type are using the {3} field\n" +"* Edit the definition of the {2} type and remove the {3} field" +msgstr "" +"组件 {1} 上的 {0} 字段为空。\n" +"* 确保没有其他 {2} 类型的实例在使用 {3} 字段\n" +"* 编辑 {2} 类型的定义并移除 {3} 字段" + +#: EventReferenceUpdater.cs:1286 +#, csharp-format +msgid "Add an EventReference field named {0} to hold '{1}' from {2}" +msgstr "添加一个名为 {0}EventReference 字段,用于保存来源于 {2}‘{1}’" + +#: EventReferenceUpdater.cs:1291 +#, csharp-format +msgid "Add an EventReference field to hold '{0}' from {1}" +msgstr "添加一个 EventReference 字段,用于保存来源于 {1}‘{0}’" + +#: EventReferenceUpdater.cs:1305 +#, csharp-format +msgid "the definition of the {0} type" +msgstr "{0} 类型的定义" + +#: EventReferenceUpdater.cs:1315 +#, csharp-format +msgid "" +"The {0} field on component {1} has an [EventRef(MigrateTo=\"{2}\")] attribute, but the {2} field doesn't exist.\n" +"* Edit {3} and add an EventReference field named {2}:\n" +" public EventReference {2};\n" +"* Re-scan your project" +msgstr "" +"组件 {1} 上的 {0} 字段具有 [EventRef(MigrateTo=\"{2}\")] 属性,但 {2} 字段不存在。\n" +"* 编辑 {3} 并添加一个名为 {2} 的 EventReference 字段:\n" +" public EventReference {2};\n" +"* 重新扫描您的项目" + +#: EventReferenceUpdater.cs:1321 +#, csharp-format +msgid "" +"The {0} field on component {1} has an [EventRef] attribute with no migration target specified.\n" +"* Edit {2} and add an EventReference field:\n" +" public EventReference ;\n" +"* Change the [EventRef] attribute on the {3} field to:\n" +" [EventRef(MigrateTo=\"\")]\n" +"* Re-scan your project." +msgstr "" +"组件 {1} 上的 {0} 字段具有 [EventRef] 属性,但未指定迁移目标。\n" +"* 编辑 {2} 并添加一个 EventReference 字段:\n" +" public EventReference <字段名>;\n" +"* 将 {3} 字段上的 [EventRef] 属性更改为:\n" +" [EventRef(MigrateTo=\"\")]\n" +"* 重新扫描您的项目。" + +#: EventReferenceUpdater.cs:1342 +#, csharp-format +msgid "Change the path on field {0} from '{1}' to '{2}' (to match GUID {3})" +msgstr "将字段 {0} 的路径从 ‘{1}’ 更改为 ‘{2}’(以匹配 GUID {3})" + +#: EventReferenceUpdater.cs:1377 +#, csharp-format +msgid "Change the GUID on field {0} from {1} to {2} (to match path '{3}')" +msgstr "将字段 {0} 的 GUID 从 ‘{1}’ 更改为 ‘{2}’(以匹配 路径 {3})" + +#: EventReferenceUpdater.cs:1414 +#, csharp-format +msgid "Fix conflicting migration targets on fields {0}" +msgstr "修复字段 {0} 上的迁移目标冲突" + +#: EventReferenceUpdater.cs:1415 +msgid " and " +msgstr " 以及 " + +#: EventReferenceUpdater.cs:1419 +#, csharp-format +msgid "" +"Fields {0} on the {1} type have [EventRef] attributes with the same MigrateTo value.\n" +"* Edit the definition of the {1} type and make sure all [EventRef] attributes have different MigrateTo values\n" +"* Re-scan your project" +msgstr "" +"{1} 类型中的字段 {0} 具有相同的 [EventRef] 属性 MigrateTo 值。\n" +"* 编辑 {1} 类型的定义,确保所有 [EventRef] 属性具有不同的 MigrateTo 值\n" +"* 重新扫描您的项目" + +#: EventReferenceUpdater.cs:1420 +msgid " and " +msgstr " 以及 " + +#: EventReferenceUpdater.cs:1997 +msgid "Open " +msgstr "打开 " + +#: EventReferenceUpdater.cs:2008 +msgid "View Documentation" +msgstr "查看文档" + +#: EventReferenceUpdater.cs:2028 +msgid "Execute" +msgstr "执行" + +#: EventReferenceUpdater.cs:2045 FindAndReplace.cs:72 +msgid "Prefabs" +msgstr "预制体" + +#: EventReferenceUpdater.cs:2046 +msgid "ScriptableObjects" +msgstr "可编程对象" + +#: EventReferenceUpdater.cs:2047 +msgid "Scenes" +msgstr "场景" + +#: EventReferenceUpdater.cs:2062 +msgid "Scan" +msgstr "扫描" + +#: EventReferenceUpdater.cs:2133 StudioParameterTriggerEditor.cs:36 +msgid "Target" +msgstr "目标" + +#: EventReferenceUpdater.cs:2140 +msgid "Task" +msgstr "任务" + +#: EventReferenceUpdater.cs:2147 FileReorganizer.cs:308 +msgid "Status" +msgstr "状态" + +#: EventReferenceUpdater.cs:2219 +msgid "No tasks." +msgstr "无任务。" + +#: EventReferenceUpdater.cs:2392 +msgid " on" +msgstr " 在" + +#: EventReferenceUpdater.cs:2424 +msgid "Manual task: " +msgstr "手动任务:\t" + +#: EventReferenceUpdater.cs:2435 +msgid "Manual Changes Required" +msgstr "需要手动更改" + +#: EventReferenceUpdater.cs:2439 +msgid "Complete" +msgstr "完成" + +#: EventReferenceUpdater.cs:2439 FileReorganizer.cs:689 +msgid "Pending" +msgstr "待处理" + +#: FileReorganizer.cs:43 +msgid "FMOD File Reorganizer" +msgstr "FMOD 文件重组器" + +#: FileReorganizer.cs:68 +#, csharp-format +msgid "" +"{0} will be moved to\n" +"{1}" +msgstr "" +"{0} 将被移动到\n" +"{1}" + +#: FileReorganizer.cs:78 +#, csharp-format +msgid "{0} will be removed if it is empty" +msgstr "如果 {0} 为空,将被移除" + +#: FileReorganizer.cs:90 +#, csharp-format +msgid "" +"{0} is missing.\n" +"You may need to reinstall the {1} support package from {2}." +msgstr "" +"未找到 {0}。\n" +"您可能需要从 {2} 重新安装 {1} 支持包。" + +#: FileReorganizer.cs:102 +#, csharp-format +msgid "{0} will be removed" +msgstr "{0} 将被移除" + +#: FileReorganizer.cs:231 +msgid "There is a file missing. Select it above for more information." +msgstr "有文件丢失。请在上方选择以获取更多信息。" + +#: FileReorganizer.cs:236 +#, csharp-format +msgid "There are {0} files missing. Select them above for more information." +msgstr "有 {0} 个文件丢失。请在上方选择以获取更多信息。" + +#: FileReorganizer.cs:301 +msgid "Task #" +msgstr "任务编号" + +#: FileReorganizer.cs:314 +msgid "Platform" +msgstr "平台" + +#: FileReorganizer.cs:321 +msgid "Description" +msgstr "描述" + +#: FileReorganizer.cs:364 +msgid "Nothing to do here." +msgstr "无需要处理的内容。" + +#: FileReorganizer.cs:598 +msgid "if empty" +msgstr "如果为空" + +#: FileReorganizer.cs:667 StudioEventEmitterEditor.cs:342 +msgid "Remove" +msgstr "移除" + +#: FileReorganizer.cs:690 +msgid "Succeeded" +msgstr "成功" + +#: FileReorganizer.cs:691 +msgid "Failed" +msgstr "失败" + +#: FileReorganizer.cs:692 +msgid "Missing" +msgstr "丢失" + +#: FileReorganizer.cs:842 +msgid "Refresh" +msgstr "刷新" + +#: FileReorganizer.cs:853 +#, csharp-format +msgid "Processing Task {0} of {1}" +msgstr "正在处理任务 {0}/{1}" + +#: FileReorganizer.cs:859 +#, csharp-format +msgid "Process {0} Tasks" +msgstr "处理 {0} 个任务" + +#: FileReorganizer.cs:1286 +#, csharp-format +msgid "Moving {0} to {1}" +msgstr "正在将 {0} 移动到 {1}" + +#: FileReorganizer.cs:1292 +#, csharp-format +msgid "" +"{0} was moved to\n" +"{1}" +msgstr "" +"{0} 已被移动到\n" +"{1}" + +#: FileReorganizer.cs:1296 +#, csharp-format +msgid "" +"{0} could not be moved to\n" +"{1}: '{2}'" +msgstr "" +"无法将 {0} 移动到\n" +"{1}: '{2}'" + +#: FileReorganizer.cs:1317 FileReorganizer.cs:1370 +#, csharp-format +msgid "{0} was removed" +msgstr "{0} 被移除" + +#: FileReorganizer.cs:1321 FileReorganizer.cs:1374 +#, csharp-format +msgid "{0} could not be removed" +msgstr "{0} 无法被移除" + +#: FileReorganizer.cs:1350 +#, csharp-format +msgid "{0} has already been removed" +msgstr "{0} 已被移除" + +#: FileReorganizer.cs:1356 +#, csharp-format +msgid "{0} is not a valid folder" +msgstr "{0} 不是有效的文件夹" + +#: FileReorganizer.cs:1362 +#, csharp-format +msgid "{0} is not empty" +msgstr "{0} 不为空" + +#: FileReorganizer.cs:1366 +#, csharp-format +msgid "Removing empty folder {0}" +msgstr "正在移除空文件夹 {0}" + +#: FindAndReplace.cs:25 +msgid "FMOD Find and Replace" +msgstr "FMOD 查找与替换" + +#: FindAndReplace.cs:57 FindAndReplace.cs:129 +msgid "find" +msgstr "查找" + +#: FindAndReplace.cs:58 +msgid "Find:" +msgstr "查找 :" + +#: FindAndReplace.cs:66 +msgid "Replace:" +msgstr "替换 :" + +#: FindAndReplace.cs:71 +msgid "Current Level" +msgstr "当前场景" + +#: FindAndReplace.cs:80 +msgid "Find" +msgstr "查找" + +#: FindAndReplace.cs:88 FindAndReplace.cs:105 +msgid "Finished Search" +msgstr "查找完成" + +#: FindAndReplace.cs:92 +msgid "Replace" +msgstr "替换" + +#: FindAndReplace.cs:109 FindAndReplace.cs:111 +msgid "Replace All" +msgstr "替换全部" + +#: FindAndReplace.cs:111 +msgid "Are you sure you wish to replace all in the current hierachy?" +msgstr "您确定要替换当前层级中的所有内容吗?" + +#: FindAndReplace.cs:111 +msgid "yes" +msgstr "是" + +#: FindAndReplace.cs:111 +msgid "no" +msgstr "否" + +#: FindAndReplace.cs:142 +msgid "Found object" +msgstr "找到的对象" + +#: FindAndReplace.cs:161 +#, csharp-format +msgid "{0} replaced" +msgstr "已替换 {0}" + +#: FindAndReplace.cs:171 +msgid "Event" +msgstr "事件" + +#: SettingsEditor.cs:17 +msgid "Disabled" +msgstr "已禁用" + +#: SettingsEditor.cs:17 +msgid "Enabled" +msgstr "已启用" + +#: SettingsEditor.cs:17 +msgid "Development Build Only" +msgstr "仅限开发版本" + +#: SettingsEditor.cs:19 +msgid "TopLeft" +msgstr "左上角" + +#: SettingsEditor.cs:19 +msgid "TopCenter" +msgstr "顶部中央" + +#: SettingsEditor.cs:19 +msgid "TopRight" +msgstr "右上角" + +#: SettingsEditor.cs:19 +msgid "BottomLeft" +msgstr "左下角" + +#: SettingsEditor.cs:19 +msgid "BottomCenter" +msgstr "底部中央" + +#: SettingsEditor.cs:19 +msgid "BottomRight" +msgstr "右下角" + +#: SettingsEditor.cs:19 +msgid "Center" +msgstr "中央" + +#: SettingsEditor.cs:19 +msgid "VR" +msgstr "VR" + +#: SettingsEditor.cs:22 +msgid "Platform Default" +msgstr "平台默认值" + +#: SettingsEditor.cs:33 +msgid "Stereo" +msgstr "立体声" + +#: SettingsEditor.cs:34 +msgid "Surround 5.1" +msgstr "环绕声 5.1" + +#: SettingsEditor.cs:35 +msgid "Surround 7.1" +msgstr "环绕声 7.1" + +#: SettingsEditor.cs:36 +msgid "Surround 7.1.4" +msgstr "环绕声 7.1.4" + +#: SettingsEditor.cs:47 +msgid "Mixer" +msgstr "混音器" + +#: SettingsEditor.cs:48 +msgid "Feeder" +msgstr "馈送器" + +#: SettingsEditor.cs:50 +msgid "File" +msgstr "文件" + +#: SettingsEditor.cs:51 +msgid "Nonblocking" +msgstr "非阻塞" + +#: SettingsEditor.cs:52 +msgid "Record" +msgstr "录音" + +#: SettingsEditor.cs:53 +msgid "Geometry" +msgstr "几何处理" + +#: SettingsEditor.cs:54 +msgid "Profiler" +msgstr "性能分析" + +#: SettingsEditor.cs:55 +msgid "Studio Update" +msgstr "Studio 更新" + +#: SettingsEditor.cs:56 +msgid "Studio Load Bank" +msgstr "Studio 加载事件库" + +#: SettingsEditor.cs:57 +msgid "Studio Load Sample" +msgstr "Studio 加载样本" + +#: SettingsEditor.cs:58 +msgid "Convolution 1" +msgstr "卷积处理1" + +#: SettingsEditor.cs:59 +msgid "Convolution 2" +msgstr "卷积处理2" + +#: SettingsEditor.cs:124 SettingsEditor.cs:139 +msgid "None" +msgstr "无" + +#: SettingsEditor.cs:125 +msgid "Error" +msgstr "错误" + +#: SettingsEditor.cs:126 +msgid "Warning" +msgstr "警告" + +#: SettingsEditor.cs:127 +msgid "Log" +msgstr "日志" + +#: SettingsEditor.cs:137 StudioEventEmitterEditor.cs:286 +msgid "All" +msgstr "全部" + +#: SettingsEditor.cs:138 +msgid "Specified" +msgstr "指定的事件库" + +#: SettingsEditor.cs:149 +msgid "Standard" +msgstr "标准" + +#: SettingsEditor.cs:150 +msgid "SeparateLFE" +msgstr "独立低频通道" + +#: SettingsEditor.cs:151 +msgid "Positional" +msgstr "位置相关的" + +#: SettingsEditor.cs:160 +msgid "Refresh Banks" +msgstr "刷新事件库" + +#: SettingsEditor.cs:163 +msgid "After 1 second" +msgstr "1秒后" + +#: SettingsEditor.cs:164 +msgid "After 5 seconds" +msgstr "5秒后" + +#: SettingsEditor.cs:165 +msgid "After 10 seconds" +msgstr "10秒后" + +#: SettingsEditor.cs:166 +msgid "After 20 seconds" +msgstr "20秒后" + +#: SettingsEditor.cs:167 +msgid "After 30 seconds" +msgstr "30秒后" + +#: SettingsEditor.cs:168 +msgid "After 1 minute" +msgstr "1分钟后" + +#: SettingsEditor.cs:169 +msgid "Prompt Me" +msgstr "提示我" + +#: SettingsEditor.cs:170 +msgid "Manually" +msgstr "手动" + +#: SettingsEditor.cs:230 SettingsEditor.cs:1507 SettingsEditor.cs:1533 +msgid "Browse" +msgstr "浏览" + +#: SettingsEditor.cs:231 +msgid "Add All" +msgstr "添加全部" + +#: SettingsEditor.cs:376 +msgid "Revert" +msgstr "恢复" + +#: SettingsEditor.cs:381 +msgid "Revert FMOD Platform Properties" +msgstr "恢复FMOD平台属性" + +#: SettingsEditor.cs:449 SettingsEditor.cs:1308 +msgid "Auto" +msgstr "自动" + +#: SettingsEditor.cs:450 +msgid "No Sound" +msgstr "无声" + +#: SettingsEditor.cs:451 +msgid "Wav Writer" +msgstr "Wav 写入器" + +#: SettingsEditor.cs:498 SettingsEditor.cs:850 +msgid "Use Defaults" +msgstr "使用默认值" + +#: SettingsEditor.cs:527 +msgid "Any" +msgstr "任何" + +#: SettingsEditor.cs:567 +msgid "List is Empty" +msgstr "列表为空" + +#: SettingsEditor.cs:576 StudioEventEmitterEditor.cs:283 +msgid "Add" +msgstr "添加" + +#: SettingsEditor.cs:592 +msgid "Threads" +msgstr "线程" + +#: SettingsEditor.cs:598 +msgid "Cores" +msgstr "核心" + +#: SettingsEditor.cs:609 +msgid "Edit" +msgstr "编辑" + +#: SettingsEditor.cs:703 +msgid "Delete" +msgstr "删除" + +#: SettingsEditor.cs:824 +msgid "Edit Codec Channels" +msgstr "编辑编解码通道" + +#: SettingsEditor.cs:914 +msgid "Output sub-directory:" +msgstr "输出子目录:" + +#: SettingsEditor.cs:915 +msgid "Surround speaker mode:" +msgstr "环绕声扬声器模式:" + +#: SettingsEditor.cs:1000 SettingsEditor.cs:1028 +msgid "Edit FMOD Platform Settings" +msgstr "编辑FMOD平台属性" + +#: SettingsEditor.cs:1041 +msgid "Select the output sub-directory and surround speaker mode that match the project platform settings in the FMOD Studio build preferences." +msgstr "选择与 FMOD Studio 构建首选项中的项目平台设置相匹配的输出子目录和环绕扬声器模式。" + +#: SettingsEditor.cs:1047 +msgid "Select the speaker mode that matches the project platform settings in the FMOD Studio build preferences." +msgstr "选择与 FMOD Studio 构建首选项中的项目平台设置相匹配的扬声器模式。" + +#: SettingsEditor.cs:1106 +msgid "Reset" +msgstr "重置" + +#: SettingsEditor.cs:1148 +msgid "Live Update" +msgstr "实时更新" + +#: SettingsEditor.cs:1152 +msgid "Live Update Port" +msgstr "实时更新端口" + +#: SettingsEditor.cs:1155 +msgid "Debug Overlay" +msgstr "调试覆盖层" + +#: SettingsEditor.cs:1158 +msgid "Debug Location" +msgstr "调试位置" + +#: SettingsEditor.cs:1159 +msgid "Font size" +msgstr "字体大小" + +#: SettingsEditor.cs:1162 +msgid "Output Mode" +msgstr "输出模式" + +#: SettingsEditor.cs:1163 +msgid "Sample Rate" +msgstr "采样率" + +#: SettingsEditor.cs:1167 +msgid "Project Platform" +msgstr "项目平台" + +#: SettingsEditor.cs:1171 +msgid "Speaker Mode" +msgstr "扬声器模式" + +#: SettingsEditor.cs:1174 +msgid "Callback Handler" +msgstr "回调处理程序" + +#: SettingsEditor.cs:1176 +msgid "Virtual Channel Count" +msgstr "虚拟声道数量" + +#: SettingsEditor.cs:1177 +msgid "Real Channel Count" +msgstr "实际声道数量" + +#: SettingsEditor.cs:1179 +msgid "Codec Counts" +msgstr "编解码器计数" + +#: SettingsEditor.cs:1192 +msgid "Only supported on the IL2CPP scripting backend" +msgstr "仅支持 IL2CPP 脚本后端" + +#: SettingsEditor.cs:1195 +msgid "Static Plugins" +msgstr "静态插件" + +#: SettingsEditor.cs:1197 +msgid "Dynamic Plugins" +msgstr "动态插件" + +#: SettingsEditor.cs:1199 +msgid "Thread Affinity" +msgstr "线程亲和性" + +#: SettingsEditor.cs:1214 +msgid "platform group" +msgstr "平台组" + +#: SettingsEditor.cs:1218 +msgid "built-in platform" +msgstr "内置平台" + +#: SettingsEditor.cs:1222 +msgid "platform" +msgstr "平台" + +#: SettingsEditor.cs:1232 +msgid "inheriting from Unity build target: " +msgstr "继承自 Unity 构建目标:" + +#: SettingsEditor.cs:1243 +msgid "inheriting from" +msgstr "继承自" + +#: SettingsEditor.cs:1290 +msgid "DSP Buffer Settings" +msgstr "DSP 缓冲设置" + +#: SettingsEditor.cs:1345 +msgid "DSP Buffer Length" +msgstr "DSP 缓冲区长度" + +#: SettingsEditor.cs:1346 +msgid "DSP Buffer Count" +msgstr "DSP 缓冲区数量" + +#: SettingsEditor.cs:1384 +msgid "FMOD Settings" +msgstr "FMOD 设置" + +#: SettingsEditor.cs:1463 +msgid "Bank Import" +msgstr "导入事件库" + +#: SettingsEditor.cs:1489 +msgid "Source Type" +msgstr "源类型" + +#: SettingsEditor.cs:1498 +msgid "Studio Project Path" +msgstr "项目路径" + +#: SettingsEditor.cs:1531 +msgid "Build Path" +msgstr "构建路径" + +#: SettingsEditor.cs:1586 +msgid "" +"\n" +"\n" +"For detailed setup instructions, please see the FMOD/Help/Getting Started menu item." +msgstr "" +"\n" +"\n" +"有关详细的设置说明, 请参见 FMOD/Help/Getting Started menu item." + +#: SettingsEditor.cs:1594 SetupWizard.cs:512 +msgid "Choose how to access your FMOD Studio content:" +msgstr "选择如何访问您的 FMOD Studio 内容:" + +#: SettingsEditor.cs:1597 SetupWizard.cs:527 +msgid "FMOD Studio Project" +msgstr "FMOD Studio 项目" + +#: SettingsEditor.cs:1598 +msgid "If you have the complete FMOD Studio project." +msgstr "如果您拥有完整的 FMOD Studio 项目。" + +#: SettingsEditor.cs:1600 SetupWizard.cs:538 +msgid "Single Platform Build" +msgstr "单平台构建" + +#: SettingsEditor.cs:1601 +msgid "If you have the contents of the Build folder for a single platform." +msgstr "如果您拥有单平台的构建文件夹内容。" + +#: SettingsEditor.cs:1603 SetupWizard.cs:550 +msgid "Multiple Platform Build" +msgstr "多平台构建" + +#: SettingsEditor.cs:1604 +msgid "If you have the contents of the Build folder for multiple platforms, with each platform in its own subdirectory." +msgstr "如果您拥有多个平台的构建文件夹内容,并且每个平台在其各自的子目录中。" + +#: SettingsEditor.cs:1687 +msgid "Streaming Asset" +msgstr "流媒体资产" + +#: SettingsEditor.cs:1687 +msgid "Asset Bundle" +msgstr "资产包" + +#: SettingsEditor.cs:1690 +msgid "Import Type" +msgstr "导入类型" + +#: SettingsEditor.cs:1695 +msgid "FMOD Bank Import Type Changed" +msgstr "FMOD 事件库的导入类型发生变化" + +#: SettingsEditor.cs:1696 +#, csharp-format +msgid "Do you want to delete the {0} banks in {1} " +msgstr "您确定要删除位于 {1} 的 {0} 事件库吗?" + +#: SettingsEditor.cs:1697 +msgid "Yes" +msgstr "是" + +#: SettingsEditor.cs:1697 +msgid "No" +msgstr "否" + +#: SettingsEditor.cs:1716 +msgid "FMOD Asset Sub Folder" +msgstr "FMOD 资产子文件夹" + +#: SettingsEditor.cs:1721 +msgid "FMOD Bank Sub Folder" +msgstr "FMOD 事件库子文件夹" + +#: SettingsEditor.cs:1735 +msgid "Event Linkage" +msgstr "事件连接方式" + +#: SettingsEditor.cs:1740 +msgid "Behavior" +msgstr "行为" + +#: SettingsEditor.cs:1745 +msgid "Stop Events Outside Max Distance" +msgstr "停止超出最大距离的事件" + +#: SettingsEditor.cs:1752 +msgid "User Interface" +msgstr "用户界面" + +#: SettingsEditor.cs:1758 +msgid "Meter Channel Ordering" +msgstr "计量声道顺序" + +#: SettingsEditor.cs:1771 +msgid "Initialization" +msgstr "初始化" + +#: SettingsEditor.cs:1775 +msgid "Logging Level" +msgstr "日志级别" + +#: SettingsEditor.cs:1779 +msgid "Enable API Error Logging" +msgstr "启用 API 错误日志记录" + +#: SettingsEditor.cs:1781 +msgid "Enable Memory Tracking" +msgstr "启用内存追踪" + +#: SettingsEditor.cs:1785 +msgid "Load Banks" +msgstr "加载事件库" + +#: SettingsEditor.cs:1805 +msgid "Load Bank Sample Data" +msgstr "加载事件库样本数据" + +#: SettingsEditor.cs:1808 +msgid "Bank Encryption Key" +msgstr "事件库加密密钥" + +#: SettingsEditor.cs:1816 +msgid "Specified Banks" +msgstr "指定的事件库" + +#: SettingsEditor.cs:1830 +msgid "Locate Bank" +msgstr "定位事件库" + +#: SettingsEditor.cs:1895 +msgid "Platform Specific" +msgstr "平台设置" + +#: SettingsEditor.cs:2046 SettingsEditor.cs:2089 +msgid "New Group" +msgstr "新建组" + +#: SettingsEditor.cs:2200 +msgid "Double-click to rename" +msgstr "双击重命名" + +#: SettingsEditor.cs:2362 +msgid "Change FMOD Platform Inheritance" +msgstr "更改 FMOD 平台继承" + +#: SettingsEditor.cs:2421 SettingsEditor.cs:2438 +msgid "Set FMOD Platform Inheritance" +msgstr "设置 FMOD 平台继承" + +#: SettingsEditor.cs:2691 +msgid "Show Status Window" +msgstr "显示状态窗口" + +#: SettingsEditor.cs:2713 +msgid "Locate Studio Project" +msgstr "定位 Studio 项目" + +#: SettingsEditor.cs:2739 +msgid "Locate Build Folder" +msgstr "定位构建文件夹" + +#: SetupWizard.cs:19 +msgid "Welcome" +msgstr "欢迎" + +#: SetupWizard.cs:20 +msgid "Updating" +msgstr "更新" + +#: SetupWizard.cs:21 +msgid "Linking" +msgstr "连接" + +#: SetupWizard.cs:22 +msgid "Listener" +msgstr "监听器" + +#: SetupWizard.cs:23 +msgid "Unity Audio" +msgstr "Unity音频" + +#: SetupWizard.cs:24 +msgid "Unity Sources" +msgstr "Unity音频源" + +#: SetupWizard.cs:25 +msgid "Source Control" +msgstr "版本控制" + +#: SetupWizard.cs:26 +msgid "End" +msgstr "完成" + +#: SetupWizard.cs:34 +msgid "Reorganize Plugin Files" +msgstr "重新组织插件文件" + +#: SetupWizard.cs:35 +msgid "Move FMOD for Unity files to match the latest layout." +msgstr "移动 FMOD for Unity 文件以匹配最新布局。" + +#: SetupWizard.cs:41 +msgid "Update Event References" +msgstr "更新事件引用" + +#: SetupWizard.cs:42 +msgid "Find event references that use the obsolete [EventRef] attribute and update them to use the EventReference type." +msgstr "查找使用过时的 [EventRef] 属性的事件引用并将它们更新为使用 EventReference 类型。" + +#: SetupWizard.cs:210 +msgid "FMOD Setup Wizard" +msgstr "FMOD 设置向导" + +#: SetupWizard.cs:325 +msgid "Do not display this again" +msgstr "不再显示此消息" + +#: SetupWizard.cs:420 SetupWizard.cs:895 +#, csharp-format +msgid "Welcome to FMOD for Unity {0}." +msgstr "欢迎来到 FMOD for Unity {0}。" + +#: SetupWizard.cs:427 +msgid "This setup wizard will help you configure your project to use FMOD." +msgstr "此设置向导将帮助您配置项目以使用 FMOD。" + +#: SetupWizard.cs:463 +msgid "If you are updating an existing FMOD installation, you may need to perform some update tasks." +msgstr "如果您正在更新已安装的FMOD,您可能需要执行一些更新任务。" + +#: SetupWizard.cs:467 +msgid "Choose an update task to perform:" +msgstr "选择要执行的更新任务:" + +#: SetupWizard.cs:509 +msgid "In order to access your FMOD Studio content you need to locate the FMOD Studio Project or the .bank files that FMOD Studio produces, and configure a few other settings." +msgstr "要访问您的 FMOD Studio 内容,您需要找到 FMOD Studio 项目或 FMOD Studio 生成的 .bank 文件,并配置一些其他设置。" + +#: SetupWizard.cs:531 +msgid "If you have the complete FMOD Studio Project." +msgstr "如果您拥有完整的 FMOD Studio 项目。" + +#: SetupWizard.cs:542 +msgid "If you have the contents of the Build folder for a single platform." +msgstr "如果您拥有单平台的构建文件夹内容。" + +#: SetupWizard.cs:554 +msgid "If you have the contents of the Build folder for multiple platforms, with each platform in its own subdirectory." +msgstr "如果您拥有多平台的构建文件夹内容,且每个平台都有自己的子目录。" + +#: SetupWizard.cs:581 +msgid "Using the FMOD Studio project at:" +msgstr "使用 FMOD Studio 项目于:" + +#: SetupWizard.cs:586 +msgid "Using the multiple platform build at:" +msgstr "使用多平台 Build 于:" + +#: SetupWizard.cs:591 +msgid "Using the single platform build at:" +msgstr "使用单平台构建于:" + +#: SetupWizard.cs:607 +msgid "If you do not intend to use the built in Unity audio, you can choose to replace the Audio Listener with the FMOD Studio Listener.\n" +msgstr "如果您不打算使用内置的 Unity 音频,您可以选择将 Audio 监听替换为 FMOD Studio 监听器。\n" + +#: SetupWizard.cs:608 +msgid "Adding the FMOD Studio Listener component to the main camera provides the FMOD Engine with the information it needs to play 3D events correctly." +msgstr "将 FMOD Studio 监听器组件添加到主摄像机中,可以为 FMOD 引擎提供正确播放 3D 事件所需的信息。" + +#: SetupWizard.cs:631 +msgid "Replace Unity Listener(s) with FMOD Audio Listener." +msgstr "将 Unity 监听器替换成 FMOD 监听器。" + +#: SetupWizard.cs:669 SetupWizard.cs:693 +msgid " Listener(s) found: " +msgstr "监听器数量:" + +#: SetupWizard.cs:703 +msgid "We recommend that you disable the built-in Unity audio for all platforms, to prevent it from consuming system audio resources that the FMOD Engine needs." +msgstr "我们建议您为所有平台禁用内置的 Unity 音频,以防止它消耗 FMOD 引擎所需的系统音频资源。" + +#: SetupWizard.cs:715 +msgid "Built in audio has been disabled" +msgstr "内置音频已被禁用" + +#: SetupWizard.cs:715 +msgid "Disable built in audio" +msgstr "禁用内置音频" + +#: SetupWizard.cs:735 +msgid "" +"Listed below are all the Unity Audio Sources found in the currently loaded scenes and the Assets directory.\n" +"Select an Audio Source and replace it with an FMOD Studio Event Emitter." +msgstr "" +"以下列出了当前加载的场景和 Assets 目录中找到的所有 Unity 音频源。\n" +"选择一个音频源并将其替换为 FMOD Studio Event Emitter 。" + +#: SetupWizard.cs:752 +msgid "No Unity Audio Sources have been found!" +msgstr "未找到任何 Unity 音频源!" + +#: SetupWizard.cs:759 +msgid "There are a number of files produced by FMOD for Unity that should be ignored by source control. Here is an example of what you should add to your source control ignore file:" +msgstr "FMOD for Unity 生成的一些文件应被版本控制忽略。以下是您应添加到版本控制忽略文件中的示例:" + +#: SetupWizard.cs:802 +msgid "FMOD for Unity has been set up successfully!" +msgstr "FMOD for Unity 已成功设置!" + +#: SetupWizard.cs:808 +msgid "FMOD for Unity has been partially set up." +msgstr "FMOD for Unity 已部分设置完成。" + +#: SetupWizard.cs:813 +msgid "" +"FMOD for Unity has not finished being set up.\n" +"Linking to a project or banks is required." +msgstr "" +"FMOD for Unity 尚未完成设置。\n" +"需要链接到项目或事件库。" + +#: SetupWizard.cs:824 +msgid " Integration Manual " +msgstr " 集成手册 " + +#: SetupWizard.cs:837 +msgid " FMOD Settings " +msgstr " FMOD 设置" + +#: SetupWizard.cs:863 +msgid "Back" +msgstr "返回" + +#: SetupWizard.cs:873 +msgid "Start" +msgstr "开始" + +#: SetupWizard.cs:875 +msgid "Next" +msgstr "下一项" + +#: SetupWizard.cs:903 +msgid "To complete the installation, we need to update the FMOD native libraries.\n" +msgstr "要完成安装,我们需要更新 FMOD 原生库。\n" + +#: SetupWizard.cs:904 +msgid "This involves a few steps:" +msgstr "这包括以下几个步骤:" + +#: SetupWizard.cs:933 +msgid "Next step:" +msgstr "下一步:" + +#: SetupWizard.cs:1135 +msgid "Expand All" +msgstr "全部展开" + +#: SetupWizard.cs:1140 +msgid "Collapse All" +msgstr "全部折叠" + +#: StudioBankLoaderEditor.cs:18 +msgid "Load" +msgstr "加载" + +#: StudioBankLoaderEditor.cs:19 +msgid "Unload" +msgstr "卸载" + +#: StudioBankLoaderEditor.cs:27 StudioEventEmitterEditor.cs:122 +msgid "Preload Sample Data" +msgstr "预加载样本数据" + +#: StudioBankLoaderEditor.cs:32 +msgid "Add Bank" +msgstr "添加事件库" + +#: StudioBankLoaderEditor.cs:40 +msgid "Select FMOD Bank" +msgstr "选择 FMOD 事件库" + +#: StudioEventEmitterEditor.cs:56 +msgid "Event Play Trigger" +msgstr "事件播放触发器" + +#: StudioEventEmitterEditor.cs:57 +msgid "Event Stop Trigger" +msgstr "事件停止触发器" + +#: StudioEventEmitterEditor.cs:87 +msgid "Override Attenuation" +msgstr "覆盖衰减" + +#: StudioEventEmitterEditor.cs:119 +msgid "Advanced Controls" +msgstr "高级控制" + +#: StudioEventEmitterEditor.cs:123 +msgid "Allow Fadeout When Stopping" +msgstr "允许停止时淡出" + +#: StudioEventEmitterEditor.cs:124 +msgid "Trigger Once" +msgstr "触发一次" + +#: StudioEventEmitterEditor.cs:125 StudioListenerEditor.cs:28 +msgid "Non-Rigidbody Velocity" +msgstr "非刚体速度" + +#: StudioEventEmitterEditor.cs:265 +msgid "Initial Parameter Values" +msgstr "初始参数值" + +#: StudioEventEmitterEditor.cs:465 +#, csharp-format +msgid "Set to Value of '{0}'" +msgstr "设置为 '{0}' 的值" + +#: StudioGlobalParameterTriggerEditor.cs:40 +msgid "Parameter Not Found" +msgstr "未找到参数" + +#: StudioGlobalParameterTriggerEditor.cs:43 StudioParameterTriggerEditor.cs:63 +msgid "Trigger" +msgstr "触发器" + +#: StudioGlobalParameterTriggerEditor.cs:49 +msgid "Parameter" +msgstr "参数" + +#: StudioGlobalParameterTriggerEditor.cs:70 +msgid "Override Value" +msgstr "覆盖值" + +#: StudioListenerEditor.cs:24 +msgid "Listener Index" +msgstr "监听器索引" + +#: StudioListenerEditor.cs:27 +msgid "Attenuation Object" +msgstr "衰减对象" diff --git a/Assets/Plugins/FMOD/src/Editor/zh_hans.po.meta b/Assets/Plugins/FMOD/src/Editor/zh_hans.po.meta new file mode 100644 index 00000000..59feb2ca --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/zh_hans.po.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6bc0be9e3a234d3429dfe763083ef8a9 +LocalizationImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/EventHandler.cs b/Assets/Plugins/FMOD/src/EventHandler.cs new file mode 100644 index 00000000..8a379a4f --- /dev/null +++ b/Assets/Plugins/FMOD/src/EventHandler.cs @@ -0,0 +1,127 @@ +using UnityEngine; +using UnityEngine.EventSystems; + +namespace FMODUnity +{ + public abstract class EventHandler : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler + { + public string CollisionTag = ""; + + protected virtual void Start() + { + HandleGameEvent(EmitterGameEvent.ObjectStart); + } + + protected virtual void OnDestroy() + { + HandleGameEvent(EmitterGameEvent.ObjectDestroy); + } + + private void OnEnable() + { + HandleGameEvent(EmitterGameEvent.ObjectEnable); + } + + private void OnDisable() + { + HandleGameEvent(EmitterGameEvent.ObjectDisable); + } + + #if UNITY_PHYSICS_EXIST + private void OnTriggerEnter(Collider other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag) || (other.attachedRigidbody && other.attachedRigidbody.CompareTag(CollisionTag))) + { + HandleGameEvent(EmitterGameEvent.TriggerEnter); + } + } + + private void OnTriggerExit(Collider other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag) || (other.attachedRigidbody && other.attachedRigidbody.CompareTag(CollisionTag))) + { + HandleGameEvent(EmitterGameEvent.TriggerExit); + } + } + #endif + + #if UNITY_PHYSICS2D_EXIST + private void OnTriggerEnter2D(Collider2D other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(EmitterGameEvent.TriggerEnter2D); + } + } + + private void OnTriggerExit2D(Collider2D other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(EmitterGameEvent.TriggerExit2D); + } + } + #endif + + private void OnCollisionEnter() + { + HandleGameEvent(EmitterGameEvent.CollisionEnter); + } + + private void OnCollisionExit() + { + HandleGameEvent(EmitterGameEvent.CollisionExit); + } + + private void OnCollisionEnter2D() + { + HandleGameEvent(EmitterGameEvent.CollisionEnter2D); + } + + private void OnCollisionExit2D() + { + HandleGameEvent(EmitterGameEvent.CollisionExit2D); + } + + private void OnMouseEnter() + { + HandleGameEvent(EmitterGameEvent.ObjectMouseEnter); + } + + private void OnMouseExit() + { + HandleGameEvent(EmitterGameEvent.ObjectMouseExit); + } + + private void OnMouseDown() + { + HandleGameEvent(EmitterGameEvent.ObjectMouseDown); + } + + private void OnMouseUp() + { + HandleGameEvent(EmitterGameEvent.ObjectMouseUp); + } + + public void OnPointerEnter(PointerEventData eventData) + { + HandleGameEvent(EmitterGameEvent.UIMouseEnter); + } + + public void OnPointerExit(PointerEventData eventData) + { + HandleGameEvent(EmitterGameEvent.UIMouseExit); + } + public void OnPointerDown(PointerEventData eventData) + { + HandleGameEvent(EmitterGameEvent.UIMouseDown); + } + + public void OnPointerUp(PointerEventData eventData) + { + HandleGameEvent(EmitterGameEvent.UIMouseUp); + } + + protected abstract void HandleGameEvent(EmitterGameEvent gameEvent); + } +} diff --git a/Assets/Plugins/FMOD/src/EventHandler.cs.meta b/Assets/Plugins/FMOD/src/EventHandler.cs.meta new file mode 100644 index 00000000..5ceb10f3 --- /dev/null +++ b/Assets/Plugins/FMOD/src/EventHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a28d1e1a42561ed4f8d44293dab99079 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/EventRefAttribute.cs b/Assets/Plugins/FMOD/src/EventRefAttribute.cs new file mode 100644 index 00000000..bb11a3f1 --- /dev/null +++ b/Assets/Plugins/FMOD/src/EventRefAttribute.cs @@ -0,0 +1,11 @@ +using System; +using UnityEngine; + +namespace FMODUnity +{ + [Obsolete("Use the EventReference struct instead")] + public class EventRefAttribute : PropertyAttribute + { + public string MigrateTo = null; + } +} diff --git a/Assets/Plugins/FMOD/src/EventRefAttribute.cs.meta b/Assets/Plugins/FMOD/src/EventRefAttribute.cs.meta new file mode 100644 index 00000000..96cb1d9e --- /dev/null +++ b/Assets/Plugins/FMOD/src/EventRefAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1b29a1189268c3b47aa2ec4b96a9e7ef +timeCreated: 1445311748 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/EventReference.cs b/Assets/Plugins/FMOD/src/EventReference.cs new file mode 100644 index 00000000..b317f52f --- /dev/null +++ b/Assets/Plugins/FMOD/src/EventReference.cs @@ -0,0 +1,53 @@ +using System; +using UnityEngine; + +namespace FMODUnity +{ + [Serializable] + public struct EventReference + { + public FMOD.GUID Guid; + +#if UNITY_EDITOR + public string Path; + + public static Func GuidLookupDelegate; + + public override string ToString() + { + return string.Format("{0} ({1})", Guid, Path); + } + + public bool IsNull + { + get + { + return string.IsNullOrEmpty(Path) && Guid.IsNull; + } + } + + public static EventReference Find(string path) + { + if (GuidLookupDelegate == null) + { + throw new InvalidOperationException("EventReference.Find called before EventManager was initialized"); + } + + return new EventReference { Path = path, Guid = GuidLookupDelegate(path) }; + } +#else + public override string ToString() + { + return Guid.ToString(); + } + + public bool IsNull + { + get + { + return Guid.IsNull; + } + } +#endif + } +} diff --git a/Assets/Plugins/FMOD/src/EventReference.cs.meta b/Assets/Plugins/FMOD/src/EventReference.cs.meta new file mode 100644 index 00000000..008d9b68 --- /dev/null +++ b/Assets/Plugins/FMOD/src/EventReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b1e4da3fb15e7a45a8f104b7d0fd6d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/FMODEventPlayable.cs b/Assets/Plugins/FMOD/src/FMODEventPlayable.cs new file mode 100644 index 00000000..714b463f --- /dev/null +++ b/Assets/Plugins/FMOD/src/FMODEventPlayable.cs @@ -0,0 +1,360 @@ +#if UNITY_TIMELINE_EXIST + +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; +using UnityEngine.Serialization; + +namespace FMODUnity +{ + [System.Serializable] + public class FMODEventPlayable : PlayableAsset, ITimelineClipAsset + { + [FormerlySerializedAs("template")] + public FMODEventPlayableBehavior Template = new FMODEventPlayableBehavior(); + + [FormerlySerializedAs("eventLength")] + public float EventLength; //In seconds. + + [Obsolete("Use the eventReference field instead")] + [SerializeField] + public string eventName; + + [FormerlySerializedAs("eventReference")] + [SerializeField] + public EventReference EventReference; + + [FormerlySerializedAs("stopType")] + [SerializeField] + public STOP_MODE StopType; + + [FormerlySerializedAs("parameters")] + [SerializeField] + public ParamRef[] Parameters = new ParamRef[0]; + + [NonSerialized] + public bool CachedParameters = false; + + public static event System.EventHandler OnCreatePlayable; + + private FMODEventPlayableBehavior behavior; + + public GameObject TrackTargetObject { get; set; } + + public override double duration + { + get + { + if (EventReference.IsNull) + { + return base.duration; + } + else + { + return EventLength; + } + } + } + + public ClipCaps clipCaps + { + get { return ClipCaps.None; } + } + + public TimelineClip OwningClip { get; set; } + + public void LinkParameters(FMOD.Studio.EventDescription eventDescription) + { +#if UNITY_EDITOR + if (!EventReference.IsNull) +#else + if (!CachedParameters && !EventReference.IsNull) +#endif + { + for (int i = 0; i < Parameters.Length; i++) + { + FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription; + eventDescription.getParameterDescriptionByName(Parameters[i].Name, out parameterDescription); + Parameters[i].ID = parameterDescription.id; + } + + List parameterLinks = Template.ParameterLinks; + + for (int i = 0; i < parameterLinks.Count; i++) + { + FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription; + eventDescription.getParameterDescriptionByName(parameterLinks[i].Name, out parameterDescription); + parameterLinks[i].ID = parameterDescription.id; + } + + CachedParameters = true; + } + } + + public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) + { + if (Application.isPlaying) + { + LinkParameters(RuntimeManager.GetEventDescription(EventReference)); + } + else + { + // Handled by the editor auditioning system. + EventArgs args = new EventArgs(); + OnCreatePlayable.Invoke(this, args); + } + + var playable = ScriptPlayable.Create(graph, Template); + behavior = playable.GetBehaviour(); + + behavior.TrackTargetObject = TrackTargetObject; + behavior.EventReference = EventReference; + behavior.StopType = StopType; + behavior.Parameters = Parameters; + behavior.OwningClip = OwningClip; + + return playable; + } + +#if UNITY_EDITOR + public void UpdateEventDuration(float duration) + { + EventLength = duration / 1000f; + } + + public void OnValidate() + { + if (OwningClip != null) + { + if (EventReference.IsNull) + { + OwningClip.displayName = "FMODEventPlayable"; + } + else + { + int index = EventReference.Path.LastIndexOf("/"); + OwningClip.displayName = EventReference.Path.Substring(index + 1); + } + } + if (behavior != null) + { + behavior.EventReference = EventReference; + } + } +#endif //UNITY_EDITOR + } + + public enum STOP_MODE : int + { + AllowFadeout, + Immediate, + None + } + + [Serializable] + public class ParameterAutomationLink + { + public string Name; + public FMOD.Studio.PARAMETER_ID ID; + public int Slot; + } + + [Serializable] + public class FMODEventPlayableBehavior : PlayableBehaviour + { + public FMODEventPlayableBehavior() + { + CurrentVolume = 1; + } + + public class EventArgs : System.EventArgs + { + public FMOD.Studio.EventInstance eventInstance { get; set; } + } + + public static event System.EventHandler Enter; + public static event System.EventHandler Exit; + public static event System.EventHandler GraphStop; + + [FormerlySerializedAs("eventReference")] + public EventReference EventReference; + + [FormerlySerializedAs("stopType")] + public STOP_MODE StopType = STOP_MODE.AllowFadeout; + + [FormerlySerializedAs("parameters")] + [NotKeyable] + public ParamRef[] Parameters = new ParamRef[0]; + + [FormerlySerializedAs("parameterLinks")] + public List ParameterLinks = new List(); + + [NonSerialized] + public GameObject TrackTargetObject; + + [NonSerialized] + public TimelineClip OwningClip; + + [FormerlySerializedAs("parameterAutomation")] + public AutomatableSlots ParameterAutomation; + + private bool isPlayheadInside = false; + + private FMOD.Studio.EventInstance eventInstance; + + public float ClipStartTime { get; private set; } = 0.0f; + + public float CurrentVolume { get; private set; } + + protected void PlayEvent() + { + if (!EventReference.IsNull) + { + eventInstance = RuntimeManager.CreateInstance(EventReference); + + // Only attach to object if the game is actually playing, not auditioning. + if (Application.isPlaying && TrackTargetObject) + { +#if UNITY_PHYSICS_EXIST + if (TrackTargetObject.GetComponent()) + { + RuntimeManager.AttachInstanceToGameObject(eventInstance, TrackTargetObject, TrackTargetObject.GetComponent()); + } + else +#endif +#if UNITY_PHYSICS2D_EXIST + if (TrackTargetObject.GetComponent()) + { + RuntimeManager.AttachInstanceToGameObject(eventInstance, TrackTargetObject, TrackTargetObject.GetComponent()); + } + else +#endif + { + RuntimeManager.AttachInstanceToGameObject(eventInstance, TrackTargetObject); + } + } + else + { + eventInstance.set3DAttributes(RuntimeUtils.To3DAttributes(Vector3.zero)); + } + + foreach (var param in Parameters) + { + eventInstance.setParameterByID(param.ID, param.Value); + } + + eventInstance.setVolume(CurrentVolume); + eventInstance.setTimelinePosition((int)(ClipStartTime * 1000.0f)); + eventInstance.start(); + } + } + + protected virtual void OnEnter() + { + if (!isPlayheadInside) + { + isPlayheadInside = true; + + if (Application.isPlaying) + { + PlayEvent(); + } + else + { + // Handled by the editor auditioning system. + EventArgs args = new EventArgs(); + Enter.Invoke(this, args); + eventInstance = args.eventInstance; + } + } + } + + protected virtual void OnExit() + { + if (isPlayheadInside) + { + isPlayheadInside = false; + + if (Application.isPlaying) + { + if (eventInstance.isValid()) + { + if (StopType != STOP_MODE.None) + { + eventInstance.stop(StopType == STOP_MODE.Immediate ? FMOD.Studio.STOP_MODE.IMMEDIATE : FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + } + eventInstance.release(); + eventInstance.clearHandle(); + } + } + else + { + // Handled by the editor auditioning system. + EventArgs args = new EventArgs(); + args.eventInstance = eventInstance; + Exit.Invoke(this, args); + } + } + } + + public override void ProcessFrame(Playable playable, FrameData info, object playerData) + { + if (eventInstance.isValid()) + { + foreach (ParameterAutomationLink link in ParameterLinks) + { + float value = ParameterAutomation.GetValue(link.Slot); + eventInstance.setParameterByID(link.ID, value); + } + } + } + + public void UpdateBehavior(float time, float volume) + { + if (volume != CurrentVolume) + { + CurrentVolume = volume; + + if (eventInstance.isValid()) + { + eventInstance.setVolume(volume); + } + } + + if ((time >= OwningClip.start) && (time < OwningClip.end)) + { + ClipStartTime = time - (float)OwningClip.start; + OnEnter(); + } + else + { + OnExit(); + } + } + + public override void OnGraphStop(Playable playable) + { + isPlayheadInside = false; + + if (Application.isPlaying) + { + if (eventInstance.isValid()) + { + eventInstance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); + eventInstance.release(); + RuntimeManager.StudioSystem.update(); + } + } + else + { + // Handled by the editor auditioning system. + EventArgs args = new EventArgs(); + args.eventInstance = eventInstance; + GraphStop.Invoke(this, args); + } + } + } +} +#endif diff --git a/Assets/Plugins/FMOD/src/FMODEventPlayable.cs.meta b/Assets/Plugins/FMOD/src/FMODEventPlayable.cs.meta new file mode 100644 index 00000000..125fd1f2 --- /dev/null +++ b/Assets/Plugins/FMOD/src/FMODEventPlayable.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 987a467495df9d942b56b1b51381d095 +timeCreated: 1523230466 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 392af304825cbe847bbf4e603852e4dd, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/FMODEventTrack.cs b/Assets/Plugins/FMOD/src/FMODEventTrack.cs new file mode 100644 index 00000000..aabc4ecd --- /dev/null +++ b/Assets/Plugins/FMOD/src/FMODEventTrack.cs @@ -0,0 +1,73 @@ +#if UNITY_TIMELINE_EXIST + +using System; +using System.ComponentModel; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace FMODUnity +{ + [TrackColor(0.066f, 0.134f, 0.244f)] + [TrackClipType(typeof(FMODEventPlayable))] + [TrackBindingType(typeof(GameObject))] + [DisplayName("FMOD/Event Track")] + public class FMODEventTrack : TrackAsset + { + public FMODEventMixerBehaviour template = new FMODEventMixerBehaviour(); + + public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) + { + var director = go.GetComponent(); + var trackTargetObject = director.GetGenericBinding(this) as GameObject; + + foreach (var clip in GetClips()) + { + var playableAsset = clip.asset as FMODEventPlayable; + + if (playableAsset) + { + playableAsset.TrackTargetObject = trackTargetObject; + playableAsset.OwningClip = clip; + } + } + + var scriptPlayable = ScriptPlayable.Create(graph, template, inputCount); + return scriptPlayable; + } + } + + [Serializable] + public class FMODEventMixerBehaviour : PlayableBehaviour + { + [Range(0, 1)] + public float volume = 1; + + public override void ProcessFrame(Playable playable, FrameData info, object playerData) + { +#if UNITY_EDITOR + /* + * Process frame is called from OnGUI() when auditioning. + * Check playing to avoid retriggering sounds while scrubbing or repainting. + */ + bool playing = playable.GetGraph().IsPlaying(); + if (!playing) + { + return; + } +#endif //UNITY_EDITOR + + int inputCount = playable.GetInputCount(); + float time = (float)playable.GetGraph().GetRootPlayable(0).GetTime(); + + for (int i = 0; i < inputCount; i++) + { + ScriptPlayable inputPlayable = (ScriptPlayable)playable.GetInput(i); + FMODEventPlayableBehavior input = inputPlayable.GetBehaviour(); + + input.UpdateBehavior(time, volume); + } + } + } +} +#endif diff --git a/Assets/Plugins/FMOD/src/FMODEventTrack.cs.meta b/Assets/Plugins/FMOD/src/FMODEventTrack.cs.meta new file mode 100644 index 00000000..1abbd38f --- /dev/null +++ b/Assets/Plugins/FMOD/src/FMODEventTrack.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 133253f56854570409c222a87786b263 +timeCreated: 1523230466 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: a4edfa5854cdec34b98b1c55f0562bdd, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/FMODRuntimeManagerOnGUIHelper.cs b/Assets/Plugins/FMOD/src/FMODRuntimeManagerOnGUIHelper.cs new file mode 100644 index 00000000..a2518db6 --- /dev/null +++ b/Assets/Plugins/FMOD/src/FMODRuntimeManagerOnGUIHelper.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace FMODUnity +{ + public class FMODRuntimeManagerOnGUIHelper : MonoBehaviour + { + public RuntimeManager TargetRuntimeManager = null; + + private void OnGUI() + { + if (TargetRuntimeManager) + { + TargetRuntimeManager.ExecuteOnGUI(); + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/FMODRuntimeManagerOnGUIHelper.cs.meta b/Assets/Plugins/FMOD/src/FMODRuntimeManagerOnGUIHelper.cs.meta new file mode 100644 index 00000000..f2b59e1a --- /dev/null +++ b/Assets/Plugins/FMOD/src/FMODRuntimeManagerOnGUIHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4417faacebce0de4fbde25ec23055cf4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/ParamRef.cs b/Assets/Plugins/FMOD/src/ParamRef.cs new file mode 100644 index 00000000..0d0927f0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/ParamRef.cs @@ -0,0 +1,12 @@ +using System; + +namespace FMODUnity +{ + [Serializable] + public class ParamRef + { + public string Name; + public float Value; + public FMOD.Studio.PARAMETER_ID ID; + } +} diff --git a/Assets/Plugins/FMOD/src/ParamRef.cs.meta b/Assets/Plugins/FMOD/src/ParamRef.cs.meta new file mode 100644 index 00000000..43c1ef36 --- /dev/null +++ b/Assets/Plugins/FMOD/src/ParamRef.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 00e1a9817a5d9844796d7c313b1ab197 +timeCreated: 1444192631 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/ParamRefAttribute.cs b/Assets/Plugins/FMOD/src/ParamRefAttribute.cs new file mode 100644 index 00000000..0ffb2a09 --- /dev/null +++ b/Assets/Plugins/FMOD/src/ParamRefAttribute.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace FMODUnity +{ + public class ParamRefAttribute : PropertyAttribute + { + } +} diff --git a/Assets/Plugins/FMOD/src/ParamRefAttribute.cs.meta b/Assets/Plugins/FMOD/src/ParamRefAttribute.cs.meta new file mode 100644 index 00000000..17046084 --- /dev/null +++ b/Assets/Plugins/FMOD/src/ParamRefAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ae6224668d1647429723f89e10d593f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Platform.cs b/Assets/Plugins/FMOD/src/Platform.cs new file mode 100644 index 00000000..62666b07 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Platform.cs @@ -0,0 +1,1036 @@ +using System; +using System.Linq; +using System.Reflection; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Serialization; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMOD +{ + public partial class VERSION + { +#if DEVELOPMENT_BUILD + public const string dllSuffix = "L"; +#else + public const string dllSuffix = ""; +#endif + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { +#if DEVELOPMENT_BUILD + public const string dllSuffix = "L"; +#else + public const string dllSuffix = ""; +#endif + } +} + +namespace FMODUnity +{ + public class PlatformCallbackHandler : ScriptableObject + { + // A hook for custom initialization logic. RuntimeManager.Initialize calls this + // just before calling system.Initialize. + // Call reportResult() with the result of each FMOD call to use FMOD's error handling logic. + public virtual void PreInitialize(FMOD.Studio.System system, Action reportResult) + { + } + } + + // This class holds per-platform settings and provides hooks for platform-specific behaviour. + // Each platform has a parent platform, forming a hierarchy that is rooted at PlatformDefault. + // By default a platform inherits all of its properties from its parent platform; this behaviour + // can be overridden for each property. + // + // There is at least one concrete derived class for each supported platform; these classes use + // [InitializeOnLoad] and a static constructor to register themselves as supported platforms by + // calling Settings.AddPlatformTemplate. The user can also create instances of the PlatformGroup + // class and use them to group platforms that have settings in common. + public abstract class Platform : ScriptableObject + { + internal const float DefaultPriority = 0; + +#if UNITY_EDITOR + internal const int MaximumCoreCount = 16; + + internal static readonly FileLayout[] OldFileLayouts = { + FileLayout.Release_1_10, + FileLayout.Release_2_0, + FileLayout.Release_2_1, + }; +#endif + + // These need to match the function called by LoadStaticPlugins + internal const string RegisterStaticPluginsClassName = "StaticPluginManager"; + internal const string RegisterStaticPluginsFunctionName = "Register"; + + // This is a persistent identifier. It is used: + // * To link platforms together at load time + // * To avoid creating duplicate platforms from templates (in Settings.OnEnable) + // * As a key for SettingsEditor UI state + // It should be kept stable for concrete platforms (like PlatformWindows) to support + // settings migration in the future. + [SerializeField] + private string identifier; + + [SerializeField] + private string parentIdentifier; + + [SerializeField] + private bool active = false; + + [SerializeField] + protected PropertyStorage Properties = new PropertyStorage(); + + [SerializeField] + [FormerlySerializedAs("outputType")] + internal string OutputTypeName; + + private static List StaticThreadAffinities = new List(); + + [SerializeField] + private PropertyThreadAffinityList threadAffinities = new PropertyThreadAffinityList(); + +#if UNITY_EDITOR + [SerializeField] + private float displaySortOrder; + + [SerializeField] + private List childIdentifiers = new List(); +#else + // The parent platform from which this platform inherits its property values. + [NonSerialized] + public Platform Parent; +#endif + + internal string Identifier + { + get + { + return identifier; + } + + set + { + identifier = value; + } + } + + // The display name to show for this platform in the UI. + internal abstract string DisplayName { get; } + + // Declares the Unity RuntimePlatforms this platform implements. + internal abstract void DeclareRuntimePlatforms(Settings settings); + +#if UNITY_EDITOR + // The Unity BuildTargets this platform implements. + // Returns BuildTarget.NoTarget if the correct value is not defined, as some BuildTarget + // values are only defined in specific circumstances (e.g. Stadia required Unity 2019.3). + internal abstract IEnumerable GetBuildTargets(); + + // The old FMOD platform identifier that this platform corresponds to, for settings migration. + internal abstract Legacy.Platform LegacyIdentifier { get; } +#endif + + // The priority to use when finding a platform to support the current Unity runtime + // platform (higher priorities are tried first). + internal virtual float Priority { get { return DefaultPriority; } } + + // Determines whether this platform matches the current environment. When more than one + // platform implements the current Unity runtime platform, FMOD for Unity will use the + // highest-priority platform that returns true from MatchesCurrentEnvironment. + internal virtual bool MatchesCurrentEnvironment { get { return true; } } + + // Whether this platform is a fixed part of the FMOD for Unity settings, or can be + // added/removed by the user. + internal virtual bool IsIntrinsic { get { return false; } } + + // A hook for platform-specific initialization logic. RuntimeManager.Initialize calls this + // before calling FMOD.Studio.System.create. + internal virtual void PreSystemCreate(Action reportResult) + { + } + + // A hook for platform-specific initialization logic. RuntimeManager.Initialize calls this + // just before calling studioSystem.Initialize. + internal virtual void PreInitialize(FMOD.Studio.System studioSystem) + { + } + + // The folder in which FMOD .bank files are stored. Used when loading banks. + internal virtual string GetBankFolder() + { + return Application.streamingAssetsPath; + } + +#if UNITY_EDITOR + [Flags] + public enum BinaryType + { + Release = 1, + Logging = 2, + Optional = 4, + AllVariants = 8, + All = Release | Logging | Optional | AllVariants + } + + protected virtual IEnumerable GetBinaryPaths(BuildTarget buildTarget, BinaryType binaryType, string prefix) + { + foreach (BinaryFileInfo info in GetBinaryFileInfo(buildTarget, binaryType)) + { + yield return info.LatestLocation(); + } + } + + internal abstract class FileInfo + { + public FileInfo(FileRecord fileRecord, BinaryType type) + { + this.fileRecord = fileRecord; + this.type = type; + } + + public readonly BinaryType type; + + private readonly FileRecord fileRecord; + + public string LatestLocation() + { + return GetLocation(FileLayout.Latest); + } + + public IEnumerable OldLocations() + { + foreach (FileLayout layout in OldFileLayouts) + { + string location = GetLocation(layout); + + if (location != null) + { + yield return location; + } + } + } + + private string GetLocation(FileLayout layout) + { + string basePath = GetBasePath(layout); + + if (basePath == null) + { + return null; + } + + bool absolute; + string path; + fileRecord.GetPath(layout, out path, out absolute); + + if (absolute) + { + return path; + } + else + { + return string.Format("{0}/{1}", basePath, path); + } + } + + protected abstract string GetBasePath(FileLayout layout); + } + + internal class BinaryFileInfo : FileInfo + { + public BinaryFileInfo(Platform platform, FileRecord fileRecord, BuildTarget buildTarget, BinaryType type) + : base(fileRecord, type) + { + this.platform = platform; + this.buildTarget = buildTarget; + } + + private readonly Platform platform; + private readonly BuildTarget buildTarget; + + protected override string GetBasePath(FileLayout layout) + { + BinaryAssetFolderInfo info = platform.GetBinaryAssetFolder(buildTarget); + + if (layout < info.oldestLayout) + { + return null; + } + + switch (layout) + { + case FileLayout.Release_1_10: + return info.path_1_10; + case FileLayout.Release_2_0: + return string.Format("Assets/Plugins/FMOD/lib/{0}", info.baseName); + case FileLayout.Release_2_1: + case FileLayout.Release_2_2: + return $"{RuntimeUtils.PluginBasePath}/platforms/{info.baseName}/lib"; + default: + throw new ArgumentException("Unrecognised file layout: " + layout); + } + } + } + + public struct FileRecord + { + public FileRecord(string latestPath) + { + this.latestPath = latestPath; + pathVersions = null; + } + + public FileRecord WithAbsoluteVersion(FileLayout layout, string path) + { + AddVersion(layout, path, true); + return this; + } + + public FileRecord WithRelativeVersion(FileLayout layout, string path) + { + AddVersion(layout, path, false); + return this; + } + + private void AddVersion(FileLayout layout, string path, bool absolute) + { + if (pathVersions == null) + { + pathVersions = new Dictionary(); + } + + pathVersions.Add(layout, new PathInfo() { path = path, absolute = absolute }); + } + + public void GetPath(FileLayout layout, out string path, out bool absolute) + { + if (pathVersions != null) + { + PathInfo pathForLayout; + + if (pathVersions.TryGetValue(layout, out pathForLayout)) + { + absolute = pathForLayout.absolute; + path = pathForLayout.path; + return; + } + } + + absolute = false; + path = latestPath; + } + + private struct PathInfo + { + public string path; + public bool absolute; + } + + private readonly string latestPath; + private Dictionary pathVersions; + } + + internal IEnumerable GetBinaryFileInfo(BuildTarget buildTarget, BinaryType binaryType) + { + bool allVariants = (binaryType & BinaryType.AllVariants) == BinaryType.AllVariants; + + if ((binaryType & BinaryType.Release) == BinaryType.Release) + { + foreach (FileRecord record in GetBinaryFiles(buildTarget, allVariants, "")) + { + yield return CreateFileInfo(record, buildTarget, BinaryType.Release); + } + } + + if ((binaryType & BinaryType.Logging) == BinaryType.Logging) + { + foreach (FileRecord record in GetBinaryFiles(buildTarget, allVariants, "L")) + { + yield return CreateFileInfo(record, buildTarget, BinaryType.Logging); + } + } + + if ((binaryType & BinaryType.Optional) == BinaryType.Optional) + { + foreach (FileRecord record in GetOptionalBinaryFiles(buildTarget, allVariants)) + { + yield return CreateFileInfo(record, buildTarget, BinaryType.Optional); + } + } + } + + internal class SourceFileInfo : FileInfo + { + public SourceFileInfo(Platform platform, FileRecord fileRecord) + : base(fileRecord, BinaryType.Optional) + { + this.platform = platform; + } + + private readonly Platform platform; + + protected override string GetBasePath(FileLayout layout) + { + BinaryAssetFolderInfo info = platform.GetBinaryAssetFolder(platform.GetBuildTargets().First()); + + if (layout < info.oldestLayout) + { + return null; + } + + switch (layout) + { + case FileLayout.Release_1_10: + return "Plugins/FMOD/Wrapper"; + case FileLayout.Release_2_0: + return "Plugins/FMOD/src/Runtime/wrapper"; + case FileLayout.Release_2_1: + case FileLayout.Release_2_2: + return $"{RuntimeUtils.PluginBasePath}/platforms/{info.baseName}/src"; + default: + throw new ArgumentException("Unrecognised file layout: " + layout); + } + } + } + + internal IEnumerable GetSourceFileInfo() + { + foreach (FileRecord record in GetSourceFiles()) + { + yield return new SourceFileInfo(this, record); + } + } + + internal BinaryFileInfo CreateFileInfo(FileRecord record, BuildTarget buildTarget, BinaryType binaryType) + { + return new BinaryFileInfo(this, record, buildTarget, binaryType); + } + + internal virtual IEnumerable GetObsoleteAssetPaths() + { + foreach (string path in GetObsoleteFiles()) + { + yield return $"{RuntimeUtils.PluginBasePath}/{path}"; + yield return $"{RuntimeUtils.PluginBasePathDefault}/{path}"; + } + } + + // Called by Settings.CanBuildTarget to get the required binaries for the current + // build target and logging state. + internal virtual IEnumerable GetBinaryFilePaths(BuildTarget buildTarget, BinaryType binaryType) + { + return GetBinaryPaths(buildTarget, binaryType, RuntimeUtils.PluginBasePath); + } + + // Called by Settings.SelectBinaries to get: + // * The required and optional binaries for the current build target and logging state; + // these get enabled. + // * All binaries; any that weren't enabled in the previous step get disabled. + internal virtual IEnumerable GetBinaryAssetPaths(BuildTarget buildTarget, BinaryType binaryType) + { + return GetBinaryPaths(buildTarget, binaryType, RuntimeUtils.PluginBasePath); + } + + public enum FileLayout : uint + { + Release_1_10, + Release_2_0, + Release_2_1, + Release_2_2, + Latest = Release_2_2, + } + + protected class BinaryAssetFolderInfo + { + public BinaryAssetFolderInfo(string baseName, string path_1_10) + { + this.baseName = baseName; + this.path_1_10 = path_1_10; + this.oldestLayout = FileLayout.Release_1_10; + } + + public BinaryAssetFolderInfo(string baseName, FileLayout oldestLayout) + { + this.baseName = baseName; + this.path_1_10 = null; + this.oldestLayout = oldestLayout; + } + + public string baseName { get; private set; } + public string path_1_10 { get; private set; } + public FileLayout oldestLayout { get; private set; } + } + + protected abstract BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget); + + protected abstract IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix); + + protected virtual IEnumerable GetOptionalBinaryFiles(BuildTarget buildTarget, bool allVariants) + { + yield break; + } + + protected virtual IEnumerable GetSourceFiles() + { + yield break; + } + + protected virtual IEnumerable GetObsoleteFiles() + { + yield break; + } + + internal virtual bool IsFMODStaticallyLinked { get { return false; } } + + internal virtual bool SupportsAdditionalCPP(BuildTarget target) + { + return true; + } +#endif + + // The base path for FMOD plugins when in a standalone player. + protected virtual string GetPluginBasePath() + { + return string.Format("{0}/Plugins", Application.dataPath); + } + + // Returns the full path for an FMOD plugin. + internal virtual string GetPluginPath(string pluginName) + { + throw new NotImplementedException(string.Format("Plugins are not implemented on platform {0}", Identifier)); + } + + // Loads static and dynamic FMOD plugins for this platform. + internal virtual void LoadPlugins(FMOD.System coreSystem, Action reportResult) + { + LoadDynamicPlugins(coreSystem, reportResult); + LoadStaticPlugins(coreSystem, reportResult); + } + + // Loads dynamic FMOD plugins for this platform. + internal virtual void LoadDynamicPlugins(FMOD.System coreSystem, Action reportResult) + { + List pluginNames = Plugins; + + if (pluginNames == null) + { + return; + } + + foreach (string pluginName in pluginNames) + { + if (string.IsNullOrEmpty(pluginName)) + { + continue; + } + + string pluginPath = GetPluginPath(pluginName); + uint handle; + + FMOD.RESULT result = coreSystem.loadPlugin(pluginPath, out handle); + +#if UNITY_64 || UNITY_EDITOR_64 + // Add a "64" suffix and try again + if (result == FMOD.RESULT.ERR_FILE_BAD || result == FMOD.RESULT.ERR_FILE_NOTFOUND) + { + string pluginPath64 = GetPluginPath(pluginName + "64"); + result = coreSystem.loadPlugin(pluginPath64, out handle); + } +#endif + + reportResult(result, string.Format("Loading plugin '{0}' from '{1}'", pluginName, pluginPath)); + } + } + + // Loads static FMOD plugins for this platform. + internal virtual void LoadStaticPlugins(FMOD.System coreSystem, Action reportResult) + { + if (StaticPlugins.Count > 0) + { +#if !UNITY_EDITOR && ENABLE_IL2CPP + // We use reflection here to avoid compile errors if the plugin registration code doesn't exist. + // It should be generated by Settings.PreprocessStaticPlugins(), which is called from + // IPreprocessBuildWithReport.OnPreprocessBuild(). However, some compilation scenarios + // (such as AddressableAssetSettings.BuildPlayerContent()) don't call OnPreprocessBuild(), + // so we can't generate the plugin registration code. + + string className = string.Format("FMODUnity.{0}", RegisterStaticPluginsClassName); + Type type = Type.GetType(className); + + if (type == null) + { + RuntimeUtils.DebugLogWarningFormat( + "FMOD: {0} static plugins specified, but the {1} class was not found.", + StaticPlugins.Count, className); + return; + } + + MethodInfo method = type.GetMethod(RegisterStaticPluginsFunctionName, + BindingFlags.Public | BindingFlags.Static); + + if (method == null) + { + RuntimeUtils.DebugLogWarningFormat( + "FMOD: {0} static plugins specified, but the {1}.{2} method was not found.", + StaticPlugins.Count, className, RegisterStaticPluginsFunctionName); + return; + } + + method.Invoke(null, new object[] { coreSystem, reportResult }); +#else + RuntimeUtils.DebugLogWarningFormat( + "FMOD: {0} static plugins specified, but static plugins are only supported on the IL2CPP scripting backend", + StaticPlugins.Count); +#endif + } + } + + // Ensures that this platform has properties. + internal void AffirmProperties() + { + if (!active) + { + Properties = new PropertyStorage(); + InitializeProperties(); + active = true; + } + } + + // Clears this platform's properties. + internal void ClearProperties() + { + if (active) + { + Properties = new PropertyStorage(); + active = false; +#if UNITY_EDITOR + DisplaySortOrder = 0; +#endif + } + } + + // Initializes this platform's properties to their default values. + internal virtual void InitializeProperties() + { + if (!IsIntrinsic) + { + ParentIdentifier = PlatformDefault.ConstIdentifier; + } + } + + // Ensures that this platform's properties are valid after loading from file. + internal virtual void EnsurePropertiesAreValid() + { + if (!IsIntrinsic && string.IsNullOrEmpty(ParentIdentifier)) + { + ParentIdentifier = PlatformDefault.ConstIdentifier; + } + } + + internal string ParentIdentifier + { + get + { + return parentIdentifier; + } + + set + { + parentIdentifier = value; + } + } + +#if UNITY_EDITOR + internal float DisplaySortOrder + { + get + { + return displaySortOrder; + } + + set + { + displaySortOrder = value; + } + } +#endif + + internal bool IsLiveUpdateEnabled + { + get + { +#if DEVELOPMENT_BUILD || UNITY_EDITOR + return LiveUpdate != TriStateBool.Disabled; +#else + return LiveUpdate == TriStateBool.Enabled; +#endif + } + } + + internal bool IsOverlayEnabled + { + get + { +#if DEVELOPMENT_BUILD || UNITY_EDITOR + return Overlay != TriStateBool.Disabled; +#else + return Overlay == TriStateBool.Enabled; +#endif + } + } + + // A property value that can be inherited from the parent or overridden. + public class Property + { + public T Value; + public bool HasValue; + } + + // These stub classes are needed because Unity can't serialize generic classes + [Serializable] + public class PropertyBool : Property + { + } + + [Serializable] + public class PropertyScreenPosition : Property + { + } + + [Serializable] + public class PropertyInt : Property + { + } + + [Serializable] + public class PropertySpeakerMode : Property + { + } + + [Serializable] + public class PropertyString : Property + { + } + + [Serializable] + public class PropertyStringList : Property> + { + } + + [Serializable] + public class PropertyCallbackHandler : Property + { + } + + internal interface PropertyOverrideControl + { + bool HasValue(Platform platform); + void Clear(Platform platform); + } + + // This class provides access to a specific property on any Platform object; the property to + // operate on is determined by the Getter function. This allows client code to operate on + // platform properties in a generic manner. + internal struct PropertyAccessor : PropertyOverrideControl + { + private readonly Func> Getter; + private readonly T DefaultValue; + + public PropertyAccessor(Func> getter, T defaultValue) + { + Getter = getter; + DefaultValue = defaultValue; + } + + // Determine whether the property has a value in the given platform, or is inherited + // from the parent. + public bool HasValue(Platform platform) + { + return platform.Active && Getter(platform.Properties).HasValue; + } + + // Get the (possibly inherited) value of the property for the given platform. + public T Get(Platform platform) + { + for (Platform current = platform; current != null; current = current.Parent) + { + if (current.Active) + { + Property property = Getter(current.Properties); + + if (property.HasValue) + { + return property.Value; + } + } + } + +#if UNITY_EDITOR + if (platform is PlatformPlayInEditor) + { + return Get(Settings.EditorSettings.CurrentEditorPlatform); + } +#endif + + return DefaultValue; + } + + // Set the value of the property in the given platform, so it is not inherited from the + // platform's parent. + public void Set(Platform platform, T value) + { + Property property = Getter(platform.Properties); + + property.Value = value; + property.HasValue = true; + } + + // Clear the value of the property in the given platform, so it is inherited from the + // platform's parent. + public void Clear(Platform platform) + { + Getter(platform.Properties).HasValue = false; + } + } + + // This class stores all of the inheritable properties for a platform. + [Serializable] + public class PropertyStorage + { + public PropertyBool LiveUpdate = new PropertyBool(); + public PropertyInt LiveUpdatePort = new PropertyInt(); + public PropertyBool Overlay = new PropertyBool(); + public PropertyScreenPosition OverlayPosition = new PropertyScreenPosition(); + public PropertyInt OverlayFontSize = new PropertyInt(); + public PropertyBool Logging = new PropertyBool(); + public PropertyInt SampleRate = new PropertyInt(); + public PropertyString BuildDirectory = new PropertyString(); + public PropertySpeakerMode SpeakerMode = new PropertySpeakerMode(); + public PropertyInt VirtualChannelCount = new PropertyInt(); + public PropertyInt RealChannelCount = new PropertyInt(); + public PropertyInt DSPBufferLength = new PropertyInt(); + public PropertyInt DSPBufferCount = new PropertyInt(); + public PropertyStringList Plugins = new PropertyStringList(); + public PropertyStringList StaticPlugins = new PropertyStringList(); + public PropertyCallbackHandler CallbackHandler = new PropertyCallbackHandler(); + } + + // Whether this platform is active in the settings UI. + internal bool Active { get { return active; } } + + // Whether this platform has any properties that are not inherited from the parent. + internal bool HasAnyOverriddenProperties + { + get + { + return active && + ( + Properties.LiveUpdate.HasValue + || Properties.LiveUpdatePort.HasValue + || Properties.Overlay.HasValue + || Properties.OverlayPosition.HasValue + || Properties.OverlayFontSize.HasValue + || Properties.Logging.HasValue + || Properties.SampleRate.HasValue + || Properties.BuildDirectory.HasValue + || Properties.SpeakerMode.HasValue + || Properties.VirtualChannelCount.HasValue + || Properties.RealChannelCount.HasValue + || Properties.DSPBufferLength.HasValue + || Properties.DSPBufferCount.HasValue + || Properties.Plugins.HasValue + || Properties.StaticPlugins.HasValue + ); + } + } + + // These accessors provide (possibly inherited) property values. + public TriStateBool LiveUpdate { get { return PropertyAccessors.LiveUpdate.Get(this); } } + public int LiveUpdatePort { get { return PropertyAccessors.LiveUpdatePort.Get(this); } } + public TriStateBool Overlay { get { return PropertyAccessors.Overlay.Get(this); } } + public ScreenPosition OverlayRect { get { return PropertyAccessors.OverlayPosition.Get(this); } } + public int OverlayFontSize { get { return PropertyAccessors.OverlayFontSize.Get(this); } } + public void SetOverlayFontSize(int size) { PropertyAccessors.OverlayFontSize.Set(this, size); } + public TriStateBool Logging { get { return PropertyAccessors.Logging.Get(this); } } + public int SampleRate { get { return PropertyAccessors.SampleRate.Get(this); } } + public string BuildDirectory { get { return PropertyAccessors.BuildDirectory.Get(this); } } + public FMOD.SPEAKERMODE SpeakerMode { get { return PropertyAccessors.SpeakerMode.Get(this); } } + public int VirtualChannelCount { get { return PropertyAccessors.VirtualChannelCount.Get(this); } } + public int RealChannelCount { get { return PropertyAccessors.RealChannelCount.Get(this); } } + public int DSPBufferLength { get { return PropertyAccessors.DSPBufferLength.Get(this); } } + public int DSPBufferCount { get { return PropertyAccessors.DSPBufferCount.Get(this); } } + public List Plugins { get { return PropertyAccessors.Plugins.Get(this); } } + public List StaticPlugins { get { return PropertyAccessors.StaticPlugins.Get(this); } } + public PlatformCallbackHandler CallbackHandler { get { return PropertyAccessors.CallbackHandler.Get(this); } } + + // These accessors provide full access to properties. + internal static class PropertyAccessors + { + public static readonly PropertyAccessor LiveUpdate + = new PropertyAccessor(properties => properties.LiveUpdate, TriStateBool.Disabled); + + public static readonly PropertyAccessor LiveUpdatePort + = new PropertyAccessor(properties => properties.LiveUpdatePort, 9264); + + public static readonly PropertyAccessor Overlay + = new PropertyAccessor(properties => properties.Overlay, TriStateBool.Disabled); + + public static readonly PropertyAccessor OverlayPosition = new PropertyAccessor(properties => properties.OverlayPosition, ScreenPosition.TopLeft); + + public static readonly PropertyAccessor OverlayFontSize = new PropertyAccessor(properties => properties.OverlayFontSize, 14); + + public static readonly PropertyAccessor Logging + = new PropertyAccessor(properties => properties.Logging, TriStateBool.Disabled); + + public static readonly PropertyAccessor SampleRate + = new PropertyAccessor(properties => properties.SampleRate, 0); + + public static readonly PropertyAccessor BuildDirectory + = new PropertyAccessor(properties => properties.BuildDirectory, "Desktop"); + + public static readonly PropertyAccessor SpeakerMode + = new PropertyAccessor(properties => properties.SpeakerMode, FMOD.SPEAKERMODE.STEREO); + + public static readonly PropertyAccessor VirtualChannelCount + = new PropertyAccessor(properties => properties.VirtualChannelCount, 128); + + public static readonly PropertyAccessor RealChannelCount + = new PropertyAccessor(properties => properties.RealChannelCount, 32); + + public static readonly PropertyAccessor DSPBufferLength + = new PropertyAccessor(properties => properties.DSPBufferLength, 0); + + public static readonly PropertyAccessor DSPBufferCount + = new PropertyAccessor(properties => properties.DSPBufferCount, 0); + + public static readonly PropertyAccessor> Plugins + = new PropertyAccessor>(properties => properties.Plugins, null); + + public static readonly PropertyAccessor> StaticPlugins + = new PropertyAccessor>(properties => properties.StaticPlugins, null); + + public static readonly PropertyAccessor CallbackHandler + = new PropertyAccessor(properties => properties.CallbackHandler, null); + } + +#if UNITY_EDITOR + // The parent platform from which this platform inherits its property values. + internal Platform Parent + { + get + { + return (ParentIdentifier != null) ? Settings.Instance.FindPlatform(ParentIdentifier) : null; + } + } + + // The platforms which inherit their property values from this platform. + internal List ChildIdentifiers { get { return childIdentifiers; } } +#endif + + // Checks whether this platform inherits from the given platform, so we can avoid creating + // inheritance loops. + internal bool InheritsFrom(Platform platform) + { + if (platform == this) + { + return true; + } + else if (Parent != null) + { + return Parent.InheritsFrom(platform); + } + else + { + return false; + } + } + + internal FMOD.OUTPUTTYPE GetOutputType() + { + if (Enum.IsDefined(typeof(FMOD.OUTPUTTYPE), OutputTypeName)) + { + return (FMOD.OUTPUTTYPE)Enum.Parse(typeof(FMOD.OUTPUTTYPE), OutputTypeName); + } + return FMOD.OUTPUTTYPE.AUTODETECT; + } + +#if UNITY_EDITOR + public struct OutputType + { + public string displayName; + public FMOD.OUTPUTTYPE outputType; + } + + internal abstract OutputType[] ValidOutputTypes { get; } + + internal virtual int CoreCount { get { return 0; } } +#endif + + internal virtual List DefaultThreadAffinities { get { return StaticThreadAffinities; } } + + [Serializable] + public class PropertyThreadAffinityList : Property> + { + } + + public IEnumerable ThreadAffinities + { + get + { + if (threadAffinities.HasValue) + { + return threadAffinities.Value; + } + else + { + return DefaultThreadAffinities; + } + } + } + + internal PropertyThreadAffinityList ThreadAffinitiesProperty { get { return threadAffinities; } } + + internal virtual List DefaultCodecChannels { get { return staticCodecChannels; } } + + private static List staticCodecChannels = new List() + { + new CodecChannelCount { format = CodecType.FADPCM, channels = 32 }, + new CodecChannelCount { format = CodecType.Vorbis, channels = 0 }, + }; + + [Serializable] + internal class PropertyCodecChannels : Property> + { + } + + [SerializeField] + private PropertyCodecChannels codecChannels = new PropertyCodecChannels(); + + internal List CodecChannels + { + get + { + if (codecChannels.HasValue) + { + return codecChannels.Value; + } + else + { + return DefaultCodecChannels; + } + } + } + + internal PropertyCodecChannels CodecChannelsProperty { get { return codecChannels; } } + } +} diff --git a/Assets/Plugins/FMOD/src/Platform.cs.meta b/Assets/Plugins/FMOD/src/Platform.cs.meta new file mode 100644 index 00000000..d3f401f3 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Platform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e7df340ba8041134888b271ea2124fcd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/PlatformDefault.cs b/Assets/Plugins/FMOD/src/PlatformDefault.cs new file mode 100644 index 00000000..588ef221 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformDefault.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMODUnity +{ + public class PlatformDefault : Platform + { + public const string ConstIdentifier = "default"; + + public PlatformDefault() + { + Identifier = ConstIdentifier; + } + + internal override string DisplayName { get { return "Default"; } } + internal override void DeclareRuntimePlatforms(Settings settings) { } +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield break; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.Default; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return null; + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + yield break; + } +#endif + + internal override bool IsIntrinsic { get { return true; } } + + internal override void InitializeProperties() + { + base.InitializeProperties(); + + PropertyAccessors.Plugins.Set(this, new List()); + PropertyAccessors.StaticPlugins.Set(this, new List()); + } + + internal override void EnsurePropertiesAreValid() + { + base.EnsurePropertiesAreValid(); + + if (StaticPlugins == null) + { + PropertyAccessors.StaticPlugins.Set(this, new List()); + } + } + + // null means no valid output types - don't display the field in the UI +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes { get { return null; } } +#endif + } +} diff --git a/Assets/Plugins/FMOD/src/PlatformDefault.cs.meta b/Assets/Plugins/FMOD/src/PlatformDefault.cs.meta new file mode 100644 index 00000000..e5e09f96 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformDefault.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9587379c972e4a54da1949613f11e1c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/PlatformGroup.cs b/Assets/Plugins/FMOD/src/PlatformGroup.cs new file mode 100644 index 00000000..4cae656b --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformGroup.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMODUnity +{ + public class PlatformGroup : Platform + { + [SerializeField] + private string displayName; + + [SerializeField] + private Legacy.Platform legacyIdentifier; + + internal override string DisplayName { get { return displayName; } } + internal override void DeclareRuntimePlatforms(Settings settings) { } +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield break; + } + + internal override Legacy.Platform LegacyIdentifier { get { return legacyIdentifier; } } + + internal static PlatformGroup Create(string displayName, Legacy.Platform legacyIdentifier) + { + PlatformGroup group = CreateInstance(); + group.Identifier = GUID.Generate().ToString(); + group.displayName = displayName; + group.legacyIdentifier = legacyIdentifier; + group.AffirmProperties(); + + return group; + } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return null; + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + yield break; + } + + internal override OutputType[] ValidOutputTypes { get { return null; } } +#endif + } +} diff --git a/Assets/Plugins/FMOD/src/PlatformGroup.cs.meta b/Assets/Plugins/FMOD/src/PlatformGroup.cs.meta new file mode 100644 index 00000000..c928a3b0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d049eb0281db9c4abd635ba1c79cb7b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/PlatformMobileHigh.cs b/Assets/Plugins/FMOD/src/PlatformMobileHigh.cs new file mode 100644 index 00000000..f42291d6 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformMobileHigh.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformMobileHigh : PlatformMobileLow + { + static PlatformMobileHigh() + { + Settings.AddPlatformTemplate("fd7c55dab0fce234b8c25f6ffca523c1"); + } + + internal override string DisplayName { get { return "High-End Mobile"; } } +#if UNITY_EDITOR + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.MobileHigh; } } +#endif + + internal override float Priority { get { return base.Priority + 1; } } + + internal override bool MatchesCurrentEnvironment + { + get + { + if (!Active) + { + return false; + } + +#if UNITY_IOS + switch (UnityEngine.iOS.Device.generation) + { + case UnityEngine.iOS.DeviceGeneration.iPad1Gen: + case UnityEngine.iOS.DeviceGeneration.iPad2Gen: + case UnityEngine.iOS.DeviceGeneration.iPad3Gen: + case UnityEngine.iOS.DeviceGeneration.iPadMini1Gen: + case UnityEngine.iOS.DeviceGeneration.iPhone: + case UnityEngine.iOS.DeviceGeneration.iPhone3G: + case UnityEngine.iOS.DeviceGeneration.iPhone3GS: + case UnityEngine.iOS.DeviceGeneration.iPhone4: + case UnityEngine.iOS.DeviceGeneration.iPhone4S: + return false; + default: + return true; + } +#elif UNITY_ANDROID + if (SystemInfo.processorCount <= 2) + { + return false; + } + else if (SystemInfo.processorCount >= 8) + { + return true; + } + else + { + // check the clock rate on quad core systems + string freqinfo = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; + try + { + using (System.IO.TextReader reader = new System.IO.StreamReader(freqinfo)) + { + string line = reader.ReadLine(); + int khz = int.Parse(line) / 1000; + if (khz >= 1600) + { + return true; + } + else + { + return false; + } + } + } + catch + { + return false; + } + } +#else + return false; +#endif + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/PlatformMobileHigh.cs.meta b/Assets/Plugins/FMOD/src/PlatformMobileHigh.cs.meta new file mode 100644 index 00000000..b4869139 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformMobileHigh.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93a382382f106584e8f8f62412fee177 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/PlatformMobileLow.cs b/Assets/Plugins/FMOD/src/PlatformMobileLow.cs new file mode 100644 index 00000000..7fe53520 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformMobileLow.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMODUnity +{ +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + public class PlatformMobileLow : Platform + { + static PlatformMobileLow() + { + Settings.AddPlatformTemplate("c88d16e5272a4e241b0ef0ac2e53b73d"); + } + + internal override string DisplayName { get { return "Low-End Mobile"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.IPhonePlayer, this); + settings.DeclareRuntimePlatform(RuntimePlatform.Android, this); + } + +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield break; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.MobileLow; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return null; + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + yield break; + } + + internal override bool SupportsAdditionalCPP(BuildTarget target) + { + if (target == BuildTarget.iOS) + { + return PlatformIOS.StaticSupportsAdditionalCpp(); + } + else + { + return base.SupportsAdditionalCPP(target); + } + } +#endif + + internal override float Priority { get { return DefaultPriority + 1; } } + + internal override bool MatchesCurrentEnvironment + { + get + { + return Active; + } + } + +#if UNITY_IOS + internal override void LoadPlugins(FMOD.System coreSystem, Action reportResult) + { + PlatformIOS.StaticLoadPlugins(this, coreSystem, reportResult); + } +#elif UNITY_ANDROID + internal override string GetBankFolder() + { + return PlatformAndroid.StaticGetBankFolder(); + } + + internal override string GetPluginPath(string pluginName) + { + return PlatformAndroid.StaticGetPluginPath(pluginName); + } +#endif + +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes { get { return null; } } +#endif + } +} diff --git a/Assets/Plugins/FMOD/src/PlatformMobileLow.cs.meta b/Assets/Plugins/FMOD/src/PlatformMobileLow.cs.meta new file mode 100644 index 00000000..717ce988 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformMobileLow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3abeb1429547a134480f4f2f1efc7e21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/PlatformPlayInEditor.cs b/Assets/Plugins/FMOD/src/PlatformPlayInEditor.cs new file mode 100644 index 00000000..3554dcb4 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformPlayInEditor.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if UNITY_EDITOR +namespace FMOD +{ + public partial class VERSION + { + public const string dll = "fmodstudioL"; + } +} + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { + public const string dll = "fmodstudioL"; + } +} +#endif + +namespace FMODUnity +{ + public class PlatformPlayInEditor : Platform + { + public PlatformPlayInEditor() + { + Identifier = "playInEditor"; + } + + internal override string DisplayName { get { return "Editor"; } } + internal override void DeclareRuntimePlatforms(Settings settings) + { + settings.DeclareRuntimePlatform(RuntimePlatform.OSXEditor, this); + settings.DeclareRuntimePlatform(RuntimePlatform.WindowsEditor, this); + settings.DeclareRuntimePlatform(RuntimePlatform.LinuxEditor, this); + } +#if UNITY_EDITOR + internal override IEnumerable GetBuildTargets() + { + yield break; + } + + internal override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.PlayInEditor; } } + + protected override BinaryAssetFolderInfo GetBinaryAssetFolder(BuildTarget buildTarget) + { + return null; + } + + protected override IEnumerable GetBinaryFiles(BuildTarget buildTarget, bool allVariants, string suffix) + { + yield break; + } +#endif + + internal override bool IsIntrinsic { get { return true; } } + + internal override string GetBankFolder() + { + // Use original asset location because streaming asset folder will contain platform specific banks + Settings globalSettings = Settings.Instance; + + string bankFolder = globalSettings.SourceBankPath; + if (globalSettings.HasPlatforms) + { + bankFolder = RuntimeUtils.GetCommonPlatformPath(Path.Combine(bankFolder, BuildDirectory)); + } + + return bankFolder; + } + +#if UNITY_EDITOR + internal override string GetPluginPath(string pluginName) + { + string platformsFolder = Path.GetFullPath($"{RuntimeUtils.PluginBasePath}/platforms"); + +#if UNITY_EDITOR_WIN && UNITY_EDITOR_64 + return string.Format("{0}/win/lib/x86_64/{1}.dll", platformsFolder, pluginName); +#elif UNITY_EDITOR_WIN + return string.Format("{0}/win/lib/x86/{1}.dll", platformsFolder, pluginName); +#elif UNITY_EDITOR_OSX + string pluginPath = string.Format("{0}/mac/lib/{1}.bundle", platformsFolder, pluginName); + if (System.IO.Directory.Exists(pluginPath)) + { + return pluginPath; + } + else + { + return string.Format("{0}/mac/lib/{1}.dylib", platformsFolder, pluginName); + } +#elif UNITY_EDITOR_LINUX && UNITY_EDITOR_64 + return string.Format("{0}/linux/lib/x86_64/lib{1}.so", platformsFolder, pluginName); +#elif UNITY_EDITOR_LINUX + return string.Format("{0}/linux/lib/x86/lib{1}.so", platformsFolder, pluginName); +#endif + } +#endif + + internal override void LoadStaticPlugins(FMOD.System coreSystem, Action reportResult) + { + // Ignore static plugins when playing in the editor + } + + internal override void InitializeProperties() + { + base.InitializeProperties(); + + PropertyAccessors.LiveUpdate.Set(this, TriStateBool.Enabled); + PropertyAccessors.Overlay.Set(this, TriStateBool.Enabled); + PropertyAccessors.SampleRate.Set(this, 48000); + PropertyAccessors.RealChannelCount.Set(this, 256); + PropertyAccessors.VirtualChannelCount.Set(this, 1024); + } +#if UNITY_EDITOR + internal override OutputType[] ValidOutputTypes { get { return null; } } +#endif + + internal override List DefaultCodecChannels { get { return staticCodecChannels; } } + + private static List staticCodecChannels = new List() + { + new CodecChannelCount { format = CodecType.FADPCM, channels = 0 }, + new CodecChannelCount { format = CodecType.Vorbis, channels = 256 }, + }; + } +} diff --git a/Assets/Plugins/FMOD/src/PlatformPlayInEditor.cs.meta b/Assets/Plugins/FMOD/src/PlatformPlayInEditor.cs.meta new file mode 100644 index 00000000..692ee070 --- /dev/null +++ b/Assets/Plugins/FMOD/src/PlatformPlayInEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 335f0a4b26fb46942858ea029e030d2a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/RuntimeManager.cs b/Assets/Plugins/FMOD/src/RuntimeManager.cs new file mode 100644 index 00000000..d0b99d18 --- /dev/null +++ b/Assets/Plugins/FMOD/src/RuntimeManager.cs @@ -0,0 +1,1601 @@ +using System; +using System.Collections.Generic; +using System.Collections; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using UnityEngine; + +#if UNITY_URP_EXIST +using UnityEngine.Rendering.Universal; +using UnityEngine.UI; +#endif + +#if UNITY_ADDRESSABLES_EXIST +using UnityEngine.AddressableAssets; +#endif + +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMODUnity +{ + [AddComponentMenu("")] + public class RuntimeManager : MonoBehaviour + { + public const string BankStubPrefix = "bank stub:"; + + private static SystemNotInitializedException initException = null; + private static RuntimeManager instance; + + private Platform currentPlatform; + private FMOD.DEBUG_CALLBACK debugCallback; + private FMOD.SYSTEM_CALLBACK errorCallback; + + private FMOD.Studio.System studioSystem; + private FMOD.System coreSystem; + private FMOD.DSP mixerHead; + + private bool isMuted = false; + + private Dictionary cachedDescriptions = new Dictionary(new GuidComparer()); + + private Dictionary loadedBanks = new Dictionary(); + private List sampleLoadRequests = new List(); + + private List attachedInstances = new List(128); + +#if UNITY_EDITOR + private List eventPositionWarnings = new List(); +#endif + + private bool listenerWarningIssued = false; + + protected bool isOverlayEnabled = false; + private FMODRuntimeManagerOnGUIHelper overlayDrawer = null; + private Rect windowRect = new Rect(10, 10, 300, 100); + + private string lastDebugText; + private float lastDebugUpdate = 0; + + private int loadingBanksRef = 0; + + private static byte[] masterBusPrefix; + private static byte[] eventSet3DAttributes; + private static byte[] systemGetBus; + +#if UNITY_URP_EXIST + private GameObject vrDebugOverlay; + private RectTransform vrDebugRectTransform; + private Text vrDebugText; + private Camera vrDebugCamera; + private string GUIText; +#endif + + static RuntimeManager() + { + UTF8Encoding encoding = new UTF8Encoding(); + + masterBusPrefix = encoding.GetBytes("bus:/, "); + eventSet3DAttributes = encoding.GetBytes("EventInstance::set3DAttributes"); + systemGetBus = encoding.GetBytes("System::getBus"); + } + + + public static bool IsMuted + { + get + { + return Instance.isMuted; + } + } + + [AOT.MonoPInvokeCallback(typeof(FMOD.DEBUG_CALLBACK))] + private static FMOD.RESULT DEBUG_CALLBACK(FMOD.DEBUG_FLAGS flags, IntPtr filePtr, int line, IntPtr funcPtr, IntPtr messagePtr) + { + FMOD.StringWrapper file = new FMOD.StringWrapper(filePtr); + FMOD.StringWrapper func = new FMOD.StringWrapper(funcPtr); + FMOD.StringWrapper message = new FMOD.StringWrapper(messagePtr); + + if (flags == FMOD.DEBUG_FLAGS.ERROR) + { + RuntimeUtils.DebugLogError(string.Format(("[FMOD] {0} : {1}"), (string)func, (string)message)); + } + else if (flags == FMOD.DEBUG_FLAGS.WARNING) + { + RuntimeUtils.DebugLogWarning(string.Format(("[FMOD] {0} : {1}"), (string)func, (string)message)); + } + else if (flags == FMOD.DEBUG_FLAGS.LOG) + { + RuntimeUtils.DebugLog(string.Format(("[FMOD] {0} : {1}"), (string)func, (string)message)); + } + return FMOD.RESULT.OK; + } + + [AOT.MonoPInvokeCallback(typeof(FMOD.SYSTEM_CALLBACK))] + private static FMOD.RESULT ERROR_CALLBACK(IntPtr system, FMOD.SYSTEM_CALLBACK_TYPE type, IntPtr commanddata1, IntPtr commanddata2, IntPtr userdata) + { + FMOD.ERRORCALLBACK_INFO callbackInfo = Marshal.PtrToStructure(commanddata1); + + // Filter out benign expected errors. + if ((callbackInfo.instancetype == FMOD.ERRORCALLBACK_INSTANCETYPE.CHANNEL || callbackInfo.instancetype == FMOD.ERRORCALLBACK_INSTANCETYPE.CHANNELCONTROL) + && callbackInfo.result == FMOD.RESULT.ERR_INVALID_HANDLE) + { + return FMOD.RESULT.OK; + } + if (callbackInfo.instancetype == FMOD.ERRORCALLBACK_INSTANCETYPE.STUDIO_EVENTINSTANCE + && callbackInfo.functionname.Equals(eventSet3DAttributes) + && callbackInfo.result == FMOD.RESULT.ERR_INVALID_HANDLE) + { + return FMOD.RESULT.OK; + } + if (callbackInfo.instancetype == FMOD.ERRORCALLBACK_INSTANCETYPE.STUDIO_SYSTEM + && callbackInfo.functionname.Equals(systemGetBus) + && callbackInfo.result == FMOD.RESULT.ERR_EVENT_NOTFOUND + && callbackInfo.functionparams.StartsWith(masterBusPrefix)) + { + return FMOD.RESULT.OK; + } + + RuntimeUtils.DebugLogError(string.Format("[FMOD] {0}({1}) returned {2} for {3} (0x{4}).", + (string)callbackInfo.functionname, (string)callbackInfo.functionparams, callbackInfo.result, callbackInfo.instancetype, callbackInfo.instance.ToString("X"))); + return FMOD.RESULT.OK; + } + + private static RuntimeManager Instance + { + get + { + if (initException != null) + { + throw initException; + } + + + if (instance == null) + { + if (!Application.isPlaying) + { + Debug.LogError("[FMOD] RuntimeManager accessed outside of runtime. Do not use RuntimeManager for Editor-only functionality, create your own System objects instead."); + return null; + } + + FMOD.RESULT initResult = FMOD.RESULT.OK; // Initialize can return an error code if it falls back to NO_SOUND, throw it as a non-cached exception + + // When reloading scripts the static instance pointer will be cleared, find the old manager and clean it up + foreach (RuntimeManager manager in Resources.FindObjectsOfTypeAll()) + { + DestroyImmediate(manager.gameObject); + } + + var gameObject = new GameObject("FMOD.UnityIntegration.RuntimeManager"); + instance = gameObject.AddComponent(); + + if (Application.isPlaying) // This class is used in edit mode by the Timeline auditioning system + { + DontDestroyOnLoad(gameObject); + } + gameObject.hideFlags = HideFlags.HideAndDontSave; + + try + { + RuntimeUtils.EnforceLibraryOrder(); + + #if UNITY_ANDROID && !UNITY_EDITOR + // First, obtain the current activity context + AndroidJavaObject activity = null; + using (var activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) + { + activity = activityClass.GetStatic("currentActivity"); + } + + using (var fmodJava = new AndroidJavaClass("org.fmod.FMOD")) + { + if (fmodJava != null) + { + fmodJava.CallStatic("init", activity); + } + else + { + RuntimeUtils.DebugLogWarning("[FMOD] Cannot initialize Java wrapper"); + } + } + #endif + + initResult = instance.Initialize(); + } + catch (Exception e) + { + initException = e as SystemNotInitializedException; + if (initException == null) + { + initException = new SystemNotInitializedException(e); + } + throw initException; + } + } + return instance; + } + } + + public static FMOD.Studio.System StudioSystem + { + get { return Instance.studioSystem; } + } + + public static FMOD.System CoreSystem + { + get { return Instance.coreSystem; } + } + + private struct LoadedBank + { + public FMOD.Studio.Bank Bank; + public int RefCount; + } + + // Explicit comparer to avoid issues on platforms that don't support JIT compilation + private class GuidComparer : IEqualityComparer + { + bool IEqualityComparer.Equals(FMOD.GUID x, FMOD.GUID y) + { + return x.Equals(y); + } + + int IEqualityComparer.GetHashCode(FMOD.GUID obj) + { + return obj.GetHashCode(); + } + } + + private void CheckInitResult(FMOD.RESULT result, string cause) + { + if (result != FMOD.RESULT.OK) + { + ReleaseStudioSystem(); + throw new SystemNotInitializedException(result, cause); + } + } + + private void ReleaseStudioSystem() + { + if (studioSystem.isValid()) + { + studioSystem.release(); + studioSystem.clearHandle(); + } + } + + private FMOD.RESULT Initialize() + { + #if UNITY_EDITOR + EditorApplication.playModeStateChanged += HandlePlayModeStateChange; + AppDomain.CurrentDomain.DomainUnload += HandleDomainUnload; + #endif // UNITY_EDITOR + + FMOD.RESULT result = FMOD.RESULT.OK; + FMOD.RESULT initResult = FMOD.RESULT.OK; + Settings fmodSettings = Settings.Instance; + currentPlatform = fmodSettings.FindCurrentPlatform(); + + int sampleRate = currentPlatform.SampleRate; + int realChannels = Math.Min(currentPlatform.RealChannelCount, 256); + int virtualChannels = currentPlatform.VirtualChannelCount; + uint dspBufferLength = (uint)currentPlatform.DSPBufferLength; + int dspBufferCount = currentPlatform.DSPBufferCount; + FMOD.SPEAKERMODE speakerMode = currentPlatform.SpeakerMode; + FMOD.OUTPUTTYPE outputType = currentPlatform.GetOutputType(); + + FMOD.ADVANCEDSETTINGS advancedSettings = new FMOD.ADVANCEDSETTINGS(); + advancedSettings.randomSeed = (uint)DateTime.UtcNow.Ticks; + advancedSettings.maxAT9Codecs = GetChannelCountForFormat(CodecType.AT9); + advancedSettings.maxFADPCMCodecs = GetChannelCountForFormat(CodecType.FADPCM); + advancedSettings.maxOpusCodecs = GetChannelCountForFormat(CodecType.Opus); + advancedSettings.maxVorbisCodecs = GetChannelCountForFormat(CodecType.Vorbis); + advancedSettings.maxXMACodecs = GetChannelCountForFormat(CodecType.XMA); + + SetThreadAffinities(currentPlatform); + + currentPlatform.PreSystemCreate(CheckInitResult); + + #if UNITY_EDITOR || DEVELOPMENT_BUILD + debugCallback = new FMOD.DEBUG_CALLBACK(DEBUG_CALLBACK); + result = FMOD.Debug.Initialize(fmodSettings.LoggingLevel, FMOD.DEBUG_MODE.CALLBACK, debugCallback, null); + if(result == FMOD.RESULT.ERR_UNSUPPORTED) + { + RuntimeUtils.DebugLogWarning("[FMOD] Unable to initialize debug logging: Logging will be disabled.\nCheck the Import Settings of the FMOD libs to enable the logging library."); + } + else + { + CheckInitResult(result, "FMOD.Debug.Initialize"); + } + #endif + + FMOD.Studio.INITFLAGS studioInitFlags = FMOD.Studio.INITFLAGS.NORMAL | FMOD.Studio.INITFLAGS.DEFERRED_CALLBACKS; + if (currentPlatform.IsLiveUpdateEnabled) + { + studioInitFlags |= FMOD.Studio.INITFLAGS.LIVEUPDATE; + advancedSettings.profilePort = (ushort)currentPlatform.LiveUpdatePort; + } + +retry: + result = FMOD.Studio.System.create(out studioSystem); + CheckInitResult(result, "FMOD.Studio.System.create"); + + result = studioSystem.getCoreSystem(out coreSystem); + CheckInitResult(result, "FMOD.Studio.System.getCoreSystem"); + + result = coreSystem.setOutput(outputType); + CheckInitResult(result, "FMOD.System.setOutput"); + + result = coreSystem.setSoftwareChannels(realChannels); + CheckInitResult(result, "FMOD.System.setSoftwareChannels"); + + result = coreSystem.setSoftwareFormat(sampleRate, speakerMode, 0); + CheckInitResult(result, "FMOD.System.setSoftwareFormat"); + + if (dspBufferLength > 0 && dspBufferCount > 0) + { + result = coreSystem.setDSPBufferSize(dspBufferLength, dspBufferCount); + CheckInitResult(result, "FMOD.System.setDSPBufferSize"); + } + + result = coreSystem.setAdvancedSettings(ref advancedSettings); + CheckInitResult(result, "FMOD.System.setAdvancedSettings"); + + if (fmodSettings.EnableErrorCallback) + { + errorCallback = new FMOD.SYSTEM_CALLBACK(ERROR_CALLBACK); + result = coreSystem.setCallback(errorCallback, FMOD.SYSTEM_CALLBACK_TYPE.ERROR); + CheckInitResult(result, "FMOD.System.setCallback"); + } + + if (!string.IsNullOrEmpty(fmodSettings.EncryptionKey)) + { + FMOD.Studio.ADVANCEDSETTINGS studioAdvancedSettings = new FMOD.Studio.ADVANCEDSETTINGS(); + result = studioSystem.setAdvancedSettings(studioAdvancedSettings, Settings.Instance.EncryptionKey); + CheckInitResult(result, "FMOD.Studio.System.setAdvancedSettings"); + } + + if (fmodSettings.EnableMemoryTracking) + { + studioInitFlags |= FMOD.Studio.INITFLAGS.MEMORY_TRACKING; + } + + currentPlatform.PreInitialize(studioSystem); + + PlatformCallbackHandler callbackHandler = currentPlatform.CallbackHandler; + + if (callbackHandler != null) + { + callbackHandler.PreInitialize(studioSystem, CheckInitResult); + } + + result = studioSystem.initialize(virtualChannels, studioInitFlags, FMOD.INITFLAGS.NORMAL, IntPtr.Zero); + if (result != FMOD.RESULT.OK && initResult == FMOD.RESULT.OK) + { + initResult = result; // Save this to throw at the end (we'll attempt NO SOUND to shield ourselves from unexpected device failures) + outputType = FMOD.OUTPUTTYPE.NOSOUND; + RuntimeUtils.DebugLogErrorFormat("[FMOD] Studio::System::initialize returned {0}, defaulting to no-sound mode.", result.ToString()); + + goto retry; + } + CheckInitResult(result, "Studio::System::initialize"); + + // Test network functionality triggered during System::update + if ((studioInitFlags & FMOD.Studio.INITFLAGS.LIVEUPDATE) != 0) + { + studioSystem.flushCommands(); // Any error will be returned through Studio.System.update + + result = studioSystem.update(); + if (result == FMOD.RESULT.ERR_NET_SOCKET_ERROR) + { + studioInitFlags &= ~FMOD.Studio.INITFLAGS.LIVEUPDATE; + RuntimeUtils.DebugLogWarning("[FMOD] Cannot open network port for Live Update (in-use), restarting with Live Update disabled."); + + result = studioSystem.release(); + CheckInitResult(result, "FMOD.Studio.System.Release"); + + goto retry; + } + } + + currentPlatform.LoadPlugins(coreSystem, CheckInitResult); + LoadBanks(fmodSettings); + + #if (UNITY_IOS || UNITY_TVOS || UNITY_VISIONOS) && !UNITY_EDITOR + RegisterSuspendCallback(HandleInterrupt); + #endif + + if (currentPlatform.IsOverlayEnabled) + { + SetOverlayPosition(); + } + return initResult; + } + + private int GetChannelCountForFormat(CodecType format) + { + CodecChannelCount channelCount = currentPlatform.CodecChannels.Find(x => x.format == format); + + return channelCount == null ? 0 : Math.Min(channelCount.channels, 256); + } + + private static void SetThreadAffinities(Platform platform) + { + foreach (ThreadAffinityGroup group in platform.ThreadAffinities) + { + foreach (ThreadType thread in group.threads) + { + FMOD.THREAD_TYPE fmodThread = RuntimeUtils.ToFMODThreadType(thread); + FMOD.THREAD_AFFINITY fmodAffinity = RuntimeUtils.ToFMODThreadAffinity(group.affinity); + + FMOD.Thread.SetAttributes(fmodThread, fmodAffinity); + } + } + } + + private class AttachedInstance + { + public FMOD.Studio.EventInstance instance; + public Transform transform; + #if UNITY_PHYSICS_EXIST + public Rigidbody rigidBody; + #endif + public Vector3 lastFramePosition; + public bool nonRigidbodyVelocity; + #if UNITY_PHYSICS2D_EXIST + public Rigidbody2D rigidBody2D; + #endif + } + + private void Update() + { + if (studioSystem.isValid()) + { + if (StudioListener.ListenerCount <= 0 && !listenerWarningIssued) + { + listenerWarningIssued = true; + RuntimeUtils.DebugLogWarning("[FMOD] Please add an 'FMOD Studio Listener' component to your camera in the scene for correct 3D positioning of sounds."); + } + + StudioEventEmitter.UpdateActiveEmitters(); + + for (int i = 0; i < attachedInstances.Count; i++) + { + FMOD.Studio.PLAYBACK_STATE playbackState = FMOD.Studio.PLAYBACK_STATE.STOPPED; + if (attachedInstances[i].instance.isValid()) + { + attachedInstances[i].instance.getPlaybackState(out playbackState); + } + + if (playbackState == FMOD.Studio.PLAYBACK_STATE.STOPPED || + attachedInstances[i].transform == null // destroyed game object + ) + { + attachedInstances[i] = attachedInstances[attachedInstances.Count - 1]; + attachedInstances.RemoveAt(attachedInstances.Count - 1); + i--; + continue; + } + + #if UNITY_PHYSICS_EXIST + if (attachedInstances[i].rigidBody) + { + attachedInstances[i].instance.set3DAttributes(RuntimeUtils.To3DAttributes(attachedInstances[i].transform, attachedInstances[i].rigidBody)); + } + else + #endif + #if UNITY_PHYSICS2D_EXIST + if (attachedInstances[i].rigidBody2D) + { + attachedInstances[i].instance.set3DAttributes(RuntimeUtils.To3DAttributes(attachedInstances[i].transform, attachedInstances[i].rigidBody2D)); + } + else + #endif + { + if (!attachedInstances[i].nonRigidbodyVelocity) + { + attachedInstances[i].instance.set3DAttributes(RuntimeUtils.To3DAttributes(attachedInstances[i].transform)); + } + else + { + var position = attachedInstances[i].transform.position; + var velocity = Vector3.zero; + if (Time.deltaTime != 0) + { + velocity = (position - attachedInstances[i].lastFramePosition) / Time.deltaTime; + velocity = Vector3.ClampMagnitude(velocity, 20.0f); // Stops pitch fluttering when moving too quickly + } + attachedInstances[i].lastFramePosition = position; + attachedInstances[i].instance.set3DAttributes(RuntimeUtils.To3DAttributes(attachedInstances[i].transform, velocity)); + } + } + } + + #if UNITY_EDITOR + ApplyMuteState(); + + for (int i = eventPositionWarnings.Count - 1; i >= 0; i--) + { + if (eventPositionWarnings[i].isValid()) + { + FMOD.ATTRIBUTES_3D attribs; + eventPositionWarnings[i].get3DAttributes(out attribs); + if (attribs.position.x == 1e+17F && + attribs.position.y == 1e+17F && + attribs.position.z == 1e+17F) + { + string path; + FMOD.Studio.EventDescription desc; + eventPositionWarnings[i].getDescription(out desc); + desc.getPath(out path); + RuntimeUtils.DebugLogWarningFormat("[FMOD] Instance of Event {0} has not had EventInstance.set3DAttributes() called on it yet!", path); + } + } + eventPositionWarnings.RemoveAt(i); + } + + isOverlayEnabled = currentPlatform.IsOverlayEnabled; + #endif + + if (isOverlayEnabled) + { + if (!overlayDrawer) + { + overlayDrawer = Instance.gameObject.AddComponent(); + overlayDrawer.TargetRuntimeManager = this; + } + else + { + overlayDrawer.gameObject.SetActive(true); + } + } + else + { + if (overlayDrawer != null && overlayDrawer.gameObject.activeSelf) + { + overlayDrawer.gameObject.SetActive(false); + } + } + + studioSystem.update(); + } + } + + private static AttachedInstance FindOrAddAttachedInstance(FMOD.Studio.EventInstance instance, Transform transform, FMOD.ATTRIBUTES_3D attributes) + { + AttachedInstance attachedInstance = Instance.attachedInstances.Find(x => x.instance.handle == instance.handle); + if (attachedInstance == null) + { + attachedInstance = new AttachedInstance(); + Instance.attachedInstances.Add(attachedInstance); + } + attachedInstance.instance = instance; + attachedInstance.transform = transform; + attachedInstance.instance.set3DAttributes(attributes); + return attachedInstance; + } + + public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, GameObject gameObject, bool nonRigidbodyVelocity = false) + { + AttachedInstance attachedInstance = FindOrAddAttachedInstance(instance, gameObject.transform, RuntimeUtils.To3DAttributes(gameObject.transform)); + + if (nonRigidbodyVelocity) + { + attachedInstance.nonRigidbodyVelocity = nonRigidbodyVelocity; + attachedInstance.lastFramePosition = gameObject.transform.position; + } + } + + [Obsolete("This overload has been deprecated in favor of passing a GameObject instead of a Transform.", false)] + public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, Transform transform, bool nonRigidbodyVelocity = false) + { + AttachedInstance attachedInstance = FindOrAddAttachedInstance(instance, transform, RuntimeUtils.To3DAttributes(transform)); + + if (nonRigidbodyVelocity) + { + attachedInstance.nonRigidbodyVelocity = nonRigidbodyVelocity; + attachedInstance.lastFramePosition = transform.position; + } + } + +#if UNITY_PHYSICS_EXIST + public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, GameObject gameObject, Rigidbody rigidBody) + { + AttachedInstance attachedInstance = FindOrAddAttachedInstance(instance, gameObject.transform, RuntimeUtils.To3DAttributes(gameObject.transform, rigidBody)); + + attachedInstance.rigidBody = rigidBody; + } + + [Obsolete("This overload has been deprecated in favor of passing a GameObject instead of a Transform.", false)] + public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, Transform transform, Rigidbody rigidBody) + { + AttachedInstance attachedInstance = FindOrAddAttachedInstance(instance, transform, RuntimeUtils.To3DAttributes(transform, rigidBody)); + + attachedInstance.rigidBody = rigidBody; + } +#endif + +#if UNITY_PHYSICS2D_EXIST + public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, GameObject gameObject, Rigidbody2D rigidBody2D) + { + AttachedInstance attachedInstance = FindOrAddAttachedInstance(instance, gameObject.transform, RuntimeUtils.To3DAttributes(gameObject.transform, rigidBody2D)); + + attachedInstance.rigidBody2D = rigidBody2D; + } + + [Obsolete("This overload has been deprecated in favor of passing a GameObject instead of a Transform.", false)] + public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, Transform transform, Rigidbody2D rigidBody2D) + { + AttachedInstance attachedInstance = FindOrAddAttachedInstance(instance, transform, RuntimeUtils.To3DAttributes(transform, rigidBody2D)); + + attachedInstance.rigidBody2D = rigidBody2D; + } +#endif + + public static void DetachInstanceFromGameObject(FMOD.Studio.EventInstance instance) + { + var manager = Instance; + for (int i = 0; i < manager.attachedInstances.Count; i++) + { + if (manager.attachedInstances[i].instance.handle == instance.handle) + { + manager.attachedInstances[i] = manager.attachedInstances[manager.attachedInstances.Count - 1]; + manager.attachedInstances.RemoveAt(manager.attachedInstances.Count - 1); + return; + } + } + } + + internal void ExecuteOnGUI() + { + if (currentPlatform.OverlayRect != ScreenPosition.VR) + { + GUIStyle debugStyle = GUI.skin.GetStyle("window"); + debugStyle.fontSize = currentPlatform.OverlayFontSize; + if (studioSystem.isValid() && isOverlayEnabled) + { + windowRect = GUI.Window(GetInstanceID(), windowRect, DrawDebugOverlay, "FMOD Studio Debug", debugStyle); + } + } + else + { +#if UNITY_URP_EXIST + if (vrDebugOverlay != null && vrDebugText != null) + { + UpdateDebugText(); + vrDebugText.text = lastDebugText; + } +#endif + } + } + +#if !UNITY_EDITOR + private void Start() + { + isOverlayEnabled = currentPlatform.IsOverlayEnabled; + } +#endif + + private void UpdateDebugText() + { + if (lastDebugUpdate + 0.25f < Time.unscaledTime) + { + if (initException != null) + { + lastDebugText = initException.Message; + } + else + { + if (!mixerHead.hasHandle()) + { + FMOD.ChannelGroup master; + coreSystem.getMasterChannelGroup(out master); + master.getDSP(0, out mixerHead); + mixerHead.setMeteringEnabled(false, true); + } + + StringBuilder debug = new StringBuilder(); + + FMOD.Studio.CPU_USAGE cpuUsage; + FMOD.CPU_USAGE cpuUsage_core; + studioSystem.getCPUUsage(out cpuUsage, out cpuUsage_core); + debug.AppendFormat("CPU: dsp = {0:F1}%, studio = {1:F1}%\n", cpuUsage_core.dsp, cpuUsage.update); + + int currentAlloc, maxAlloc; + FMOD.Memory.GetStats(out currentAlloc, out maxAlloc); + debug.AppendFormat("MEMORY: cur = {0}MB, max = {1}MB\n", currentAlloc >> 20, maxAlloc >> 20); + + int realchannels, channels; + coreSystem.getChannelsPlaying(out channels, out realchannels); + debug.AppendFormat("CHANNELS: real = {0}, total = {1}\n", realchannels, channels); + + FMOD.DSP_METERING_INFO outputMetering; + mixerHead.getMeteringInfo(IntPtr.Zero, out outputMetering); + float rms = 0; + for (int i = 0; i < outputMetering.numchannels; i++) + { + rms += outputMetering.rmslevel[i] * outputMetering.rmslevel[i]; + } + rms = Mathf.Sqrt(rms / (float)outputMetering.numchannels); + + float db = rms > 0 ? 20.0f * Mathf.Log10(rms * Mathf.Sqrt(2.0f)) : -80.0f; + if (db > 10.0f) db = 10.0f; + + debug.AppendFormat("VOLUME: RMS = {0:f2}db\n", db); + lastDebugText = debug.ToString(); + lastDebugUpdate = Time.unscaledTime; + } + } + } + + private void DrawDebugOverlay(int windowID) + { + UpdateDebugText(); + + GUIStyle debugStyle = GUI.skin.GetStyle("label"); + + debugStyle.fontSize = currentPlatform.OverlayFontSize; + float width = currentPlatform.OverlayFontSize * 20; + float height = currentPlatform.OverlayFontSize * 7; + GUI.Label(new Rect(30, 20, width, height), lastDebugText, debugStyle); + GUI.DragWindow(); + } + + private void OnDestroy() + { + coreSystem.setCallback(null, 0); + ReleaseStudioSystem(); + + initException = null; + instance = null; + +#if UNITY_EDITOR + AppDomain.CurrentDomain.DomainUnload -= HandleDomainUnload; + EditorApplication.playModeStateChanged -= HandlePlayModeStateChange; +#endif + } + +#if UNITY_EDITOR + private static void Destroy() + { + if (instance) + { + DestroyImmediate(instance.gameObject); + } + } + + private void HandleDomainUnload(object sender, EventArgs args) + { + ReleaseStudioSystem(); + } + + private void HandlePlayModeStateChange(PlayModeStateChange state) + { + if (state == PlayModeStateChange.ExitingEditMode || state == PlayModeStateChange.EnteredEditMode) + { + if (state == PlayModeStateChange.ExitingEditMode && EditorSettings.enterPlayModeOptionsEnabled && + (EditorSettings.enterPlayModeOptions | EnterPlayModeOptions.DisableDomainReload) != 0) + { + OnDestroy(); // When domain reload is disabled, OnDestroy is not called when entering play mode, breaking live update. + } + Destroy(); + } + } +#endif + + #if (UNITY_IOS || UNITY_TVOS || UNITY_VISIONOS) && !UNITY_EDITOR + [AOT.MonoPInvokeCallback(typeof(Action))] + private static void HandleInterrupt(bool began) + { + if (Instance.studioSystem.isValid()) + { + // Strings bank is always loaded + if (Instance.loadedBanks.Count > 1) + PauseAllEvents(began); + + if (began) + { + Instance.coreSystem.mixerSuspend(); + } + else + { + Instance.coreSystem.mixerResume(); + } + } + } + #else + private void OnApplicationPause(bool pauseStatus) + { + if (studioSystem.isValid()) + { + PauseAllEvents(pauseStatus); + + if (pauseStatus) + { + coreSystem.mixerSuspend(); + } + else + { + coreSystem.mixerResume(); + } + } + } + #endif + + private static void ReferenceLoadedBank(string bankName, bool loadSamples) + { + LoadedBank loadedBank = Instance.loadedBanks[bankName]; + loadedBank.RefCount++; + + if (loadSamples) + { + loadedBank.Bank.loadSampleData(); + } + + Instance.loadedBanks[bankName] = loadedBank; // Save the incremented reference count + } + + private void RegisterLoadedBank(LoadedBank loadedBank, string bankPath, string bankName, bool loadSamples, FMOD.RESULT loadResult) + { + if (loadResult == FMOD.RESULT.OK) + { + loadedBank.RefCount = 1; + + if (loadSamples) + { + loadedBank.Bank.loadSampleData(); + } + + Instance.loadedBanks.Add(bankName, loadedBank); + } + else if (loadResult == FMOD.RESULT.ERR_EVENT_ALREADY_LOADED) + { + RuntimeUtils.DebugLogWarningFormat("[FMOD] Unable to load {0} - bank already loaded. This may occur when attempting to load another localized bank before the first is unloaded, or if a bank has been loaded via the API.", bankName); + } + else + { + throw new BankLoadException(bankPath, loadResult); + } + + ExecuteSampleLoadRequestsIfReady(); + } + + private void ExecuteSampleLoadRequestsIfReady() + { + if (sampleLoadRequests.Count > 0) + { + foreach (string bankName in sampleLoadRequests) + { + if (!loadedBanks.ContainsKey(bankName)) + { + // Not ready + return; + } + } + + // All requested banks are loaded, so we can now load sample data + foreach (string bankName in sampleLoadRequests) + { + LoadedBank loadedBank = loadedBanks[bankName]; + CheckInitResult(loadedBank.Bank.loadSampleData(), + string.Format("Loading sample data for bank: {0}", bankName)); + } + + sampleLoadRequests.Clear(); + } + } + +#if UNITY_ANDROID || UNITY_WEBGL + private IEnumerator loadFromWeb(string bankPath, string bankName, bool loadSamples) + { + byte[] loadWebResult; + FMOD.RESULT loadResult; + + UnityEngine.Networking.UnityWebRequest www = UnityEngine.Networking.UnityWebRequest.Get(bankPath); + yield return www.SendWebRequest(); + loadWebResult = www.downloadHandler.data; + + LoadedBank loadedBank = new LoadedBank(); + loadResult = Instance.studioSystem.loadBankMemory(loadWebResult, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out loadedBank.Bank); + if (loadResult != FMOD.RESULT.OK) + { + RuntimeUtils.DebugLogWarningFormat("[FMOD] loadFromWeb. Path = {0}, result = {1}.", bankPath, loadResult); + } + RegisterLoadedBank(loadedBank, bankPath, bankName, loadSamples, loadResult); + loadingBanksRef--; + + RuntimeUtils.DebugLogFormat("[FMOD] Finished loading {0}", bankPath); + } +#endif // UNITY_ANDROID || UNITY_WEBGL + + public static void LoadBank(string bankName, bool loadSamples = false) + { + LoadBank(bankName, loadSamples, bankName); + } + + private static void LoadBank(string bankName, bool loadSamples, string bankId) + { + if (Instance.loadedBanks.ContainsKey(bankId)) + { + ReferenceLoadedBank(bankId, loadSamples); + } + else + { + string bankFolder = Instance.currentPlatform.GetBankFolder(); + +#if !UNITY_EDITOR + if (!string.IsNullOrEmpty(Settings.Instance.TargetSubFolder)) + { + bankFolder = RuntimeUtils.GetCommonPlatformPath(Path.Combine(bankFolder, Settings.Instance.TargetSubFolder)); + } +#endif + + const string BankExtension = ".bank"; + + string bankPath; + + if (System.IO.Path.GetExtension(bankName) != BankExtension) + { + bankPath = string.Format("{0}/{1}{2}", bankFolder, bankName, BankExtension); + } + else + { + bankPath = string.Format("{0}/{1}", bankFolder, bankName); + } + Instance.loadingBanksRef++; +#if UNITY_ANDROID && !UNITY_EDITOR + if (Settings.Instance.AndroidUseOBB) + { + Instance.StartCoroutine(Instance.loadFromWeb(bankPath, bankName, loadSamples)); + } + else +#elif UNITY_WEBGL && !UNITY_EDITOR + if (true) + { + Instance.StartCoroutine(Instance.loadFromWeb(bankPath, bankName, loadSamples)); + } + else +#endif // (UNITY_ANDROID || UNITY_WEBGL) && !UNITY_EDITOR + { + LoadedBank loadedBank = new LoadedBank(); + FMOD.RESULT loadResult = Instance.studioSystem.loadBankFile(bankPath, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out loadedBank.Bank); + Instance.RegisterLoadedBank(loadedBank, bankPath, bankId, loadSamples, loadResult); + Instance.loadingBanksRef--; + } + } + + } + + public static void LoadBank(TextAsset asset, bool loadSamples = false) + { + LoadBank(asset, loadSamples, asset.name); + } + + private static void LoadBank(TextAsset asset, bool loadSamples, string bankId) + { + if (Instance.loadedBanks.ContainsKey(bankId)) + { + ReferenceLoadedBank(bankId, loadSamples); + } + else + { +#if UNITY_EDITOR + if (asset.text.StartsWith(BankStubPrefix)) + { + string name = asset.text.Substring(BankStubPrefix.Length); + LoadBank(name, loadSamples, bankId); + return; + } +#endif + + LoadedBank loadedBank = new LoadedBank(); + FMOD.RESULT loadResult = Instance.studioSystem.loadBankMemory(asset.bytes, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out loadedBank.Bank); + Instance.RegisterLoadedBank(loadedBank, bankId, bankId, loadSamples, loadResult); + } + } + +#if UNITY_ADDRESSABLES_EXIST + public static void LoadBank(AssetReference assetReference, bool loadSamples = false, System.Action completionCallback = null) + { + if (Instance.loadedBanks.ContainsKey(assetReference.AssetGUID)) + { + ReferenceLoadedBank(assetReference.AssetGUID, loadSamples); + } + else + { + Instance.loadingBanksRef++; + assetReference.LoadAssetAsync().Completed += (obj) => + { + if (!obj.IsValid()) + { + RuntimeUtils.DebugLogError("[FMOD] Unable to load AssetReference: " + obj.OperationException); + return; + } + + TextAsset bank = obj.Result; + LoadBank(bank, loadSamples, assetReference.AssetGUID); + + Instance.loadingBanksRef--; + + if (completionCallback != null) + { + completionCallback(); + } + + assetReference.ReleaseAsset(); + }; + + } + } +#endif + + private void LoadBanks(Settings fmodSettings) + { + if (fmodSettings.ImportType == ImportType.StreamingAssets) + { + if (fmodSettings.AutomaticSampleLoading) + { + sampleLoadRequests.AddRange(BanksToLoad(fmodSettings)); + } + + try + { + foreach (string bankName in BanksToLoad(fmodSettings)) + { + LoadBank(bankName); + } + + WaitForAllSampleLoading(); + } + catch (BankLoadException e) + { + RuntimeUtils.DebugLogException(e); + } + } + } + + private IEnumerable BanksToLoad(Settings fmodSettings) + { + switch (fmodSettings.BankLoadType) + { + case BankLoadType.All: + foreach (string masterBankFileName in fmodSettings.MasterBanks) + { + yield return masterBankFileName + ".strings"; + yield return masterBankFileName; + } + + foreach (var bank in fmodSettings.Banks) + { + yield return bank; + } + break; + case BankLoadType.Specified: + foreach (var bank in fmodSettings.BanksToLoad) + { + if (!string.IsNullOrEmpty(bank)) + { + yield return bank; + } + } + break; + case BankLoadType.None: + break; + default: + break; + } + } + + public static void UnloadBank(string bankName) + { + LoadedBank loadedBank; + if (Instance.loadedBanks.TryGetValue(bankName, out loadedBank)) + { + loadedBank.RefCount--; + if (loadedBank.RefCount == 0) + { + loadedBank.Bank.unload(); + Instance.loadedBanks.Remove(bankName); + Instance.sampleLoadRequests.Remove(bankName); + return; + } + Instance.loadedBanks[bankName] = loadedBank; + } + } + + public static void UnloadBank(TextAsset asset) + { + UnloadBank(asset.name); + } + +#if UNITY_ADDRESSABLES_EXIST + public static void UnloadBank(AssetReference assetReference) + { + UnloadBank(assetReference.AssetGUID); + } +#endif + + [Obsolete("[FMOD] Deprecated. Use AnySampleDataLoading instead.")] + public static bool AnyBankLoading() + { + return AnySampleDataLoading(); + } + + public static bool AnySampleDataLoading() + { + bool loading = false; + foreach (LoadedBank bank in Instance.loadedBanks.Values) + { + FMOD.Studio.LOADING_STATE loadingState; + bank.Bank.getSampleLoadingState(out loadingState); + loading |= (loadingState == FMOD.Studio.LOADING_STATE.LOADING); + } + return loading; + } + + [Obsolete("[FMOD] Deprecated. Use WaitForAllSampleLoading instead.")] + public static void WaitForAllLoads() + { + WaitForAllSampleLoading(); + } + + public static void WaitForAllSampleLoading() + { + Instance.studioSystem.flushSampleLoading(); + } + + public static FMOD.GUID PathToGUID(string path) + { + FMOD.GUID guid; + if (path.StartsWith("{")) + { + FMOD.Studio.Util.parseID(path, out guid); + } + else + { + var result = Instance.studioSystem.lookupID(path, out guid); + if (result == FMOD.RESULT.ERR_EVENT_NOTFOUND) + { + throw new EventNotFoundException(path); + } + } + return guid; + } + + public static EventReference PathToEventReference(string path) + { + FMOD.GUID guid; + + try + { + guid = PathToGUID(path); + } + catch (EventNotFoundException) + { + guid = new FMOD.GUID(); + } + +#if UNITY_EDITOR + return new EventReference() { Path = path, Guid = guid }; +#else + return new EventReference() { Guid = guid }; +#endif + } + + public static FMOD.Studio.EventInstance CreateInstance(EventReference eventReference) + { + try + { + return CreateInstance(eventReference.Guid); + } + catch (EventNotFoundException) + { + throw new EventNotFoundException(eventReference); + } + } + + public static FMOD.Studio.EventInstance CreateInstance(string path) + { + try + { + return CreateInstance(PathToGUID(path)); + } + catch(EventNotFoundException) + { + // Switch from exception with GUID to exception with path + throw new EventNotFoundException(path); + } + } + + public static FMOD.Studio.EventInstance CreateInstance(FMOD.GUID guid) + { + FMOD.Studio.EventDescription eventDesc = GetEventDescription(guid); + FMOD.Studio.EventInstance newInstance; + eventDesc.createInstance(out newInstance); + + #if UNITY_EDITOR + bool is3D = false; + eventDesc.is3D(out is3D); + if (is3D) + { + // Set position to 1e+17F, set3DAttributes should be called by the dev after this. + newInstance.set3DAttributes(RuntimeUtils.To3DAttributes(new Vector3(1e+17F, 1e+17F, 1e+17F))); + instance.eventPositionWarnings.Add(newInstance); + } + #endif + + return newInstance; + } + + public static void PlayOneShot(EventReference eventReference, Vector3 position = new Vector3()) + { + try + { + PlayOneShot(eventReference.Guid, position); + } + catch (EventNotFoundException) + { + RuntimeUtils.DebugLogWarning("[FMOD] Event not found: " + eventReference); + } + } + + public static void PlayOneShot(string path, Vector3 position = new Vector3()) + { + try + { + PlayOneShot(PathToGUID(path), position); + } + catch (EventNotFoundException) + { + RuntimeUtils.DebugLogWarning("[FMOD] Event not found: " + path); + } + } + + public static void PlayOneShot(FMOD.GUID guid, Vector3 position = new Vector3()) + { + var instance = CreateInstance(guid); + instance.set3DAttributes(RuntimeUtils.To3DAttributes(position)); + instance.start(); + instance.release(); + } + + public static void PlayOneShotAttached(EventReference eventReference, GameObject gameObject) + { + try + { + PlayOneShotAttached(eventReference.Guid, gameObject); + } + catch (EventNotFoundException) + { + RuntimeUtils.DebugLogWarning("[FMOD] Event not found: " + eventReference); + } + } + + public static void PlayOneShotAttached(string path, GameObject gameObject) + { + try + { + PlayOneShotAttached(PathToGUID(path), gameObject); + } + catch (EventNotFoundException) + { + RuntimeUtils.DebugLogWarning("[FMOD] Event not found: " + path); + } + } + + public static void PlayOneShotAttached(FMOD.GUID guid, GameObject gameObject) + { + var instance = CreateInstance(guid); + #if UNITY_PHYSICS_EXIST + AttachInstanceToGameObject(instance, gameObject, gameObject.GetComponent()); + #elif UNITY_PHYSICS2D_EXIST + AttachInstanceToGameObject(instance, gameObject, gameObject.GetComponent()); + #else + AttachInstanceToGameObject(instance, gameObject); + #endif + instance.start(); + instance.release(); + } + + public static FMOD.Studio.EventDescription GetEventDescription(EventReference eventReference) + { + try + { + return GetEventDescription(eventReference.Guid); + } + catch (EventNotFoundException) + { + throw new EventNotFoundException(eventReference); + } + } + + public static FMOD.Studio.EventDescription GetEventDescription(string path) + { + try + { + return GetEventDescription(PathToGUID(path)); + } + catch (EventNotFoundException) + { + throw new EventNotFoundException(path); + } + } + + public static FMOD.Studio.EventDescription GetEventDescription(FMOD.GUID guid) + { + FMOD.Studio.EventDescription eventDesc; + if (Instance.cachedDescriptions.ContainsKey(guid) && Instance.cachedDescriptions[guid].isValid()) + { + eventDesc = Instance.cachedDescriptions[guid]; + } + else + { + var result = Instance.studioSystem.getEventByID(guid, out eventDesc); + + if (result != FMOD.RESULT.OK) + { + throw new EventNotFoundException(guid); + } + + if (eventDesc.isValid()) + { + Instance.cachedDescriptions[guid] = eventDesc; + } + } + return eventDesc; + } + +#if UNITY_PHYSICS_EXIST + public static void SetListenerLocation(GameObject gameObject, Rigidbody rigidBody, GameObject attenuationObject = null) + { + SetListenerLocation(0, gameObject, rigidBody, attenuationObject); + } + + public static void SetListenerLocation(int listenerIndex, GameObject gameObject, Rigidbody rigidBody, GameObject attenuationObject = null) + { + if(attenuationObject) + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform, rigidBody), RuntimeUtils.ToFMODVector(attenuationObject.transform.position)); + } + else + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform, rigidBody)); + } + } +#endif + +#if UNITY_PHYSICS2D_EXIST + public static void SetListenerLocation(GameObject gameObject, Rigidbody2D rigidBody2D, GameObject attenuationObject = null) + { + SetListenerLocation(0, gameObject, rigidBody2D, attenuationObject); + } + + public static void SetListenerLocation(int listenerIndex, GameObject gameObject, Rigidbody2D rigidBody2D, GameObject attenuationObject = null) + { + if (attenuationObject) + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform, rigidBody2D), RuntimeUtils.ToFMODVector(attenuationObject.transform.position)); + } + else + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform, rigidBody2D)); + } + } +#endif + + public static void SetListenerLocation(int listenerIndex, GameObject gameObject, GameObject attenuationObject = null, Vector3 velocity = new Vector3()) + { + if (attenuationObject) + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform, velocity), RuntimeUtils.ToFMODVector(attenuationObject.transform.position)); + } + else + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform, velocity)); + } + } + + public static void SetListenerLocation(GameObject gameObject, GameObject attenuationObject = null) + { + SetListenerLocation(0, gameObject, attenuationObject); + } + + public static void SetListenerLocation(int listenerIndex, GameObject gameObject, GameObject attenuationObject = null) + { + if (attenuationObject) + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform), RuntimeUtils.ToFMODVector(attenuationObject.transform.position)); + } + else + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject.transform)); + } + } + + public static FMOD.Studio.Bus GetBus(string path) + { + FMOD.Studio.Bus bus; + if (StudioSystem.getBus(path, out bus) != FMOD.RESULT.OK) + { + throw new BusNotFoundException(path); + } + return bus; + } + + public static FMOD.Studio.VCA GetVCA(string path) + { + FMOD.Studio.VCA vca; + if (StudioSystem.getVCA(path, out vca) != FMOD.RESULT.OK) + { + throw new VCANotFoundException(path); + } + return vca; + } + + public static void PauseAllEvents(bool paused) + { + FMOD.Studio.Bus masterBus; + if (StudioSystem.getBus("bus:/", out masterBus) == FMOD.RESULT.OK) + { + masterBus.setPaused(paused); + } + } + + public static void MuteAllEvents(bool muted) + { + Instance.isMuted = muted; + + ApplyMuteState(); + } + + private static void ApplyMuteState() + { + FMOD.Studio.Bus masterBus; + if (StudioSystem.getBus("bus:/", out masterBus) == FMOD.RESULT.OK) + { +#if UNITY_EDITOR + masterBus.setMute(Instance.isMuted || EditorUtility.audioMasterMute); +#else + masterBus.setMute(Instance.isMuted); +#endif + } + } + + public static bool IsInitialized + { + get + { + return instance != null && instance.studioSystem.isValid(); + } + } + + public static bool HaveAllBanksLoaded + { + get + { + return Instance.loadingBanksRef == 0; + } + } + + public static bool HaveMasterBanksLoaded + { + get + { + var banks = Settings.Instance.MasterBanks; + foreach(var bank in banks) + { + if (!HasBankLoaded(bank)) return false; + } + return true; + } + } + + public static bool HasBankLoaded(string loadedBank) + { + return (Instance.loadedBanks.ContainsKey(loadedBank)); + } + +#if (UNITY_IOS || UNITY_TVOS || UNITY_VISIONOS) && !UNITY_EDITOR + [DllImport("__Internal")] + private static extern void RegisterSuspendCallback(Action func); +#endif + + private void SetOverlayPosition() + { + float width = currentPlatform.OverlayFontSize * 20; + float height = currentPlatform.OverlayFontSize * 7; + float margin = 30; + + switch (currentPlatform.OverlayRect) + { + case ScreenPosition.TopLeft: + windowRect = new Rect(margin, margin, width, height); + break; + case ScreenPosition.TopCenter: + windowRect = new Rect((Screen.width / 2) - (width / 2), margin, width, height); + break; + case ScreenPosition.TopRight: + windowRect = new Rect(Screen.width - (width + margin), margin, width, height); + break; + case ScreenPosition.BottomLeft: + windowRect = new Rect(margin, Screen.height - (height + margin), width, height); + break; + case ScreenPosition.BottomCenter: + windowRect = new Rect((Screen.width / 2) - (width / 2), Screen.height - (height + margin), width, height); + break; + case ScreenPosition.BottomRight: + windowRect = new Rect(Screen.width - (width + margin), Screen.height - (height + margin), width, height); + break; + case ScreenPosition.Center: + windowRect = new Rect((Screen.width / 2) - (width / 2), (Screen.height / 2) - (height / 2), width, height); + break; + case ScreenPosition.VR: +#if UNITY_URP_EXIST + int fmodOverlayLayer = LayerMask.NameToLayer("fmodOverlayLayer"); + UniversalAdditionalCameraData mainCameraData = Camera.main.GetComponent(); + if (fmodOverlayLayer != -1 && mainCameraData != null) + { + vrDebugCamera = Instantiate(Camera.main, Camera.main.transform); + vrDebugCamera.name = "FMOD: UI Camera"; + vrDebugCamera.transform.DetachChildren(); + vrDebugCamera.cullingMask = (1 << fmodOverlayLayer); + Camera.main.cullingMask &= ~(1 << fmodOverlayLayer); + vrDebugCamera.GetComponent().renderType = CameraRenderType.Overlay; + mainCameraData.cameraStack.Add(vrDebugCamera); + vrDebugOverlay = new GameObject(); + vrDebugOverlay.layer = fmodOverlayLayer; + vrDebugOverlay.transform.position = Vector3.zero; + vrDebugOverlay.name = "FMOD: VRDebugOverlay"; + Canvas canvas = vrDebugOverlay.AddComponent(); + vrDebugRectTransform = vrDebugOverlay.GetComponent(); + vrDebugRectTransform.position = new Vector3(0, 0, 500); + vrDebugRectTransform.sizeDelta = new Vector2(300, 100); + vrDebugRectTransform.localScale = new Vector3(-1, 1, 1); + vrDebugText = vrDebugOverlay.AddComponent(); + canvas.renderMode = RenderMode.WorldSpace; + canvas.worldCamera = vrDebugCamera; + vrDebugText.color = Color.black; +#if UNITY_2022_1_OR_NEWER + vrDebugText.font = Resources.GetBuiltinResource(typeof(Font), "LegacyRuntime.ttf") as Font; +#else + vrDebugText.font = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font; +#endif + Quaternion rot = vrDebugCamera.transform.rotation; + rot.z = 0; + Vector3 pos = vrDebugCamera.transform.position + (rot * Vector3.forward * 500); + pos.y = 0; + vrDebugRectTransform.transform.position = pos; + vrDebugRectTransform.transform.LookAt(vrDebugCamera.transform.position); + canvas.transform.SetParent(vrDebugCamera.transform); + } + else + { + if (fmodOverlayLayer == -1) + { + RuntimeUtils.DebugLogWarning("[FMOD] Missing 'fmodOverlayLayer' layer, Cannot display Debug Overlay"); + } + else if (mainCameraData == null) + { + RuntimeUtils.DebugLogWarning("[FMOD] Universal Render Pipeline Required, Cannot display Debug Overlay"); + } + else + { + RuntimeUtils.DebugLogWarning("[FMOD] Unknown Debug Overlay issue. Contact Support"); + } + } + break; +#else + RuntimeUtils.DebugLogWarning("[FMOD] UNITY_URP_EXIST is not defined. The VR debug overlay requires the Universal Render Pipeline."); + break; +#endif + default: + windowRect = new Rect(margin, margin, width, height); + break; + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/RuntimeManager.cs.meta b/Assets/Plugins/FMOD/src/RuntimeManager.cs.meta new file mode 100644 index 00000000..b0ae704d --- /dev/null +++ b/Assets/Plugins/FMOD/src/RuntimeManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5e5fb8ce07f0ce84b9d1852869527ea5 +timeCreated: 1444628977 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 100 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/RuntimeUtils.cs b/Assets/Plugins/FMOD/src/RuntimeUtils.cs new file mode 100644 index 00000000..0518df13 --- /dev/null +++ b/Assets/Plugins/FMOD/src/RuntimeUtils.cs @@ -0,0 +1,628 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMOD +{ + [Serializable] + public partial struct GUID : IEquatable + { + public GUID(Guid guid) + { + byte[] bytes = guid.ToByteArray(); + + Data1 = BitConverter.ToInt32(bytes, 0); + Data2 = BitConverter.ToInt32(bytes, 4); + Data3 = BitConverter.ToInt32(bytes, 8); + Data4 = BitConverter.ToInt32(bytes, 12); + } + + public static GUID Parse(string s) + { + return new GUID(new Guid(s)); + } + + public bool IsNull + { + get + { + return Data1 == 0 + && Data2 == 0 + && Data3 == 0 + && Data4 == 0; + } + } + + public override bool Equals(object other) + { + return (other is GUID) && Equals((GUID)other); + } + + public bool Equals(GUID other) + { + return Data1 == other.Data1 + && Data2 == other.Data2 + && Data3 == other.Data3 + && Data4 == other.Data4; + } + + public static bool operator==(GUID a, GUID b) + { + return a.Equals(b); + } + + public static bool operator!=(GUID a, GUID b) + { + return !a.Equals(b); + } + + public override int GetHashCode() + { + return Data1 ^ Data2 ^ Data3 ^ Data4; + } + + public static implicit operator Guid(GUID guid) + { + return new Guid(guid.Data1, + (short) ((guid.Data2 >> 0) & 0xFFFF), + (short) ((guid.Data2 >> 16) & 0xFFFF), + (byte) ((guid.Data3 >> 0) & 0xFF), + (byte) ((guid.Data3 >> 8) & 0xFF), + (byte) ((guid.Data3 >> 16) & 0xFF), + (byte) ((guid.Data3 >> 24) & 0xFF), + (byte) ((guid.Data4 >> 0) & 0xFF), + (byte) ((guid.Data4 >> 8) & 0xFF), + (byte) ((guid.Data4 >> 16) & 0xFF), + (byte) ((guid.Data4 >> 24) & 0xFF) + ); + } + + public override string ToString() + { + return ((Guid)this).ToString("B"); + } + } +} + +namespace FMODUnity +{ + public class EventNotFoundException : Exception + { + public FMOD.GUID Guid; + public string Path; + + public EventNotFoundException(string path) + : base("[FMOD] Event not found: '" + path + "'") + { + Path = path; + } + + public EventNotFoundException(FMOD.GUID guid) + : base("[FMOD] Event not found: " + guid) + { + Guid = guid; + } + + public EventNotFoundException(EventReference eventReference) + : base("[FMOD] Event not found: " + eventReference.ToString()) + { + Guid = eventReference.Guid; + +#if UNITY_EDITOR + Path = eventReference.Path; +#endif + } + } + + public class BusNotFoundException : Exception + { + public string Path; + + public BusNotFoundException(string path) + : base("[FMOD] Bus not found '" + path + "'") + { + Path = path; + } + } + + public class VCANotFoundException : Exception + { + public string Path; + + public VCANotFoundException(string path) + : base("[FMOD] VCA not found '" + path + "'") + { + Path = path; + } + } + + public class BankLoadException : Exception + { + public string Path; + public FMOD.RESULT Result; + + public BankLoadException(string path, FMOD.RESULT result) + : base(string.Format("[FMOD] Could not load bank '{0}' : {1} : {2}", path, result.ToString(), FMOD.Error.String(result))) + { + Path = path; + Result = result; + } + public BankLoadException(string path, string error) + : base(string.Format("[FMOD] Could not load bank '{0}' : {1}", path, error)) + { + Path = path; + Result = FMOD.RESULT.ERR_INTERNAL; + } + } + + public class SystemNotInitializedException : Exception + { + public FMOD.RESULT Result; + public string Location; + + public SystemNotInitializedException(FMOD.RESULT result, string location) + : base(string.Format("[FMOD] Initialization failed : {2} : {0} : {1}", result.ToString(), FMOD.Error.String(result), location)) + { + Result = result; + Location = location; + } + + public SystemNotInitializedException(Exception inner) + : base("[FMOD] Initialization failed", inner) + { + } + } + + public enum EmitterGameEvent : int + { + None, + ObjectStart, + ObjectDestroy, + TriggerEnter, + TriggerExit, + TriggerEnter2D, + TriggerExit2D, + CollisionEnter, + CollisionExit, + CollisionEnter2D, + CollisionExit2D, + ObjectEnable, + ObjectDisable, + ObjectMouseEnter, + ObjectMouseExit, + ObjectMouseDown, + ObjectMouseUp, + UIMouseEnter, + UIMouseExit, + UIMouseDown, + UIMouseUp, + } + + public enum LoaderGameEvent : int + { + None, + ObjectStart, + ObjectDestroy, + TriggerEnter, + TriggerExit, + TriggerEnter2D, + TriggerExit2D, + ObjectEnable, + ObjectDisable, + } + + // We use our own enum to avoid serialization issues if FMOD.THREAD_TYPE changes + public enum ThreadType + { + Mixer, + Feeder, + Stream, + File, + Nonblocking, + Record, + Geometry, + Profiler, + Studio_Update, + Studio_Load_Bank, + Studio_Load_Sample, + Convolution_1, + Convolution_2, + } + + // We use our own enum to avoid serialization issues if FMOD.THREAD_AFFINITY changes + [Flags] + public enum ThreadAffinity : uint + { + Any = 0, + Core0 = 1 << 0, + Core1 = 1 << 1, + Core2 = 1 << 2, + Core3 = 1 << 3, + Core4 = 1 << 4, + Core5 = 1 << 5, + Core6 = 1 << 6, + Core7 = 1 << 7, + Core8 = 1 << 8, + Core9 = 1 << 9, + Core10 = 1 << 10, + Core11 = 1 << 11, + Core12 = 1 << 12, + Core13 = 1 << 13, + Core14 = 1 << 14, + Core15 = 1 << 15, + } + + // Using a separate enum to avoid serialization issues if FMOD.SOUND_TYPE changes. + public enum CodecType : int + { + FADPCM, + Vorbis, + AT9, + XMA, + Opus + } + + [Serializable] + public class ThreadAffinityGroup + { + public List threads = new List(); + public ThreadAffinity affinity = ThreadAffinity.Any; + + public ThreadAffinityGroup() + { + } + + public ThreadAffinityGroup(ThreadAffinityGroup other) + { + threads = new List(other.threads); + affinity = other.affinity; + } + + public ThreadAffinityGroup(ThreadAffinity affinity, params ThreadType[] threads) + { + this.threads = new List(threads); + this.affinity = affinity; + } + } + + [Serializable] + public class CodecChannelCount + { + public CodecType format; + public int channels; + + public CodecChannelCount() { } + + public CodecChannelCount(CodecChannelCount other) + { + format = other.format; + channels = other.channels; + } + } + + public static class RuntimeUtils + { +#if UNITY_EDITOR + private static string pluginBasePath; + + public const string BaseFolderGUID = "06ae579381df01a4a87bb149dec89954"; + public const string PluginBasePathDefault = "Assets/Plugins/FMOD"; + + public static string PluginBasePath + { + get + { + if (pluginBasePath == null) + { + pluginBasePath = AssetDatabase.GUIDToAssetPath(BaseFolderGUID); + + if (string.IsNullOrEmpty(pluginBasePath)) + { + pluginBasePath = PluginBasePathDefault; + + DebugLogWarningFormat("FMOD: Couldn't find base folder with GUID {0}; defaulting to {1}", + BaseFolderGUID, pluginBasePath); + } + } + + return pluginBasePath; + } + } +#endif + + public static string GetCommonPlatformPath(string path) + { + if (string.IsNullOrEmpty(path)) + { + return path; + } + + return path.Replace('\\', '/'); + } + + public static FMOD.VECTOR ToFMODVector(this Vector3 vec) + { + FMOD.VECTOR temp; + temp.x = vec.x; + temp.y = vec.y; + temp.z = vec.z; + + return temp; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(this Vector3 pos) + { + FMOD.ATTRIBUTES_3D attributes = new FMOD.ATTRIBUTES_3D(); + attributes.forward = ToFMODVector(Vector3.forward); + attributes.up = ToFMODVector(Vector3.up); + attributes.position = ToFMODVector(pos); + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(this Transform transform) + { + FMOD.ATTRIBUTES_3D attributes = new FMOD.ATTRIBUTES_3D(); + attributes.forward = transform.forward.ToFMODVector(); + attributes.up = transform.up.ToFMODVector(); + attributes.position = transform.position.ToFMODVector(); + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(this Transform transform, Vector3 velocity) + { + FMOD.ATTRIBUTES_3D attributes = new FMOD.ATTRIBUTES_3D(); + attributes.forward = transform.forward.ToFMODVector(); + attributes.up = transform.up.ToFMODVector(); + attributes.position = transform.position.ToFMODVector(); + attributes.velocity = velocity.ToFMODVector(); + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(this GameObject go) + { + return go.transform.To3DAttributes(); + } + +#if UNITY_PHYSICS_EXIST + public static FMOD.ATTRIBUTES_3D To3DAttributes(Transform transform, Rigidbody rigidbody = null) + { + FMOD.ATTRIBUTES_3D attributes = transform.To3DAttributes(); + + if (rigidbody) + { +#if UNITY_6000_0_OR_NEWER + attributes.velocity = rigidbody.linearVelocity.ToFMODVector(); +#else + attributes.velocity = rigidbody.velocity.ToFMODVector(); +#endif + } + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(GameObject go, Rigidbody rigidbody) + { + FMOD.ATTRIBUTES_3D attributes = go.transform.To3DAttributes(); + + if (rigidbody) + { +#if UNITY_6000_0_OR_NEWER + attributes.velocity = rigidbody.linearVelocity.ToFMODVector(); +#else + attributes.velocity = rigidbody.velocity.ToFMODVector(); +#endif + } + + return attributes; + } +#endif + +#if UNITY_PHYSICS2D_EXIST + public static FMOD.ATTRIBUTES_3D To3DAttributes(Transform transform, Rigidbody2D rigidbody) + { + FMOD.ATTRIBUTES_3D attributes = transform.To3DAttributes(); + + if (rigidbody) + { + FMOD.VECTOR vel; +#if UNITY_6000_1_OR_NEWER + vel.x = rigidbody.linearVelocity.x; + vel.y = rigidbody.linearVelocity.y; +#else +#pragma warning disable CS0618 + vel.x = rigidbody.velocity.x; + vel.y = rigidbody.velocity.y; +#pragma warning restore CS0618 +#endif + vel.z = 0; + attributes.velocity = vel; + } + + return attributes; + } + + + public static FMOD.ATTRIBUTES_3D To3DAttributes(GameObject go, Rigidbody2D rigidbody) + { + FMOD.ATTRIBUTES_3D attributes = go.transform.To3DAttributes(); + + if (rigidbody) + { + FMOD.VECTOR vel; +#if UNITY_6000_1_OR_NEWER + vel.x = rigidbody.linearVelocity.x; + vel.y = rigidbody.linearVelocity.y; +#else +#pragma warning disable CS0618 + vel.x = rigidbody.velocity.x; + vel.y = rigidbody.velocity.y; +#pragma warning restore CS0618 +#endif + vel.z = 0; + attributes.velocity = vel; + } + + return attributes; + } +#endif + + public static FMOD.THREAD_TYPE ToFMODThreadType(ThreadType threadType) + { + switch (threadType) + { + case ThreadType.Mixer: + return FMOD.THREAD_TYPE.MIXER; + case ThreadType.Feeder: + return FMOD.THREAD_TYPE.FEEDER; + case ThreadType.Stream: + return FMOD.THREAD_TYPE.STREAM; + case ThreadType.File: + return FMOD.THREAD_TYPE.FILE; + case ThreadType.Nonblocking: + return FMOD.THREAD_TYPE.NONBLOCKING; + case ThreadType.Record: + return FMOD.THREAD_TYPE.RECORD; + case ThreadType.Geometry: + return FMOD.THREAD_TYPE.GEOMETRY; + case ThreadType.Profiler: + return FMOD.THREAD_TYPE.PROFILER; + case ThreadType.Studio_Update: + return FMOD.THREAD_TYPE.STUDIO_UPDATE; + case ThreadType.Studio_Load_Bank: + return FMOD.THREAD_TYPE.STUDIO_LOAD_BANK; + case ThreadType.Studio_Load_Sample: + return FMOD.THREAD_TYPE.STUDIO_LOAD_SAMPLE; + case ThreadType.Convolution_1: + return FMOD.THREAD_TYPE.CONVOLUTION1; + case ThreadType.Convolution_2: + return FMOD.THREAD_TYPE.CONVOLUTION2; + default: + throw new ArgumentException("Unrecognised thread type '" + threadType.ToString() + "'"); + } + } + + public static string DisplayName(this ThreadType thread) + { + return thread.ToString().Replace('_', ' '); + } + + public static FMOD.THREAD_AFFINITY ToFMODThreadAffinity(ThreadAffinity affinity) + { + FMOD.THREAD_AFFINITY fmodAffinity = FMOD.THREAD_AFFINITY.CORE_ALL; + + SetFMODAffinityBit(affinity, ThreadAffinity.Core0, FMOD.THREAD_AFFINITY.CORE_0, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core1, FMOD.THREAD_AFFINITY.CORE_1, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core2, FMOD.THREAD_AFFINITY.CORE_2, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core3, FMOD.THREAD_AFFINITY.CORE_3, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core4, FMOD.THREAD_AFFINITY.CORE_4, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core5, FMOD.THREAD_AFFINITY.CORE_5, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core6, FMOD.THREAD_AFFINITY.CORE_6, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core7, FMOD.THREAD_AFFINITY.CORE_7, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core8, FMOD.THREAD_AFFINITY.CORE_8, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core9, FMOD.THREAD_AFFINITY.CORE_9, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core10, FMOD.THREAD_AFFINITY.CORE_10, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core11, FMOD.THREAD_AFFINITY.CORE_11, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core12, FMOD.THREAD_AFFINITY.CORE_12, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core13, FMOD.THREAD_AFFINITY.CORE_13, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core14, FMOD.THREAD_AFFINITY.CORE_14, ref fmodAffinity); + SetFMODAffinityBit(affinity, ThreadAffinity.Core15, FMOD.THREAD_AFFINITY.CORE_15, ref fmodAffinity); + + return fmodAffinity; + } + + private static void SetFMODAffinityBit(ThreadAffinity affinity, ThreadAffinity mask, + FMOD.THREAD_AFFINITY fmodMask, ref FMOD.THREAD_AFFINITY fmodAffinity) + { + if ((affinity & mask) != 0) + { + fmodAffinity |= fmodMask; + } + } + + public static void EnforceLibraryOrder() + { + // Call a function in fmod.dll to make sure it's loaded before fmodstudio.dll + int temp1, temp2; + FMOD.Memory.GetStats(out temp1, out temp2); + + FMOD.GUID temp3; + FMOD.Studio.Util.parseID("", out temp3); + } + + public static void DebugLog(string message) + { + if (!Settings.IsInitialized() || Settings.Instance.LoggingLevel == FMOD.DEBUG_FLAGS.LOG) + { + Debug.Log(message); + } + } + + public static void DebugLogFormat(string format, params object[] args) + { + if (!Settings.IsInitialized() || Settings.Instance.LoggingLevel == FMOD.DEBUG_FLAGS.LOG) + { + Debug.LogFormat(format, args); + } + } + + public static void DebugLogWarning(string message) + { + if (!Settings.IsInitialized() || Settings.Instance.LoggingLevel >= FMOD.DEBUG_FLAGS.WARNING) + { + Debug.LogWarning(message); + } + } + + public static void DebugLogWarningFormat(string format, params object[] args) + { + if (!Settings.IsInitialized() || Settings.Instance.LoggingLevel >= FMOD.DEBUG_FLAGS.WARNING) + { + Debug.LogWarningFormat(format, args); + } + } + + public static void DebugLogError(string message) + { + if (!Settings.IsInitialized() || Settings.Instance.LoggingLevel >= FMOD.DEBUG_FLAGS.ERROR) + { + Debug.LogError(message); + } + } + + public static void DebugLogErrorFormat(string format, params object[] args) + { + if (!Settings.IsInitialized() || Settings.Instance.LoggingLevel >= FMOD.DEBUG_FLAGS.ERROR) + { + Debug.LogErrorFormat(format, args); + } + } + + public static void DebugLogException(Exception e) + { + if (!Settings.IsInitialized() || Settings.Instance.LoggingLevel >= FMOD.DEBUG_FLAGS.ERROR) + { + Debug.LogException(e); + } + } + +#if UNITY_EDITOR + public static string WritableAssetPath(string subPath) + { + if (RuntimeUtils.PluginBasePath.StartsWith("Assets/")) + { + return $"{RuntimeUtils.PluginBasePath}/{subPath}.asset"; + } + else + { + return $"Assets/Plugins/FMOD/{subPath}.asset"; + } + } +#endif + } +} diff --git a/Assets/Plugins/FMOD/src/RuntimeUtils.cs.meta b/Assets/Plugins/FMOD/src/RuntimeUtils.cs.meta new file mode 100644 index 00000000..825c75bc --- /dev/null +++ b/Assets/Plugins/FMOD/src/RuntimeUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6e349601408e423499e7b9f75216091d +timeCreated: 1433225261 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Settings.cs b/Assets/Plugins/FMOD/src/Settings.cs new file mode 100644 index 00000000..9a213e8e --- /dev/null +++ b/Assets/Plugins/FMOD/src/Settings.cs @@ -0,0 +1,1020 @@ +using UnityEngine; +using System.Collections.Generic; +using System; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using UnityEngine.Serialization; +using System.Runtime.CompilerServices; +#if UNITY_EDITOR +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +#endif + +[assembly: InternalsVisibleTo("FMODUnityEditor")] +namespace FMODUnity +{ + [Serializable] + public enum ImportType + { + StreamingAssets, + AssetBundle, + } + + [Serializable] + public enum BankLoadType + { + All, + Specified, + None + } + + [Serializable] + public enum MeterChannelOrderingType + { + Standard, + SeparateLFE, + Positional + } + + public enum EventLinkage + { + Path, + GUID, + } + + public enum TriStateBool + { + Disabled, + Enabled, + Development, + } + + public enum ScreenPosition + { + TopLeft, + TopCenter, + TopRight, + BottomLeft, + BottomCenter, + BottomRight, + Center, + VR, + } + + public interface IEditorSettings + { +#if UNITY_EDITOR + Settings RuntimeSettings { get; set; } + bool ForceLoggingBinaries { get; set; } + Platform CurrentEditorPlatform { get; } + void Clear(); + void ResetPlatformSettings(); + void ReimportLegacyPlatforms(); + void CreateSettingsAsset(string assetName); + void AddMissingPlatforms(); + void AddPlatformsToAsset(); + void AddPlatformForBuildTargets(Platform platform); + void UpdateMigratedPlatform(Platform platform); + Platform GetPlatform(BuildTarget buildTarget); + void SetPlatformParent(Platform platform, Platform newParent); + PlatformGroup AddPlatformGroup(string displayName, int sortOrder); + void PreprocessBuild(BuildTarget target, Platform.BinaryType binaryType); + void CleanTemporaryFiles(); + void DeleteTemporaryFile(string assetPath); + bool CanBuildTarget(BuildTarget target, Platform.BinaryType binaryType, out string error); + void CheckActiveBuildTarget(); +#endif + } + + // This class stores all of the FMOD for Unity cross-platform settings, as well as a collection + // of Platform objects that hold the platform-specific settings. The Platform objects are stored + // in the same asset as the Settings object using AssetDatabase.AddObjectToAsset. + public class Settings : ScriptableObject + { +#if UNITY_EDITOR + [FormerlySerializedAs("SwitchSettingsMigration")] + [SerializeField] + private bool switchSettingsMigration = false; +#endif + + internal const string SettingsAssetName = "FMODStudioSettings"; + + private static Settings instance = null; + private static IEditorSettings editorSettings = null; + private static bool isInitializing = false; + + [SerializeField] + public bool HasSourceProject = true; + + [SerializeField] + public bool HasPlatforms = true; + + [SerializeField] + private string sourceProjectPath; + + [SerializeField] + private string sourceBankPath; + + [FormerlySerializedAs("SourceBankPathUnformatted")] + [SerializeField] + private string sourceBankPathUnformatted; // Kept as to not break existing projects + + [SerializeField] + public int BankRefreshCooldown = 5; + + [SerializeField] + public bool ShowBankRefreshWindow = true; + + internal const int BankRefreshPrompt = -1; + internal const int BankRefreshManual = -2; + + [SerializeField] + public bool AutomaticEventLoading; + + [SerializeField] + public BankLoadType BankLoadType; + + [SerializeField] + public bool AutomaticSampleLoading; + + [SerializeField] + public string EncryptionKey; + + [SerializeField] + public ImportType ImportType; + + [SerializeField] + public string TargetAssetPath = "FMODBanks"; + + [SerializeField] + public string TargetBankFolder = ""; + + [SerializeField] + public EventLinkage EventLinkage = EventLinkage.Path; + + [SerializeField] + public FMOD.DEBUG_FLAGS LoggingLevel = FMOD.DEBUG_FLAGS.WARNING; + + [SerializeField] + internal List SpeakerModeSettings; + + [SerializeField] + internal List SampleRateSettings; + + [SerializeField] + internal List LiveUpdateSettings; + + [SerializeField] + internal List OverlaySettings; + + [SerializeField] + internal List BankDirectorySettings; + + [SerializeField] + internal List VirtualChannelSettings; + + [SerializeField] + internal List RealChannelSettings; + + [SerializeField] + internal List Plugins = new List(); + + [SerializeField] + public List MasterBanks; + + [SerializeField] + public List Banks; + + [SerializeField] + public List BanksToLoad; + + [SerializeField] + public ushort LiveUpdatePort = 9264; + + [SerializeField] + public bool EnableMemoryTracking; + + [SerializeField] + public bool AndroidUseOBB = false; + + [SerializeField] + public bool AndroidPatchBuild = false; + + [SerializeField] + public MeterChannelOrderingType MeterChannelOrdering; + + [SerializeField] + public bool StopEventsOutsideMaxDistance = false; + + [SerializeField] + internal bool BoltUnitOptionsBuildPending = false; + + [SerializeField] + public bool EnableErrorCallback = false; + + [SerializeField] + internal SharedLibraryUpdateStages SharedLibraryUpdateStage = SharedLibraryUpdateStages.Start; + + [SerializeField] + internal double SharedLibraryTimeSinceStart = 0.0; + + [SerializeField] + internal int CurrentVersion; + + [SerializeField] + public bool HideSetupWizard; + + [SerializeField] + internal int LastEventReferenceScanVersion; + + // This holds all known platforms, but only those that have settings are shown in the UI. + // It is populated at load time from the Platform objects in the settings asset. + // It is serializable to facilitate undo support. + [SerializeField] + public List Platforms = new List(); + + // This is used to find the platform that matches the current Unity runtime platform. + internal Dictionary> PlatformForRuntimePlatform = new Dictionary>(); + + // Default platform settings. + [NonSerialized] + public Platform DefaultPlatform; + + // Play In Editor platform settings. + [NonSerialized] + public Platform PlayInEditorPlatform; + +#if UNITY_EDITOR + // We store a persistent list so we don't try to re-migrate platforms if the user deletes them. + [SerializeField] + internal List MigratedPlatforms = new List(); +#endif + + // A collection of templates for constructing known platforms. + internal static List PlatformTemplates = new List(); + + [NonSerialized] + private bool hasLoaded = false; + + public static Settings Instance + { + get + { + if (isInitializing) + { + return null; + } + + Initialize(); + + return instance; + } + } + + internal static void Initialize() + { + if (instance == null) + { + isInitializing = true; + + instance = Resources.Load(SettingsAssetName) as Settings; + + if (instance == null) + { + RuntimeUtils.DebugLog("[FMOD] Cannot find integration settings, creating default settings"); + instance = CreateInstance(); + instance.name = "FMOD Studio Integration Settings"; + instance.CurrentVersion = FMOD.VERSION.number; + instance.LastEventReferenceScanVersion = FMOD.VERSION.number; + +#if UNITY_EDITOR + if (editorSettings != null) + { + editorSettings.CreateSettingsAsset(SettingsAssetName); + } + else + { + // editorSettings is populated via the static constructor of FMODUnity.EditorSettings when in the Unity editor. + RuntimeUtils.DebugLogError("[FMOD] Attempted to instantiate Settings before EditorSettings was populated. " + + "Ensure that Settings.Instance is not being called from an InitializeOnLoad method or class."); + } +#endif + } + else + { +#if UNITY_EDITOR + if (AssetDatabase.GetAssetPath(instance).StartsWith("Packages")) + { + RuntimeUtils.DebugLogError($"[FMOD] {SettingsAssetName} initialization failed. {SettingsAssetName} located in \"Packages\" folder. Please delete {SettingsAssetName} in file explorer."); + instance = CreateInstance(); + } +#endif + } + + isInitializing = false; + } + } + + internal static bool IsInitialized() + { + return !(instance == null || isInitializing); + } + + internal static IEditorSettings EditorSettings + { + get + { + return editorSettings; + } + set + { + editorSettings = value; + } + } + + public string SourceProjectPath + { + get + { + return sourceProjectPath; + } + set + { + sourceProjectPath = value; + } + } + + public string SourceBankPath + { + get + { + return sourceBankPath; + } + set + { + sourceBankPath = value; + } + } + + internal string TargetPath + { + get + { + if (ImportType == ImportType.AssetBundle) + { + if (string.IsNullOrEmpty(TargetAssetPath)) + { + return Application.dataPath; + } + else + { + return Application.dataPath + "/" + TargetAssetPath; + } + } + else + { + if (string.IsNullOrEmpty(TargetBankFolder)) + { + return Application.streamingAssetsPath; + } + else + { + return Application.streamingAssetsPath + "/" + TargetBankFolder; + } + } + } + } + + public string TargetSubFolder + { + get + { + if (ImportType == ImportType.AssetBundle) + { + return TargetAssetPath; + } + else + { + return TargetBankFolder; + } + } + set + { + if (ImportType == ImportType.AssetBundle) + { + TargetAssetPath = value; + } + else + { + TargetBankFolder = value; + } + } + } + + internal enum SharedLibraryUpdateStages + { + Start = 0, + DisableExistingLibraries, + RestartUnity, + CopyNewLibraries, + }; + + internal Platform FindPlatform(string identifier) + { + foreach (Platform platform in Platforms) + { + if (platform.Identifier == identifier) + { + return platform; + } + } + + return null; + } + + internal bool PlatformExists(string identifier) + { + return FindPlatform(identifier) != null; + } + + internal void AddPlatform(Platform platform) + { + if (PlatformExists(platform.Identifier)) + { + throw new ArgumentException(string.Format("Duplicate platform identifier: {0}", platform.Identifier)); + } + + Platforms.Add(platform); + } + + internal void RemovePlatform(string identifier) + { + Platforms.RemoveAll(p => p.Identifier == identifier); + } + + // Links the platform to its parent, and to the BuildTargets and RuntimePlatforms it implements. + internal void LinkPlatform(Platform platform) + { + LinkPlatformToParent(platform); + + platform.DeclareRuntimePlatforms(this); + +#if UNITY_EDITOR + if (editorSettings != null) + { + editorSettings.AddPlatformForBuildTargets(platform); + } +#endif + } + + internal void DeclareRuntimePlatform(RuntimePlatform runtimePlatform, Platform platform) + { + List platforms; + + if (!PlatformForRuntimePlatform.TryGetValue(runtimePlatform, out platforms)) + { + platforms = new List(); + PlatformForRuntimePlatform.Add(runtimePlatform, platforms); + } + + platforms.Add(platform); + + // Highest priority goes first + platforms.Sort((a, b) => b.Priority.CompareTo(a.Priority)); + } + + // Links the given platform to its parent, if it has one. + private void LinkPlatformToParent(Platform platform) + { + if (!string.IsNullOrEmpty(platform.ParentIdentifier)) + { + SetPlatformParent(platform, FindPlatform(platform.ParentIdentifier)); + } + } + + // The highest-priority platform that matches the current environment. + internal Platform FindCurrentPlatform() + { + List platforms; + + if (PlatformForRuntimePlatform.TryGetValue(Application.platform, out platforms)) + { + foreach (Platform platform in platforms) + { + if (platform.MatchesCurrentEnvironment) + { + return platform; + } + } + } + + return DefaultPlatform; + } + + private Settings() + { + MasterBanks = new List(); + Banks = new List(); + BanksToLoad = new List(); + RealChannelSettings = new List(); + VirtualChannelSettings = new List(); + LiveUpdateSettings = new List(); + OverlaySettings = new List(); + SampleRateSettings = new List(); + SpeakerModeSettings = new List(); + BankDirectorySettings = new List(); + + ImportType = ImportType.StreamingAssets; + AutomaticEventLoading = true; + AutomaticSampleLoading = false; + EnableMemoryTracking = false; + } + + // Adds properties to a platform, thus revealing it in the UI. + internal void AddPlatformProperties(Platform platform) + { + platform.AffirmProperties(); + LinkPlatformToParent(platform); + } + +#if UNITY_EDITOR + internal void SetPlatformParent(Platform platform, Platform newParent) + { + if (editorSettings != null) + { + editorSettings.SetPlatformParent(platform, newParent); + } + } +#else + public void SetPlatformParent(Platform platform, Platform newParent) + { + platform.Parent = newParent; + } +#endif + + // A template for constructing a platform from an identifier. + internal struct PlatformTemplate + { + public string Identifier; + public Func CreateInstance; + }; + + // Adds a platform to the collection of templates. Platforms register themselves by using + // [InitializeOnLoad] and calling this function from a static constructor. + internal static void AddPlatformTemplate(string identifier) where T : Platform + { + PlatformTemplates.Add(new PlatformTemplate() { + Identifier = identifier, + CreateInstance = () => CreatePlatformInstance(identifier) + }); + } + + private static Platform CreatePlatformInstance(string identifier) where T : Platform + { + Platform platform = CreateInstance(); + platform.InitializeProperties(); + platform.Identifier = identifier; + + return platform; + } + + internal void OnEnable() + { + if (hasLoaded) + { + // Already loaded + return; + } + + hasLoaded = true; + +#if UNITY_EDITOR + if (editorSettings != null) + { + // Clear the EditorSettings object in case it has not been reloaded (this can happen + // if the settings asset is modified on disk). + editorSettings.Clear(); + + editorSettings.RuntimeSettings = this; + } +#endif + + PopulatePlatformsFromAsset(); + + DefaultPlatform = Platforms.FirstOrDefault(platform => platform is PlatformDefault); + PlayInEditorPlatform = Platforms.FirstOrDefault(platform => platform is PlatformPlayInEditor); + +#if UNITY_EDITOR + if (editorSettings != null) + { + if (switchSettingsMigration == false) + { + // Create Switch settings from the legacy Mobile settings, if they exist + Legacy.CopySetting(LiveUpdateSettings, Legacy.Platform.Mobile, Legacy.Platform.Switch); + Legacy.CopySetting(OverlaySettings, Legacy.Platform.Mobile, Legacy.Platform.Switch); + + Legacy.CopySetting(RealChannelSettings, Legacy.Platform.Mobile, Legacy.Platform.Switch); + Legacy.CopySetting(VirtualChannelSettings, Legacy.Platform.Mobile, Legacy.Platform.Switch); + Legacy.CopySetting(SampleRateSettings, Legacy.Platform.Mobile, Legacy.Platform.Switch); + Legacy.CopySetting(SpeakerModeSettings, Legacy.Platform.Mobile, Legacy.Platform.Switch); + switchSettingsMigration = true; + } + + // Fix up slashes for old settings meta data. + SourceProjectPath = RuntimeUtils.GetCommonPlatformPath(SourceProjectPath); + sourceBankPathUnformatted = RuntimeUtils.GetCommonPlatformPath(sourceBankPathUnformatted); + + // Remove the FMODStudioCache if in the old location + string oldCache = "Assets/Plugins/FMOD/Resources/FMODStudioCache.asset"; + if (File.Exists(oldCache)) + { + AssetDatabase.DeleteAsset(oldCache); + } + + editorSettings.AddMissingPlatforms(); + + // Add all known platforms to the settings asset. We can only do this if the Settings + // object is already in the asset database, which won't be the case if we're inside the + // CreateInstance call in the Instance accessor above. + if (AssetDatabase.Contains(this)) + { + editorSettings.AddPlatformsToAsset(); + } + } +#endif + + // Link all known platforms + Platforms.ForEach(LinkPlatform); + } + + private void PopulatePlatformsFromAsset() + { + Platforms.Clear(); + +#if UNITY_EDITOR + string assetPath = AssetDatabase.GetAssetPath(this); + UnityEngine.Object[] assets = AssetDatabase.LoadAllAssetsAtPath(assetPath); + Platform[] assetPlatforms = assets.OfType().ToArray(); +#else + Platform[] assetPlatforms = Resources.LoadAll(SettingsAssetName); +#endif + + foreach (Platform newPlatform in assetPlatforms) + { + Platform existingPlatform = FindPlatform(newPlatform.Identifier); + + if (existingPlatform != null) + { + // Duplicate platform; clean one of them up + Platform platformToDestroy; + + if (newPlatform.Active && !existingPlatform.Active) + { + RemovePlatform(existingPlatform.Identifier); + + platformToDestroy = existingPlatform; + existingPlatform = null; + } + else + { + platformToDestroy = newPlatform; + } + + RuntimeUtils.DebugLogWarningFormat("FMOD: Cleaning up duplicate platform: ID = {0}, name = '{1}', type = {2}", + platformToDestroy.Identifier, platformToDestroy.DisplayName, platformToDestroy.GetType().Name); + + DestroyImmediate(platformToDestroy, true); + } + + if (existingPlatform == null) + { + newPlatform.EnsurePropertiesAreValid(); + AddPlatform(newPlatform); + } + } + +#if UNITY_EDITOR + // Remove any invalid child platforms (ie. deprecated platforms). + foreach (Platform newPlatform in assetPlatforms) + { + if (newPlatform.ChildIdentifiers.RemoveAll(x => FindPlatform(x) == null) > 0) + { + EditorUtility.SetDirty(newPlatform); + } + } + + if (editorSettings != null) + { + Platforms.ForEach(editorSettings.UpdateMigratedPlatform); + } +#endif + } + } + + // This class stores data types and code used for migrating old settings. + internal static class Legacy + { +#if UNITY_EDITOR + private const string RegisterStaticPluginsAssetPathRelative = + "/Plugins/FMOD/Cache/fmod_register_static_plugins.cpp"; + private const string RegisterStaticPluginsAssetPathFull = "Assets" + RegisterStaticPluginsAssetPathRelative; + + public static void CleanTemporaryChanges() + { + CleanIl2CppArgs(); + CleanTemporaryFiles(); + } + + private static IEnumerable AdditionalIl2CppFiles() + { + yield return Application.dataPath + RegisterStaticPluginsAssetPathRelative; + yield return Application.dataPath + "/Plugins/FMOD/src/Runtime/fmod_static_plugin_support.h"; + } + + public static void CleanIl2CppArgs() + { + const string Il2CppCommand_AdditionalCpp = "--additional-cpp"; + + string arguments = PlayerSettings.GetAdditionalIl2CppArgs(); + string newArguments = arguments; + + foreach (string path in AdditionalIl2CppFiles()) + { + // Match on basename only in case the temp file location has moved + string basename = Regex.Escape(Path.GetFileName(path)); + Regex regex = new Regex(Il2CppCommand_AdditionalCpp + "=\"[^\"]*" + basename + "\""); + + for (int startIndex = 0; startIndex < newArguments.Length; ) + { + Match match = regex.Match(newArguments, startIndex); + + if (!match.Success) + { + break; + } + + RuntimeUtils.DebugLogFormat("FMOD: Removing Il2CPP argument '{0}'", match.Value); + + int matchStart = match.Index; + int matchEnd = match.Index + match.Length; + + // Consume an adjacent space if there is one + if (matchStart > 0 && newArguments[matchStart - 1] == ' ') + { + --matchStart; + } + else if (matchEnd < newArguments.Length && newArguments[matchEnd] == ' ') + { + ++matchEnd; + } + + newArguments = newArguments.Substring(0, matchStart) + newArguments.Substring(matchEnd); + startIndex = matchStart; + } + } + + if (newArguments != arguments) + { + PlayerSettings.SetAdditionalIl2CppArgs(newArguments); + } + } + + public static void CleanTemporaryFiles() + { + if (EditorApplication.isPlayingOrWillChangePlaymode) + { + // Messing with the asset database while entering play mode causes a NullReferenceException + return; + } + + string[] TemporaryFiles = { + RegisterStaticPluginsAssetPathFull, + }; + + foreach (string path in TemporaryFiles) + { + if (Settings.EditorSettings != null) + { + Settings.EditorSettings.DeleteTemporaryFile(path); + } + } + } +#endif + + [Serializable] + public enum Platform + { + None, + PlayInEditor, + Default, + Desktop, + Mobile, + MobileHigh, + MobileLow, + Console, + Windows, + Mac, + Linux, + iOS, + Android, + Deprecated_1, + XboxOne, + PS4, + Deprecated_2, + Deprecated_3, + AppleTV, + UWP, + Switch, + WebGL, + Deprecated_4, + Reserved_1, + Reserved_2, + Reserved_3, + Count, + } + + public class PlatformSettingBase + { + public Platform Platform; + } + + public class PlatformSetting : PlatformSettingBase + { + public T Value; + } + + [Serializable] + public class PlatformIntSetting : PlatformSetting + { + } + + [Serializable] + public class PlatformStringSetting : PlatformSetting + { + } + + [Serializable] + public class PlatformBoolSetting : PlatformSetting + { + } + + // Copies a setting from one platform to another. + public static void CopySetting(List list, Platform fromPlatform, Platform toPlatform) + where T : PlatformSetting, new() + { + T fromSetting = list.Find((x) => x.Platform == fromPlatform); + T toSetting = list.Find((x) => x.Platform == toPlatform); + + if (fromSetting != null) + { + if (toSetting == null) + { + toSetting = new T() { Platform = toPlatform }; + list.Add(toSetting); + } + + toSetting.Value = fromSetting.Value; + } + else if (toSetting != null) + { + list.Remove(toSetting); + } + } + + public static void CopySetting(List list, Platform fromPlatform, Platform toPlatform) + { + CopySetting(list, fromPlatform, toPlatform); + } + + public static void CopySetting(List list, Platform fromPlatform, Platform toPlatform) + { + CopySetting(list, fromPlatform, toPlatform); + } + + // Returns the UI display name for the given platform. + public static string DisplayName(Platform platform) + { + switch (platform) + { + case Platform.Linux: + return "Linux"; + case Platform.Desktop: + return "Desktop"; + case Platform.Console: + return "Console"; + case Platform.iOS: + return "iOS"; + case Platform.Mac: + return "OSX"; + case Platform.Mobile: + return "Mobile"; + case Platform.PS4: + return "PS4"; + case Platform.Windows: + return "Windows"; + case Platform.UWP: + return "UWP"; + case Platform.XboxOne: + return "XBox One"; + case Platform.Android: + return "Android"; + case Platform.AppleTV: + return "Apple TV"; + case Platform.MobileHigh: + return "High-End Mobile"; + case Platform.MobileLow: + return "Low-End Mobile"; + case Platform.Switch: + return "Switch"; + case Platform.WebGL: + return "WebGL"; + } + return "Unknown"; + } + + // Returns the UI sort order for the given platform. + public static float SortOrder(Platform legacyPlatform) + { + switch (legacyPlatform) + { + case Platform.Desktop: + return 1; + case Platform.Windows: + return 1.1f; + case Platform.Mac: + return 1.2f; + case Platform.Linux: + return 1.3f; + case Platform.Mobile: + return 2; + case Platform.MobileHigh: + return 2.1f; + case Platform.MobileLow: + return 2.2f; + case Platform.AppleTV: + return 2.3f; + case Platform.Console: + return 3; + case Platform.XboxOne: + return 3.1f; + case Platform.PS4: + return 3.2f; + case Platform.Switch: + return 3.3f; + default: + return 0; + } + } + + // Returns the parent for the given platform. + public static Platform Parent(Platform platform) + { + switch (platform) + { + case Platform.Windows: + case Platform.Linux: + case Platform.Mac: + case Platform.UWP: + case Platform.WebGL: + return Platform.Desktop; + case Platform.MobileHigh: + case Platform.MobileLow: + case Platform.iOS: + case Platform.Android: + case Platform.AppleTV: + return Platform.Mobile; + case Platform.Switch: + case Platform.XboxOne: + case Platform.PS4: + case Platform.Reserved_1: + case Platform.Reserved_2: + case Platform.Reserved_3: + return Platform.Console; + case Platform.Desktop: + case Platform.Console: + case Platform.Mobile: + return Platform.Default; + case Platform.PlayInEditor: + case Platform.Default: + default: + return Platform.None; + } + } + + // Determines whether the given platform is a group + public static bool IsGroup(Platform platform) + { + switch (platform) + { + case Platform.Desktop: + case Platform.Mobile: + case Platform.Console: + return true; + default: + return false; + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Settings.cs.meta b/Assets/Plugins/FMOD/src/Settings.cs.meta new file mode 100644 index 00000000..1388e86d --- /dev/null +++ b/Assets/Plugins/FMOD/src/Settings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: eef8d824ea7b63742966aaa0e94ac383 +timeCreated: 1435215721 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: -400 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/StudioBankLoader.cs b/Assets/Plugins/FMOD/src/StudioBankLoader.cs new file mode 100644 index 00000000..8a2afa0f --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioBankLoader.cs @@ -0,0 +1,118 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace FMODUnity +{ + [AddComponentMenu("FMOD Studio/FMOD Studio Bank Loader")] + public class StudioBankLoader : MonoBehaviour + { + public LoaderGameEvent LoadEvent; + public LoaderGameEvent UnloadEvent; + [BankRef] + public List Banks; + public string CollisionTag; + public bool PreloadSamples; + private bool isQuitting; + + private void HandleGameEvent(LoaderGameEvent gameEvent) + { + if (LoadEvent == gameEvent) + { + Load(); + } + if (UnloadEvent == gameEvent) + { + Unload(); + } + } + + private void Start() + { + RuntimeUtils.EnforceLibraryOrder(); + HandleGameEvent(LoaderGameEvent.ObjectStart); + } + + private void OnApplicationQuit() + { + isQuitting = true; + } + + private void OnDestroy() + { + if (!isQuitting) + { + HandleGameEvent(LoaderGameEvent.ObjectDestroy); + } + } + +#if UNITY_PHYSICS_EXIST + private void OnTriggerEnter(Collider other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(LoaderGameEvent.TriggerEnter); + } + } + + private void OnTriggerExit(Collider other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(LoaderGameEvent.TriggerExit); + } + } +#endif + +#if UNITY_PHYSICS2D_EXIST + private void OnTriggerEnter2D(Collider2D other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(LoaderGameEvent.TriggerEnter2D); + } + } + + private void OnTriggerExit2D(Collider2D other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(LoaderGameEvent.TriggerExit2D); + } + } +#endif + + private void OnEnable() + { + HandleGameEvent(LoaderGameEvent.ObjectEnable); + } + + private void OnDisable() + { + HandleGameEvent(LoaderGameEvent.ObjectDisable); + } + + public void Load() + { + foreach (var bankRef in Banks) + { + try + { + RuntimeManager.LoadBank(bankRef, PreloadSamples); + } + catch (BankLoadException e) + { + RuntimeUtils.DebugLogException(e); + } + } + RuntimeManager.WaitForAllSampleLoading(); + } + + public void Unload() + { + foreach (var bankRef in Banks) + { + RuntimeManager.UnloadBank(bankRef); + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/StudioBankLoader.cs.meta b/Assets/Plugins/FMOD/src/StudioBankLoader.cs.meta new file mode 100644 index 00000000..b799f70f --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioBankLoader.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b9468c5f457ace64f8d4df6d642b107f +timeCreated: 1440562167 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: -250 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/StudioEventEmitter.cs b/Assets/Plugins/FMOD/src/StudioEventEmitter.cs new file mode 100644 index 00000000..7b1b650d --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioEventEmitter.cs @@ -0,0 +1,411 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Serialization; + +namespace FMODUnity +{ + [AddComponentMenu("FMOD Studio/FMOD Studio Event Emitter")] + public class StudioEventEmitter : EventHandler + { + public EventReference EventReference; + + [Obsolete("Use the EventReference field instead")] + public string Event = ""; + + [FormerlySerializedAs("PlayEvent")] + public EmitterGameEvent EventPlayTrigger = EmitterGameEvent.None; + [Obsolete("Use the EventPlayTrigger field instead")] + public EmitterGameEvent PlayEvent + { + get { return EventPlayTrigger; } + set { EventPlayTrigger = value; } + } + [FormerlySerializedAs("StopEvent")] + public EmitterGameEvent EventStopTrigger = EmitterGameEvent.None; + [Obsolete("Use the EventStopTrigger field instead")] + public EmitterGameEvent StopEvent + { + get { return EventStopTrigger; } + set { EventStopTrigger = value; } + } + public bool AllowFadeout = true; + public bool TriggerOnce = false; + public bool Preload = false; + [FormerlySerializedAs("AllowNonRigidbodyDoppler")] + public bool NonRigidbodyVelocity = false; + public ParamRef[] Params = new ParamRef[0]; + public bool OverrideAttenuation = false; + public float OverrideMinDistance = -1.0f; + public float OverrideMaxDistance = -1.0f; + + protected FMOD.Studio.EventDescription eventDescription; + + protected FMOD.Studio.EventInstance instance; + + private bool hasTriggered = false; + private bool isQuitting = false; + private bool isOneshot = false; + private List cachedParams = new List(); + + private static List activeEmitters = new List(); + + private const string SnapshotString = "snapshot"; + + public FMOD.Studio.EventDescription EventDescription { get { return eventDescription; } } + + public FMOD.Studio.EventInstance EventInstance { get { return instance; } } + + public bool IsActive { get; private set; } + + private float MaxDistance + { + get + { + if (OverrideAttenuation) + { + return OverrideMaxDistance; + } + + if (!eventDescription.isValid()) + { + Lookup(); + } + + float minDistance, maxDistance; + eventDescription.getMinMaxDistance(out minDistance, out maxDistance); + return maxDistance; + } + } + + public static void UpdateActiveEmitters() + { + foreach (StudioEventEmitter emitter in activeEmitters) + { + emitter.UpdatePlayingStatus(); + } + } + + private static void RegisterActiveEmitter(StudioEventEmitter emitter) + { + if (!activeEmitters.Contains(emitter)) + { + activeEmitters.Add(emitter); + } + } + + private static void DeregisterActiveEmitter(StudioEventEmitter emitter) + { + activeEmitters.Remove(emitter); + } + + private void UpdatePlayingStatus(bool force = false) + { + // If at least one listener is within the max distance, ensure an event instance is playing + bool playInstance = StudioListener.DistanceSquaredToNearestListener(transform.position) <= (MaxDistance * MaxDistance); + + if (force || playInstance != IsPlaying()) + { + if (playInstance) + { + PlayInstance(); + } + else + { + StopInstance(); + } + } + } + + protected override void Start() + { + RuntimeUtils.EnforceLibraryOrder(); + if (Preload) + { + Lookup(); + eventDescription.loadSampleData(); + } + + HandleGameEvent(EmitterGameEvent.ObjectStart); + + // If a Rigidbody or Rigidbody2D is present on this GameObject, turn off "NonRigidbodyVelocity" +#if UNITY_PHYSICS_EXIST + if (NonRigidbodyVelocity && GetComponent()) + { + Debug.LogWarning(string.Format("[FMOD] Non-Rigidbody Velocity is enabled on Emitter attached to GameObject \"{0}\", which also has a Rigidbody component attached - this will be disabled in favor of velocity from Rigidbody component.", this.name)); + NonRigidbodyVelocity = false; + } +#endif +#if UNITY_PHYSICS2D_EXIST + if (NonRigidbodyVelocity && GetComponent()) + { + Debug.LogWarning(string.Format("[FMOD] Non-Rigidbody Velocity is enabled on Emitter attached to GameObject \"{0}\", which also has a Rigidbody2D component attached - this will be disabled in favor of velocity from Rigidbody2D component.", this.name)); + NonRigidbodyVelocity = false; + } +#endif + } + + private void OnApplicationQuit() + { + isQuitting = true; + } + + protected override void OnDestroy() + { + if (!isQuitting) + { + HandleGameEvent(EmitterGameEvent.ObjectDestroy); + + if (instance.isValid()) + { + RuntimeManager.DetachInstanceFromGameObject(instance); + if (eventDescription.isValid() && isOneshot) + { + instance.release(); + instance.clearHandle(); + } + } + + DeregisterActiveEmitter(this); + + if (Preload) + { + eventDescription.unloadSampleData(); + } + } + } + + protected override void HandleGameEvent(EmitterGameEvent gameEvent) + { + if (EventPlayTrigger == gameEvent) + { + Play(); + } + if (EventStopTrigger == gameEvent) + { + Stop(); + } + } + + private void Lookup() + { + eventDescription = RuntimeManager.GetEventDescription(EventReference); + + if (eventDescription.isValid()) + { + for (int i = 0; i < Params.Length; i++) + { + FMOD.Studio.PARAMETER_DESCRIPTION param; + eventDescription.getParameterDescriptionByName(Params[i].Name, out param); + Params[i].ID = param.id; + } + } + } + + public void Play() + { + if (TriggerOnce && hasTriggered) + { + return; + } + + if (EventReference.IsNull) + { + return; + } + + cachedParams.Clear(); + + if (!eventDescription.isValid()) + { + Lookup(); + } + + bool isSnapshot; + eventDescription.isSnapshot(out isSnapshot); + + if (!isSnapshot) + { + eventDescription.isOneshot(out isOneshot); + } + + bool is3D; + eventDescription.is3D(out is3D); + + IsActive = true; + + if (is3D && !isOneshot && Settings.Instance.StopEventsOutsideMaxDistance) + { + RegisterActiveEmitter(this); + UpdatePlayingStatus(true); + } + else + { + PlayInstance(); + } + } + + private void PlayInstance() + { + if (!instance.isValid()) + { + instance.clearHandle(); + } + + // Let previous oneshot instances play out + if (isOneshot && instance.isValid()) + { + instance.release(); + instance.clearHandle(); + } + + bool is3D; + eventDescription.is3D(out is3D); + + if (!instance.isValid()) + { + eventDescription.createInstance(out instance); + + // Only want to update if we need to set 3D attributes + if (is3D) + { + var transform = GetComponent(); +#if UNITY_PHYSICS_EXIST + if (GetComponent()) + { + Rigidbody rigidBody = GetComponent(); + instance.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject, rigidBody)); + RuntimeManager.AttachInstanceToGameObject(instance, gameObject, rigidBody); + } + else +#endif +#if UNITY_PHYSICS2D_EXIST + if (GetComponent()) + { + var rigidBody2D = GetComponent(); + instance.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject, rigidBody2D)); + RuntimeManager.AttachInstanceToGameObject(instance, gameObject, rigidBody2D); + } + else +#endif + { + instance.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject)); + RuntimeManager.AttachInstanceToGameObject(instance, gameObject, NonRigidbodyVelocity); + } + } + } + + foreach (var param in Params) + { + instance.setParameterByID(param.ID, param.Value); + } + + foreach (var cachedParam in cachedParams) + { + instance.setParameterByID(cachedParam.ID, cachedParam.Value); + } + + if (is3D && OverrideAttenuation) + { + instance.setProperty(FMOD.Studio.EVENT_PROPERTY.MINIMUM_DISTANCE, OverrideMinDistance); + instance.setProperty(FMOD.Studio.EVENT_PROPERTY.MAXIMUM_DISTANCE, OverrideMaxDistance); + } + + instance.start(); + + hasTriggered = true; + } + + public void Stop() + { + DeregisterActiveEmitter(this); + IsActive = false; + cachedParams.Clear(); + StopInstance(); + } + + private void StopInstance() + { + if (TriggerOnce && hasTriggered) + { + DeregisterActiveEmitter(this); + } + + if (instance.isValid()) + { + instance.stop(AllowFadeout ? FMOD.Studio.STOP_MODE.ALLOWFADEOUT : FMOD.Studio.STOP_MODE.IMMEDIATE); + instance.release(); + if (!AllowFadeout) + { + instance.clearHandle(); + } + } + } + + public void SetParameter(string name, float value, bool ignoreseekspeed = false) + { + if (Settings.Instance.StopEventsOutsideMaxDistance && IsActive) + { + string findName = name; + ParamRef cachedParam = cachedParams.Find(x => x.Name == findName); + + if (cachedParam == null) + { + FMOD.Studio.PARAMETER_DESCRIPTION paramDesc; + eventDescription.getParameterDescriptionByName(name, out paramDesc); + + cachedParam = new ParamRef(); + cachedParam.ID = paramDesc.id; + cachedParam.Name = paramDesc.name; + cachedParams.Add(cachedParam); + } + + cachedParam.Value = value; + } + + if (instance.isValid()) + { + instance.setParameterByName(name, value, ignoreseekspeed); + } + } + + public void SetParameter(FMOD.Studio.PARAMETER_ID id, float value, bool ignoreseekspeed = false) + { + if (Settings.Instance.StopEventsOutsideMaxDistance && IsActive) + { + FMOD.Studio.PARAMETER_ID findId = id; + ParamRef cachedParam = cachedParams.Find(x => x.ID.Equals(findId)); + + if (cachedParam == null) + { + FMOD.Studio.PARAMETER_DESCRIPTION paramDesc; + eventDescription.getParameterDescriptionByID(id, out paramDesc); + + cachedParam = new ParamRef(); + cachedParam.ID = paramDesc.id; + cachedParam.Name = paramDesc.name; + cachedParams.Add(cachedParam); + } + + cachedParam.Value = value; + } + + if (instance.isValid()) + { + instance.setParameterByID(id, value, ignoreseekspeed); + } + } + + public bool IsPlaying() + { + if (instance.isValid()) + { + FMOD.Studio.PLAYBACK_STATE playbackState; + instance.getPlaybackState(out playbackState); + return (playbackState != FMOD.Studio.PLAYBACK_STATE.STOPPED); + } + return false; + } + } +} diff --git a/Assets/Plugins/FMOD/src/StudioEventEmitter.cs.meta b/Assets/Plugins/FMOD/src/StudioEventEmitter.cs.meta new file mode 100644 index 00000000..bc079bd5 --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioEventEmitter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9a6610d2e704f1648819acc8d7460285 +timeCreated: 1444629021 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: -220 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/StudioGlobalParameterTrigger.cs b/Assets/Plugins/FMOD/src/StudioGlobalParameterTrigger.cs new file mode 100644 index 00000000..76ec6176 --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioGlobalParameterTrigger.cs @@ -0,0 +1,56 @@ +using System; +using UnityEngine; +using UnityEngine.Serialization; + +namespace FMODUnity +{ + [AddComponentMenu("FMOD Studio/FMOD Studio Global Parameter Trigger")] + public class StudioGlobalParameterTrigger: EventHandler + { + [ParamRef] + [FormerlySerializedAs("parameter")] + public string Parameter; + + public EmitterGameEvent TriggerEvent; + + [FormerlySerializedAs("value")] + public float Value; + + private FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription; + public FMOD.Studio.PARAMETER_DESCRIPTION ParameterDescription { get { return parameterDescription; } } + + protected override void HandleGameEvent(EmitterGameEvent gameEvent) + { + if (TriggerEvent == gameEvent) + { + TriggerParameters(); + } + } + + public void TriggerParameters() + { + bool paramNameSpecified = !string.IsNullOrEmpty(Parameter); + if (paramNameSpecified) + { + FMOD.RESULT result = FMOD.RESULT.OK; + bool paramIDNeedsLookup = string.IsNullOrEmpty(parameterDescription.name); + if (paramIDNeedsLookup) + { + result = RuntimeManager.StudioSystem.getParameterDescriptionByName(Parameter, out parameterDescription); + if (result != FMOD.RESULT.OK) + { + RuntimeUtils.DebugLogError(string.Format(("[FMOD] StudioGlobalParameterTrigger failed to lookup parameter {0} : result = {1}"), Parameter, result)); + return; + } + } + + result = RuntimeManager.StudioSystem.setParameterByID(parameterDescription.id, Value); + if (result != FMOD.RESULT.OK) + { + RuntimeUtils.DebugLogError(string.Format(("[FMOD] StudioGlobalParameterTrigger failed to set parameter {0} : result = {1}"), Parameter, result)); + return; + } + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/StudioGlobalParameterTrigger.cs.meta b/Assets/Plugins/FMOD/src/StudioGlobalParameterTrigger.cs.meta new file mode 100644 index 00000000..af31c44d --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioGlobalParameterTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b0e04e2572f9a940a47465f6f3c2f00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/StudioListener.cs b/Assets/Plugins/FMOD/src/StudioListener.cs new file mode 100644 index 00000000..491c190a --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioListener.cs @@ -0,0 +1,181 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace FMODUnity +{ + [AddComponentMenu("FMOD Studio/FMOD Studio Listener")] + public class StudioListener : MonoBehaviour + { + [SerializeField] + private bool nonRigidbodyVelocity = false; + + [SerializeField] + private GameObject attenuationObject = null; + + public GameObject AttenuationObject + { + get { return attenuationObject; } + set { attenuationObject = value; } + } + + private Vector3 lastFramePosition = Vector3.zero; + +#if UNITY_PHYSICS_EXIST + private Rigidbody rigidBody; +#endif +#if UNITY_PHYSICS2D_EXIST + private Rigidbody2D rigidBody2D; +#endif + private static List listeners = new List(); + + public static int ListenerCount + { + get + { + return listeners.Count; + } + } + + public int ListenerNumber + { + get + { + return listeners.IndexOf(this); + } + } + + public static float DistanceToNearestListener(Vector3 position) + { + float result = float.MaxValue; + for (int i = 0; i < listeners.Count; i++) + { + if (listeners[i].attenuationObject == null) + { + result = Mathf.Min(result, Vector3.Distance(position, listeners[i].transform.position)); + } + else + { + result = Mathf.Min(result, Vector3.Distance(position, listeners[i].attenuationObject.transform.position)); + } + } + return result; + } + + public static float DistanceSquaredToNearestListener(Vector3 position) + { + float result = float.MaxValue; + for (int i = 0; i < listeners.Count; i++) + { + if (listeners[i].attenuationObject == null) + { + result = Mathf.Min(result, (position - listeners[i].transform.position).sqrMagnitude); + } + else + { + result = Mathf.Min(result, (position - listeners[i].attenuationObject.transform.position).sqrMagnitude); + } + } + return result; + } + + private static void AddListener(StudioListener listener) + { + // Is the listener already in the list? + if (listeners.Contains(listener)) + { + Debug.LogWarning(string.Format(("[FMOD] Listener has already been added at index {0}."), listener.ListenerNumber)); + return; + } + + // If already at the max numListeners + if (listeners.Count >= FMOD.CONSTANTS.MAX_LISTENERS) + { + Debug.LogWarning(string.Format(("[FMOD] Max number of listeners reached : {0}."), FMOD.CONSTANTS.MAX_LISTENERS)); + } + + listeners.Add(listener); + RuntimeManager.StudioSystem.setNumListeners(Mathf.Clamp(listeners.Count, 1, FMOD.CONSTANTS.MAX_LISTENERS)); + } + + private static void RemoveListener(StudioListener listener) + { + listeners.Remove(listener); + RuntimeManager.StudioSystem.setNumListeners(Mathf.Clamp(listeners.Count, 1, FMOD.CONSTANTS.MAX_LISTENERS)); + } + + private void OnEnable() + { + RuntimeUtils.EnforceLibraryOrder(); +#if UNITY_PHYSICS_EXIST + rigidBody = gameObject.GetComponent(); + + if (nonRigidbodyVelocity && rigidBody) + { + Debug.LogWarning(string.Format("[FMOD] Non-Rigidbody Velocity is enabled on Listener attached to GameObject \"{0}\", which also has a Rigidbody component attached - this will be disabled in favor of velocity from Rigidbody component.", this.name)); + nonRigidbodyVelocity = false; + } +#endif +#if UNITY_PHYSICS2D_EXIST + rigidBody2D = gameObject.GetComponent(); + + if (nonRigidbodyVelocity && rigidBody2D) + { + Debug.LogWarning(string.Format("[FMOD] Non-Rigidbody Velocity is enabled on Listener attached to GameObject \"{0}\", which also has a Rigidbody2D component attached - this will be disabled in favor of velocity from Rigidbody2D component.", this.name)); + nonRigidbodyVelocity = false; + } +#endif + AddListener(this); + + lastFramePosition = transform.position; + } + + private void OnDisable() + { + RemoveListener(this); + } + + private void Update() + { + if (ListenerNumber < 0 || ListenerNumber >= FMOD.CONSTANTS.MAX_LISTENERS) + { + return; + } + + if (nonRigidbodyVelocity) + { + var velocity = Vector3.zero; + var position = transform.position; + + if (Time.deltaTime != 0) + { + velocity = (position - lastFramePosition) / Time.deltaTime; + velocity = Vector3.ClampMagnitude(velocity, 20.0f); + } + + lastFramePosition = position; + + RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, attenuationObject, velocity); + } + else + { +#if UNITY_PHYSICS_EXIST + if (rigidBody) + { + RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody, attenuationObject); + } + else +#endif +#if UNITY_PHYSICS2D_EXIST + if (rigidBody2D) + { + RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody2D, attenuationObject); + } + else +#endif + { + RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, attenuationObject); + } + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/StudioListener.cs.meta b/Assets/Plugins/FMOD/src/StudioListener.cs.meta new file mode 100644 index 00000000..ff0696fb --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioListener.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 86c6556701af9e04380698b89f691b6e +timeCreated: 1449016511 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 80 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/StudioParameterTrigger.cs b/Assets/Plugins/FMOD/src/StudioParameterTrigger.cs new file mode 100644 index 00000000..3c94f786 --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioParameterTrigger.cs @@ -0,0 +1,63 @@ +using System; +using UnityEngine; + +namespace FMODUnity +{ + [Serializable] + public class EmitterRef + { + public StudioEventEmitter Target; + public ParamRef[] Params; + } + + [AddComponentMenu("FMOD Studio/FMOD Studio Parameter Trigger")] + public class StudioParameterTrigger: EventHandler + { + public EmitterRef[] Emitters; + public EmitterGameEvent TriggerEvent; + + private void Awake() + { + for (int i = 0; i < Emitters.Length; i++) + { + var emitterRef = Emitters[i]; + if (emitterRef.Target != null && !emitterRef.Target.EventReference.IsNull) + { + FMOD.Studio.EventDescription eventDesc = RuntimeManager.GetEventDescription(emitterRef.Target.EventReference); + if (eventDesc.isValid()) + { + for (int j = 0; j < Emitters[i].Params.Length; j++) + { + FMOD.Studio.PARAMETER_DESCRIPTION param; + eventDesc.getParameterDescriptionByName(emitterRef.Params[j].Name, out param); + emitterRef.Params[j].ID = param.id; + } + } + } + } + } + + protected override void HandleGameEvent(EmitterGameEvent gameEvent) + { + if (TriggerEvent == gameEvent) + { + TriggerParameters(); + } + } + + public void TriggerParameters() + { + for (int i = 0; i < Emitters.Length; i++) + { + var emitterRef = Emitters[i]; + if (emitterRef.Target != null && emitterRef.Target.EventInstance.isValid()) + { + for (int j = 0; j < Emitters[i].Params.Length; j++) + { + emitterRef.Target.EventInstance.setParameterByID(Emitters[i].Params[j].ID, Emitters[i].Params[j].Value); + } + } + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/StudioParameterTrigger.cs.meta b/Assets/Plugins/FMOD/src/StudioParameterTrigger.cs.meta new file mode 100644 index 00000000..7fe323f7 --- /dev/null +++ b/Assets/Plugins/FMOD/src/StudioParameterTrigger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 744a208c85da6d04c861d81b992e4ead +timeCreated: 1451968823 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/fmod.cs b/Assets/Plugins/FMOD/src/fmod.cs new file mode 100644 index 00000000..f2bbf559 --- /dev/null +++ b/Assets/Plugins/FMOD/src/fmod.cs @@ -0,0 +1,4064 @@ +/* ======================================================================================== */ +/* FMOD Core API - C# wrapper. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2025. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/docs/2.03/api/core-api.html */ +/* ======================================================================================== */ + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections.Generic; + +namespace FMOD +{ + /* + FMOD version number. Check this against FMOD::System::getVersion / System_GetVersion + 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number. + */ + public partial class VERSION + { + public const int number = 0x00020306; +#if !UNITY_2021_3_OR_NEWER + public const string dll = "fmod"; +#endif + } + + public class CONSTANTS + { + public const int MAX_CHANNEL_WIDTH = 32; + public const int MAX_LISTENERS = 8; + public const int REVERB_MAXINSTANCES = 4; + public const int MAX_SYSTEMS = 8; + } + + /* + FMOD core types + */ + public enum RESULT : int + { + OK, + ERR_BADCOMMAND, + ERR_CHANNEL_ALLOC, + ERR_CHANNEL_STOLEN, + ERR_DMA, + ERR_DSP_CONNECTION, + ERR_DSP_DONTPROCESS, + ERR_DSP_FORMAT, + ERR_DSP_INUSE, + ERR_DSP_NOTFOUND, + ERR_DSP_RESERVED, + ERR_DSP_SILENCE, + ERR_DSP_TYPE, + ERR_FILE_BAD, + ERR_FILE_COULDNOTSEEK, + ERR_FILE_DISKEJECTED, + ERR_FILE_EOF, + ERR_FILE_ENDOFDATA, + ERR_FILE_NOTFOUND, + ERR_FORMAT, + ERR_HEADER_MISMATCH, + ERR_HTTP, + ERR_HTTP_ACCESS, + ERR_HTTP_PROXY_AUTH, + ERR_HTTP_SERVER_ERROR, + ERR_HTTP_TIMEOUT, + ERR_INITIALIZATION, + ERR_INITIALIZED, + ERR_INTERNAL, + ERR_INVALID_FLOAT, + ERR_INVALID_HANDLE, + ERR_INVALID_PARAM, + ERR_INVALID_POSITION, + ERR_INVALID_SPEAKER, + ERR_INVALID_SYNCPOINT, + ERR_INVALID_THREAD, + ERR_INVALID_VECTOR, + ERR_MAXAUDIBLE, + ERR_MEMORY, + ERR_MEMORY_CANTPOINT, + ERR_NEEDS3D, + ERR_NEEDSHARDWARE, + ERR_NET_CONNECT, + ERR_NET_SOCKET_ERROR, + ERR_NET_URL, + ERR_NET_WOULD_BLOCK, + ERR_NOTREADY, + ERR_OUTPUT_ALLOCATED, + ERR_OUTPUT_CREATEBUFFER, + ERR_OUTPUT_DRIVERCALL, + ERR_OUTPUT_FORMAT, + ERR_OUTPUT_INIT, + ERR_OUTPUT_NODRIVERS, + ERR_PLUGIN, + ERR_PLUGIN_MISSING, + ERR_PLUGIN_RESOURCE, + ERR_PLUGIN_VERSION, + ERR_RECORD, + ERR_REVERB_CHANNELGROUP, + ERR_REVERB_INSTANCE, + ERR_SUBSOUNDS, + ERR_SUBSOUND_ALLOCATED, + ERR_SUBSOUND_CANTMOVE, + ERR_TAGNOTFOUND, + ERR_TOOMANYCHANNELS, + ERR_TRUNCATED, + ERR_UNIMPLEMENTED, + ERR_UNINITIALIZED, + ERR_UNSUPPORTED, + ERR_VERSION, + ERR_EVENT_ALREADY_LOADED, + ERR_EVENT_LIVEUPDATE_BUSY, + ERR_EVENT_LIVEUPDATE_MISMATCH, + ERR_EVENT_LIVEUPDATE_TIMEOUT, + ERR_EVENT_NOTFOUND, + ERR_STUDIO_UNINITIALIZED, + ERR_STUDIO_NOT_LOADED, + ERR_INVALID_STRING, + ERR_ALREADY_LOCKED, + ERR_NOT_LOCKED, + ERR_RECORD_DISCONNECTED, + ERR_TOOMANYSAMPLES, + } + + public enum CHANNELCONTROL_TYPE : int + { + CHANNEL, + CHANNELGROUP, + MAX + } + + [StructLayout(LayoutKind.Sequential)] + public struct VECTOR + { + public float x; + public float y; + public float z; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ATTRIBUTES_3D + { + public VECTOR position; + public VECTOR velocity; + public VECTOR forward; + public VECTOR up; + } + + [StructLayout(LayoutKind.Sequential)] + public partial struct GUID + { + public int Data1; + public int Data2; + public int Data3; + public int Data4; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ASYNCREADINFO + { + public IntPtr handle; + public uint offset; + public uint sizebytes; + public int priority; + + public IntPtr userdata; + public IntPtr buffer; + public uint bytesread; + public FILE_ASYNCDONE_FUNC done; + } + + public enum OUTPUTTYPE : int + { + AUTODETECT, + + UNKNOWN, + NOSOUND, + WAVWRITER, + NOSOUND_NRT, + WAVWRITER_NRT, + + WASAPI, + ASIO, + PULSEAUDIO, + ALSA, + COREAUDIO, + AUDIOTRACK, + OPENSL, + AUDIOOUT, + AUDIO3D, + WEBAUDIO, + NNAUDIO, + WINSONIC, + AAUDIO, + AUDIOWORKLET, + PHASE, + OHAUDIO, + + MAX, + } + + public enum PORT_TYPE : int + { + MUSIC, + COPYRIGHT_MUSIC, + VOICE, + CONTROLLER, + PERSONAL, + VIBRATION, + AUX, + PASSTHROUGH, + VR_VIBRATION, + + MAX + } + + public enum DEBUG_MODE : int + { + TTY, + FILE, + CALLBACK, + } + + [Flags] + public enum DEBUG_FLAGS : uint + { + NONE = 0x00000000, + ERROR = 0x00000001, + WARNING = 0x00000002, + LOG = 0x00000004, + + TYPE_MEMORY = 0x00000100, + TYPE_FILE = 0x00000200, + TYPE_CODEC = 0x00000400, + TYPE_TRACE = 0x00000800, + + DISPLAY_TIMESTAMPS = 0x00010000, + DISPLAY_LINENUMBERS = 0x00020000, + DISPLAY_THREAD = 0x00040000, + } + + [Flags] + public enum MEMORY_TYPE : uint + { + NORMAL = 0x00000000, + STREAM_FILE = 0x00000001, + STREAM_DECODE = 0x00000002, + SAMPLEDATA = 0x00000004, + DSP_BUFFER = 0x00000008, + PLUGIN = 0x00000010, + PERSISTENT = 0x00200000, + ALL = 0xFFFFFFFF + } + + public enum SPEAKERMODE : int + { + DEFAULT, + RAW, + MONO, + STEREO, + QUAD, + SURROUND, + _5POINT1, + _7POINT1, + _7POINT1POINT4, + + MAX, + } + + public enum SPEAKER : int + { + NONE = -1, + FRONT_LEFT, + FRONT_RIGHT, + FRONT_CENTER, + LOW_FREQUENCY, + SURROUND_LEFT, + SURROUND_RIGHT, + BACK_LEFT, + BACK_RIGHT, + TOP_FRONT_LEFT, + TOP_FRONT_RIGHT, + TOP_BACK_LEFT, + TOP_BACK_RIGHT, + + MAX, + } + + [Flags] + public enum CHANNELMASK : uint + { + FRONT_LEFT = 0x00000001, + FRONT_RIGHT = 0x00000002, + FRONT_CENTER = 0x00000004, + LOW_FREQUENCY = 0x00000008, + SURROUND_LEFT = 0x00000010, + SURROUND_RIGHT = 0x00000020, + BACK_LEFT = 0x00000040, + BACK_RIGHT = 0x00000080, + BACK_CENTER = 0x00000100, + + MONO = (FRONT_LEFT), + STEREO = (FRONT_LEFT | FRONT_RIGHT), + LRC = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER), + QUAD = (FRONT_LEFT | FRONT_RIGHT | SURROUND_LEFT | SURROUND_RIGHT), + SURROUND = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT), + _5POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT), + _5POINT1_REARS = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT), + _7POINT0 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT), + _7POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT) + } + + public enum CHANNELORDER : int + { + DEFAULT, + WAVEFORMAT, + PROTOOLS, + ALLMONO, + ALLSTEREO, + ALSA, + + MAX, + } + + public enum PLUGINTYPE : int + { + OUTPUT, + CODEC, + DSP, + + MAX, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PLUGINLIST + { + PLUGINTYPE type; + IntPtr description; + } + + [Flags] + public enum INITFLAGS : uint + { + NORMAL = 0x00000000, + STREAM_FROM_UPDATE = 0x00000001, + MIX_FROM_UPDATE = 0x00000002, + _3D_RIGHTHANDED = 0x00000004, + CLIP_OUTPUT = 0x00000008, + CHANNEL_LOWPASS = 0x00000100, + CHANNEL_DISTANCEFILTER = 0x00000200, + PROFILE_ENABLE = 0x00010000, + VOL0_BECOMES_VIRTUAL = 0x00020000, + GEOMETRY_USECLOSEST = 0x00040000, + PREFER_DOLBY_DOWNMIX = 0x00080000, + THREAD_UNSAFE = 0x00100000, + PROFILE_METER_ALL = 0x00200000, + MEMORY_TRACKING = 0x00400000, + } + + public enum SOUND_TYPE : int + { + UNKNOWN, + AIFF, + ASF, + DLS, + FLAC, + FSB, + IT, + MIDI, + MOD, + MPEG, + OGGVORBIS, + PLAYLIST, + RAW, + S3M, + USER, + WAV, + XM, + XMA, + AUDIOQUEUE, + AT9, + VORBIS, + MEDIA_FOUNDATION, + MEDIACODEC, + FADPCM, + OPUS, + + MAX, + } + + public enum SOUND_FORMAT : int + { + NONE, + PCM8, + PCM16, + PCM24, + PCM32, + PCMFLOAT, + BITSTREAM, + + MAX + } + + [Flags] + public enum MODE : uint + { + DEFAULT = 0x00000000, + LOOP_OFF = 0x00000001, + LOOP_NORMAL = 0x00000002, + LOOP_BIDI = 0x00000004, + _2D = 0x00000008, + _3D = 0x00000010, + CREATESTREAM = 0x00000080, + CREATESAMPLE = 0x00000100, + CREATECOMPRESSEDSAMPLE = 0x00000200, + OPENUSER = 0x00000400, + OPENMEMORY = 0x00000800, + OPENMEMORY_POINT = 0x10000000, + OPENRAW = 0x00001000, + OPENONLY = 0x00002000, + ACCURATETIME = 0x00004000, + MPEGSEARCH = 0x00008000, + NONBLOCKING = 0x00010000, + UNIQUE = 0x00020000, + _3D_HEADRELATIVE = 0x00040000, + _3D_WORLDRELATIVE = 0x00080000, + _3D_INVERSEROLLOFF = 0x00100000, + _3D_LINEARROLLOFF = 0x00200000, + _3D_LINEARSQUAREROLLOFF = 0x00400000, + _3D_INVERSETAPEREDROLLOFF = 0x00800000, + _3D_CUSTOMROLLOFF = 0x04000000, + _3D_IGNOREGEOMETRY = 0x40000000, + IGNORETAGS = 0x02000000, + LOWMEM = 0x08000000, + VIRTUAL_PLAYFROMSTART = 0x80000000 + } + + public enum OPENSTATE : int + { + READY = 0, + LOADING, + ERROR, + CONNECTING, + BUFFERING, + SEEKING, + PLAYING, + SETPOSITION, + + MAX, + } + + public enum SOUNDGROUP_BEHAVIOR : int + { + BEHAVIOR_FAIL, + BEHAVIOR_MUTE, + BEHAVIOR_STEALLOWEST, + + MAX, + } + + public enum CHANNELCONTROL_CALLBACK_TYPE : int + { + END, + VIRTUALVOICE, + SYNCPOINT, + OCCLUSION, + + MAX, + } + + public struct CHANNELCONTROL_DSP_INDEX + { + public const int HEAD = -1; + public const int FADER = -2; + public const int TAIL = -3; + } + + public enum ERRORCALLBACK_INSTANCETYPE : int + { + NONE, + SYSTEM, + CHANNEL, + CHANNELGROUP, + CHANNELCONTROL, + SOUND, + SOUNDGROUP, + DSP, + DSPCONNECTION, + GEOMETRY, + REVERB3D, + STUDIO_SYSTEM, + STUDIO_EVENTDESCRIPTION, + STUDIO_EVENTINSTANCE, + STUDIO_PARAMETERINSTANCE, + STUDIO_BUS, + STUDIO_VCA, + STUDIO_BANK, + STUDIO_COMMANDREPLAY + } + + [StructLayout(LayoutKind.Sequential)] + public struct ERRORCALLBACK_INFO + { + public RESULT result; + public ERRORCALLBACK_INSTANCETYPE instancetype; + public IntPtr instance; + public StringWrapper functionname; + public StringWrapper functionparams; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CPU_USAGE + { + public float dsp; /* DSP mixing CPU usage. */ + public float stream; /* Streaming engine CPU usage. */ + public float geometry; /* Geometry engine CPU usage. */ + public float update; /* System::update CPU usage. */ + public float convolution1; /* Convolution reverb processing thread #1 CPU usage */ + public float convolution2; /* Convolution reverb processing thread #2 CPU usage */ + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_DATA_PARAMETER_INFO + { + public IntPtr data; + public uint length; + public int index; + } + + [Flags] + public enum SYSTEM_CALLBACK_TYPE : uint + { + DEVICELISTCHANGED = 0x00000001, + DEVICELOST = 0x00000002, + MEMORYALLOCATIONFAILED = 0x00000004, + THREADCREATED = 0x00000008, + BADDSPCONNECTION = 0x00000010, + PREMIX = 0x00000020, + POSTMIX = 0x00000040, + ERROR = 0x00000080, + THREADDESTROYED = 0x00000100, + PREUPDATE = 0x00000200, + POSTUPDATE = 0x00000400, + RECORDLISTCHANGED = 0x00000800, + BUFFEREDNOMIX = 0x00001000, + DEVICEREINITIALIZE = 0x00002000, + OUTPUTUNDERRUN = 0x00004000, + RECORDPOSITIONCHANGED = 0x00008000, + ALL = 0xFFFFFFFF, + } + + /* + FMOD Callbacks + */ + public delegate RESULT DEBUG_CALLBACK (DEBUG_FLAGS flags, IntPtr file, int line, IntPtr func, IntPtr message); + public delegate RESULT SYSTEM_CALLBACK (IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata1, IntPtr commanddata2, IntPtr userdata); + public delegate RESULT CHANNELCONTROL_CALLBACK (IntPtr channelcontrol, CHANNELCONTROL_TYPE controltype, CHANNELCONTROL_CALLBACK_TYPE callbacktype, IntPtr commanddata1, IntPtr commanddata2); + public delegate RESULT DSP_CALLBACK (IntPtr dsp, DSP_CALLBACK_TYPE type, IntPtr data); + public delegate RESULT SOUND_NONBLOCK_CALLBACK (IntPtr sound, RESULT result); + public delegate RESULT SOUND_PCMREAD_CALLBACK (IntPtr sound, IntPtr data, uint datalen); + public delegate RESULT SOUND_PCMSETPOS_CALLBACK (IntPtr sound, int subsound, uint position, TIMEUNIT postype); + public delegate RESULT FILE_OPEN_CALLBACK (IntPtr name, ref uint filesize, ref IntPtr handle, IntPtr userdata); + public delegate RESULT FILE_CLOSE_CALLBACK (IntPtr handle, IntPtr userdata); + public delegate RESULT FILE_READ_CALLBACK (IntPtr handle, IntPtr buffer, uint sizebytes, ref uint bytesread, IntPtr userdata); + public delegate RESULT FILE_SEEK_CALLBACK (IntPtr handle, uint pos, IntPtr userdata); + public delegate RESULT FILE_ASYNCREAD_CALLBACK (IntPtr info, IntPtr userdata); + public delegate RESULT FILE_ASYNCCANCEL_CALLBACK(IntPtr info, IntPtr userdata); + public delegate void FILE_ASYNCDONE_FUNC (IntPtr info, RESULT result); + public delegate IntPtr MEMORY_ALLOC_CALLBACK (uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate IntPtr MEMORY_REALLOC_CALLBACK (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void MEMORY_FREE_CALLBACK (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); + public delegate float CB_3D_ROLLOFF_CALLBACK (IntPtr channelcontrol, float distance); + + public enum DSP_RESAMPLER : int + { + DEFAULT, + NOINTERP, + LINEAR, + CUBIC, + SPLINE, + + MAX, + } + + public enum DSP_CALLBACK_TYPE : int + { + DATAPARAMETERRELEASE, + + MAX, + } + + public enum DSPCONNECTION_TYPE : int + { + STANDARD, + SIDECHAIN, + SEND, + SEND_SIDECHAIN, + + MAX, + } + + public enum TAGTYPE : int + { + UNKNOWN = 0, + ID3V1, + ID3V2, + VORBISCOMMENT, + SHOUTCAST, + ICECAST, + ASF, + MIDI, + PLAYLIST, + FMOD, + USER, + + MAX + } + + public enum TAGDATATYPE : int + { + BINARY = 0, + INT, + FLOAT, + STRING, + STRING_UTF16, + STRING_UTF16BE, + STRING_UTF8, + + MAX + } + + [StructLayout(LayoutKind.Sequential)] + public struct TAG + { + public TAGTYPE type; + public TAGDATATYPE datatype; + public StringWrapper name; + public IntPtr data; + public uint datalen; + public bool updated; + } + + [Flags] + public enum TIMEUNIT : uint + { + MS = 0x00000001, + PCM = 0x00000002, + PCMBYTES = 0x00000004, + RAWBYTES = 0x00000008, + PCMFRACTION = 0x00000010, + MODORDER = 0x00000100, + MODROW = 0x00000200, + MODPATTERN = 0x00000400, + } + + public struct PORT_INDEX + { + public const ulong NONE = 0xFFFFFFFFFFFFFFFF; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CREATESOUNDEXINFO + { + public int cbsize; + public uint length; + public uint fileoffset; + public int numchannels; + public int defaultfrequency; + public SOUND_FORMAT format; + public uint decodebuffersize; + public int initialsubsound; + public int numsubsounds; + public IntPtr inclusionlist; + public int inclusionlistnum; + public IntPtr pcmreadcallback_internal; + public IntPtr pcmsetposcallback_internal; + public IntPtr nonblockcallback_internal; + public IntPtr dlsname; + public IntPtr encryptionkey; + public int maxpolyphony; + public IntPtr userdata; + public SOUND_TYPE suggestedsoundtype; + public IntPtr fileuseropen_internal; + public IntPtr fileuserclose_internal; + public IntPtr fileuserread_internal; + public IntPtr fileuserseek_internal; + public IntPtr fileuserasyncread_internal; + public IntPtr fileuserasynccancel_internal; + public IntPtr fileuserdata; + public int filebuffersize; + public CHANNELORDER channelorder; + public IntPtr initialsoundgroup; + public uint initialseekposition; + public TIMEUNIT initialseekpostype; + public int ignoresetfilesystem; + public uint audioqueuepolicy; + public uint minmidigranularity; + public int nonblockthreadid; + public IntPtr fsbguid; + + public SOUND_PCMREAD_CALLBACK pcmreadcallback + { + set { pcmreadcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return pcmreadcallback_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(pcmreadcallback_internal); } + } + public SOUND_PCMSETPOS_CALLBACK pcmsetposcallback + { + set { pcmsetposcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return pcmsetposcallback_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(pcmsetposcallback_internal); } + } + public SOUND_NONBLOCK_CALLBACK nonblockcallback + { + set { nonblockcallback_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return nonblockcallback_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(nonblockcallback_internal); } + } + public FILE_OPEN_CALLBACK fileuseropen + { + set { fileuseropen_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuseropen_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(fileuseropen_internal); } + } + public FILE_CLOSE_CALLBACK fileuserclose + { + set { fileuserclose_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserclose_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(fileuserclose_internal); } + } + public FILE_READ_CALLBACK fileuserread + { + set { fileuserread_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserread_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(fileuserread_internal); } + } + public FILE_SEEK_CALLBACK fileuserseek + { + set { fileuserseek_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserseek_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(fileuserseek_internal); } + } + public FILE_ASYNCREAD_CALLBACK fileuserasyncread + { + set { fileuserasyncread_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserasyncread_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(fileuserasyncread_internal); } + } + public FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel + { + set { fileuserasynccancel_internal = (value == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(value)); } + get { return fileuserasynccancel_internal == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(fileuserasynccancel_internal); } + } + + } + +#pragma warning disable 414 + [StructLayout(LayoutKind.Sequential)] + public struct REVERB_PROPERTIES + { + public float DecayTime; + public float EarlyDelay; + public float LateDelay; + public float HFReference; + public float HFDecayRatio; + public float Diffusion; + public float Density; + public float LowShelfFrequency; + public float LowShelfGain; + public float HighCut; + public float EarlyLateMix; + public float WetLevel; + + #region wrapperinternal + public REVERB_PROPERTIES(float decayTime, float earlyDelay, float lateDelay, float hfReference, + float hfDecayRatio, float diffusion, float density, float lowShelfFrequency, float lowShelfGain, + float highCut, float earlyLateMix, float wetLevel) + { + DecayTime = decayTime; + EarlyDelay = earlyDelay; + LateDelay = lateDelay; + HFReference = hfReference; + HFDecayRatio = hfDecayRatio; + Diffusion = diffusion; + Density = density; + LowShelfFrequency = lowShelfFrequency; + LowShelfGain = lowShelfGain; + HighCut = highCut; + EarlyLateMix = earlyLateMix; + WetLevel = wetLevel; + } + #endregion + } +#pragma warning restore 414 + + public class PRESET + { + public static REVERB_PROPERTIES OFF() { return new REVERB_PROPERTIES( 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f );} + public static REVERB_PROPERTIES GENERIC() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f );} + public static REVERB_PROPERTIES PADDEDCELL() { return new REVERB_PROPERTIES( 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f );} + public static REVERB_PROPERTIES ROOM() { return new REVERB_PROPERTIES( 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f );} + public static REVERB_PROPERTIES BATHROOM() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f );} + public static REVERB_PROPERTIES LIVINGROOM() { return new REVERB_PROPERTIES( 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f );} + public static REVERB_PROPERTIES STONEROOM() { return new REVERB_PROPERTIES( 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f );} + public static REVERB_PROPERTIES AUDITORIUM() { return new REVERB_PROPERTIES( 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f );} + public static REVERB_PROPERTIES CONCERTHALL() { return new REVERB_PROPERTIES( 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f );} + public static REVERB_PROPERTIES CAVE() { return new REVERB_PROPERTIES( 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f );} + public static REVERB_PROPERTIES ARENA() { return new REVERB_PROPERTIES( 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f );} + public static REVERB_PROPERTIES HANGAR() { return new REVERB_PROPERTIES( 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f );} + public static REVERB_PROPERTIES CARPETTEDHALLWAY() { return new REVERB_PROPERTIES( 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f );} + public static REVERB_PROPERTIES HALLWAY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f );} + public static REVERB_PROPERTIES STONECORRIDOR() { return new REVERB_PROPERTIES( 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f );} + public static REVERB_PROPERTIES ALLEY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f );} + public static REVERB_PROPERTIES FOREST() { return new REVERB_PROPERTIES( 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f );} + public static REVERB_PROPERTIES CITY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f );} + public static REVERB_PROPERTIES MOUNTAINS() { return new REVERB_PROPERTIES( 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f );} + public static REVERB_PROPERTIES QUARRY() { return new REVERB_PROPERTIES( 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f );} + public static REVERB_PROPERTIES PLAIN() { return new REVERB_PROPERTIES( 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f );} + public static REVERB_PROPERTIES PARKINGLOT() { return new REVERB_PROPERTIES( 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f );} + public static REVERB_PROPERTIES SEWERPIPE() { return new REVERB_PROPERTIES( 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f );} + public static REVERB_PROPERTIES UNDERWATER() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f );} + } + + [StructLayout(LayoutKind.Sequential)] + public struct ADVANCEDSETTINGS + { + public int cbSize; + public int maxMPEGCodecs; + public int maxADPCMCodecs; + public int maxXMACodecs; + public int maxVorbisCodecs; + public int maxAT9Codecs; + public int maxFADPCMCodecs; + public int maxOpusCodecs; + public int ASIONumChannels; + public IntPtr ASIOChannelList; + public IntPtr ASIOSpeakerList; + public float vol0virtualvol; + public uint defaultDecodeBufferSize; + public ushort profilePort; + public uint geometryMaxFadeTime; + public float distanceFilterCenterFreq; + public int reverb3Dinstance; + public int DSPBufferPoolSize; + public DSP_RESAMPLER resamplerMethod; + public uint randomSeed; + public int maxConvolutionThreads; + public int maxSpatialObjects; + } + + [Flags] + public enum DRIVER_STATE : uint + { + CONNECTED = 0x00000001, + DEFAULT = 0x00000002, + } + + public enum THREAD_PRIORITY : int + { + /* Platform specific priority range */ + PLATFORM_MIN = -32 * 1024, + PLATFORM_MAX = 32 * 1024, + + /* Platform agnostic priorities, maps internally to platform specific value */ + DEFAULT = PLATFORM_MIN - 1, + LOW = PLATFORM_MIN - 2, + MEDIUM = PLATFORM_MIN - 3, + HIGH = PLATFORM_MIN - 4, + VERY_HIGH = PLATFORM_MIN - 5, + EXTREME = PLATFORM_MIN - 6, + CRITICAL = PLATFORM_MIN - 7, + + /* Thread defaults */ + MIXER = EXTREME, + FEEDER = CRITICAL, + STREAM = VERY_HIGH, + FILE = HIGH, + NONBLOCKING = HIGH, + RECORD = HIGH, + GEOMETRY = LOW, + PROFILER = MEDIUM, + STUDIO_UPDATE = MEDIUM, + STUDIO_LOAD_BANK = MEDIUM, + STUDIO_LOAD_SAMPLE = MEDIUM, + CONVOLUTION1 = VERY_HIGH, + CONVOLUTION2 = VERY_HIGH + + } + + public enum THREAD_STACK_SIZE : uint + { + DEFAULT = 0, + MIXER = 80 * 1024, + FEEDER = 16 * 1024, + STREAM = 96 * 1024, + FILE = 64 * 1024, + NONBLOCKING = 112 * 1024, + RECORD = 16 * 1024, + GEOMETRY = 48 * 1024, + PROFILER = 128 * 1024, + STUDIO_UPDATE = 96 * 1024, + STUDIO_LOAD_BANK = 96 * 1024, + STUDIO_LOAD_SAMPLE = 96 * 1024, + CONVOLUTION1 = 16 * 1024, + CONVOLUTION2 = 16 * 1024 + } + + [Flags] + public enum THREAD_AFFINITY : long + { + /* Platform agnostic thread groupings */ + GROUP_DEFAULT = 0x4000000000000000, + GROUP_A = 0x4000000000000001, + GROUP_B = 0x4000000000000002, + GROUP_C = 0x4000000000000003, + + /* Thread defaults */ + MIXER = GROUP_A, + FEEDER = GROUP_C, + STREAM = GROUP_C, + FILE = GROUP_C, + NONBLOCKING = GROUP_C, + RECORD = GROUP_C, + GEOMETRY = GROUP_C, + PROFILER = GROUP_C, + STUDIO_UPDATE = GROUP_B, + STUDIO_LOAD_BANK = GROUP_C, + STUDIO_LOAD_SAMPLE = GROUP_C, + CONVOLUTION1 = GROUP_C, + CONVOLUTION2 = GROUP_C, + + /* Core mask, valid up to 1 << 61 */ + CORE_ALL = 0, + CORE_0 = 1 << 0, + CORE_1 = 1 << 1, + CORE_2 = 1 << 2, + CORE_3 = 1 << 3, + CORE_4 = 1 << 4, + CORE_5 = 1 << 5, + CORE_6 = 1 << 6, + CORE_7 = 1 << 7, + CORE_8 = 1 << 8, + CORE_9 = 1 << 9, + CORE_10 = 1 << 10, + CORE_11 = 1 << 11, + CORE_12 = 1 << 12, + CORE_13 = 1 << 13, + CORE_14 = 1 << 14, + CORE_15 = 1 << 15 + } + + public enum THREAD_TYPE : int + { + MIXER, + FEEDER, + STREAM, + FILE, + NONBLOCKING, + RECORD, + GEOMETRY, + PROFILER, + STUDIO_UPDATE, + STUDIO_LOAD_BANK, + STUDIO_LOAD_SAMPLE, + CONVOLUTION1, + CONVOLUTION2, + + MAX + } + + /* + FMOD System factory functions. Use this to create an FMOD System Instance. below you will see System init/close to get started. + */ + public struct Factory + { + public static RESULT System_Create(out System system) + { + return FMOD5_System_Create(out system.handle, VERSION.number); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Create(out IntPtr system, uint headerversion); + + #endregion + } + + /* + FMOD global system functions (optional). + */ + public struct Memory + { + public static RESULT Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags = MEMORY_TYPE.ALL) + { + return FMOD5_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); + } + + public static RESULT GetStats(out int currentalloced, out int maxalloced, bool blocking = true) + { + return FMOD5_Memory_GetStats(out currentalloced, out maxalloced, blocking); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Memory_Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Memory_GetStats (out int currentalloced, out int maxalloced, bool blocking); + + #endregion + } + + public struct Debug + { + public static RESULT Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode = DEBUG_MODE.TTY, DEBUG_CALLBACK callback = null, string filename = null) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Debug_Initialize(flags, mode, callback, encoder.byteFromStringUTF8(filename)); + } + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Debug_Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode, DEBUG_CALLBACK callback, byte[] filename); + + #endregion + } + + public struct Thread + { + public static RESULT SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity = THREAD_AFFINITY.GROUP_DEFAULT, THREAD_PRIORITY priority = THREAD_PRIORITY.DEFAULT, THREAD_STACK_SIZE stacksize = THREAD_STACK_SIZE.DEFAULT) + { + return FMOD5_Thread_SetAttributes(type, affinity, priority, stacksize); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Thread_SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity, THREAD_PRIORITY priority, THREAD_STACK_SIZE stacksize); + #endregion + } + + /* + 'System' API. + */ + public struct System + { + public RESULT release() + { + return FMOD5_System_Release(this.handle); + } + + // Setup functions. + public RESULT setOutput(OUTPUTTYPE output) + { + return FMOD5_System_SetOutput(this.handle, output); + } + public RESULT getOutput(out OUTPUTTYPE output) + { + return FMOD5_System_GetOutput(this.handle, out output); + } + public RESULT getNumDrivers(out int numdrivers) + { + return FMOD5_System_GetNumDrivers(this.handle, out numdrivers); + } + public RESULT getDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels); + using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) + { + name = encoding.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) + { + return FMOD5_System_GetDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels); + } + public RESULT setDriver(int driver) + { + return FMOD5_System_SetDriver(this.handle, driver); + } + public RESULT getDriver(out int driver) + { + return FMOD5_System_GetDriver(this.handle, out driver); + } + public RESULT setSoftwareChannels(int numsoftwarechannels) + { + return FMOD5_System_SetSoftwareChannels(this.handle, numsoftwarechannels); + } + public RESULT getSoftwareChannels(out int numsoftwarechannels) + { + return FMOD5_System_GetSoftwareChannels(this.handle, out numsoftwarechannels); + } + public RESULT setSoftwareFormat(int samplerate, SPEAKERMODE speakermode, int numrawspeakers) + { + return FMOD5_System_SetSoftwareFormat(this.handle, samplerate, speakermode, numrawspeakers); + } + public RESULT getSoftwareFormat(out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers) + { + return FMOD5_System_GetSoftwareFormat(this.handle, out samplerate, out speakermode, out numrawspeakers); + } + public RESULT setDSPBufferSize(uint bufferlength, int numbuffers) + { + return FMOD5_System_SetDSPBufferSize(this.handle, bufferlength, numbuffers); + } + public RESULT getDSPBufferSize(out uint bufferlength, out int numbuffers) + { + return FMOD5_System_GetDSPBufferSize(this.handle, out bufferlength, out numbuffers); + } + public RESULT setFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign) + { + return FMOD5_System_SetFileSystem(this.handle, useropen, userclose, userread, userseek, userasyncread, userasynccancel, blockalign); + } + public RESULT attachFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek) + { + return FMOD5_System_AttachFileSystem(this.handle, useropen, userclose, userread, userseek); + } + public RESULT setAdvancedSettings(ref ADVANCEDSETTINGS settings) + { + settings.cbSize = Marshal.SizeOf(); + return FMOD5_System_SetAdvancedSettings(this.handle, ref settings); + } + public RESULT getAdvancedSettings(ref ADVANCEDSETTINGS settings) + { + settings.cbSize = Marshal.SizeOf(); + return FMOD5_System_GetAdvancedSettings(this.handle, ref settings); + } + public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) + { + return FMOD5_System_SetCallback(this.handle, callback, callbackmask); + } + + // Plug-in support. + public RESULT setPluginPath(string path) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_SetPluginPath(this.handle, encoder.byteFromStringUTF8(path)); + } + } + public RESULT loadPlugin(string filename, out uint handle, uint priority = 0) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_LoadPlugin(this.handle, encoder.byteFromStringUTF8(filename), out handle, priority); + } + } + public RESULT unloadPlugin(uint handle) + { + return FMOD5_System_UnloadPlugin(this.handle, handle); + } + public RESULT getNumNestedPlugins(uint handle, out int count) + { + return FMOD5_System_GetNumNestedPlugins(this.handle, handle, out count); + } + public RESULT getNestedPlugin(uint handle, int index, out uint nestedhandle) + { + return FMOD5_System_GetNestedPlugin(this.handle, handle, index, out nestedhandle); + } + public RESULT getNumPlugins(PLUGINTYPE plugintype, out int numplugins) + { + return FMOD5_System_GetNumPlugins(this.handle, plugintype, out numplugins); + } + public RESULT getPluginHandle(PLUGINTYPE plugintype, int index, out uint handle) + { + return FMOD5_System_GetPluginHandle(this.handle, plugintype, index, out handle); + } + public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out string name, int namelen, out uint version) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, stringMem, namelen, out version); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out uint version) + { + return FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, IntPtr.Zero, 0, out version); + } + public RESULT setOutputByPlugin(uint handle) + { + return FMOD5_System_SetOutputByPlugin(this.handle, handle); + } + public RESULT getOutputByPlugin(out uint handle) + { + return FMOD5_System_GetOutputByPlugin(this.handle, out handle); + } + public RESULT createDSPByPlugin(uint handle, out DSP dsp) + { + return FMOD5_System_CreateDSPByPlugin(this.handle, handle, out dsp.handle); + } + public RESULT getDSPInfoByPlugin(uint handle, out IntPtr description) + { + return FMOD5_System_GetDSPInfoByPlugin(this.handle, handle, out description); + } + public RESULT registerDSP(ref DSP_DESCRIPTION description, out uint handle) + { + return FMOD5_System_RegisterDSP(this.handle, ref description, out handle); + } + + // Init/Close. + public RESULT init(int maxchannels, INITFLAGS flags, IntPtr extradriverdata) + { + return FMOD5_System_Init(this.handle, maxchannels, flags, extradriverdata); + } + public RESULT close() + { + return FMOD5_System_Close(this.handle); + } + + // General post-init system functions. + public RESULT update() + { + return FMOD5_System_Update(this.handle); + } + public RESULT setSpeakerPosition(SPEAKER speaker, float x, float y, bool active) + { + return FMOD5_System_SetSpeakerPosition(this.handle, speaker, x, y, active); + } + public RESULT getSpeakerPosition(SPEAKER speaker, out float x, out float y, out bool active) + { + return FMOD5_System_GetSpeakerPosition(this.handle, speaker, out x, out y, out active); + } + public RESULT setStreamBufferSize(uint filebuffersize, TIMEUNIT filebuffersizetype) + { + return FMOD5_System_SetStreamBufferSize(this.handle, filebuffersize, filebuffersizetype); + } + public RESULT getStreamBufferSize(out uint filebuffersize, out TIMEUNIT filebuffersizetype) + { + return FMOD5_System_GetStreamBufferSize(this.handle, out filebuffersize, out filebuffersizetype); + } + public RESULT set3DSettings(float dopplerscale, float distancefactor, float rolloffscale) + { + return FMOD5_System_Set3DSettings(this.handle, dopplerscale, distancefactor, rolloffscale); + } + public RESULT get3DSettings(out float dopplerscale, out float distancefactor, out float rolloffscale) + { + return FMOD5_System_Get3DSettings(this.handle, out dopplerscale, out distancefactor, out rolloffscale); + } + public RESULT set3DNumListeners(int numlisteners) + { + return FMOD5_System_Set3DNumListeners(this.handle, numlisteners); + } + public RESULT get3DNumListeners(out int numlisteners) + { + return FMOD5_System_Get3DNumListeners(this.handle, out numlisteners); + } + public RESULT set3DListenerAttributes(int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up) + { + return FMOD5_System_Set3DListenerAttributes(this.handle, listener, ref pos, ref vel, ref forward, ref up); + } + public RESULT get3DListenerAttributes(int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up) + { + return FMOD5_System_Get3DListenerAttributes(this.handle, listener, out pos, out vel, out forward, out up); + } + public RESULT set3DRolloffCallback(CB_3D_ROLLOFF_CALLBACK callback) + { + return FMOD5_System_Set3DRolloffCallback(this.handle, callback); + } + public RESULT mixerSuspend() + { + return FMOD5_System_MixerSuspend(this.handle); + } + public RESULT mixerResume() + { + return FMOD5_System_MixerResume(this.handle); + } + public RESULT getDefaultMixMatrix(SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop) + { + return FMOD5_System_GetDefaultMixMatrix(this.handle, sourcespeakermode, targetspeakermode, matrix, matrixhop); + } + public RESULT getSpeakerModeChannels(SPEAKERMODE mode, out int channels) + { + return FMOD5_System_GetSpeakerModeChannels(this.handle, mode, out channels); + } + + // System information functions. + public RESULT getVersion(out uint version) + { + uint buildnumber; + return getVersion(out version, out buildnumber); + } + public RESULT getVersion(out uint version, out uint buildnumber) + { + return FMOD5_System_GetVersion(this.handle, out version, out buildnumber); + } + public RESULT getOutputHandle(out IntPtr handle) + { + return FMOD5_System_GetOutputHandle(this.handle, out handle); + } + public RESULT getChannelsPlaying(out int channels) + { + return FMOD5_System_GetChannelsPlaying(this.handle, out channels, IntPtr.Zero); + } + public RESULT getChannelsPlaying(out int channels, out int realchannels) + { + return FMOD5_System_GetChannelsPlaying(this.handle, out channels, out realchannels); + } + public RESULT getCPUUsage(out CPU_USAGE usage) + { + return FMOD5_System_GetCPUUsage(this.handle, out usage); + } + public RESULT getFileUsage(out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead) + { + return FMOD5_System_GetFileUsage(this.handle, out sampleBytesRead, out streamBytesRead, out otherBytesRead); + } + + // Sound/DSP/Channel/FX creation and retrieval. + public RESULT createSound(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateSound(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); + } + } + public RESULT createSound(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateSound(this.handle, data, mode, ref exinfo, out sound.handle); + } + public RESULT createSound(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateSound(this.handle, name_or_data, mode, ref exinfo, out sound.handle); + } + public RESULT createSound(string name, MODE mode, out Sound sound) + { + CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); + exinfo.cbsize = Marshal.SizeOf(); + + return createSound(name, mode, ref exinfo, out sound); + } + public RESULT createStream(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateStream(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); + } + } + public RESULT createStream(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateStream(this.handle, data, mode, ref exinfo, out sound.handle); + } + public RESULT createStream(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateStream(this.handle, name_or_data, mode, ref exinfo, out sound.handle); + } + public RESULT createStream(string name, MODE mode, out Sound sound) + { + CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); + exinfo.cbsize = Marshal.SizeOf(); + + return createStream(name, mode, ref exinfo, out sound); + } + public RESULT createDSP(ref DSP_DESCRIPTION description, out DSP dsp) + { + return FMOD5_System_CreateDSP(this.handle, ref description, out dsp.handle); + } + public RESULT createDSPByType(DSP_TYPE type, out DSP dsp) + { + return FMOD5_System_CreateDSPByType(this.handle, type, out dsp.handle); + } + public RESULT createChannelGroup(string name, out ChannelGroup channelgroup) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateChannelGroup(this.handle, encoder.byteFromStringUTF8(name), out channelgroup.handle); + } + } + public RESULT createSoundGroup(string name, out SoundGroup soundgroup) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateSoundGroup(this.handle, encoder.byteFromStringUTF8(name), out soundgroup.handle); + } + } + public RESULT createReverb3D(out Reverb3D reverb) + { + return FMOD5_System_CreateReverb3D(this.handle, out reverb.handle); + } + public RESULT playSound(Sound sound, ChannelGroup channelgroup, bool paused, out Channel channel) + { + return FMOD5_System_PlaySound(this.handle, sound.handle, channelgroup.handle, paused, out channel.handle); + } + public RESULT playDSP(DSP dsp, ChannelGroup channelgroup, bool paused, out Channel channel) + { + return FMOD5_System_PlayDSP(this.handle, dsp.handle, channelgroup.handle, paused, out channel.handle); + } + public RESULT getChannel(int channelid, out Channel channel) + { + return FMOD5_System_GetChannel(this.handle, channelid, out channel.handle); + } + public RESULT getDSPInfoByType(DSP_TYPE type, out IntPtr description) + { + return FMOD5_System_GetDSPInfoByType(this.handle, type, out description); + } + public RESULT getMasterChannelGroup(out ChannelGroup channelgroup) + { + return FMOD5_System_GetMasterChannelGroup(this.handle, out channelgroup.handle); + } + public RESULT getMasterSoundGroup(out SoundGroup soundgroup) + { + return FMOD5_System_GetMasterSoundGroup(this.handle, out soundgroup.handle); + } + + // Routing to ports. + public RESULT attachChannelGroupToPort(PORT_TYPE portType, ulong portIndex, ChannelGroup channelgroup, bool passThru = false) + { + return FMOD5_System_AttachChannelGroupToPort(this.handle, portType, portIndex, channelgroup.handle, passThru); + } + public RESULT detachChannelGroupFromPort(ChannelGroup channelgroup) + { + return FMOD5_System_DetachChannelGroupFromPort(this.handle, channelgroup.handle); + } + + // Reverb api. + public RESULT setReverbProperties(int instance, ref REVERB_PROPERTIES prop) + { + return FMOD5_System_SetReverbProperties(this.handle, instance, ref prop); + } + public RESULT getReverbProperties(int instance, out REVERB_PROPERTIES prop) + { + return FMOD5_System_GetReverbProperties(this.handle, instance, out prop); + } + + // System level DSP functionality. + public RESULT lockDSP() + { + return FMOD5_System_LockDSP(this.handle); + } + public RESULT unlockDSP() + { + return FMOD5_System_UnlockDSP(this.handle); + } + + // Recording api + public RESULT getRecordNumDrivers(out int numdrivers, out int numconnected) + { + return FMOD5_System_GetRecordNumDrivers(this.handle, out numdrivers, out numconnected); + } + public RESULT getRecordDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetRecordDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels, out state); + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getRecordDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) + { + return FMOD5_System_GetRecordDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels, out state); + } + public RESULT getRecordPosition(int id, out uint position) + { + return FMOD5_System_GetRecordPosition(this.handle, id, out position); + } + public RESULT recordStart(int id, Sound sound, bool loop) + { + return FMOD5_System_RecordStart(this.handle, id, sound.handle, loop); + } + public RESULT recordStop(int id) + { + return FMOD5_System_RecordStop(this.handle, id); + } + public RESULT isRecording(int id, out bool recording) + { + return FMOD5_System_IsRecording(this.handle, id, out recording); + } + + // Geometry api + public RESULT createGeometry(int maxpolygons, int maxvertices, out Geometry geometry) + { + return FMOD5_System_CreateGeometry(this.handle, maxpolygons, maxvertices, out geometry.handle); + } + public RESULT setGeometrySettings(float maxworldsize) + { + return FMOD5_System_SetGeometrySettings(this.handle, maxworldsize); + } + public RESULT getGeometrySettings(out float maxworldsize) + { + return FMOD5_System_GetGeometrySettings(this.handle, out maxworldsize); + } + public RESULT loadGeometry(IntPtr data, int datasize, out Geometry geometry) + { + return FMOD5_System_LoadGeometry(this.handle, data, datasize, out geometry.handle); + } + public RESULT getGeometryOcclusion(ref VECTOR listener, ref VECTOR source, out float direct, out float reverb) + { + return FMOD5_System_GetGeometryOcclusion(this.handle, ref listener, ref source, out direct, out reverb); + } + + // Network functions + public RESULT setNetworkProxy(string proxy) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_SetNetworkProxy(this.handle, encoder.byteFromStringUTF8(proxy)); + } + } + public RESULT getNetworkProxy(out string proxy, int proxylen) + { + IntPtr stringMem = Marshal.AllocHGlobal(proxylen); + + RESULT result = FMOD5_System_GetNetworkProxy(this.handle, stringMem, proxylen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + proxy = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT setNetworkTimeout(int timeout) + { + return FMOD5_System_SetNetworkTimeout(this.handle, timeout); + } + public RESULT getNetworkTimeout(out int timeout) + { + return FMOD5_System_GetNetworkTimeout(this.handle, out timeout); + } + + // Userdata set/get + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_System_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_System_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Release (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetOutput (IntPtr system, OUTPUTTYPE output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutput (IntPtr system, out OUTPUTTYPE output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumDrivers (IntPtr system, out int numdrivers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetDriver (IntPtr system, int driver); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDriver (IntPtr system, out int driver); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSoftwareChannels (IntPtr system, int numsoftwarechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSoftwareChannels (IntPtr system, out int numsoftwarechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSoftwareFormat (IntPtr system, int samplerate, SPEAKERMODE speakermode, int numrawspeakers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSoftwareFormat (IntPtr system, out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetDSPBufferSize (IntPtr system, uint bufferlength, int numbuffers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPBufferSize (IntPtr system, out uint bufferlength, out int numbuffers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_AttachFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetPluginPath (IntPtr system, byte[] path); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LoadPlugin (IntPtr system, byte[] filename, out uint handle, uint priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_UnloadPlugin (IntPtr system, uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumNestedPlugins (IntPtr system, uint handle, out int count); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNestedPlugin (IntPtr system, uint handle, int index, out uint nestedhandle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumPlugins (IntPtr system, PLUGINTYPE plugintype, out int numplugins); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetPluginHandle (IntPtr system, PLUGINTYPE plugintype, int index, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetPluginInfo (IntPtr system, uint handle, out PLUGINTYPE plugintype, IntPtr name, int namelen, out uint version); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetOutputByPlugin (IntPtr system, uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutputByPlugin (IntPtr system, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSPByPlugin (IntPtr system, uint handle, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPInfoByPlugin (IntPtr system, uint handle, out IntPtr description); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RegisterDSP (IntPtr system, ref DSP_DESCRIPTION description, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Init (IntPtr system, int maxchannels, INITFLAGS flags, IntPtr extradriverdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Close (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Update (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSpeakerPosition (IntPtr system, SPEAKER speaker, float x, float y, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSpeakerPosition (IntPtr system, SPEAKER speaker, out float x, out float y, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetStreamBufferSize (IntPtr system, uint filebuffersize, TIMEUNIT filebuffersizetype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetStreamBufferSize (IntPtr system, out uint filebuffersize, out TIMEUNIT filebuffersizetype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DSettings (IntPtr system, float dopplerscale, float distancefactor, float rolloffscale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DSettings (IntPtr system, out float dopplerscale, out float distancefactor, out float rolloffscale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DNumListeners (IntPtr system, int numlisteners); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DNumListeners (IntPtr system, out int numlisteners); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DListenerAttributes (IntPtr system, int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DListenerAttributes (IntPtr system, int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DRolloffCallback (IntPtr system, CB_3D_ROLLOFF_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_MixerSuspend (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_MixerResume (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDefaultMixMatrix (IntPtr system, SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSpeakerModeChannels (IntPtr system, SPEAKERMODE mode, out int channels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetVersion (IntPtr system, out uint version, out uint buildnumber); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutputHandle (IntPtr system, out IntPtr handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, out int realchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetFileUsage (IntPtr system, out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSound (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSound (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateStream (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateStream (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSP (IntPtr system, ref DSP_DESCRIPTION description, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSPByType (IntPtr system, DSP_TYPE type, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateChannelGroup (IntPtr system, byte[] name, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSoundGroup (IntPtr system, byte[] name, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateReverb3D (IntPtr system, out IntPtr reverb); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_PlaySound (IntPtr system, IntPtr sound, IntPtr channelgroup, bool paused, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_PlayDSP (IntPtr system, IntPtr dsp, IntPtr channelgroup, bool paused, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannel (IntPtr system, int channelid, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPInfoByType (IntPtr system, DSP_TYPE type, out IntPtr description); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetMasterChannelGroup (IntPtr system, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetMasterSoundGroup (IntPtr system, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_AttachChannelGroupToPort (IntPtr system, PORT_TYPE portType, ulong portIndex, IntPtr channelgroup, bool passThru); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_DetachChannelGroupFromPort(IntPtr system, IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetReverbProperties (IntPtr system, int instance, ref REVERB_PROPERTIES prop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetReverbProperties (IntPtr system, int instance, out REVERB_PROPERTIES prop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LockDSP (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_UnlockDSP (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordNumDrivers (IntPtr system, out int numdrivers, out int numconnected); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordPosition (IntPtr system, int id, out uint position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RecordStart (IntPtr system, int id, IntPtr sound, bool loop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RecordStop (IntPtr system, int id); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_IsRecording (IntPtr system, int id, out bool recording); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateGeometry (IntPtr system, int maxpolygons, int maxvertices, out IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetGeometrySettings (IntPtr system, float maxworldsize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetGeometrySettings (IntPtr system, out float maxworldsize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LoadGeometry (IntPtr system, IntPtr data, int datasize, out IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetGeometryOcclusion (IntPtr system, ref VECTOR listener, ref VECTOR source, out float direct, out float reverb); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetNetworkProxy (IntPtr system, byte[] proxy); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNetworkProxy (IntPtr system, IntPtr proxy, int proxylen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetNetworkTimeout (IntPtr system, int timeout); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNetworkTimeout (IntPtr system, out int timeout); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetUserData (IntPtr system, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetUserData (IntPtr system, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public System(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + + /* + 'Sound' API. + */ + public struct Sound + { + public RESULT release() + { + return FMOD5_Sound_Release(this.handle); + } + public RESULT getSystemObject(out System system) + { + return FMOD5_Sound_GetSystemObject(this.handle, out system.handle); + } + + // Standard sound manipulation functions. + public RESULT @lock(uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2) + { + return FMOD5_Sound_Lock(this.handle, offset, length, out ptr1, out ptr2, out len1, out len2); + } + public RESULT unlock(IntPtr ptr1, IntPtr ptr2, uint len1, uint len2) + { + return FMOD5_Sound_Unlock(this.handle, ptr1, ptr2, len1, len2); + } + public RESULT setDefaults(float frequency, int priority) + { + return FMOD5_Sound_SetDefaults(this.handle, frequency, priority); + } + public RESULT getDefaults(out float frequency, out int priority) + { + return FMOD5_Sound_GetDefaults(this.handle, out frequency, out priority); + } + public RESULT set3DMinMaxDistance(float min, float max) + { + return FMOD5_Sound_Set3DMinMaxDistance(this.handle, min, max); + } + public RESULT get3DMinMaxDistance(out float min, out float max) + { + return FMOD5_Sound_Get3DMinMaxDistance(this.handle, out min, out max); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_Sound_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_Sound_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_Sound_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_Sound_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + + public RESULT getSubSound(int index, out Sound subsound) + { + return FMOD5_Sound_GetSubSound(this.handle, index, out subsound.handle); + } + public RESULT getSubSoundParent(out Sound parentsound) + { + return FMOD5_Sound_GetSubSoundParent(this.handle, out parentsound.handle); + } + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_Sound_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getLength(out uint length, TIMEUNIT lengthtype) + { + return FMOD5_Sound_GetLength(this.handle, out length, lengthtype); + } + public RESULT getFormat(out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits) + { + return FMOD5_Sound_GetFormat(this.handle, out type, out format, out channels, out bits); + } + public RESULT getNumSubSounds(out int numsubsounds) + { + return FMOD5_Sound_GetNumSubSounds(this.handle, out numsubsounds); + } + public RESULT getNumTags(out int numtags, out int numtagsupdated) + { + return FMOD5_Sound_GetNumTags(this.handle, out numtags, out numtagsupdated); + } + public RESULT getTag(string name, int index, out TAG tag) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Sound_GetTag(this.handle, encoder.byteFromStringUTF8(name), index, out tag); + } + } + public RESULT getOpenState(out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy) + { + return FMOD5_Sound_GetOpenState(this.handle, out openstate, out percentbuffered, out starving, out diskbusy); + } + public RESULT readData(byte[] buffer) + { + return FMOD5_Sound_ReadData(this.handle, buffer, (uint)buffer.Length, IntPtr.Zero); + } + public RESULT readData(byte[] buffer, out uint read) + { + return FMOD5_Sound_ReadData(this.handle, buffer, (uint)buffer.Length, out read); + } + public RESULT seekData(uint pcm) + { + return FMOD5_Sound_SeekData(this.handle, pcm); + } + public RESULT setSoundGroup(SoundGroup soundgroup) + { + return FMOD5_Sound_SetSoundGroup(this.handle, soundgroup.handle); + } + public RESULT getSoundGroup(out SoundGroup soundgroup) + { + return FMOD5_Sound_GetSoundGroup(this.handle, out soundgroup.handle); + } + + // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks. + public RESULT getNumSyncPoints(out int numsyncpoints) + { + return FMOD5_Sound_GetNumSyncPoints(this.handle, out numsyncpoints); + } + public RESULT getSyncPoint(int index, out IntPtr point) + { + return FMOD5_Sound_GetSyncPoint(this.handle, index, out point); + } + public RESULT getSyncPointInfo(IntPtr point, out string name, int namelen, out uint offset, TIMEUNIT offsettype) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_Sound_GetSyncPointInfo(this.handle, point, stringMem, namelen, out offset, offsettype); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getSyncPointInfo(IntPtr point, out uint offset, TIMEUNIT offsettype) + { + return FMOD5_Sound_GetSyncPointInfo(this.handle, point, IntPtr.Zero, 0, out offset, offsettype); + } + public RESULT addSyncPoint(uint offset, TIMEUNIT offsettype, string name, out IntPtr point) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Sound_AddSyncPoint(this.handle, offset, offsettype, encoder.byteFromStringUTF8(name), out point); + } + } + public RESULT deleteSyncPoint(IntPtr point) + { + return FMOD5_Sound_DeleteSyncPoint(this.handle, point); + } + + // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time. + public RESULT setMode(MODE mode) + { + return FMOD5_Sound_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_Sound_GetMode(this.handle, out mode); + } + public RESULT setLoopCount(int loopcount) + { + return FMOD5_Sound_SetLoopCount(this.handle, loopcount); + } + public RESULT getLoopCount(out int loopcount) + { + return FMOD5_Sound_GetLoopCount(this.handle, out loopcount); + } + public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Sound_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); + } + public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Sound_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); + } + + // For MOD/S3M/XM/IT/MID sequenced formats only. + public RESULT getMusicNumChannels(out int numchannels) + { + return FMOD5_Sound_GetMusicNumChannels(this.handle, out numchannels); + } + public RESULT setMusicChannelVolume(int channel, float volume) + { + return FMOD5_Sound_SetMusicChannelVolume(this.handle, channel, volume); + } + public RESULT getMusicChannelVolume(int channel, out float volume) + { + return FMOD5_Sound_GetMusicChannelVolume(this.handle, channel, out volume); + } + public RESULT setMusicSpeed(float speed) + { + return FMOD5_Sound_SetMusicSpeed(this.handle, speed); + } + public RESULT getMusicSpeed(out float speed) + { + return FMOD5_Sound_GetMusicSpeed(this.handle, out speed); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Sound_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Sound_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Release (IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSystemObject (IntPtr sound, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Lock (IntPtr sound, uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Unlock (IntPtr sound, IntPtr ptr1, IntPtr ptr2, uint len1, uint len2); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetDefaults (IntPtr sound, float frequency, int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetDefaults (IntPtr sound, out float frequency, out int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DMinMaxDistance (IntPtr sound, float min, float max); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DMinMaxDistance (IntPtr sound, out float min, out float max); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DConeSettings (IntPtr sound, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DConeSettings (IntPtr sound, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DCustomRolloff (IntPtr sound, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DCustomRolloff (IntPtr sound, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSubSound (IntPtr sound, int index, out IntPtr subsound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSubSoundParent (IntPtr sound, out IntPtr parentsound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetName (IntPtr sound, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLength (IntPtr sound, out uint length, TIMEUNIT lengthtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetFormat (IntPtr sound, out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumSubSounds (IntPtr sound, out int numsubsounds); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumTags (IntPtr sound, out int numtags, out int numtagsupdated); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetTag (IntPtr sound, byte[] name, int index, out TAG tag); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetOpenState (IntPtr sound, out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, byte[] buffer, uint length, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, byte[] buffer, uint length, out uint read); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SeekData (IntPtr sound, uint pcm); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetSoundGroup (IntPtr sound, IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSoundGroup (IntPtr sound, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumSyncPoints (IntPtr sound, out int numsyncpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSyncPoint (IntPtr sound, int index, out IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSyncPointInfo (IntPtr sound, IntPtr point, IntPtr name, int namelen, out uint offset, TIMEUNIT offsettype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_AddSyncPoint (IntPtr sound, uint offset, TIMEUNIT offsettype, byte[] name, out IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_DeleteSyncPoint (IntPtr sound, IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMode (IntPtr sound, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMode (IntPtr sound, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetLoopCount (IntPtr sound, int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLoopCount (IntPtr sound, out int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetLoopPoints (IntPtr sound, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLoopPoints (IntPtr sound, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicNumChannels (IntPtr sound, out int numchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMusicChannelVolume (IntPtr sound, int channel, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicChannelVolume (IntPtr sound, int channel, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMusicSpeed (IntPtr sound, float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicSpeed (IntPtr sound, out float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetUserData (IntPtr sound, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetUserData (IntPtr sound, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Sound(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'ChannelControl' API + */ + interface IChannelControl + { + RESULT getSystemObject (out System system); + + // General control functionality for Channels and ChannelGroups. + RESULT stop (); + RESULT setPaused (bool paused); + RESULT getPaused (out bool paused); + RESULT setVolume (float volume); + RESULT getVolume (out float volume); + RESULT setVolumeRamp (bool ramp); + RESULT getVolumeRamp (out bool ramp); + RESULT getAudibility (out float audibility); + RESULT setPitch (float pitch); + RESULT getPitch (out float pitch); + RESULT setMute (bool mute); + RESULT getMute (out bool mute); + RESULT setReverbProperties (int instance, float wet); + RESULT getReverbProperties (int instance, out float wet); + RESULT setLowPassGain (float gain); + RESULT getLowPassGain (out float gain); + RESULT setMode (MODE mode); + RESULT getMode (out MODE mode); + RESULT setCallback (CHANNELCONTROL_CALLBACK callback); + RESULT isPlaying (out bool isplaying); + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + RESULT setPan (float pan); + RESULT setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + RESULT setMixLevelsInput (float[] levels, int numlevels); + RESULT setMixMatrix (float[] matrix, int outchannels, int inchannels, int inchannel_hop); + RESULT getMixMatrix (float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + + // Clock based functionality. + RESULT getDSPClock (out ulong dspclock, out ulong parentclock); + RESULT setDelay (ulong dspclock_start, ulong dspclock_end, bool stopchannels); + RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end); + RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + RESULT addFadePoint (ulong dspclock, float volume); + RESULT setFadePointRamp (ulong dspclock, float volume); + RESULT removeFadePoints (ulong dspclock_start, ulong dspclock_end); + RESULT getFadePoints (ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + + // DSP effects. + RESULT getDSP (int index, out DSP dsp); + RESULT addDSP (int index, DSP dsp); + RESULT removeDSP (DSP dsp); + RESULT getNumDSPs (out int numdsps); + RESULT setDSPIndex (DSP dsp, int index); + RESULT getDSPIndex (DSP dsp, out int index); + + // 3D functionality. + RESULT set3DAttributes (ref VECTOR pos, ref VECTOR vel); + RESULT get3DAttributes (out VECTOR pos, out VECTOR vel); + RESULT set3DMinMaxDistance (float mindistance, float maxdistance); + RESULT get3DMinMaxDistance (out float mindistance, out float maxdistance); + RESULT set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume); + RESULT get3DConeSettings (out float insideconeangle, out float outsideconeangle, out float outsidevolume); + RESULT set3DConeOrientation (ref VECTOR orientation); + RESULT get3DConeOrientation (out VECTOR orientation); + RESULT set3DCustomRolloff (ref VECTOR points, int numpoints); + RESULT get3DCustomRolloff (out IntPtr points, out int numpoints); + RESULT set3DOcclusion (float directocclusion, float reverbocclusion); + RESULT get3DOcclusion (out float directocclusion, out float reverbocclusion); + RESULT set3DSpread (float angle); + RESULT get3DSpread (out float angle); + RESULT set3DLevel (float level); + RESULT get3DLevel (out float level); + RESULT set3DDopplerLevel (float level); + RESULT get3DDopplerLevel (out float level); + RESULT set3DDistanceFilter (bool custom, float customLevel, float centerFreq); + RESULT get3DDistanceFilter (out bool custom, out float customLevel, out float centerFreq); + + // Userdata set/get. + RESULT setUserData (IntPtr userdata); + RESULT getUserData (out IntPtr userdata); + } + + /* + 'Channel' API + */ + public struct Channel : IChannelControl + { + // Channel specific control functionality. + public RESULT setFrequency(float frequency) + { + return FMOD5_Channel_SetFrequency(this.handle, frequency); + } + public RESULT getFrequency(out float frequency) + { + return FMOD5_Channel_GetFrequency(this.handle, out frequency); + } + public RESULT setPriority(int priority) + { + return FMOD5_Channel_SetPriority(this.handle, priority); + } + public RESULT getPriority(out int priority) + { + return FMOD5_Channel_GetPriority(this.handle, out priority); + } + public RESULT setPosition(uint position, TIMEUNIT postype) + { + return FMOD5_Channel_SetPosition(this.handle, position, postype); + } + public RESULT getPosition(out uint position, TIMEUNIT postype) + { + return FMOD5_Channel_GetPosition(this.handle, out position, postype); + } + public RESULT setChannelGroup(ChannelGroup channelgroup) + { + return FMOD5_Channel_SetChannelGroup(this.handle, channelgroup.handle); + } + public RESULT getChannelGroup(out ChannelGroup channelgroup) + { + return FMOD5_Channel_GetChannelGroup(this.handle, out channelgroup.handle); + } + public RESULT setLoopCount(int loopcount) + { + return FMOD5_Channel_SetLoopCount(this.handle, loopcount); + } + public RESULT getLoopCount(out int loopcount) + { + return FMOD5_Channel_GetLoopCount(this.handle, out loopcount); + } + public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Channel_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); + } + public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Channel_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); + } + + // Information only functions. + public RESULT isVirtual(out bool isvirtual) + { + return FMOD5_Channel_IsVirtual(this.handle, out isvirtual); + } + public RESULT getCurrentSound(out Sound sound) + { + return FMOD5_Channel_GetCurrentSound(this.handle, out sound.handle); + } + public RESULT getIndex(out int index) + { + return FMOD5_Channel_GetIndex(this.handle, out index); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_Channel_GetSystemObject(this.handle, out system.handle); + } + + // General control functionality for Channels and ChannelGroups. + public RESULT stop() + { + return FMOD5_Channel_Stop(this.handle); + } + public RESULT setPaused(bool paused) + { + return FMOD5_Channel_SetPaused(this.handle, paused); + } + public RESULT getPaused(out bool paused) + { + return FMOD5_Channel_GetPaused(this.handle, out paused); + } + public RESULT setVolume(float volume) + { + return FMOD5_Channel_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_Channel_GetVolume(this.handle, out volume); + } + public RESULT setVolumeRamp(bool ramp) + { + return FMOD5_Channel_SetVolumeRamp(this.handle, ramp); + } + public RESULT getVolumeRamp(out bool ramp) + { + return FMOD5_Channel_GetVolumeRamp(this.handle, out ramp); + } + public RESULT getAudibility(out float audibility) + { + return FMOD5_Channel_GetAudibility(this.handle, out audibility); + } + public RESULT setPitch(float pitch) + { + return FMOD5_Channel_SetPitch(this.handle, pitch); + } + public RESULT getPitch(out float pitch) + { + return FMOD5_Channel_GetPitch(this.handle, out pitch); + } + public RESULT setMute(bool mute) + { + return FMOD5_Channel_SetMute(this.handle, mute); + } + public RESULT getMute(out bool mute) + { + return FMOD5_Channel_GetMute(this.handle, out mute); + } + public RESULT setReverbProperties(int instance, float wet) + { + return FMOD5_Channel_SetReverbProperties(this.handle, instance, wet); + } + public RESULT getReverbProperties(int instance, out float wet) + { + return FMOD5_Channel_GetReverbProperties(this.handle, instance, out wet); + } + public RESULT setLowPassGain(float gain) + { + return FMOD5_Channel_SetLowPassGain(this.handle, gain); + } + public RESULT getLowPassGain(out float gain) + { + return FMOD5_Channel_GetLowPassGain(this.handle, out gain); + } + public RESULT setMode(MODE mode) + { + return FMOD5_Channel_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_Channel_GetMode(this.handle, out mode); + } + public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) + { + return FMOD5_Channel_SetCallback(this.handle, callback); + } + public RESULT isPlaying(out bool isplaying) + { + return FMOD5_Channel_IsPlaying(this.handle, out isplaying); + } + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + public RESULT setPan(float pan) + { + return FMOD5_Channel_SetPan(this.handle, pan); + } + public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) + { + return FMOD5_Channel_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); + } + public RESULT setMixLevelsInput(float[] levels, int numlevels) + { + return FMOD5_Channel_SetMixLevelsInput(this.handle, levels, numlevels); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) + { + return FMOD5_Channel_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) + { + return FMOD5_Channel_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + + // Clock based functionality. + public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) + { + return FMOD5_Channel_GetDSPClock(this.handle, out dspclock, out parentclock); + } + public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels = true) + { + return FMOD5_Channel_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) + { + return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) + { + return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); + } + public RESULT addFadePoint(ulong dspclock, float volume) + { + return FMOD5_Channel_AddFadePoint(this.handle, dspclock, volume); + } + public RESULT setFadePointRamp(ulong dspclock, float volume) + { + return FMOD5_Channel_SetFadePointRamp(this.handle, dspclock, volume); + } + public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) + { + return FMOD5_Channel_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); + } + public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) + { + return FMOD5_Channel_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); + } + + // DSP effects. + public RESULT getDSP(int index, out DSP dsp) + { + return FMOD5_Channel_GetDSP(this.handle, index, out dsp.handle); + } + public RESULT addDSP(int index, DSP dsp) + { + return FMOD5_Channel_AddDSP(this.handle, index, dsp.handle); + } + public RESULT removeDSP(DSP dsp) + { + return FMOD5_Channel_RemoveDSP(this.handle, dsp.handle); + } + public RESULT getNumDSPs(out int numdsps) + { + return FMOD5_Channel_GetNumDSPs(this.handle, out numdsps); + } + public RESULT setDSPIndex(DSP dsp, int index) + { + return FMOD5_Channel_SetDSPIndex(this.handle, dsp.handle, index); + } + public RESULT getDSPIndex(DSP dsp, out int index) + { + return FMOD5_Channel_GetDSPIndex(this.handle, dsp.handle, out index); + } + + // 3D functionality. + public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) + { + return FMOD5_Channel_Set3DAttributes(this.handle, ref pos, ref vel); + } + public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) + { + return FMOD5_Channel_Get3DAttributes(this.handle, out pos, out vel); + } + public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) + { + return FMOD5_Channel_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); + } + public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) + { + return FMOD5_Channel_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_Channel_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_Channel_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DConeOrientation(ref VECTOR orientation) + { + return FMOD5_Channel_Set3DConeOrientation(this.handle, ref orientation); + } + public RESULT get3DConeOrientation(out VECTOR orientation) + { + return FMOD5_Channel_Get3DConeOrientation(this.handle, out orientation); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_Channel_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_Channel_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) + { + return FMOD5_Channel_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); + } + public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) + { + return FMOD5_Channel_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); + } + public RESULT set3DSpread(float angle) + { + return FMOD5_Channel_Set3DSpread(this.handle, angle); + } + public RESULT get3DSpread(out float angle) + { + return FMOD5_Channel_Get3DSpread(this.handle, out angle); + } + public RESULT set3DLevel(float level) + { + return FMOD5_Channel_Set3DLevel(this.handle, level); + } + public RESULT get3DLevel(out float level) + { + return FMOD5_Channel_Get3DLevel(this.handle, out level); + } + public RESULT set3DDopplerLevel(float level) + { + return FMOD5_Channel_Set3DDopplerLevel(this.handle, level); + } + public RESULT get3DDopplerLevel(out float level) + { + return FMOD5_Channel_Get3DDopplerLevel(this.handle, out level); + } + public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) + { + return FMOD5_Channel_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); + } + public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) + { + return FMOD5_Channel_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Channel_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Channel_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetFrequency (IntPtr channel, float frequency); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetFrequency (IntPtr channel, out float frequency); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPriority (IntPtr channel, int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPriority (IntPtr channel, out int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPosition (IntPtr channel, uint position, TIMEUNIT postype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPosition (IntPtr channel, out uint position, TIMEUNIT postype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetChannelGroup (IntPtr channel, IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetChannelGroup (IntPtr channel, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLoopCount (IntPtr channel, int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLoopCount (IntPtr channel, out int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLoopPoints (IntPtr channel, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLoopPoints (IntPtr channel, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_IsVirtual (IntPtr channel, out bool isvirtual); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetCurrentSound (IntPtr channel, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetIndex (IntPtr channel, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetSystemObject (IntPtr channel, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Stop (IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPaused (IntPtr channel, bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPaused (IntPtr channel, out bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetVolume (IntPtr channel, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetVolume (IntPtr channel, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetVolumeRamp (IntPtr channel, bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetVolumeRamp (IntPtr channel, out bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetAudibility (IntPtr channel, out float audibility); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPitch (IntPtr channel, float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPitch (IntPtr channel, out float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMute (IntPtr channel, bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMute (IntPtr channel, out bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetReverbProperties (IntPtr channel, int instance, float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetReverbProperties (IntPtr channel, int instance, out float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLowPassGain (IntPtr channel, float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLowPassGain (IntPtr channel, out float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMode (IntPtr channel, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMode (IntPtr channel, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetCallback (IntPtr channel, CHANNELCONTROL_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_IsPlaying (IntPtr channel, out bool isplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPan (IntPtr channel, float pan); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixLevelsOutput (IntPtr channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixLevelsInput (IntPtr channel, float[] levels, int numlevels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixMatrix (IntPtr channel, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMixMatrix (IntPtr channel, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSPClock (IntPtr channel, out ulong dspclock, out ulong parentclock); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetDelay (IntPtr channel, ulong dspclock_start, ulong dspclock_end, bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_AddFadePoint (IntPtr channel, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetFadePointRamp (IntPtr channel, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_RemoveFadePoints (IntPtr channel, ulong dspclock_start, ulong dspclock_end); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetFadePoints (IntPtr channel, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSP (IntPtr channel, int index, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_AddDSP (IntPtr channel, int index, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_RemoveDSP (IntPtr channel, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetNumDSPs (IntPtr channel, out int numdsps); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetDSPIndex (IntPtr channel, IntPtr dsp, int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSPIndex (IntPtr channel, IntPtr dsp, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DAttributes (IntPtr channel, ref VECTOR pos, ref VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DAttributes (IntPtr channel, out VECTOR pos, out VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DMinMaxDistance (IntPtr channel, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DMinMaxDistance (IntPtr channel, out float mindistance, out float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DConeSettings (IntPtr channel, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DConeSettings (IntPtr channel, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DConeOrientation (IntPtr channel, ref VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DConeOrientation (IntPtr channel, out VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DCustomRolloff (IntPtr channel, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DCustomRolloff (IntPtr channel, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DOcclusion (IntPtr channel, float directocclusion, float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DOcclusion (IntPtr channel, out float directocclusion, out float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DSpread (IntPtr channel, float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DSpread (IntPtr channel, out float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DLevel (IntPtr channel, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DLevel (IntPtr channel, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DDopplerLevel (IntPtr channel, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DDopplerLevel (IntPtr channel, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DDistanceFilter (IntPtr channel, bool custom, float customLevel, float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DDistanceFilter (IntPtr channel, out bool custom, out float customLevel, out float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetUserData (IntPtr channel, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetUserData (IntPtr channel, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Channel(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'ChannelGroup' API + */ + public struct ChannelGroup : IChannelControl + { + public RESULT release() + { + return FMOD5_ChannelGroup_Release(this.handle); + } + + // Nested channel groups. + public RESULT addGroup(ChannelGroup group, bool propagatedspclock = true) + { + return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, IntPtr.Zero); + } + public RESULT addGroup(ChannelGroup group, bool propagatedspclock, out DSPConnection connection) + { + return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, out connection.handle); + } + public RESULT getNumGroups(out int numgroups) + { + return FMOD5_ChannelGroup_GetNumGroups(this.handle, out numgroups); + } + public RESULT getGroup(int index, out ChannelGroup group) + { + return FMOD5_ChannelGroup_GetGroup(this.handle, index, out group.handle); + } + public RESULT getParentGroup(out ChannelGroup group) + { + return FMOD5_ChannelGroup_GetParentGroup(this.handle, out group.handle); + } + + // Information only functions. + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_ChannelGroup_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getNumChannels(out int numchannels) + { + return FMOD5_ChannelGroup_GetNumChannels(this.handle, out numchannels); + } + public RESULT getChannel(int index, out Channel channel) + { + return FMOD5_ChannelGroup_GetChannel(this.handle, index, out channel.handle); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_ChannelGroup_GetSystemObject(this.handle, out system.handle); + } + + // General control functionality for Channels and ChannelGroups. + public RESULT stop() + { + return FMOD5_ChannelGroup_Stop(this.handle); + } + public RESULT setPaused(bool paused) + { + return FMOD5_ChannelGroup_SetPaused(this.handle, paused); + } + public RESULT getPaused(out bool paused) + { + return FMOD5_ChannelGroup_GetPaused(this.handle, out paused); + } + public RESULT setVolume(float volume) + { + return FMOD5_ChannelGroup_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_ChannelGroup_GetVolume(this.handle, out volume); + } + public RESULT setVolumeRamp(bool ramp) + { + return FMOD5_ChannelGroup_SetVolumeRamp(this.handle, ramp); + } + public RESULT getVolumeRamp(out bool ramp) + { + return FMOD5_ChannelGroup_GetVolumeRamp(this.handle, out ramp); + } + public RESULT getAudibility(out float audibility) + { + return FMOD5_ChannelGroup_GetAudibility(this.handle, out audibility); + } + public RESULT setPitch(float pitch) + { + return FMOD5_ChannelGroup_SetPitch(this.handle, pitch); + } + public RESULT getPitch(out float pitch) + { + return FMOD5_ChannelGroup_GetPitch(this.handle, out pitch); + } + public RESULT setMute(bool mute) + { + return FMOD5_ChannelGroup_SetMute(this.handle, mute); + } + public RESULT getMute(out bool mute) + { + return FMOD5_ChannelGroup_GetMute(this.handle, out mute); + } + public RESULT setReverbProperties(int instance, float wet) + { + return FMOD5_ChannelGroup_SetReverbProperties(this.handle, instance, wet); + } + public RESULT getReverbProperties(int instance, out float wet) + { + return FMOD5_ChannelGroup_GetReverbProperties(this.handle, instance, out wet); + } + public RESULT setLowPassGain(float gain) + { + return FMOD5_ChannelGroup_SetLowPassGain(this.handle, gain); + } + public RESULT getLowPassGain(out float gain) + { + return FMOD5_ChannelGroup_GetLowPassGain(this.handle, out gain); + } + public RESULT setMode(MODE mode) + { + return FMOD5_ChannelGroup_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_ChannelGroup_GetMode(this.handle, out mode); + } + public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) + { + return FMOD5_ChannelGroup_SetCallback(this.handle, callback); + } + public RESULT isPlaying(out bool isplaying) + { + return FMOD5_ChannelGroup_IsPlaying(this.handle, out isplaying); + } + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + public RESULT setPan(float pan) + { + return FMOD5_ChannelGroup_SetPan(this.handle, pan); + } + public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) + { + return FMOD5_ChannelGroup_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); + } + public RESULT setMixLevelsInput(float[] levels, int numlevels) + { + return FMOD5_ChannelGroup_SetMixLevelsInput(this.handle, levels, numlevels); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop) + { + return FMOD5_ChannelGroup_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop) + { + return FMOD5_ChannelGroup_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + + // Clock based functionality. + public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) + { + return FMOD5_ChannelGroup_GetDSPClock(this.handle, out dspclock, out parentclock); + } + public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels) + { + return FMOD5_ChannelGroup_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) + { + return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) + { + return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); + } + public RESULT addFadePoint(ulong dspclock, float volume) + { + return FMOD5_ChannelGroup_AddFadePoint(this.handle, dspclock, volume); + } + public RESULT setFadePointRamp(ulong dspclock, float volume) + { + return FMOD5_ChannelGroup_SetFadePointRamp(this.handle, dspclock, volume); + } + public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) + { + return FMOD5_ChannelGroup_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); + } + public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) + { + return FMOD5_ChannelGroup_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); + } + + // DSP effects. + public RESULT getDSP(int index, out DSP dsp) + { + return FMOD5_ChannelGroup_GetDSP(this.handle, index, out dsp.handle); + } + public RESULT addDSP(int index, DSP dsp) + { + return FMOD5_ChannelGroup_AddDSP(this.handle, index, dsp.handle); + } + public RESULT removeDSP(DSP dsp) + { + return FMOD5_ChannelGroup_RemoveDSP(this.handle, dsp.handle); + } + public RESULT getNumDSPs(out int numdsps) + { + return FMOD5_ChannelGroup_GetNumDSPs(this.handle, out numdsps); + } + public RESULT setDSPIndex(DSP dsp, int index) + { + return FMOD5_ChannelGroup_SetDSPIndex(this.handle, dsp.handle, index); + } + public RESULT getDSPIndex(DSP dsp, out int index) + { + return FMOD5_ChannelGroup_GetDSPIndex(this.handle, dsp.handle, out index); + } + + // 3D functionality. + public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) + { + return FMOD5_ChannelGroup_Set3DAttributes(this.handle, ref pos, ref vel); + } + public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) + { + return FMOD5_ChannelGroup_Get3DAttributes(this.handle, out pos, out vel); + } + public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) + { + return FMOD5_ChannelGroup_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); + } + public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) + { + return FMOD5_ChannelGroup_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_ChannelGroup_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_ChannelGroup_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DConeOrientation(ref VECTOR orientation) + { + return FMOD5_ChannelGroup_Set3DConeOrientation(this.handle, ref orientation); + } + public RESULT get3DConeOrientation(out VECTOR orientation) + { + return FMOD5_ChannelGroup_Get3DConeOrientation(this.handle, out orientation); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_ChannelGroup_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_ChannelGroup_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) + { + return FMOD5_ChannelGroup_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); + } + public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) + { + return FMOD5_ChannelGroup_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); + } + public RESULT set3DSpread(float angle) + { + return FMOD5_ChannelGroup_Set3DSpread(this.handle, angle); + } + public RESULT get3DSpread(out float angle) + { + return FMOD5_ChannelGroup_Get3DSpread(this.handle, out angle); + } + public RESULT set3DLevel(float level) + { + return FMOD5_ChannelGroup_Set3DLevel(this.handle, level); + } + public RESULT get3DLevel(out float level) + { + return FMOD5_ChannelGroup_Get3DLevel(this.handle, out level); + } + public RESULT set3DDopplerLevel(float level) + { + return FMOD5_ChannelGroup_Set3DDopplerLevel(this.handle, level); + } + public RESULT get3DDopplerLevel(out float level) + { + return FMOD5_ChannelGroup_Get3DDopplerLevel(this.handle, out level); + } + public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) + { + return FMOD5_ChannelGroup_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); + } + public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) + { + return FMOD5_ChannelGroup_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_ChannelGroup_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_ChannelGroup_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Release (IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, out IntPtr connection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumGroups (IntPtr channelgroup, out int numgroups); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetGroup (IntPtr channelgroup, int index, out IntPtr group); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetParentGroup (IntPtr channelgroup, out IntPtr group); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetName (IntPtr channelgroup, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumChannels (IntPtr channelgroup, out int numchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetChannel (IntPtr channelgroup, int index, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetSystemObject (IntPtr channelgroup, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Stop (IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPaused (IntPtr channelgroup, bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetPaused (IntPtr channelgroup, out bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetVolume (IntPtr channelgroup, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetVolume (IntPtr channelgroup, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetVolumeRamp (IntPtr channelgroup, bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetVolumeRamp (IntPtr channelgroup, out bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetAudibility (IntPtr channelgroup, out float audibility); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPitch (IntPtr channelgroup, float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetPitch (IntPtr channelgroup, out float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMute (IntPtr channelgroup, bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMute (IntPtr channelgroup, out bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetReverbProperties (IntPtr channelgroup, int instance, float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetReverbProperties (IntPtr channelgroup, int instance, out float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetLowPassGain (IntPtr channelgroup, float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetLowPassGain (IntPtr channelgroup, out float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMode (IntPtr channelgroup, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMode (IntPtr channelgroup, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetCallback (IntPtr channelgroup, CHANNELCONTROL_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_IsPlaying (IntPtr channelgroup, out bool isplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPan (IntPtr channelgroup, float pan); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsOutput (IntPtr channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsInput (IntPtr channelgroup, float[] levels, int numlevels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixMatrix (IntPtr channelgroup, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMixMatrix (IntPtr channelgroup, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSPClock (IntPtr channelgroup, out ulong dspclock, out ulong parentclock); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetDelay (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end, bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddFadePoint (IntPtr channelgroup, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetFadePointRamp (IntPtr channelgroup, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_RemoveFadePoints (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetFadePoints (IntPtr channelgroup, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSP (IntPtr channelgroup, int index, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddDSP (IntPtr channelgroup, int index, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_RemoveDSP (IntPtr channelgroup, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumDSPs (IntPtr channelgroup, out int numdsps); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetDSPIndex (IntPtr channelgroup, IntPtr dsp, int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSPIndex (IntPtr channelgroup, IntPtr dsp, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DAttributes (IntPtr channelgroup, ref VECTOR pos, ref VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DAttributes (IntPtr channelgroup, out VECTOR pos, out VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DMinMaxDistance (IntPtr channelgroup, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DMinMaxDistance (IntPtr channelgroup, out float mindistance, out float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DConeSettings (IntPtr channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DConeSettings (IntPtr channelgroup, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DConeOrientation(IntPtr channelgroup, ref VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DConeOrientation(IntPtr channelgroup, out VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DCustomRolloff (IntPtr channelgroup, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DCustomRolloff (IntPtr channelgroup, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DOcclusion (IntPtr channelgroup, float directocclusion, float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DOcclusion (IntPtr channelgroup, out float directocclusion, out float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DSpread (IntPtr channelgroup, float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DSpread (IntPtr channelgroup, out float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DLevel (IntPtr channelgroup, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DLevel (IntPtr channelgroup, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DDopplerLevel (IntPtr channelgroup, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DDopplerLevel (IntPtr channelgroup, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DDistanceFilter (IntPtr channelgroup, bool custom, float customLevel, float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DDistanceFilter (IntPtr channelgroup, out bool custom, out float customLevel, out float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetUserData (IntPtr channelgroup, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetUserData (IntPtr channelgroup, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public ChannelGroup(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'SoundGroup' API + */ + public struct SoundGroup + { + public RESULT release() + { + return FMOD5_SoundGroup_Release(this.handle); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_SoundGroup_GetSystemObject(this.handle, out system.handle); + } + + // SoundGroup control functions. + public RESULT setMaxAudible(int maxaudible) + { + return FMOD5_SoundGroup_SetMaxAudible(this.handle, maxaudible); + } + public RESULT getMaxAudible(out int maxaudible) + { + return FMOD5_SoundGroup_GetMaxAudible(this.handle, out maxaudible); + } + public RESULT setMaxAudibleBehavior(SOUNDGROUP_BEHAVIOR behavior) + { + return FMOD5_SoundGroup_SetMaxAudibleBehavior(this.handle, behavior); + } + public RESULT getMaxAudibleBehavior(out SOUNDGROUP_BEHAVIOR behavior) + { + return FMOD5_SoundGroup_GetMaxAudibleBehavior(this.handle, out behavior); + } + public RESULT setMuteFadeSpeed(float speed) + { + return FMOD5_SoundGroup_SetMuteFadeSpeed(this.handle, speed); + } + public RESULT getMuteFadeSpeed(out float speed) + { + return FMOD5_SoundGroup_GetMuteFadeSpeed(this.handle, out speed); + } + public RESULT setVolume(float volume) + { + return FMOD5_SoundGroup_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_SoundGroup_GetVolume(this.handle, out volume); + } + public RESULT stop() + { + return FMOD5_SoundGroup_Stop(this.handle); + } + + // Information only functions. + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_SoundGroup_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getNumSounds(out int numsounds) + { + return FMOD5_SoundGroup_GetNumSounds(this.handle, out numsounds); + } + public RESULT getSound(int index, out Sound sound) + { + return FMOD5_SoundGroup_GetSound(this.handle, index, out sound.handle); + } + public RESULT getNumPlaying(out int numplaying) + { + return FMOD5_SoundGroup_GetNumPlaying(this.handle, out numplaying); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_SoundGroup_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_SoundGroup_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_Release (IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetSystemObject (IntPtr soundgroup, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMaxAudible (IntPtr soundgroup, int maxaudible); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMaxAudible (IntPtr soundgroup, out int maxaudible); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMaxAudibleBehavior (IntPtr soundgroup, SOUNDGROUP_BEHAVIOR behavior); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMaxAudibleBehavior (IntPtr soundgroup, out SOUNDGROUP_BEHAVIOR behavior); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMuteFadeSpeed (IntPtr soundgroup, float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMuteFadeSpeed (IntPtr soundgroup, out float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetVolume (IntPtr soundgroup, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetVolume (IntPtr soundgroup, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_Stop (IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetName (IntPtr soundgroup, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetNumSounds (IntPtr soundgroup, out int numsounds); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetSound (IntPtr soundgroup, int index, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetNumPlaying (IntPtr soundgroup, out int numplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetUserData (IntPtr soundgroup, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetUserData (IntPtr soundgroup, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public SoundGroup(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'DSP' API + */ + public struct DSP + { + public RESULT release() + { + return FMOD5_DSP_Release(this.handle); + } + public RESULT getSystemObject(out System system) + { + return FMOD5_DSP_GetSystemObject(this.handle, out system.handle); + } + + // Connection / disconnection / input and output enumeration. + public RESULT addInput(DSP input) + { + return FMOD5_DSP_AddInput(this.handle, input.handle, IntPtr.Zero, DSPCONNECTION_TYPE.STANDARD); + } + public RESULT addInput(DSP input, out DSPConnection connection, DSPCONNECTION_TYPE type = DSPCONNECTION_TYPE.STANDARD) + { + return FMOD5_DSP_AddInput(this.handle, input.handle, out connection.handle, type); + } + public RESULT disconnectFrom(DSP target, DSPConnection connection) + { + return FMOD5_DSP_DisconnectFrom(this.handle, target.handle, connection.handle); + } + public RESULT disconnectAll(bool inputs, bool outputs) + { + return FMOD5_DSP_DisconnectAll(this.handle, inputs, outputs); + } + public RESULT getNumInputs(out int numinputs) + { + return FMOD5_DSP_GetNumInputs(this.handle, out numinputs); + } + public RESULT getNumOutputs(out int numoutputs) + { + return FMOD5_DSP_GetNumOutputs(this.handle, out numoutputs); + } + public RESULT getInput(int index, out DSP input, out DSPConnection inputconnection) + { + return FMOD5_DSP_GetInput(this.handle, index, out input.handle, out inputconnection.handle); + } + public RESULT getOutput(int index, out DSP output, out DSPConnection outputconnection) + { + return FMOD5_DSP_GetOutput(this.handle, index, out output.handle, out outputconnection.handle); + } + + // DSP unit control. + public RESULT setActive(bool active) + { + return FMOD5_DSP_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_DSP_GetActive(this.handle, out active); + } + public RESULT setBypass(bool bypass) + { + return FMOD5_DSP_SetBypass(this.handle, bypass); + } + public RESULT getBypass(out bool bypass) + { + return FMOD5_DSP_GetBypass(this.handle, out bypass); + } + public RESULT setWetDryMix(float prewet, float postwet, float dry) + { + return FMOD5_DSP_SetWetDryMix(this.handle, prewet, postwet, dry); + } + public RESULT getWetDryMix(out float prewet, out float postwet, out float dry) + { + return FMOD5_DSP_GetWetDryMix(this.handle, out prewet, out postwet, out dry); + } + public RESULT setChannelFormat(CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode) + { + return FMOD5_DSP_SetChannelFormat(this.handle, channelmask, numchannels, source_speakermode); + } + public RESULT getChannelFormat(out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode) + { + return FMOD5_DSP_GetChannelFormat(this.handle, out channelmask, out numchannels, out source_speakermode); + } + public RESULT getOutputChannelFormat(CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode) + { + return FMOD5_DSP_GetOutputChannelFormat(this.handle, inmask, inchannels, inspeakermode, out outmask, out outchannels, out outspeakermode); + } + public RESULT reset() + { + return FMOD5_DSP_Reset(this.handle); + } + public RESULT setCallback(DSP_CALLBACK callback) + { + return FMOD5_DSP_SetCallback(this.handle, callback); + } + + // DSP parameter control. + public RESULT setParameterFloat(int index, float value) + { + return FMOD5_DSP_SetParameterFloat(this.handle, index, value); + } + public RESULT setParameterInt(int index, int value) + { + return FMOD5_DSP_SetParameterInt(this.handle, index, value); + } + public RESULT setParameterBool(int index, bool value) + { + return FMOD5_DSP_SetParameterBool(this.handle, index, value); + } + public RESULT setParameterData(int index, byte[] data) + { + return FMOD5_DSP_SetParameterData(this.handle, index, Marshal.UnsafeAddrOfPinnedArrayElement(data, 0), (uint)data.Length); + } + public RESULT getParameterFloat(int index, out float value) + { + return FMOD5_DSP_GetParameterFloat(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterInt(int index, out int value) + { + return FMOD5_DSP_GetParameterInt(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterBool(int index, out bool value) + { + return FMOD5_DSP_GetParameterBool(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterData(int index, out IntPtr data, out uint length) + { + return FMOD5_DSP_GetParameterData(this.handle, index, out data, out length, IntPtr.Zero, 0); + } + public RESULT getNumParameters(out int numparams) + { + return FMOD5_DSP_GetNumParameters(this.handle, out numparams); + } + public RESULT getParameterInfo(int index, out DSP_PARAMETER_DESC desc) + { + IntPtr descPtr; + RESULT result = FMOD5_DSP_GetParameterInfo(this.handle, index, out descPtr); + desc = (DSP_PARAMETER_DESC)Marshal.PtrToStructure(descPtr); + return result; + } + public RESULT getDataParameterIndex(int datatype, out int index) + { + return FMOD5_DSP_GetDataParameterIndex(this.handle, datatype, out index); + } + public RESULT showConfigDialog(IntPtr hwnd, bool show) + { + return FMOD5_DSP_ShowConfigDialog(this.handle, hwnd, show); + } + + // DSP attributes. + public RESULT getInfo(out string name, out uint version, out int channels, out int configwidth, out int configheight) + { + IntPtr nameMem = Marshal.AllocHGlobal(32); + + RESULT result = FMOD5_DSP_GetInfo(this.handle, nameMem, out version, out channels, out configwidth, out configheight); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(nameMem); + } + Marshal.FreeHGlobal(nameMem); + return result; + } + public RESULT getInfo(out uint version, out int channels, out int configwidth, out int configheight) + { + return FMOD5_DSP_GetInfo(this.handle, IntPtr.Zero, out version, out channels, out configwidth, out configheight); ; + } + public RESULT getType(out DSP_TYPE type) + { + return FMOD5_DSP_GetType(this.handle, out type); + } + public RESULT getIdle(out bool idle) + { + return FMOD5_DSP_GetIdle(this.handle, out idle); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_DSP_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_DSP_GetUserData(this.handle, out userdata); + } + + // Metering. + public RESULT setMeteringEnabled(bool inputEnabled, bool outputEnabled) + { + return FMOD5_DSP_SetMeteringEnabled(this.handle, inputEnabled, outputEnabled); + } + public RESULT getMeteringEnabled(out bool inputEnabled, out bool outputEnabled) + { + return FMOD5_DSP_GetMeteringEnabled(this.handle, out inputEnabled, out outputEnabled); + } + + public RESULT getMeteringInfo(IntPtr zero, out DSP_METERING_INFO outputInfo) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, zero, out outputInfo); + } + public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, IntPtr zero) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, zero); + } + public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, out outputInfo); + } + + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD5_DSP_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_Release (IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetSystemObject (IntPtr dsp, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, IntPtr zero, DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, out IntPtr connection, DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_DisconnectFrom (IntPtr dsp, IntPtr target, IntPtr connection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_DisconnectAll (IntPtr dsp, bool inputs, bool outputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumInputs (IntPtr dsp, out int numinputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumOutputs (IntPtr dsp, out int numoutputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetInput (IntPtr dsp, int index, out IntPtr input, out IntPtr inputconnection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetOutput (IntPtr dsp, int index, out IntPtr output, out IntPtr outputconnection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetActive (IntPtr dsp, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetActive (IntPtr dsp, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetBypass (IntPtr dsp, bool bypass); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetBypass (IntPtr dsp, out bool bypass); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetWetDryMix (IntPtr dsp, float prewet, float postwet, float dry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetWetDryMix (IntPtr dsp, out float prewet, out float postwet, out float dry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetChannelFormat (IntPtr dsp, CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetChannelFormat (IntPtr dsp, out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetOutputChannelFormat (IntPtr dsp, CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_Reset (IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetCallback (IntPtr dsp, DSP_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterFloat (IntPtr dsp, int index, float value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterInt (IntPtr dsp, int index, int value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterBool (IntPtr dsp, int index, bool value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterData (IntPtr dsp, int index, IntPtr data, uint length); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterFloat (IntPtr dsp, int index, out float value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterInt (IntPtr dsp, int index, out int value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterBool (IntPtr dsp, int index, out bool value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterData (IntPtr dsp, int index, out IntPtr data, out uint length, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumParameters (IntPtr dsp, out int numparams); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterInfo (IntPtr dsp, int index, out IntPtr desc); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetDataParameterIndex (IntPtr dsp, int datatype, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_ShowConfigDialog (IntPtr dsp, IntPtr hwnd, bool show); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetInfo (IntPtr dsp, IntPtr name, out uint version, out int channels, out int configwidth, out int configheight); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetType (IntPtr dsp, out DSP_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetIdle (IntPtr dsp, out bool idle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetUserData (IntPtr dsp, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetUserData (IntPtr dsp, out IntPtr userdata); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_SetMeteringEnabled (IntPtr dsp, bool inputEnabled, bool outputEnabled); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringEnabled (IntPtr dsp, out bool inputEnabled, out bool outputEnabled); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, IntPtr zero, out DSP_METERING_INFO outputInfo); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, IntPtr zero); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetCPUUsage (IntPtr dsp, out uint exclusive, out uint inclusive); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public DSP(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'DSPConnection' API + */ + public struct DSPConnection + { + public RESULT getInput(out DSP input) + { + return FMOD5_DSPConnection_GetInput(this.handle, out input.handle); + } + public RESULT getOutput(out DSP output) + { + return FMOD5_DSPConnection_GetOutput(this.handle, out output.handle); + } + public RESULT setMix(float volume) + { + return FMOD5_DSPConnection_SetMix(this.handle, volume); + } + public RESULT getMix(out float volume) + { + return FMOD5_DSPConnection_GetMix(this.handle, out volume); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) + { + return FMOD5_DSPConnection_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) + { + return FMOD5_DSPConnection_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + public RESULT getType(out DSPCONNECTION_TYPE type) + { + return FMOD5_DSPConnection_GetType(this.handle, out type); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_DSPConnection_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_DSPConnection_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetInput (IntPtr dspconnection, out IntPtr input); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetOutput (IntPtr dspconnection, out IntPtr output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetMix (IntPtr dspconnection, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetMix (IntPtr dspconnection, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetMixMatrix (IntPtr dspconnection, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetMixMatrix (IntPtr dspconnection, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetType (IntPtr dspconnection, out DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetUserData (IntPtr dspconnection, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetUserData (IntPtr dspconnection, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public DSPConnection(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'Geometry' API + */ + public struct Geometry + { + public RESULT release() + { + return FMOD5_Geometry_Release(this.handle); + } + + // Polygon manipulation. + public RESULT addPolygon(float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex) + { + return FMOD5_Geometry_AddPolygon(this.handle, directocclusion, reverbocclusion, doublesided, numvertices, vertices, out polygonindex); + } + public RESULT getNumPolygons(out int numpolygons) + { + return FMOD5_Geometry_GetNumPolygons(this.handle, out numpolygons); + } + public RESULT getMaxPolygons(out int maxpolygons, out int maxvertices) + { + return FMOD5_Geometry_GetMaxPolygons(this.handle, out maxpolygons, out maxvertices); + } + public RESULT getPolygonNumVertices(int index, out int numvertices) + { + return FMOD5_Geometry_GetPolygonNumVertices(this.handle, index, out numvertices); + } + public RESULT setPolygonVertex(int index, int vertexindex, ref VECTOR vertex) + { + return FMOD5_Geometry_SetPolygonVertex(this.handle, index, vertexindex, ref vertex); + } + public RESULT getPolygonVertex(int index, int vertexindex, out VECTOR vertex) + { + return FMOD5_Geometry_GetPolygonVertex(this.handle, index, vertexindex, out vertex); + } + public RESULT setPolygonAttributes(int index, float directocclusion, float reverbocclusion, bool doublesided) + { + return FMOD5_Geometry_SetPolygonAttributes(this.handle, index, directocclusion, reverbocclusion, doublesided); + } + public RESULT getPolygonAttributes(int index, out float directocclusion, out float reverbocclusion, out bool doublesided) + { + return FMOD5_Geometry_GetPolygonAttributes(this.handle, index, out directocclusion, out reverbocclusion, out doublesided); + } + + // Object manipulation. + public RESULT setActive(bool active) + { + return FMOD5_Geometry_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_Geometry_GetActive(this.handle, out active); + } + public RESULT setRotation(ref VECTOR forward, ref VECTOR up) + { + return FMOD5_Geometry_SetRotation(this.handle, ref forward, ref up); + } + public RESULT getRotation(out VECTOR forward, out VECTOR up) + { + return FMOD5_Geometry_GetRotation(this.handle, out forward, out up); + } + public RESULT setPosition(ref VECTOR position) + { + return FMOD5_Geometry_SetPosition(this.handle, ref position); + } + public RESULT getPosition(out VECTOR position) + { + return FMOD5_Geometry_GetPosition(this.handle, out position); + } + public RESULT setScale(ref VECTOR scale) + { + return FMOD5_Geometry_SetScale(this.handle, ref scale); + } + public RESULT getScale(out VECTOR scale) + { + return FMOD5_Geometry_GetScale(this.handle, out scale); + } + public RESULT save(IntPtr data, out int datasize) + { + return FMOD5_Geometry_Save(this.handle, data, out datasize); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Geometry_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Geometry_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_Release (IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_AddPolygon (IntPtr geometry, float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetNumPolygons (IntPtr geometry, out int numpolygons); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetMaxPolygons (IntPtr geometry, out int maxpolygons, out int maxvertices); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonNumVertices(IntPtr geometry, int index, out int numvertices); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPolygonVertex (IntPtr geometry, int index, int vertexindex, ref VECTOR vertex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonVertex (IntPtr geometry, int index, int vertexindex, out VECTOR vertex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPolygonAttributes (IntPtr geometry, int index, float directocclusion, float reverbocclusion, bool doublesided); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonAttributes (IntPtr geometry, int index, out float directocclusion, out float reverbocclusion, out bool doublesided); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetActive (IntPtr geometry, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetActive (IntPtr geometry, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetRotation (IntPtr geometry, ref VECTOR forward, ref VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetRotation (IntPtr geometry, out VECTOR forward, out VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPosition (IntPtr geometry, ref VECTOR position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPosition (IntPtr geometry, out VECTOR position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetScale (IntPtr geometry, ref VECTOR scale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetScale (IntPtr geometry, out VECTOR scale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_Save (IntPtr geometry, IntPtr data, out int datasize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetUserData (IntPtr geometry, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetUserData (IntPtr geometry, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Geometry(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'Reverb3D' API + */ + public struct Reverb3D + { + public RESULT release() + { + return FMOD5_Reverb3D_Release(this.handle); + } + + // Reverb manipulation. + public RESULT set3DAttributes(ref VECTOR position, float mindistance, float maxdistance) + { + return FMOD5_Reverb3D_Set3DAttributes(this.handle, ref position, mindistance, maxdistance); + } + public RESULT get3DAttributes(ref VECTOR position, ref float mindistance, ref float maxdistance) + { + return FMOD5_Reverb3D_Get3DAttributes(this.handle, ref position, ref mindistance, ref maxdistance); + } + public RESULT setProperties(ref REVERB_PROPERTIES properties) + { + return FMOD5_Reverb3D_SetProperties(this.handle, ref properties); + } + public RESULT getProperties(ref REVERB_PROPERTIES properties) + { + return FMOD5_Reverb3D_GetProperties(this.handle, ref properties); + } + public RESULT setActive(bool active) + { + return FMOD5_Reverb3D_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_Reverb3D_GetActive(this.handle, out active); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Reverb3D_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Reverb3D_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Release (IntPtr reverb3d); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Set3DAttributes (IntPtr reverb3d, ref VECTOR position, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Get3DAttributes (IntPtr reverb3d, ref VECTOR position, ref float mindistance, ref float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetActive (IntPtr reverb3d, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetActive (IntPtr reverb3d, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetUserData (IntPtr reverb3d, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetUserData (IntPtr reverb3d, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Reverb3D(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + #region Helper Functions + [StructLayout(LayoutKind.Sequential)] + public struct StringWrapper + { + IntPtr nativeUtf8Ptr; + + public StringWrapper(IntPtr ptr) + { + nativeUtf8Ptr = ptr; + } + + public static implicit operator string(StringWrapper fstring) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return encoder.stringFromNative(fstring.nativeUtf8Ptr); + } + } + + public bool StartsWith(byte[] prefix) + { + if (nativeUtf8Ptr == IntPtr.Zero) + { + return false; + } + + for (int i = 0; i < prefix.Length; i++) + { + if (Marshal.ReadByte(nativeUtf8Ptr, i) != prefix[i]) + { + return false; + } + } + + return true; + } + + public bool Equals(byte[] comparison) + { + if (nativeUtf8Ptr == IntPtr.Zero) + { + return false; + } + + for (int i = 0; i < comparison.Length; i++) + { + if (Marshal.ReadByte(nativeUtf8Ptr, i) != comparison[i]) + { + return false; + } + } + + if (Marshal.ReadByte(nativeUtf8Ptr, comparison.Length) != 0) + { + return false; + } + + return true; + } + } + + static class StringHelper + { + public class ThreadSafeEncoding : IDisposable + { + UTF8Encoding encoding = new UTF8Encoding(); + byte[] encodedBuffer = new byte[128]; + char[] decodedBuffer = new char[128]; + bool inUse; + GCHandle gcHandle; + + public bool InUse() { return inUse; } + public void SetInUse() { inUse = true; } + + private int roundUpPowerTwo(int number) + { + int newNumber = 1; + while (newNumber <= number) + { + newNumber *= 2; + } + + return newNumber; + } + + public byte[] byteFromStringUTF8(string s) + { + if (s == null) + { + return null; + } + + int maximumLength = encoding.GetMaxByteCount(s.Length) + 1; // +1 for null terminator + if (maximumLength > encodedBuffer.Length) + { + int encodedLength = encoding.GetByteCount(s) + 1; // +1 for null terminator + if (encodedLength > encodedBuffer.Length) + { + encodedBuffer = new byte[roundUpPowerTwo(encodedLength)]; + } + } + + int byteCount = encoding.GetBytes(s, 0, s.Length, encodedBuffer, 0); + encodedBuffer[byteCount] = 0; // Apply null terminator + + return encodedBuffer; + } + + public IntPtr intptrFromStringUTF8(string s) + { + if (s == null) + { + return IntPtr.Zero; + } + + gcHandle = GCHandle.Alloc(byteFromStringUTF8(s), GCHandleType.Pinned); + return gcHandle.AddrOfPinnedObject(); + } + + public string stringFromNative(IntPtr nativePtr) + { + if (nativePtr == IntPtr.Zero) + { + return ""; + } + + int nativeLen = 0; + while (Marshal.ReadByte(nativePtr, nativeLen) != 0) + { + nativeLen++; + } + + if (nativeLen == 0) + { + return ""; + } + + if (nativeLen > encodedBuffer.Length) + { + encodedBuffer = new byte[roundUpPowerTwo(nativeLen)]; + } + + Marshal.Copy(nativePtr, encodedBuffer, 0, nativeLen); + + int maximumLength = encoding.GetMaxCharCount(nativeLen); + if (maximumLength > decodedBuffer.Length) + { + int decodedLength = encoding.GetCharCount(encodedBuffer, 0, nativeLen); + if (decodedLength > decodedBuffer.Length) + { + decodedBuffer = new char[roundUpPowerTwo(decodedLength)]; + } + } + + int charCount = encoding.GetChars(encodedBuffer, 0, nativeLen, decodedBuffer, 0); + + return new String(decodedBuffer, 0, charCount); + } + + public void Dispose() + { + if (gcHandle.IsAllocated) + { + gcHandle.Free(); + } + lock (encoders) + { + inUse = false; + } + } + } + + static List encoders = new List(1); + + public static ThreadSafeEncoding GetFreeHelper() + { + lock (encoders) + { + ThreadSafeEncoding helper = null; + // Search for not in use helper + for (int i = 0; i < encoders.Count; i++) + { + if (!encoders[i].InUse()) + { + helper = encoders[i]; + break; + } + } + // Otherwise create another helper + if (helper == null) + { + helper = new ThreadSafeEncoding(); + encoders.Add(helper); + } + helper.SetInUse(); + return helper; + } + } + } + + #endregion +} diff --git a/Assets/Plugins/FMOD/src/fmod.cs.meta b/Assets/Plugins/FMOD/src/fmod.cs.meta new file mode 100644 index 00000000..07641e1c --- /dev/null +++ b/Assets/Plugins/FMOD/src/fmod.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bd0d0c955caff8940ac1667ee36dd4c9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/fmod_dsp.cs b/Assets/Plugins/FMOD/src/fmod_dsp.cs new file mode 100644 index 00000000..02820ee1 --- /dev/null +++ b/Assets/Plugins/FMOD/src/fmod_dsp.cs @@ -0,0 +1,1007 @@ +/* ======================================================================================== */ +/* FMOD Core API - DSP header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2025. */ +/* */ +/* Use this header if you are wanting to develop your own DSP plugin to use with FMODs */ +/* dsp system. With this header you can make your own DSP plugin that FMOD can */ +/* register and use. See the documentation and examples on how to make a working plugin. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/docs/2.03/api/plugin-api-dsp.html */ +/* =========================================================================================*/ + +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace FMOD +{ + [StructLayout(LayoutKind.Sequential)] + public struct DSP_BUFFER_ARRAY + { + public int numbuffers; + public IntPtr buffernumchannels; + public IntPtr bufferchannelmask; + public IntPtr buffers; + public SPEAKERMODE speakermode; + + /* + These properties take advantage of the fact that numbuffers is always zero or one + */ + + public int numchannels + { + get + { + if (buffernumchannels != IntPtr.Zero && numbuffers != 0) + return Marshal.ReadInt32(buffernumchannels); + + return 0; + } + set + { + if (buffernumchannels != IntPtr.Zero && numbuffers != 0) + Marshal.WriteInt32(buffernumchannels, value); + } + } + + public IntPtr buffer + { + get + { + if (buffers != IntPtr.Zero && numbuffers != 0) + return Marshal.ReadIntPtr(buffers); + + return IntPtr.Zero; + } + set + { + if (buffers != IntPtr.Zero && numbuffers != 0) + Marshal.WriteIntPtr(buffers, value); + } + } + } + + public enum DSP_PROCESS_OPERATION + { + PROCESS_PERFORM = 0, + PROCESS_QUERY + } + + [StructLayout(LayoutKind.Sequential)] + public struct COMPLEX + { + public float real; + public float imag; + } + + public enum DSP_PAN_SURROUND_FLAGS + { + DEFAULT = 0, + ROTATION_NOT_BIASED = 1, + } + + + /* + DSP callbacks + */ + public delegate RESULT DSP_CREATE_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_RELEASE_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_RESET_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SETPOSITION_CALLBACK (ref DSP_STATE dsp_state, uint pos); + public delegate RESULT DSP_READ_CALLBACK (ref DSP_STATE dsp_state, IntPtr inbuffer, IntPtr outbuffer, uint length, int inchannels, ref int outchannels); + public delegate RESULT DSP_SHOULDIPROCESS_CALLBACK (ref DSP_STATE dsp_state, bool inputsidle, uint length, CHANNELMASK inmask, int inchannels, SPEAKERMODE speakermode); + public delegate RESULT DSP_PROCESS_CALLBACK (ref DSP_STATE dsp_state, uint length, ref DSP_BUFFER_ARRAY inbufferarray, ref DSP_BUFFER_ARRAY outbufferarray, bool inputsidle, DSP_PROCESS_OPERATION op); + public delegate RESULT DSP_SETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, float value); + public delegate RESULT DSP_SETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, int value); + public delegate RESULT DSP_SETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, bool value); + public delegate RESULT DSP_SETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, IntPtr data, uint length); + public delegate RESULT DSP_GETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, ref float value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, ref int value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, ref bool value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, ref IntPtr data, ref uint length, IntPtr valuestr); + public delegate RESULT DSP_SYSTEM_REGISTER_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SYSTEM_DEREGISTER_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SYSTEM_MIX_CALLBACK (ref DSP_STATE dsp_state, int stage); + + + /* + DSP functions + */ + public delegate IntPtr DSP_ALLOC_FUNC (uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate IntPtr DSP_REALLOC_FUNC (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void DSP_FREE_FUNC (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void DSP_LOG_FUNC (DEBUG_FLAGS level, IntPtr file, int line, IntPtr function, IntPtr str); + public delegate RESULT DSP_GETSAMPLERATE_FUNC (ref DSP_STATE dsp_state, ref int rate); + public delegate RESULT DSP_GETBLOCKSIZE_FUNC (ref DSP_STATE dsp_state, ref uint blocksize); + public delegate RESULT DSP_GETSPEAKERMODE_FUNC (ref DSP_STATE dsp_state, ref int speakermode_mixer, ref int speakermode_output); + public delegate RESULT DSP_GETCLOCK_FUNC (ref DSP_STATE dsp_state, out ulong clock, out uint offset, out uint length); + public delegate RESULT DSP_GETLISTENERATTRIBUTES_FUNC (ref DSP_STATE dsp_state, ref int numlisteners, IntPtr attributes); + public delegate RESULT DSP_GETUSERDATA_FUNC (ref DSP_STATE dsp_state, out IntPtr userdata); + public delegate RESULT DSP_DFT_FFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr signal, IntPtr dft, IntPtr window, int signalhop); + public delegate RESULT DSP_DFT_IFFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr dft, IntPtr signal, IntPtr window, int signalhop); + public delegate RESULT DSP_PAN_SUMMONOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSTEREOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix, DSP_PAN_SURROUND_FLAGS flags); + public delegate RESULT DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_GETROLLOFFGAIN_FUNC (ref DSP_STATE dsp_state, DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, out float gain); + + + public enum DSP_TYPE : int + { + UNKNOWN, + MIXER, + OSCILLATOR, + LOWPASS, + ITLOWPASS, + HIGHPASS, + ECHO, + FADER, + FLANGE, + DISTORTION, + NORMALIZE, + LIMITER, + PARAMEQ, + PITCHSHIFT, + CHORUS, + ITECHO, + COMPRESSOR, + SFXREVERB, + LOWPASS_SIMPLE, + DELAY, + TREMOLO, + SEND, + RETURN, + HIGHPASS_SIMPLE, + PAN, + THREE_EQ, + FFT, + LOUDNESS_METER, + CONVOLUTIONREVERB, + CHANNELMIX, + TRANSCEIVER, + OBJECTPAN, + MULTIBAND_EQ, + MULTIBAND_DYNAMICS, + MAX + } + + public enum DSP_PARAMETER_TYPE + { + FLOAT = 0, + INT, + BOOL, + DATA, + MAX + } + + public enum DSP_PARAMETER_FLOAT_MAPPING_TYPE + { + DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR = 0, + DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, + DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR + { + public int numpoints; + public IntPtr pointparamvalues; + public IntPtr pointpositions; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FLOAT_MAPPING + { + public DSP_PARAMETER_FLOAT_MAPPING_TYPE type; + public DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; + } + + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_FLOAT + { + public float min; + public float max; + public float defaultval; + public DSP_PARAMETER_FLOAT_MAPPING mapping; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_INT + { + public int min; + public int max; + public int defaultval; + public bool goestoinf; + public IntPtr valuenames; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_BOOL + { + public bool defaultval; + public IntPtr valuenames; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_DATA + { + public int datatype; + } + + [StructLayout(LayoutKind.Explicit)] + public struct DSP_PARAMETER_DESC_UNION + { + [FieldOffset(0)] + public DSP_PARAMETER_DESC_FLOAT floatdesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_INT intdesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_BOOL booldesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_DATA datadesc; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC + { + public DSP_PARAMETER_TYPE type; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] name; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] label; + public string description; + + public DSP_PARAMETER_DESC_UNION desc; + } + + public enum DSP_PARAMETER_DATA_TYPE + { + DSP_PARAMETER_DATA_TYPE_USER = 0, + DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, + DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, + DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, + DSP_PARAMETER_DATA_TYPE_FFT = -4, + DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, + DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE = -6, + DSP_PARAMETER_DATA_TYPE_DYNAMIC_RESPONSE = -7 + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_OVERALLGAIN + { + public float linear_gain; + public float linear_gain_additive; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_3DATTRIBUTES + { + public ATTRIBUTES_3D relative; + public ATTRIBUTES_3D absolute; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_3DATTRIBUTES_MULTI + { + public int numlisteners; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public ATTRIBUTES_3D[] relative; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public float[] weight; + public ATTRIBUTES_3D absolute; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_SIDECHAIN + { + public int sidechainenable; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FFT + { + public int length; + public int numchannels; + + [MarshalAs(UnmanagedType.ByValArray,SizeConst=32)] + private IntPtr[] spectrum_internal; + + public float[][] spectrum + { + get + { + var buffer = new float[numchannels][]; + + for (int i = 0; i < numchannels; ++i) + { + buffer[i] = new float[length]; + Marshal.Copy(spectrum_internal[i], buffer[i], 0, length); + } + + return buffer; + } + } + + public void getSpectrum(ref float[][] buffer) + { + int bufferLength = Math.Min(buffer.Length, numchannels); + for (int i = 0; i < bufferLength; ++i) + { + getSpectrum(i, ref buffer[i]); + } + } + + public void getSpectrum(int channel, ref float[] buffer) + { + int bufferLength = Math.Min(buffer.Length, length); + Marshal.Copy(spectrum_internal[channel], buffer, 0, bufferLength); + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DYNAMIC_RESPONSE + { + public int numchannels; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public float[] rms; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_LOUDNESS_METER_INFO_TYPE + { + public float momentaryloudness; + public float shorttermloudness; + public float integratedloudness; + public float loudness10thpercentile; + public float loudness95thpercentile; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 66)] + public float[] loudnesshistogram; + public float maxtruepeak; + public float maxmomentaryloudness; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_LOUDNESS_METER_WEIGHTING_TYPE + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public float[] channelweight; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_ATTENUATION_RANGE + { + public float min; + public float max; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_DESCRIPTION + { + public uint pluginsdkversion; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public byte[] name; + public uint version; + public int numinputbuffers; + public int numoutputbuffers; + public DSP_CREATE_CALLBACK create; + public DSP_RELEASE_CALLBACK release; + public DSP_RESET_CALLBACK reset; + public DSP_READ_CALLBACK read; + public DSP_PROCESS_CALLBACK process; + public DSP_SETPOSITION_CALLBACK setposition; + + public int numparameters; + public IntPtr paramdesc; + public DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; + public DSP_SETPARAM_INT_CALLBACK setparameterint; + public DSP_SETPARAM_BOOL_CALLBACK setparameterbool; + public DSP_SETPARAM_DATA_CALLBACK setparameterdata; + public DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; + public DSP_GETPARAM_INT_CALLBACK getparameterint; + public DSP_GETPARAM_BOOL_CALLBACK getparameterbool; + public DSP_GETPARAM_DATA_CALLBACK getparameterdata; + public DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; + public IntPtr userdata; + + public DSP_SYSTEM_REGISTER_CALLBACK sys_register; + public DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; + public DSP_SYSTEM_MIX_CALLBACK sys_mix; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_DFT_FUNCTIONS + { + public DSP_DFT_FFTREAL_FUNC fftreal; + public DSP_DFT_IFFTREAL_FUNC inversefftreal; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_PAN_FUNCTIONS + { + public DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix; + public DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix; + public DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix; + public DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix; + public DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix; + public DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_FUNCTIONS + { + public DSP_ALLOC_FUNC alloc; + public DSP_REALLOC_FUNC realloc; + public DSP_FREE_FUNC free; + public DSP_GETSAMPLERATE_FUNC getsamplerate; + public DSP_GETBLOCKSIZE_FUNC getblocksize; + public IntPtr dft_internal; + public IntPtr pan_internal; + public DSP_GETSPEAKERMODE_FUNC getspeakermode; + public DSP_GETCLOCK_FUNC getclock; + public DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes; + public DSP_LOG_FUNC log; + public DSP_GETUSERDATA_FUNC getuserdata; + public DSP_STATE_DFT_FUNCTIONS dft + { + get { return Marshal.PtrToStructure(dft_internal); } + } + public DSP_STATE_PAN_FUNCTIONS pan + { + get { return Marshal.PtrToStructure(pan_internal); } + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE + { + public IntPtr instance; + public IntPtr plugindata; + public uint channelmask; + public int source_speakermode; + public IntPtr sidechaindata; + public int sidechainchannels; + private IntPtr functions_internal; + public int systemobject; + + public DSP_STATE_FUNCTIONS functions + { + get { return Marshal.PtrToStructure(functions_internal); } + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_METERING_INFO + { + public int numsamples; + [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] + public float[] peaklevel; + [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] + public float[] rmslevel; + public short numchannels; + } + + /* + ============================================================================================================== + + FMOD built in effect parameters. + Use DSP::setParameter with these enums for the 'index' parameter. + + ============================================================================================================== + */ + + public enum DSP_OSCILLATOR : int + { + TYPE, + RATE + } + + public enum DSP_LOWPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_ITLOWPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_HIGHPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_ECHO : int + { + DELAY, + FEEDBACK, + DRYLEVEL, + WETLEVEL, + DELAYCHANGEMODE + } + + public enum DSP_ECHO_DELAYCHANGEMODE_TYPE : int + { + FADE, + LERP, + NONE + } + + public enum DSP_FADER : int + { + GAIN, + OVERALL_GAIN, + } + + public enum DSP_DELAY : int + { + CH0, + CH1, + CH2, + CH3, + CH4, + CH5, + CH6, + CH7, + CH8, + CH9, + CH10, + CH11, + CH12, + CH13, + CH14, + CH15, + MAXDELAY, + } + + public enum DSP_FLANGE : int + { + MIX, + DEPTH, + RATE + } + + public enum DSP_TREMOLO : int + { + FREQUENCY, + DEPTH, + SHAPE, + SKEW, + DUTY, + SQUARE, + PHASE, + SPREAD + } + + public enum DSP_DISTORTION : int + { + LEVEL + } + + public enum DSP_NORMALIZE : int + { + FADETIME, + THRESHOLD, + MAXAMP + } + + public enum DSP_LIMITER : int + { + RELEASETIME, + CEILING, + MAXIMIZERGAIN, + MODE, + } + + public enum DSP_PARAMEQ : int + { + CENTER, + BANDWIDTH, + GAIN + } + + public enum DSP_MULTIBAND_EQ : int + { + A_FILTER, + A_FREQUENCY, + A_Q, + A_GAIN, + B_FILTER, + B_FREQUENCY, + B_Q, + B_GAIN, + C_FILTER, + C_FREQUENCY, + C_Q, + C_GAIN, + D_FILTER, + D_FREQUENCY, + D_Q, + D_GAIN, + E_FILTER, + E_FREQUENCY, + E_Q, + E_GAIN, + } + + public enum DSP_MULTIBAND_EQ_FILTER_TYPE : int + { + DISABLED, + LOWPASS_12DB, + LOWPASS_24DB, + LOWPASS_48DB, + HIGHPASS_12DB, + HIGHPASS_24DB, + HIGHPASS_48DB, + LOWSHELF, + HIGHSHELF, + PEAKING, + BANDPASS, + NOTCH, + ALLPASS, + LOWPASS_6DB, + HIGHPASS_6DB, + } + + public enum DSP_MULTIBAND_DYNAMICS : int + { + LOWER_FREQUENCY, + UPPER_FREQUENCY, + LINKED, + USE_SIDECHAIN, + A_MODE, + A_GAIN, + A_THRESHOLD, + A_RATIO, + A_ATTACK, + A_RELEASE, + A_GAIN_MAKEUP, + A_RESPONSE_DATA, + B_MODE, + B_GAIN, + B_THRESHOLD, + B_RATIO, + B_ATTACK, + B_RELEASE, + B_GAIN_MAKEUP, + B_RESPONSE_DATA, + C_MODE, + C_GAIN, + C_THRESHOLD, + C_RATIO, + C_ATTACK, + C_RELEASE, + C_GAIN_MAKEUP, + C_RESPONSE_DATA, + } + + public enum DSP_MULTIBAND_DYNAMICS_MODE_TYPE : int + { + DISABLED, + COMPRESS_UP, + COMPRESS_DOWN, + EXPAND_UP, + EXPAND_DOWN + } + + public enum DSP_PITCHSHIFT : int + { + PITCH, + FFTSIZE, + OVERLAP, + MAXCHANNELS + } + + public enum DSP_CHORUS : int + { + MIX, + RATE, + DEPTH, + } + + public enum DSP_ITECHO : int + { + WETDRYMIX, + FEEDBACK, + LEFTDELAY, + RIGHTDELAY, + PANDELAY + } + + public enum DSP_COMPRESSOR : int + { + THRESHOLD, + RATIO, + ATTACK, + RELEASE, + GAINMAKEUP, + USESIDECHAIN, + LINKED + } + + public enum DSP_SFXREVERB : int + { + DECAYTIME, + EARLYDELAY, + LATEDELAY, + HFREFERENCE, + HFDECAYRATIO, + DIFFUSION, + DENSITY, + LOWSHELFFREQUENCY, + LOWSHELFGAIN, + HIGHCUT, + EARLYLATEMIX, + WETLEVEL, + DRYLEVEL + } + + public enum DSP_LOWPASS_SIMPLE : int + { + CUTOFF + } + + public enum DSP_SEND : int + { + RETURNID, + LEVEL, + } + + public enum DSP_RETURN : int + { + ID, + INPUT_SPEAKER_MODE + } + + public enum DSP_HIGHPASS_SIMPLE : int + { + CUTOFF + } + + public enum DSP_PAN_2D_STEREO_MODE_TYPE : int + { + DISTRIBUTED, + DISCRETE + } + + public enum DSP_PAN_MODE_TYPE : int + { + MONO, + STEREO, + SURROUND + } + + public enum DSP_PAN_3D_ROLLOFF_TYPE : int + { + LINEARSQUARED, + LINEAR, + INVERSE, + INVERSETAPERED, + CUSTOM + } + + public enum DSP_PAN_3D_EXTENT_MODE_TYPE : int + { + AUTO, + USER, + OFF + } + + public enum DSP_PAN : int + { + MODE, + _2D_STEREO_POSITION, + _2D_DIRECTION, + _2D_EXTENT, + _2D_ROTATION, + _2D_LFE_LEVEL, + _2D_STEREO_MODE, + _2D_STEREO_SEPARATION, + _2D_STEREO_AXIS, + ENABLED_SPEAKERS, + _3D_POSITION, + _3D_ROLLOFF, + _3D_MIN_DISTANCE, + _3D_MAX_DISTANCE, + _3D_EXTENT_MODE, + _3D_SOUND_SIZE, + _3D_MIN_EXTENT, + _3D_PAN_BLEND, + LFE_UPMIX_ENABLED, + OVERALL_GAIN, + SURROUND_SPEAKER_MODE, + _2D_HEIGHT_BLEND, + ATTENUATION_RANGE, + OVERRIDE_RANGE + } + + public enum DSP_THREE_EQ_CROSSOVERSLOPE_TYPE : int + { + _12DB, + _24DB, + _48DB + } + + public enum DSP_THREE_EQ : int + { + LOWGAIN, + MIDGAIN, + HIGHGAIN, + LOWCROSSOVER, + HIGHCROSSOVER, + CROSSOVERSLOPE + } + + public enum DSP_FFT_WINDOW_TYPE : int + { + RECT, + TRIANGLE, + HAMMING, + HANNING, + BLACKMAN, + BLACKMANHARRIS + } + + public enum DSP_FFT_DOWNMIX_TYPE : int + { + NONE, + MONO + } + + public enum DSP_FFT : int + { + WINDOWSIZE, + WINDOW, + BAND_START_FREQ, + BAND_STOP_FREQ, + SPECTRUMDATA, + RMS, + SPECTRAL_CENTROID, + IMMEDIATE_MODE, + DOWNMIX, + CHANNEL + } + + + public enum DSP_LOUDNESS_METER : int + { + STATE, + WEIGHTING, + INFO + } + + + public enum DSP_LOUDNESS_METER_STATE_TYPE : int + { + RESET_INTEGRATED = -3, + RESET_MAXPEAK = -2, + RESET_ALL = -1, + PAUSED = 0, + ANALYZING = 1 + } + + public enum DSP_CONVOLUTION_REVERB : int + { + IR, + WET, + DRY, + LINKED + } + + public enum DSP_CHANNELMIX_OUTPUT : int + { + DEFAULT, + ALLMONO, + ALLSTEREO, + ALLQUAD, + ALL5POINT1, + ALL7POINT1, + ALLLFE, + ALL7POINT1POINT4 + } + + public enum DSP_CHANNELMIX : int + { + OUTPUTGROUPING, + GAIN_CH0, + GAIN_CH1, + GAIN_CH2, + GAIN_CH3, + GAIN_CH4, + GAIN_CH5, + GAIN_CH6, + GAIN_CH7, + GAIN_CH8, + GAIN_CH9, + GAIN_CH10, + GAIN_CH11, + GAIN_CH12, + GAIN_CH13, + GAIN_CH14, + GAIN_CH15, + GAIN_CH16, + GAIN_CH17, + GAIN_CH18, + GAIN_CH19, + GAIN_CH20, + GAIN_CH21, + GAIN_CH22, + GAIN_CH23, + GAIN_CH24, + GAIN_CH25, + GAIN_CH26, + GAIN_CH27, + GAIN_CH28, + GAIN_CH29, + GAIN_CH30, + GAIN_CH31, + OUTPUT_CH0, + OUTPUT_CH1, + OUTPUT_CH2, + OUTPUT_CH3, + OUTPUT_CH4, + OUTPUT_CH5, + OUTPUT_CH6, + OUTPUT_CH7, + OUTPUT_CH8, + OUTPUT_CH9, + OUTPUT_CH10, + OUTPUT_CH11, + OUTPUT_CH12, + OUTPUT_CH13, + OUTPUT_CH14, + OUTPUT_CH15, + OUTPUT_CH16, + OUTPUT_CH17, + OUTPUT_CH18, + OUTPUT_CH19, + OUTPUT_CH20, + OUTPUT_CH21, + OUTPUT_CH22, + OUTPUT_CH23, + OUTPUT_CH24, + OUTPUT_CH25, + OUTPUT_CH26, + OUTPUT_CH27, + OUTPUT_CH28, + OUTPUT_CH29, + OUTPUT_CH30, + OUTPUT_CH31, + } + + public enum DSP_TRANSCEIVER_SPEAKERMODE : int + { + AUTO = -1, + MONO = 0, + STEREO, + SURROUND, + } + + public enum DSP_TRANSCEIVER : int + { + TRANSMIT, + GAIN, + CHANNEL, + TRANSMITSPEAKERMODE + } + + public enum DSP_OBJECTPAN : int + { + _3D_POSITION, + _3D_ROLLOFF, + _3D_MIN_DISTANCE, + _3D_MAX_DISTANCE, + _3D_EXTENT_MODE, + _3D_SOUND_SIZE, + _3D_MIN_EXTENT, + OVERALL_GAIN, + OUTPUTGAIN, + ATTENUATION_RANGE, + OVERRIDE_RANGE + } +} diff --git a/Assets/Plugins/FMOD/src/fmod_dsp.cs.meta b/Assets/Plugins/FMOD/src/fmod_dsp.cs.meta new file mode 100644 index 00000000..5d5c6ab9 --- /dev/null +++ b/Assets/Plugins/FMOD/src/fmod_dsp.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b7b10c26cf550794183b926ffae615a7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/fmod_errors.cs b/Assets/Plugins/FMOD/src/fmod_errors.cs new file mode 100644 index 00000000..88f5ae27 --- /dev/null +++ b/Assets/Plugins/FMOD/src/fmod_errors.cs @@ -0,0 +1,106 @@ +/* ============================================================================================== */ +/* FMOD Core / Studio API - Error string header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2025. */ +/* */ +/* Use this header if you want to store or display a string version / english explanation */ +/* of the FMOD error codes. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/docs/2.03/api/core-api-common.html#fmod_result */ +/* =============================================================================================== */ + +namespace FMOD +{ + public class Error + { + public static string String(FMOD.RESULT errcode) + { + switch (errcode) + { + case FMOD.RESULT.OK: return "No errors."; + case FMOD.RESULT.ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound)."; + case FMOD.RESULT.ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel."; + case FMOD.RESULT.ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound."; + case FMOD.RESULT.ERR_DMA: return "DMA Failure. See debug output for more information."; + case FMOD.RESULT.ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts."; + case FMOD.RESULT.ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph."; + case FMOD.RESULT.ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map."; + case FMOD.RESULT.ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released."; + case FMOD.RESULT.ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified."; + case FMOD.RESULT.ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system."; + case FMOD.RESULT.ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph."; + case FMOD.RESULT.ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type."; + case FMOD.RESULT.ERR_FILE_BAD: return "Error loading file."; + case FMOD.RESULT.ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format."; + case FMOD.RESULT.ERR_FILE_DISKEJECTED: return "Media was ejected while reading."; + case FMOD.RESULT.ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?)."; + case FMOD.RESULT.ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data."; + case FMOD.RESULT.ERR_FILE_NOTFOUND: return "File not found."; + case FMOD.RESULT.ERR_FORMAT: return "Unsupported file or audio format."; + case FMOD.RESULT.ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library."; + case FMOD.RESULT.ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere."; + case FMOD.RESULT.ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden."; + case FMOD.RESULT.ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource."; + case FMOD.RESULT.ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred."; + case FMOD.RESULT.ERR_HTTP_TIMEOUT: return "The HTTP request timed out."; + case FMOD.RESULT.ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function."; + case FMOD.RESULT.ERR_INITIALIZED: return "Cannot call this command after System::init."; + case FMOD.RESULT.ERR_INTERNAL: return "An error occured in the FMOD system. Use the logging version of FMOD for more information."; + case FMOD.RESULT.ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float."; + case FMOD.RESULT.ERR_INVALID_HANDLE: return "An invalid object handle was used."; + case FMOD.RESULT.ERR_INVALID_PARAM: return "An invalid parameter was passed to this function."; + case FMOD.RESULT.ERR_INVALID_POSITION: return "An invalid seek position was passed to this function."; + case FMOD.RESULT.ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode."; + case FMOD.RESULT.ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle."; + case FMOD.RESULT.ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported."; + case FMOD.RESULT.ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular."; + case FMOD.RESULT.ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup."; + case FMOD.RESULT.ERR_MEMORY: return "Not enough memory or resources."; + case FMOD.RESULT.ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used."; + case FMOD.RESULT.ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound."; + case FMOD.RESULT.ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support."; + case FMOD.RESULT.ERR_NET_CONNECT: return "Couldn't connect to the specified host."; + case FMOD.RESULT.ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere."; + case FMOD.RESULT.ERR_NET_URL: return "The specified URL couldn't be resolved."; + case FMOD.RESULT.ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately."; + case FMOD.RESULT.ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready."; + case FMOD.RESULT.ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused."; + case FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer."; + case FMOD.RESULT.ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted."; + case FMOD.RESULT.ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format."; + case FMOD.RESULT.ERR_OUTPUT_INIT: return "Error initializing output device."; + case FMOD.RESULT.ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails."; + case FMOD.RESULT.ERR_PLUGIN: return "An unspecified error has been returned from a plugin."; + case FMOD.RESULT.ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available."; + case FMOD.RESULT.ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be allocated or found. (ie the DLS file for MIDI playback)"; + case FMOD.RESULT.ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version."; + case FMOD.RESULT.ERR_RECORD: return "An error occurred trying to initialize the recording device."; + case FMOD.RESULT.ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection."; + case FMOD.RESULT.ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist."; + case FMOD.RESULT.ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound."; + case FMOD.RESULT.ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first."; + case FMOD.RESULT.ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file."; + case FMOD.RESULT.ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags."; + case FMOD.RESULT.ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat."; + case FMOD.RESULT.ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated."; + case FMOD.RESULT.ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be. Contact support."; + case FMOD.RESULT.ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called."; + case FMOD.RESULT.ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified."; + case FMOD.RESULT.ERR_VERSION: return "The version number of this file format is not supported."; + case FMOD.RESULT.ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out."; + case FMOD.RESULT.ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found."; + case FMOD.RESULT.ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized."; + case FMOD.RESULT.ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded."; + case FMOD.RESULT.ERR_INVALID_STRING: return "An invalid string was passed to this function."; + case FMOD.RESULT.ERR_ALREADY_LOCKED: return "The specified resource is already locked."; + case FMOD.RESULT.ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked."; + case FMOD.RESULT.ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected."; + case FMOD.RESULT.ERR_TOOMANYSAMPLES: return "The length provided exceed the allowable limit."; + default: return "Unknown error."; + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/fmod_errors.cs.meta b/Assets/Plugins/FMOD/src/fmod_errors.cs.meta new file mode 100644 index 00000000..2b15a75e --- /dev/null +++ b/Assets/Plugins/FMOD/src/fmod_errors.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6e0992509b0077e479d2da05c8f52eb0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/fmod_studio.cs b/Assets/Plugins/FMOD/src/fmod_studio.cs new file mode 100644 index 00000000..eabae46b --- /dev/null +++ b/Assets/Plugins/FMOD/src/fmod_studio.cs @@ -0,0 +1,2256 @@ +/* ======================================================================================== */ +/* FMOD Studio API - C# wrapper. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2025. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/docs/2.03/api/studio-api.html */ +/* ======================================================================================== */ + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections; + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { +#if !UNITY_2021_3_OR_NEWER + public const string dll = "fmodstudio"; +#endif + } + + public enum STOP_MODE : int + { + ALLOWFADEOUT, + IMMEDIATE, + } + + public enum LOADING_STATE : int + { + UNLOADING, + UNLOADED, + LOADING, + LOADED, + ERROR, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PROGRAMMER_SOUND_PROPERTIES + { + public StringWrapper name; + public IntPtr sound; + public int subsoundIndex; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TIMELINE_MARKER_PROPERTIES + { + public StringWrapper name; + public int position; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TIMELINE_BEAT_PROPERTIES + { + public int bar; + public int beat; + public int position; + public float tempo; + public int timesignatureupper; + public int timesignaturelower; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TIMELINE_NESTED_BEAT_PROPERTIES + { + public GUID eventid; + public TIMELINE_BEAT_PROPERTIES properties; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ADVANCEDSETTINGS + { + public int cbsize; + public int commandqueuesize; + public int handleinitialsize; + public int studioupdateperiod; + public int idlesampledatapoolsize; + public int streamingscheduledelay; + public IntPtr encryptionkey; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CPU_USAGE + { + public float update; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BUFFER_INFO + { + public int currentusage; + public int peakusage; + public int capacity; + public int stallcount; + public float stalltime; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BUFFER_USAGE + { + public BUFFER_INFO studiocommandqueue; + public BUFFER_INFO studiohandle; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BANK_INFO + { + public int size; + public IntPtr userdata; + public int userdatalength; + public FILE_OPEN_CALLBACK opencallback; + public FILE_CLOSE_CALLBACK closecallback; + public FILE_READ_CALLBACK readcallback; + public FILE_SEEK_CALLBACK seekcallback; + } + + [Flags] + public enum SYSTEM_CALLBACK_TYPE : uint + { + PREUPDATE = 0x00000001, + POSTUPDATE = 0x00000002, + BANK_UNLOAD = 0x00000004, + LIVEUPDATE_CONNECTED = 0x00000008, + LIVEUPDATE_DISCONNECTED = 0x00000010, + ALL = 0xFFFFFFFF, + } + + public delegate RESULT SYSTEM_CALLBACK(IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata, IntPtr userdata); + + public enum PARAMETER_TYPE : int + { + GAME_CONTROLLED, + AUTOMATIC_DISTANCE, + AUTOMATIC_EVENT_CONE_ANGLE, + AUTOMATIC_EVENT_ORIENTATION, + AUTOMATIC_DIRECTION, + AUTOMATIC_ELEVATION, + AUTOMATIC_LISTENER_ORIENTATION, + AUTOMATIC_SPEED, + AUTOMATIC_SPEED_ABSOLUTE, + AUTOMATIC_DISTANCE_NORMALIZED, + MAX + } + + [Flags] + public enum PARAMETER_FLAGS : uint + { + READONLY = 0x00000001, + AUTOMATIC = 0x00000002, + GLOBAL = 0x00000004, + DISCRETE = 0x00000008, + LABELED = 0x00000010, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PARAMETER_ID + { + public uint data1; + public uint data2; + } + + [StructLayout(LayoutKind.Sequential)] + public struct PARAMETER_DESCRIPTION + { + public StringWrapper name; + public PARAMETER_ID id; + public float minimum; + public float maximum; + public float defaultvalue; + public PARAMETER_TYPE type; + public PARAMETER_FLAGS flags; + public GUID guid; + } + + // This is only need for loading memory and given our C# wrapper LOAD_MEMORY_POINT isn't feasible anyway + enum LOAD_MEMORY_MODE : int + { + LOAD_MEMORY, + LOAD_MEMORY_POINT, + } + + enum LOAD_MEMORY_ALIGNMENT : int + { + VALUE = 32 + } + + [StructLayout(LayoutKind.Sequential)] + public struct SOUND_INFO + { + public IntPtr name_or_data; + public MODE mode; + public CREATESOUNDEXINFO exinfo; + public int subsoundindex; + + public string name + { + get + { + using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) + { + return ((mode & (MODE.OPENMEMORY | MODE.OPENMEMORY_POINT)) == 0) ? encoding.stringFromNative(name_or_data) : String.Empty; + } + } + } + } + + public enum USER_PROPERTY_TYPE : int + { + INTEGER, + BOOLEAN, + FLOAT, + STRING, + } + + [StructLayout(LayoutKind.Sequential)] + public struct USER_PROPERTY + { + public StringWrapper name; + public USER_PROPERTY_TYPE type; + private Union_IntBoolFloatString value; + + public int intValue() { return (type == USER_PROPERTY_TYPE.INTEGER) ? value.intvalue : -1; } + public bool boolValue() { return (type == USER_PROPERTY_TYPE.BOOLEAN) ? value.boolvalue : false; } + public float floatValue() { return (type == USER_PROPERTY_TYPE.FLOAT) ? value.floatvalue : -1; } + public string stringValue() { return (type == USER_PROPERTY_TYPE.STRING) ? value.stringvalue : ""; } + }; + + [StructLayout(LayoutKind.Explicit)] + struct Union_IntBoolFloatString + { + [FieldOffset(0)] + public int intvalue; + [FieldOffset(0)] + public bool boolvalue; + [FieldOffset(0)] + public float floatvalue; + [FieldOffset(0)] + public StringWrapper stringvalue; + } + + [Flags] + public enum INITFLAGS : uint + { + NORMAL = 0x00000000, + LIVEUPDATE = 0x00000001, + ALLOW_MISSING_PLUGINS = 0x00000002, + SYNCHRONOUS_UPDATE = 0x00000004, + DEFERRED_CALLBACKS = 0x00000008, + LOAD_FROM_UPDATE = 0x00000010, + MEMORY_TRACKING = 0x00000020, + } + + [Flags] + public enum LOAD_BANK_FLAGS : uint + { + NORMAL = 0x00000000, + NONBLOCKING = 0x00000001, + DECOMPRESS_SAMPLES = 0x00000002, + UNENCRYPTED = 0x00000004, + } + + [Flags] + public enum COMMANDCAPTURE_FLAGS : uint + { + NORMAL = 0x00000000, + FILEFLUSH = 0x00000001, + SKIP_INITIAL_STATE = 0x00000002, + } + + [Flags] + public enum COMMANDREPLAY_FLAGS : uint + { + NORMAL = 0x00000000, + SKIP_CLEANUP = 0x00000001, + FAST_FORWARD = 0x00000002, + SKIP_BANK_LOAD = 0x00000004, + } + + public enum PLAYBACK_STATE : int + { + PLAYING, + SUSTAINING, + STOPPED, + STARTING, + STOPPING, + } + + public enum EVENT_PROPERTY : int + { + CHANNELPRIORITY, + SCHEDULE_DELAY, + SCHEDULE_LOOKAHEAD, + MINIMUM_DISTANCE, + MAXIMUM_DISTANCE, + COOLDOWN, + MAX + }; + + [StructLayout(LayoutKind.Sequential)] + public struct PLUGIN_INSTANCE_PROPERTIES + { + public IntPtr name; + public IntPtr dsp; + } + + [Flags] + public enum EVENT_CALLBACK_TYPE : uint + { + CREATED = 0x00000001, + DESTROYED = 0x00000002, + STARTING = 0x00000004, + STARTED = 0x00000008, + RESTARTED = 0x00000010, + STOPPED = 0x00000020, + START_FAILED = 0x00000040, + CREATE_PROGRAMMER_SOUND = 0x00000080, + DESTROY_PROGRAMMER_SOUND = 0x00000100, + PLUGIN_CREATED = 0x00000200, + PLUGIN_DESTROYED = 0x00000400, + TIMELINE_MARKER = 0x00000800, + TIMELINE_BEAT = 0x00001000, + SOUND_PLAYED = 0x00002000, + SOUND_STOPPED = 0x00004000, + REAL_TO_VIRTUAL = 0x00008000, + VIRTUAL_TO_REAL = 0x00010000, + START_EVENT_COMMAND = 0x00020000, + NESTED_TIMELINE_BEAT = 0x00040000, + + ALL = 0xFFFFFFFF, + } + + public delegate RESULT EVENT_CALLBACK(EVENT_CALLBACK_TYPE type, IntPtr _event, IntPtr parameters); + + public delegate RESULT COMMANDREPLAY_FRAME_CALLBACK(IntPtr replay, int commandindex, float currenttime, IntPtr userdata); + public delegate RESULT COMMANDREPLAY_LOAD_BANK_CALLBACK(IntPtr replay, int commandindex, GUID bankguid, IntPtr bankfilename, LOAD_BANK_FLAGS flags, out IntPtr bank, IntPtr userdata); + public delegate RESULT COMMANDREPLAY_CREATE_INSTANCE_CALLBACK(IntPtr replay, int commandindex, IntPtr eventdescription, out IntPtr instance, IntPtr userdata); + + public enum INSTANCETYPE : int + { + NONE, + SYSTEM, + EVENTDESCRIPTION, + EVENTINSTANCE, + PARAMETERINSTANCE, + BUS, + VCA, + BANK, + COMMANDREPLAY, + } + + [StructLayout(LayoutKind.Sequential)] + public struct COMMAND_INFO + { + public StringWrapper commandname; + public int parentcommandindex; + public int framenumber; + public float frametime; + public INSTANCETYPE instancetype; + public INSTANCETYPE outputtype; + public UInt32 instancehandle; + public UInt32 outputhandle; + } + + [StructLayout(LayoutKind.Sequential)] + public struct MEMORY_USAGE + { + public int exclusive; + public int inclusive; + public int sampledata; + } + + public struct Util + { + public static RESULT parseID(string idString, out GUID id) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_ParseID(encoder.byteFromStringUTF8(idString), out id); + } + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_ParseID(byte[] idString, out GUID id); + #endregion + } + + public struct System + { + // Initialization / system functions. + public static RESULT create(out System system) + { + return FMOD_Studio_System_Create(out system.handle, VERSION.number); + } + public RESULT setAdvancedSettings(ADVANCEDSETTINGS settings) + { + settings.cbsize = Marshal.SizeOf(); + return FMOD_Studio_System_SetAdvancedSettings(this.handle, ref settings); + } + public RESULT setAdvancedSettings(ADVANCEDSETTINGS settings, string encryptionKey) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr userKey = settings.encryptionkey; + settings.encryptionkey = encoder.intptrFromStringUTF8(encryptionKey); + FMOD.RESULT result = setAdvancedSettings(settings); + settings.encryptionkey = userKey; + return result; + } + } + public RESULT getAdvancedSettings(out ADVANCEDSETTINGS settings) + { + settings.cbsize = Marshal.SizeOf(); + return FMOD_Studio_System_GetAdvancedSettings(this.handle, out settings); + } + public RESULT initialize(int maxchannels, INITFLAGS studioflags, FMOD.INITFLAGS flags, IntPtr extradriverdata) + { + return FMOD_Studio_System_Initialize(this.handle, maxchannels, studioflags, flags, extradriverdata); + } + public RESULT release() + { + return FMOD_Studio_System_Release(this.handle); + } + public RESULT update() + { + return FMOD_Studio_System_Update(this.handle); + } + public RESULT getCoreSystem(out FMOD.System coresystem) + { + return FMOD_Studio_System_GetCoreSystem(this.handle, out coresystem.handle); + } + public RESULT getEvent(string path, out EventDescription _event) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetEvent(this.handle, encoder.byteFromStringUTF8(path), out _event.handle); + } + } + public RESULT getBus(string path, out Bus bus) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetBus(this.handle, encoder.byteFromStringUTF8(path), out bus.handle); + } + } + public RESULT getVCA(string path, out VCA vca) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetVCA(this.handle, encoder.byteFromStringUTF8(path), out vca.handle); + } + } + public RESULT getBank(string path, out Bank bank) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetBank(this.handle, encoder.byteFromStringUTF8(path), out bank.handle); + } + } + + public RESULT getEventByID(GUID id, out EventDescription _event) + { + return FMOD_Studio_System_GetEventByID(this.handle, ref id, out _event.handle); + } + public RESULT getBusByID(GUID id, out Bus bus) + { + return FMOD_Studio_System_GetBusByID(this.handle, ref id, out bus.handle); + } + public RESULT getVCAByID(GUID id, out VCA vca) + { + return FMOD_Studio_System_GetVCAByID(this.handle, ref id, out vca.handle); + } + public RESULT getBankByID(GUID id, out Bank bank) + { + return FMOD_Studio_System_GetBankByID(this.handle, ref id, out bank.handle); + } + public RESULT getSoundInfo(string key, out SOUND_INFO info) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetSoundInfo(this.handle, encoder.byteFromStringUTF8(key), out info); + } + } + public RESULT getParameterDescriptionByName(string name, out PARAMETER_DESCRIPTION parameter) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetParameterDescriptionByName(this.handle, encoder.byteFromStringUTF8(name), out parameter); + } + } + public RESULT getParameterDescriptionByID(PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_System_GetParameterDescriptionByID(this.handle, id, out parameter); + } + public RESULT getParameterLabelByName(string name, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + byte[] nameBytes = encoder.byteFromStringUTF8(name); + RESULT result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterLabelByID(PARAMETER_ID id, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterByID(PARAMETER_ID id, out float value) + { + float finalValue; + return getParameterByID(id, out value, out finalValue); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value, out float finalvalue) + { + return FMOD_Studio_System_GetParameterByID(this.handle, id, out value, out finalvalue); + } + public RESULT setParameterByID(PARAMETER_ID id, float value, bool ignoreseekspeed = false) + { + return FMOD_Studio_System_SetParameterByID(this.handle, id, value, ignoreseekspeed); + } + public RESULT setParameterByIDWithLabel(PARAMETER_ID id, string label, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_SetParameterByIDWithLabel(this.handle, id, encoder.byteFromStringUTF8(label), ignoreseekspeed); + } + } + public RESULT setParametersByIDs(PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed = false) + { + return FMOD_Studio_System_SetParametersByIDs(this.handle, ids, values, count, ignoreseekspeed); + } + public RESULT getParameterByName(string name, out float value) + { + float finalValue; + return getParameterByName(name, out value, out finalValue); + } + public RESULT getParameterByName(string name, out float value, out float finalvalue) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetParameterByName(this.handle, encoder.byteFromStringUTF8(name), out value, out finalvalue); + } + } + public RESULT setParameterByName(string name, float value, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_SetParameterByName(this.handle, encoder.byteFromStringUTF8(name), value, ignoreseekspeed); + } + } + public RESULT setParameterByNameWithLabel(string name, string label, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper(), + labelEncoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_SetParameterByNameWithLabel(this.handle, encoder.byteFromStringUTF8(name), labelEncoder.byteFromStringUTF8(label), ignoreseekspeed); + } + } + public RESULT lookupID(string path, out GUID id) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LookupID(this.handle, encoder.byteFromStringUTF8(path), out id); + } + } + public RESULT lookupPath(GUID id, out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_System_LookupPath(this.handle, ref id, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_System_LookupPath(this.handle, ref id, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getNumListeners(out int numlisteners) + { + return FMOD_Studio_System_GetNumListeners(this.handle, out numlisteners); + } + public RESULT setNumListeners(int numlisteners) + { + return FMOD_Studio_System_SetNumListeners(this.handle, numlisteners); + } + public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes) + { + return FMOD_Studio_System_GetListenerAttributes(this.handle, listener, out attributes, IntPtr.Zero); + } + public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes, out VECTOR attenuationposition) + { + return FMOD_Studio_System_GetListenerAttributes(this.handle, listener, out attributes, out attenuationposition); + } + public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes) + { + return FMOD_Studio_System_SetListenerAttributes(this.handle, listener, ref attributes, IntPtr.Zero); + } + public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes, VECTOR attenuationposition) + { + return FMOD_Studio_System_SetListenerAttributes(this.handle, listener, ref attributes, ref attenuationposition); + } + public RESULT getListenerWeight(int listener, out float weight) + { + return FMOD_Studio_System_GetListenerWeight(this.handle, listener, out weight); + } + public RESULT setListenerWeight(int listener, float weight) + { + return FMOD_Studio_System_SetListenerWeight(this.handle, listener, weight); + } + public RESULT loadBankFile(string filename, LOAD_BANK_FLAGS flags, out Bank bank) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LoadBankFile(this.handle, encoder.byteFromStringUTF8(filename), flags, out bank.handle); + } + } + public RESULT loadBankMemory(byte[] buffer, LOAD_BANK_FLAGS flags, out Bank bank) + { + // Manually pin the byte array. It's what the marshaller should do anyway but don't leave it to chance. + GCHandle pinnedArray = GCHandle.Alloc(buffer, GCHandleType.Pinned); + IntPtr pointer = pinnedArray.AddrOfPinnedObject(); + RESULT result = FMOD_Studio_System_LoadBankMemory(this.handle, pointer, buffer.Length, LOAD_MEMORY_MODE.LOAD_MEMORY, flags, out bank.handle); + pinnedArray.Free(); + return result; + } + public RESULT loadBankCustom(BANK_INFO info, LOAD_BANK_FLAGS flags, out Bank bank) + { + info.size = Marshal.SizeOf(); + return FMOD_Studio_System_LoadBankCustom(this.handle, ref info, flags, out bank.handle); + } + public RESULT unloadAll() + { + return FMOD_Studio_System_UnloadAll(this.handle); + } + public RESULT flushCommands() + { + return FMOD_Studio_System_FlushCommands(this.handle); + } + public RESULT flushSampleLoading() + { + return FMOD_Studio_System_FlushSampleLoading(this.handle); + } + public RESULT startCommandCapture(string filename, COMMANDCAPTURE_FLAGS flags) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_StartCommandCapture(this.handle, encoder.byteFromStringUTF8(filename), flags); + } + } + public RESULT stopCommandCapture() + { + return FMOD_Studio_System_StopCommandCapture(this.handle); + } + public RESULT loadCommandReplay(string filename, COMMANDREPLAY_FLAGS flags, out CommandReplay replay) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LoadCommandReplay(this.handle, encoder.byteFromStringUTF8(filename), flags, out replay.handle); + } + } + public RESULT getBankCount(out int count) + { + return FMOD_Studio_System_GetBankCount(this.handle, out count); + } + public RESULT getBankList(out Bank[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_System_GetBankCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new Bank[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_System_GetBankList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new Bank[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getParameterDescriptionCount(out int count) + { + return FMOD_Studio_System_GetParameterDescriptionCount(this.handle, out count); + } + public RESULT getParameterDescriptionList(out PARAMETER_DESCRIPTION[] array) + { + array = null; + + int capacity; + RESULT result = FMOD_Studio_System_GetParameterDescriptionCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new PARAMETER_DESCRIPTION[0]; + return RESULT.OK; + } + + PARAMETER_DESCRIPTION[] tempArray = new PARAMETER_DESCRIPTION[capacity]; + int actualCount; + result = FMOD_Studio_System_GetParameterDescriptionList(this.handle, tempArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + + if (actualCount != capacity) + { + Array.Resize(ref tempArray, actualCount); + } + + array = tempArray; + + return RESULT.OK; + } + public RESULT getCPUUsage(out CPU_USAGE usage, out FMOD.CPU_USAGE usage_core) + { + return FMOD_Studio_System_GetCPUUsage(this.handle, out usage, out usage_core); + } + public RESULT getBufferUsage(out BUFFER_USAGE usage) + { + return FMOD_Studio_System_GetBufferUsage(this.handle, out usage); + } + public RESULT resetBufferUsage() + { + return FMOD_Studio_System_ResetBufferUsage(this.handle); + } + + public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_System_SetCallback(this.handle, callback, callbackmask); + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_System_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_System_SetUserData(this.handle, userdata); + } + + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_System_GetMemoryUsage(this.handle, out memoryusage); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Create (out IntPtr system, uint headerversion); + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_System_IsValid (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetAdvancedSettings (IntPtr system, out ADVANCEDSETTINGS settings); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Initialize (IntPtr system, int maxchannels, INITFLAGS studioflags, FMOD.INITFLAGS flags, IntPtr extradriverdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Release (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Update (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetCoreSystem (IntPtr system, out IntPtr coresystem); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetEvent (IntPtr system, byte[] path, out IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBus (IntPtr system, byte[] path, out IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetVCA (IntPtr system, byte[] path, out IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBank (IntPtr system, byte[] path, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetEventByID (IntPtr system, ref GUID id, out IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBusByID (IntPtr system, ref GUID id, out IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetVCAByID (IntPtr system, ref GUID id, out IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankByID (IntPtr system, ref GUID id, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetSoundInfo (IntPtr system, byte[] key, out SOUND_INFO info); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionByName(IntPtr system, byte[] name, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionByID(IntPtr system, PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterLabelByName (IntPtr system, byte[] name, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterLabelByID (IntPtr system, PARAMETER_ID id, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterByID (IntPtr system, PARAMETER_ID id, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByID (IntPtr system, PARAMETER_ID id, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByIDWithLabel (IntPtr system, PARAMETER_ID id, byte[] label, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParametersByIDs (IntPtr system, PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterByName (IntPtr system, byte[] name, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByName (IntPtr system, byte[] name, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByNameWithLabel (IntPtr system, byte[] name, byte[] label, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LookupID (IntPtr system, byte[] path, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LookupPath (IntPtr system, ref GUID id, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetNumListeners (IntPtr system, out int numlisteners); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetNumListeners (IntPtr system, int numlisteners); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetListenerAttributes (IntPtr system, int listener, out ATTRIBUTES_3D attributes, IntPtr zero); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetListenerAttributes (IntPtr system, int listener, out ATTRIBUTES_3D attributes, out VECTOR attenuationposition); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetListenerAttributes (IntPtr system, int listener, ref ATTRIBUTES_3D attributes, IntPtr zero); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetListenerAttributes (IntPtr system, int listener, ref ATTRIBUTES_3D attributes, ref VECTOR attenuationposition); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetListenerWeight (IntPtr system, int listener, out float weight); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetListenerWeight (IntPtr system, int listener, float weight); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankFile (IntPtr system, byte[] filename, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankMemory (IntPtr system, IntPtr buffer, int length, LOAD_MEMORY_MODE mode, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankCustom (IntPtr system, ref BANK_INFO info, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_UnloadAll (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_FlushCommands (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_FlushSampleLoading (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_StartCommandCapture (IntPtr system, byte[] filename, COMMANDCAPTURE_FLAGS flags); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_StopCommandCapture (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadCommandReplay (IntPtr system, byte[] filename, COMMANDREPLAY_FLAGS flags, out IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankCount (IntPtr system, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankList (IntPtr system, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionCount(IntPtr system, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionList(IntPtr system, [Out] PARAMETER_DESCRIPTION[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage, out FMOD.CPU_USAGE usage_core); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBufferUsage (IntPtr system, out BUFFER_USAGE usage); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_ResetBufferUsage (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetUserData (IntPtr system, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetUserData (IntPtr system, IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetMemoryUsage (IntPtr system, out MEMORY_USAGE memoryusage); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public System(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_System_IsValid(this.handle); + } + + #endregion + } + + public struct EventDescription + { + public RESULT getID(out GUID id) + { + return FMOD_Studio_EventDescription_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_EventDescription_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterDescriptionCount(out int count) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionCount(this.handle, out count); + } + public RESULT getParameterDescriptionByIndex(int index, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(this.handle, index, out parameter); + } + public RESULT getParameterDescriptionByName(string name, out PARAMETER_DESCRIPTION parameter) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByName(this.handle, encoder.byteFromStringUTF8(name), out parameter); + } + } + public RESULT getParameterDescriptionByID(PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByID(this.handle, id, out parameter); + } + public RESULT getParameterLabelByIndex(int index, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterLabelByName(string name, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + byte[] nameBytes = encoder.byteFromStringUTF8(name); + RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterLabelByID(PARAMETER_ID id, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getUserPropertyCount(out int count) + { + return FMOD_Studio_EventDescription_GetUserPropertyCount(this.handle, out count); + } + public RESULT getUserPropertyByIndex(int index, out USER_PROPERTY property) + { + return FMOD_Studio_EventDescription_GetUserPropertyByIndex(this.handle, index, out property); + } + public RESULT getUserProperty(string name, out USER_PROPERTY property) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventDescription_GetUserProperty(this.handle, encoder.byteFromStringUTF8(name), out property); + } + } + public RESULT getLength(out int length) + { + return FMOD_Studio_EventDescription_GetLength(this.handle, out length); + } + public RESULT getMinMaxDistance(out float min, out float max) + { + return FMOD_Studio_EventDescription_GetMinMaxDistance(this.handle, out min, out max); + } + public RESULT getSoundSize(out float size) + { + return FMOD_Studio_EventDescription_GetSoundSize(this.handle, out size); + } + public RESULT isSnapshot(out bool snapshot) + { + return FMOD_Studio_EventDescription_IsSnapshot(this.handle, out snapshot); + } + public RESULT isOneshot(out bool oneshot) + { + return FMOD_Studio_EventDescription_IsOneshot(this.handle, out oneshot); + } + public RESULT isStream(out bool isStream) + { + return FMOD_Studio_EventDescription_IsStream(this.handle, out isStream); + } + public RESULT is3D(out bool is3D) + { + return FMOD_Studio_EventDescription_Is3D(this.handle, out is3D); + } + public RESULT isDopplerEnabled(out bool doppler) + { + return FMOD_Studio_EventDescription_IsDopplerEnabled(this.handle, out doppler); + } + public RESULT hasSustainPoint(out bool sustainPoint) + { + return FMOD_Studio_EventDescription_HasSustainPoint(this.handle, out sustainPoint); + } + + public RESULT createInstance(out EventInstance instance) + { + return FMOD_Studio_EventDescription_CreateInstance(this.handle, out instance.handle); + } + + public RESULT getInstanceCount(out int count) + { + return FMOD_Studio_EventDescription_GetInstanceCount(this.handle, out count); + } + public RESULT getInstanceList(out EventInstance[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_EventDescription_GetInstanceCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new EventInstance[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_EventDescription_GetInstanceList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new EventInstance[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + + public RESULT loadSampleData() + { + return FMOD_Studio_EventDescription_LoadSampleData(this.handle); + } + + public RESULT unloadSampleData() + { + return FMOD_Studio_EventDescription_UnloadSampleData(this.handle); + } + + public RESULT getSampleLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_EventDescription_GetSampleLoadingState(this.handle, out state); + } + + public RESULT releaseAllInstances() + { + return FMOD_Studio_EventDescription_ReleaseAllInstances(this.handle); + } + public RESULT setCallback(EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_EventDescription_SetCallback(this.handle, callback, callbackmask); + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_EventDescription_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_EventDescription_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_EventDescription_IsValid (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetID (IntPtr eventdescription, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetPath (IntPtr eventdescription, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionCount(IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(IntPtr eventdescription, int index, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByName(IntPtr eventdescription, byte[] name, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByID(IntPtr eventdescription, PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByIndex(IntPtr eventdescription, int index, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByName(IntPtr eventdescription, byte[] name, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByID (IntPtr eventdescription, PARAMETER_ID id, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyCount (IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyByIndex(IntPtr eventdescription, int index, out USER_PROPERTY property); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserProperty (IntPtr eventdescription, byte[] name, out USER_PROPERTY property); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetLength (IntPtr eventdescription, out int length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetMinMaxDistance (IntPtr eventdescription, out float min, out float max); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetSoundSize (IntPtr eventdescription, out float size); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsSnapshot (IntPtr eventdescription, out bool snapshot); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsOneshot (IntPtr eventdescription, out bool oneshot); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsStream (IntPtr eventdescription, out bool isStream); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_Is3D (IntPtr eventdescription, out bool is3D); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsDopplerEnabled (IntPtr eventdescription, out bool doppler); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_HasSustainPoint (IntPtr eventdescription, out bool sustainPoint); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_CreateInstance (IntPtr eventdescription, out IntPtr instance); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetInstanceCount (IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetInstanceList (IntPtr eventdescription, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_LoadSampleData (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_UnloadSampleData (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetSampleLoadingState (IntPtr eventdescription, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_ReleaseAllInstances (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_SetCallback (IntPtr eventdescription, EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserData (IntPtr eventdescription, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_SetUserData (IntPtr eventdescription, IntPtr userdata); + #endregion + #region wrapperinternal + + public IntPtr handle; + + public EventDescription(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_EventDescription_IsValid(this.handle); + } + + #endregion + } + + public struct EventInstance + { + public RESULT getDescription(out EventDescription description) + { + return FMOD_Studio_EventInstance_GetDescription(this.handle, out description.handle); + } + public RESULT getSystem(out System system) + { + return FMOD_Studio_EventInstance_GetSystem(this.handle, out system.handle); + } + public RESULT getVolume(out float volume) + { + return FMOD_Studio_EventInstance_GetVolume(this.handle, out volume, IntPtr.Zero); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_EventInstance_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_EventInstance_SetVolume(this.handle, volume); + } + public RESULT getPitch(out float pitch) + { + return FMOD_Studio_EventInstance_GetPitch(this.handle, out pitch, IntPtr.Zero); + } + public RESULT getPitch(out float pitch, out float finalpitch) + { + return FMOD_Studio_EventInstance_GetPitch(this.handle, out pitch, out finalpitch); + } + public RESULT setPitch(float pitch) + { + return FMOD_Studio_EventInstance_SetPitch(this.handle, pitch); + } + public RESULT get3DAttributes(out ATTRIBUTES_3D attributes) + { + return FMOD_Studio_EventInstance_Get3DAttributes(this.handle, out attributes); + } + public RESULT set3DAttributes(ATTRIBUTES_3D attributes) + { + return FMOD_Studio_EventInstance_Set3DAttributes(this.handle, ref attributes); + } + public RESULT getListenerMask(out uint mask) + { + return FMOD_Studio_EventInstance_GetListenerMask(this.handle, out mask); + } + public RESULT setListenerMask(uint mask) + { + return FMOD_Studio_EventInstance_SetListenerMask(this.handle, mask); + } + public RESULT getProperty(EVENT_PROPERTY index, out float value) + { + return FMOD_Studio_EventInstance_GetProperty(this.handle, index, out value); + } + public RESULT setProperty(EVENT_PROPERTY index, float value) + { + return FMOD_Studio_EventInstance_SetProperty(this.handle, index, value); + } + public RESULT getReverbLevel(int index, out float level) + { + return FMOD_Studio_EventInstance_GetReverbLevel(this.handle, index, out level); + } + public RESULT setReverbLevel(int index, float level) + { + return FMOD_Studio_EventInstance_SetReverbLevel(this.handle, index, level); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_EventInstance_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_EventInstance_SetPaused(this.handle, paused); + } + public RESULT start() + { + return FMOD_Studio_EventInstance_Start(this.handle); + } + public RESULT stop(STOP_MODE mode) + { + return FMOD_Studio_EventInstance_Stop(this.handle, mode); + } + public RESULT getTimelinePosition(out int position) + { + return FMOD_Studio_EventInstance_GetTimelinePosition(this.handle, out position); + } + public RESULT setTimelinePosition(int position) + { + return FMOD_Studio_EventInstance_SetTimelinePosition(this.handle, position); + } + public RESULT getPlaybackState(out PLAYBACK_STATE state) + { + return FMOD_Studio_EventInstance_GetPlaybackState(this.handle, out state); + } + public RESULT getChannelGroup(out FMOD.ChannelGroup group) + { + return FMOD_Studio_EventInstance_GetChannelGroup(this.handle, out group.handle); + } + public RESULT getMinMaxDistance(out float min, out float max) + { + return FMOD_Studio_EventInstance_GetMinMaxDistance(this.handle, out min, out max); + } + public RESULT release() + { + return FMOD_Studio_EventInstance_Release(this.handle); + } + public RESULT isVirtual(out bool virtualstate) + { + return FMOD_Studio_EventInstance_IsVirtual(this.handle, out virtualstate); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value) + { + float finalvalue; + return getParameterByID(id, out value, out finalvalue); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value, out float finalvalue) + { + return FMOD_Studio_EventInstance_GetParameterByID(this.handle, id, out value, out finalvalue); + } + public RESULT setParameterByID(PARAMETER_ID id, float value, bool ignoreseekspeed = false) + { + return FMOD_Studio_EventInstance_SetParameterByID(this.handle, id, value, ignoreseekspeed); + } + public RESULT setParameterByIDWithLabel(PARAMETER_ID id, string label, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_SetParameterByIDWithLabel(this.handle, id, encoder.byteFromStringUTF8(label), ignoreseekspeed); + } + } + public RESULT setParametersByIDs(PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed = false) + { + return FMOD_Studio_EventInstance_SetParametersByIDs(this.handle, ids, values, count, ignoreseekspeed); + } + public RESULT getParameterByName(string name, out float value) + { + float finalValue; + return getParameterByName(name, out value, out finalValue); + } + public RESULT getParameterByName(string name, out float value, out float finalvalue) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_GetParameterByName(this.handle, encoder.byteFromStringUTF8(name), out value, out finalvalue); + } + } + public RESULT setParameterByName(string name, float value, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_SetParameterByName(this.handle, encoder.byteFromStringUTF8(name), value, ignoreseekspeed); + } + } + public RESULT setParameterByNameWithLabel(string name, string label, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper(), + labelEncoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_SetParameterByNameWithLabel(this.handle, encoder.byteFromStringUTF8(name), labelEncoder.byteFromStringUTF8(label), ignoreseekspeed); + } + } + public RESULT keyOff() + { + return FMOD_Studio_EventInstance_KeyOff(this.handle); + } + public RESULT setCallback(EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_EventInstance_SetCallback(this.handle, callback, callbackmask); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_EventInstance_GetUserData(this.handle, out userdata); + } + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_EventInstance_SetUserData(this.handle, userdata); + } + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD_Studio_EventInstance_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_EventInstance_GetMemoryUsage(this.handle, out memoryusage); + } + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_EventInstance_IsValid (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetDescription (IntPtr _event, out IntPtr description); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetSystem (IntPtr _event, out IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetVolume (IntPtr _event, out float volume, IntPtr zero); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetVolume (IntPtr _event, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetVolume (IntPtr _event, float volume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPitch (IntPtr _event, out float pitch, IntPtr zero); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPitch (IntPtr _event, out float pitch, out float finalpitch); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetPitch (IntPtr _event, float pitch); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Get3DAttributes (IntPtr _event, out ATTRIBUTES_3D attributes); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Set3DAttributes (IntPtr _event, ref ATTRIBUTES_3D attributes); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetListenerMask (IntPtr _event, out uint mask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetListenerMask (IntPtr _event, uint mask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetProperty (IntPtr _event, EVENT_PROPERTY index, out float value); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetProperty (IntPtr _event, EVENT_PROPERTY index, float value); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetReverbLevel (IntPtr _event, int index, out float level); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetReverbLevel (IntPtr _event, int index, float level); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPaused (IntPtr _event, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetPaused (IntPtr _event, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Start (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Stop (IntPtr _event, STOP_MODE mode); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetTimelinePosition (IntPtr _event, out int position); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetTimelinePosition (IntPtr _event, int position); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPlaybackState (IntPtr _event, out PLAYBACK_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetChannelGroup (IntPtr _event, out IntPtr group); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetMinMaxDistance (IntPtr _event, out float min, out float max); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Release (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_IsVirtual (IntPtr _event, out bool virtualstate); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetParameterByName (IntPtr _event, byte[] name, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByName (IntPtr _event, byte[] name, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByNameWithLabel (IntPtr _event, byte[] name, byte[] label, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetParameterByID (IntPtr _event, PARAMETER_ID id, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByID (IntPtr _event, PARAMETER_ID id, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByIDWithLabel (IntPtr _event, PARAMETER_ID id, byte[] label, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParametersByIDs (IntPtr _event, PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_KeyOff (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetCallback (IntPtr _event, EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetUserData (IntPtr _event, out IntPtr userdata); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetUserData (IntPtr _event, IntPtr userdata); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetCPUUsage (IntPtr _event, out uint exclusive, out uint inclusive); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetMemoryUsage (IntPtr _event, out MEMORY_USAGE memoryusage); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public EventInstance(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_EventInstance_IsValid(this.handle); + } + + #endregion + } + + public struct Bus + { + public RESULT getID(out GUID id) + { + return FMOD_Studio_Bus_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bus_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bus_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + + } + public RESULT getVolume(out float volume) + { + float finalVolume; + return getVolume(out volume, out finalVolume); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_Bus_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_Bus_SetVolume(this.handle, volume); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_Bus_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_Bus_SetPaused(this.handle, paused); + } + public RESULT getMute(out bool mute) + { + return FMOD_Studio_Bus_GetMute(this.handle, out mute); + } + public RESULT setMute(bool mute) + { + return FMOD_Studio_Bus_SetMute(this.handle, mute); + } + public RESULT stopAllEvents(STOP_MODE mode) + { + return FMOD_Studio_Bus_StopAllEvents(this.handle, mode); + } + public RESULT lockChannelGroup() + { + return FMOD_Studio_Bus_LockChannelGroup(this.handle); + } + public RESULT unlockChannelGroup() + { + return FMOD_Studio_Bus_UnlockChannelGroup(this.handle); + } + public RESULT getChannelGroup(out FMOD.ChannelGroup group) + { + return FMOD_Studio_Bus_GetChannelGroup(this.handle, out group.handle); + } + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD_Studio_Bus_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_Bus_GetMemoryUsage(this.handle, out memoryusage); + } + public RESULT getPortIndex(out ulong index) + { + return FMOD_Studio_Bus_GetPortIndex(this.handle, out index); + } + public RESULT setPortIndex(ulong index) + { + return FMOD_Studio_Bus_SetPortIndex(this.handle, index); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_Bus_IsValid (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetID (IntPtr bus, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetPath (IntPtr bus, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetVolume (IntPtr bus, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetVolume (IntPtr bus, float volume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetPaused (IntPtr bus, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetPaused (IntPtr bus, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetMute (IntPtr bus, out bool mute); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetMute (IntPtr bus, bool mute); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_StopAllEvents (IntPtr bus, STOP_MODE mode); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_LockChannelGroup (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_UnlockChannelGroup (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetChannelGroup (IntPtr bus, out IntPtr group); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetCPUUsage (IntPtr bus, out uint exclusive, out uint inclusive); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetMemoryUsage (IntPtr bus, out MEMORY_USAGE memoryusage); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetPortIndex (IntPtr bus, out ulong index); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetPortIndex (IntPtr bus, ulong index); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Bus(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_Bus_IsValid(this.handle); + } + + #endregion + } + + public struct VCA + { + public RESULT getID(out GUID id) + { + return FMOD_Studio_VCA_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_VCA_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_VCA_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getVolume(out float volume) + { + float finalVolume; + return getVolume(out volume, out finalVolume); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_VCA_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_VCA_SetVolume(this.handle, volume); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_VCA_IsValid (IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetID (IntPtr vca, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetPath (IntPtr vca, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetVolume (IntPtr vca, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_SetVolume (IntPtr vca, float volume); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public VCA(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_VCA_IsValid(this.handle); + } + + #endregion + } + + public struct Bank + { + // Property access + + public RESULT getID(out GUID id) + { + return FMOD_Studio_Bank_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bank_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bank_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT unload() + { + return FMOD_Studio_Bank_Unload(this.handle); + } + public RESULT loadSampleData() + { + return FMOD_Studio_Bank_LoadSampleData(this.handle); + } + public RESULT unloadSampleData() + { + return FMOD_Studio_Bank_UnloadSampleData(this.handle); + } + public RESULT getLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_Bank_GetLoadingState(this.handle, out state); + } + public RESULT getSampleLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_Bank_GetSampleLoadingState(this.handle, out state); + } + + // Enumeration + public RESULT getStringCount(out int count) + { + return FMOD_Studio_Bank_GetStringCount(this.handle, out count); + } + public RESULT getStringInfo(int index, out GUID id, out string path) + { + path = null; + id = new GUID(); + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bank_GetStringInfo(this.handle, index, out id, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bank_GetStringInfo(this.handle, index, out id, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + + public RESULT getEventCount(out int count) + { + return FMOD_Studio_Bank_GetEventCount(this.handle, out count); + } + public RESULT getEventList(out EventDescription[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetEventCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new EventDescription[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetEventList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new EventDescription[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getBusCount(out int count) + { + return FMOD_Studio_Bank_GetBusCount(this.handle, out count); + } + public RESULT getBusList(out Bus[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetBusCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new Bus[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetBusList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new Bus[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getVCACount(out int count) + { + return FMOD_Studio_Bank_GetVCACount(this.handle, out count); + } + public RESULT getVCAList(out VCA[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetVCACount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new VCA[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetVCAList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new VCA[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_Bank_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_Bank_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_Bank_IsValid (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetID (IntPtr bank, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetPath (IntPtr bank, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_Unload (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_LoadSampleData (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_UnloadSampleData (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetLoadingState (IntPtr bank, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetSampleLoadingState (IntPtr bank, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetStringCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetStringInfo (IntPtr bank, int index, out GUID id, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetEventCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetEventList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetBusCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetBusList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetVCACount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetVCAList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetUserData (IntPtr bank, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_SetUserData (IntPtr bank, IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Bank(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_Bank_IsValid(this.handle); + } + + #endregion + } + + public struct CommandReplay + { + // Information query + public RESULT getSystem(out System system) + { + return FMOD_Studio_CommandReplay_GetSystem(this.handle, out system.handle); + } + + public RESULT getLength(out float length) + { + return FMOD_Studio_CommandReplay_GetLength(this.handle, out length); + } + public RESULT getCommandCount(out int count) + { + return FMOD_Studio_CommandReplay_GetCommandCount(this.handle, out count); + } + public RESULT getCommandInfo(int commandIndex, out COMMAND_INFO info) + { + return FMOD_Studio_CommandReplay_GetCommandInfo(this.handle, commandIndex, out info); + } + + public RESULT getCommandString(int commandIndex, out string buffer) + { + buffer = null; + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + int stringLength = 256; + IntPtr stringMem = Marshal.AllocHGlobal(256); + RESULT result = FMOD_Studio_CommandReplay_GetCommandString(this.handle, commandIndex, stringMem, stringLength); + + while (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringLength *= 2; + stringMem = Marshal.AllocHGlobal(stringLength); + result = FMOD_Studio_CommandReplay_GetCommandString(this.handle, commandIndex, stringMem, stringLength); + } + + if (result == RESULT.OK) + { + buffer = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getCommandAtTime(float time, out int commandIndex) + { + return FMOD_Studio_CommandReplay_GetCommandAtTime(this.handle, time, out commandIndex); + } + // Playback + public RESULT setBankPath(string bankPath) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_CommandReplay_SetBankPath(this.handle, encoder.byteFromStringUTF8(bankPath)); + } + } + public RESULT start() + { + return FMOD_Studio_CommandReplay_Start(this.handle); + } + public RESULT stop() + { + return FMOD_Studio_CommandReplay_Stop(this.handle); + } + public RESULT seekToTime(float time) + { + return FMOD_Studio_CommandReplay_SeekToTime(this.handle, time); + } + public RESULT seekToCommand(int commandIndex) + { + return FMOD_Studio_CommandReplay_SeekToCommand(this.handle, commandIndex); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_CommandReplay_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_CommandReplay_SetPaused(this.handle, paused); + } + public RESULT getPlaybackState(out PLAYBACK_STATE state) + { + return FMOD_Studio_CommandReplay_GetPlaybackState(this.handle, out state); + } + public RESULT getCurrentCommand(out int commandIndex, out float currentTime) + { + return FMOD_Studio_CommandReplay_GetCurrentCommand(this.handle, out commandIndex, out currentTime); + } + // Release + public RESULT release() + { + return FMOD_Studio_CommandReplay_Release(this.handle); + } + // Callbacks + public RESULT setFrameCallback(COMMANDREPLAY_FRAME_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetFrameCallback(this.handle, callback); + } + public RESULT setLoadBankCallback(COMMANDREPLAY_LOAD_BANK_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetLoadBankCallback(this.handle, callback); + } + public RESULT setCreateInstanceCallback(COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetCreateInstanceCallback(this.handle, callback); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_CommandReplay_GetUserData(this.handle, out userdata); + } + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_CommandReplay_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_CommandReplay_IsValid (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetSystem (IntPtr replay, out IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetLength (IntPtr replay, out float length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandCount (IntPtr replay, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandInfo (IntPtr replay, int commandindex, out COMMAND_INFO info); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandString (IntPtr replay, int commandIndex, IntPtr buffer, int length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandAtTime (IntPtr replay, float time, out int commandIndex); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetBankPath (IntPtr replay, byte[] bankPath); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Start (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Stop (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SeekToTime (IntPtr replay, float time); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SeekToCommand (IntPtr replay, int commandIndex); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetPaused (IntPtr replay, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetPaused (IntPtr replay, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetPlaybackState (IntPtr replay, out PLAYBACK_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCurrentCommand (IntPtr replay, out int commandIndex, out float currentTime); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Release (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetFrameCallback (IntPtr replay, COMMANDREPLAY_FRAME_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetLoadBankCallback (IntPtr replay, COMMANDREPLAY_LOAD_BANK_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetCreateInstanceCallback(IntPtr replay, COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetUserData (IntPtr replay, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetUserData (IntPtr replay, IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public CommandReplay(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_CommandReplay_IsValid(this.handle); + } + + #endregion + } +} // FMOD diff --git a/Assets/Plugins/FMOD/src/fmod_studio.cs.meta b/Assets/Plugins/FMOD/src/fmod_studio.cs.meta new file mode 100644 index 00000000..a6aac508 --- /dev/null +++ b/Assets/Plugins/FMOD/src/fmod_studio.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ae7eb0b6a2bff364b9c1fae52173e74c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity b/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity index 97c9fcee..14af3acf 100644 --- a/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity +++ b/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:242010fea66c813efc675fcfb24840e31b3f1c57df42eaf1999ad89836e2e28a -size 63201744 +oid sha256:aa0f7f00928bc3e84b539557a82ee58666cca0ea47304b0976e44a601ecf4605 +size 63207332 diff --git a/Assets/_PROJECT/Scripts/Audio/AudioManager.cs b/Assets/_PROJECT/Scripts/Audio/AudioManager.cs new file mode 100644 index 00000000..cdb892ea --- /dev/null +++ b/Assets/_PROJECT/Scripts/Audio/AudioManager.cs @@ -0,0 +1,276 @@ +using FMOD.Studio; +using FMODUnity; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using UnityEditor; +using UnityEngine; +using UnityEngine.SceneManagement; + +public class AudioManager : MonoBehaviour +{ + [Header("Volume")] + [Range(0, 1)] + + public float MasterVolume = 1; + [Range(0, 1)] + + public float MusicVolume = 1; + [Range(0, 1)] + + public float SFXVolume = 1; + [Range(0, 1)] + + public float UIVolume = 1; + [Range(0, 1)] + + private Bus masterBus; + private Bus musicBus; + private Bus sfxBus; + private Bus reverbBus; + private Bus uiBus; + const string sid = "00000000-0000-0000-0000-000000000000"; + static readonly Guid nullGuid = new Guid(sid); + + private List eventInstances = new(); + class TimelineInfo + { + public FMOD.StringWrapper LastMarker = new(); + } + TimelineInfo timelineInfo; + GCHandle timelineHandle; + + EVENT_CALLBACK beatCallback; + + private static AudioManager _instance { get; set; } + public static event Action OnNewBGMMarker; + // public static AudioManager instance; + private static EventInstance musicEventInstance; + + + // public access for the Singleton + // and lazy instantiation if not exists + public static AudioManager Instance + { + get + { + // if exists directly return + if (_instance) return _instance; + + // otherwise search it in the scene + _instance = FindObjectOfType(); + + // found it? + if (_instance) return _instance; + + // otherwise create and initialize it + CreateInstance(); + + return _instance; + } + } + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + private static void CreateInstance() + { + // skip if already exists + if (_instance) return; + if (SceneManager.GetActiveScene().name == "BankLoader") return; + InitializeInstance(new GameObject(nameof(AudioManager)).AddComponent()); + } + + private static void InitializeInstance(AudioManager instance) + { + _instance = instance; + DontDestroyOnLoad(_instance.gameObject); + _instance.eventInstances = new List(); + _instance.masterBus = RuntimeManager.GetBus("bus:/"); + _instance.musicBus = RuntimeManager.GetBus("bus:/Music"); + _instance.sfxBus = RuntimeManager.GetBus("bus:/SFX"); + _instance.uiBus = RuntimeManager.GetBus("bus:/UI"); + // _instance.MasterVolume = SaveManager.Instance.systemData.MasterVolume / 100f; + // _instance.SFXVolume = SaveManager.Instance.systemData.SFXVolume / 100f; + // _instance.MusicVolume = SaveManager.Instance.systemData.MusicVolume / 100f; + // _instance.UIVolume = SaveManager.Instance.systemData.UIVolume / 100f; + + } + + private void Awake() + { + if (_instance && _instance != this) + { + Destroy(gameObject); + return; + } + InitializeInstance(this); + } + + public EventInstance CreateInstance(EventReference eventReference) + { + EventInstance eventInstance = RuntimeManager.CreateInstance(eventReference); + eventInstances.Add(eventInstance); + return eventInstance; + } + + private void Update() + { + musicBus.setVolume(MusicVolume); + sfxBus.setVolume(SFXVolume); + uiBus.setVolume(UIVolume); + masterBus.setVolume(MasterVolume); + } + + public static bool IsEventReferenceValid(EventReference eventReference) + { + return eventReference.Guid != nullGuid; + } + public static void PlayOneShot(EventReference eventReference) + { + if (eventReference.Guid != nullGuid) + RuntimeManager.PlayOneShot(eventReference); + else + { + Debug.LogWarning("EventReference is null, ignoring..."); + } + } + public void InitializeMusic(EventReference musicEventReference) + { + if (musicEventReference.Guid == nullGuid) + { + Debug.LogWarning("EventReference is null, ignoring."); + return; + } + musicEventInstance = CreateInstance(musicEventReference); + timelineInfo = new TimelineInfo(); + + // Explicitly create the delegate object and assign it to a member so it doesn't get freed + // by the garbage collected while it's being used + beatCallback = new EVENT_CALLBACK(BeatEventCallback); + + // Pin the class that will store the data modified during the callback + timelineHandle = GCHandle.Alloc(timelineInfo); + // Pass the object through the userdata of the instance + musicEventInstance.setUserData(GCHandle.ToIntPtr(timelineHandle)); + musicEventInstance.setCallback(beatCallback, EVENT_CALLBACK_TYPE.TIMELINE_BEAT | EVENT_CALLBACK_TYPE.TIMELINE_MARKER); + } + + public void SetMusicParameter(string parameter, float value) + { + musicEventInstance.setParameterByName(parameter, value); + } + public void StartMusic() + { + if (!musicEventInstance.isValid()) + { + Debug.LogWarning("Music is not initialized yet, ignoring."); + return; + } + musicEventInstance.start(); + } + + public int GetMusicPosition() + { + musicEventInstance.getTimelinePosition(out int position); + return position; + } + + public void StopSFX() + { + sfxBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE); + } + + public void FadeOutMusic() + { + musicEventInstance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + musicEventInstance.release(); + + } + + public static bool IsPlaying() + { + musicEventInstance.getPlaybackState(out PLAYBACK_STATE state); + return state != PLAYBACK_STATE.STOPPED; + } + + public static bool IsPlaying(EventInstance instance) + { + instance.getPlaybackState(out PLAYBACK_STATE state); + return state != PLAYBACK_STATE.STOPPED; + } + public static void Unpause() + { + musicEventInstance.setPaused(false); + } + + public static void Unpause(EventInstance instance) + { + instance.setPaused(false); + } + + public static void Pause() + { + musicEventInstance.setPaused(true); + } + + public static void Pause(EventInstance instance) + { + instance.setPaused(true); + } + + private void CleanUp() + { + if (eventInstances != null) + { + foreach (EventInstance eventInstance in eventInstances) + { + eventInstance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); + eventInstance.release(); + } + } + + } + + // taken from https://www.fmod.com/docs/2.02/unity/examples-timeline-callbacks.html + [AOT.MonoPInvokeCallback(typeof(EVENT_CALLBACK))] + static FMOD.RESULT BeatEventCallback(EVENT_CALLBACK_TYPE type, IntPtr instancePtr, IntPtr parameterPtr) + { + EventInstance instance = new(instancePtr); + + // Retrieve the user data + FMOD.RESULT result = instance.getUserData(out IntPtr timelineInfoPtr); + if (result != FMOD.RESULT.OK) + { + Debug.LogError("Timeline Callback error: " + result); + } + else if (timelineInfoPtr != IntPtr.Zero) + { + // Get the object to store beat and marker details + GCHandle timelineHandle = GCHandle.FromIntPtr(timelineInfoPtr); + TimelineInfo timelineInfo = (TimelineInfo)timelineHandle.Target; + + switch (type) + { + case EVENT_CALLBACK_TYPE.TIMELINE_MARKER: + { + var parameter = (TIMELINE_MARKER_PROPERTIES)Marshal.PtrToStructure(parameterPtr, typeof(TIMELINE_MARKER_PROPERTIES)); + timelineInfo.LastMarker = parameter.name; + OnNewBGMMarker?.Invoke(parameter.name); + break; + } + case EVENT_CALLBACK_TYPE.DESTROYED: + { + // Now the event has been destroyed, unpin the timeline memory so it can be garbage collected + timelineHandle.Free(); + break; + } + } + } + return FMOD.RESULT.OK; + } + + private void OnDestroy() + { + CleanUp(); + } + +} \ No newline at end of file diff --git a/Assets/_PROJECT/Scripts/Audio/AudioManager.cs.meta b/Assets/_PROJECT/Scripts/Audio/AudioManager.cs.meta new file mode 100644 index 00000000..88cdb7dd --- /dev/null +++ b/Assets/_PROJECT/Scripts/Audio/AudioManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c87d04403eccfb742b177e2556692f35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_PROJECT/Scripts/Audio/FMODEvents.cs b/Assets/_PROJECT/Scripts/Audio/FMODEvents.cs new file mode 100644 index 00000000..9badcb6b --- /dev/null +++ b/Assets/_PROJECT/Scripts/Audio/FMODEvents.cs @@ -0,0 +1,24 @@ +using FMODUnity; +using UnityEngine; + +public class FMODEvents : MonoBehaviour +{ + [field: Header("SFX")] + [field: SerializeField] public EventReference TestSound { get; private set; } + + + [field: Header("UI")] + [field: SerializeField] public EventReference ButtonClick { get; private set; } + [field: SerializeField] public EventReference ButtonSelect { get; private set; } + + public static FMODEvents Instance { get; private set; } + + private void Awake() + { + if (Instance != null) + { + return; + } + Instance = this; + } +} diff --git a/Assets/_PROJECT/Scripts/Audio/FMODEvents.cs.meta b/Assets/_PROJECT/Scripts/Audio/FMODEvents.cs.meta new file mode 100644 index 00000000..64d2c584 --- /dev/null +++ b/Assets/_PROJECT/Scripts/Audio/FMODEvents.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7db9618133cf954a8f3392be7f313b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/.cache/buildrecords/Desktop/Ambience.br b/DeltaVRFMOD/.cache/buildrecords/Desktop/Ambience.br new file mode 100644 index 00000000..bc55e6e0 Binary files /dev/null and b/DeltaVRFMOD/.cache/buildrecords/Desktop/Ambience.br differ diff --git a/DeltaVRFMOD/.cache/buildrecords/Desktop/Master.br b/DeltaVRFMOD/.cache/buildrecords/Desktop/Master.br new file mode 100644 index 00000000..efdcbf12 Binary files /dev/null and b/DeltaVRFMOD/.cache/buildrecords/Desktop/Master.br differ diff --git a/DeltaVRFMOD/.cache/buildrecords/Desktop/SFX.br b/DeltaVRFMOD/.cache/buildrecords/Desktop/SFX.br new file mode 100644 index 00000000..1874fc41 Binary files /dev/null and b/DeltaVRFMOD/.cache/buildrecords/Desktop/SFX.br differ diff --git a/DeltaVRFMOD/.cache/buildrecords/Desktop/UI.br b/DeltaVRFMOD/.cache/buildrecords/Desktop/UI.br new file mode 100644 index 00000000..d3c8f1ee Binary files /dev/null and b/DeltaVRFMOD/.cache/buildrecords/Desktop/UI.br differ diff --git a/DeltaVRFMOD/.cache/buildrecords/Desktop/Voiceovers.br b/DeltaVRFMOD/.cache/buildrecords/Desktop/Voiceovers.br new file mode 100644 index 00000000..accff5dc Binary files /dev/null and b/DeltaVRFMOD/.cache/buildrecords/Desktop/Voiceovers.br differ diff --git a/DeltaVRFMOD/.cache/fsbcache/Desktop/5B9D5F45.fobj b/DeltaVRFMOD/.cache/fsbcache/Desktop/5B9D5F45.fobj new file mode 100644 index 00000000..e5d262ec Binary files /dev/null and b/DeltaVRFMOD/.cache/fsbcache/Desktop/5B9D5F45.fobj differ diff --git a/DeltaVRFMOD/.cache/{26319f11-c1b4-4a17-b759-dc647869c6d0}.pdc b/DeltaVRFMOD/.cache/{26319f11-c1b4-4a17-b759-dc647869c6d0}.pdc new file mode 100644 index 00000000..f6eafd55 Binary files /dev/null and b/DeltaVRFMOD/.cache/{26319f11-c1b4-4a17-b759-dc647869c6d0}.pdc differ diff --git a/DeltaVRFMOD/.cache/{29f6fb51-8034-4aa2-a99c-5da8bb1df69c}.pdc b/DeltaVRFMOD/.cache/{29f6fb51-8034-4aa2-a99c-5da8bb1df69c}.pdc new file mode 100644 index 00000000..150209dc Binary files /dev/null and b/DeltaVRFMOD/.cache/{29f6fb51-8034-4aa2-a99c-5da8bb1df69c}.pdc differ diff --git a/DeltaVRFMOD/.cache/{2b3161f6-e132-48ca-bb2c-ccf9dd0c544f}.pdc b/DeltaVRFMOD/.cache/{2b3161f6-e132-48ca-bb2c-ccf9dd0c544f}.pdc new file mode 100644 index 00000000..59487c23 Binary files /dev/null and b/DeltaVRFMOD/.cache/{2b3161f6-e132-48ca-bb2c-ccf9dd0c544f}.pdc differ diff --git a/DeltaVRFMOD/.cache/{3fb72931-9ce4-4b34-8107-48b93827d00d}.pdc b/DeltaVRFMOD/.cache/{3fb72931-9ce4-4b34-8107-48b93827d00d}.pdc new file mode 100644 index 00000000..0117c3b4 Binary files /dev/null and b/DeltaVRFMOD/.cache/{3fb72931-9ce4-4b34-8107-48b93827d00d}.pdc differ diff --git a/DeltaVRFMOD/.cache/{47a8123e-81fb-4689-986b-8eb75ef0d3f3}.pdc b/DeltaVRFMOD/.cache/{47a8123e-81fb-4689-986b-8eb75ef0d3f3}.pdc new file mode 100644 index 00000000..b366f499 Binary files /dev/null and b/DeltaVRFMOD/.cache/{47a8123e-81fb-4689-986b-8eb75ef0d3f3}.pdc differ diff --git a/DeltaVRFMOD/.cache/{4e9f4162-c020-48d3-90aa-c93f7a4d8b73}.pdc b/DeltaVRFMOD/.cache/{4e9f4162-c020-48d3-90aa-c93f7a4d8b73}.pdc new file mode 100644 index 00000000..0a5da2af Binary files /dev/null and b/DeltaVRFMOD/.cache/{4e9f4162-c020-48d3-90aa-c93f7a4d8b73}.pdc differ diff --git a/DeltaVRFMOD/.cache/{57fca2cf-8680-4984-a89f-12539cc9bdc4}.pdc b/DeltaVRFMOD/.cache/{57fca2cf-8680-4984-a89f-12539cc9bdc4}.pdc new file mode 100644 index 00000000..29341022 Binary files /dev/null and b/DeltaVRFMOD/.cache/{57fca2cf-8680-4984-a89f-12539cc9bdc4}.pdc differ diff --git a/DeltaVRFMOD/.cache/{5dbb0efd-7f4d-4aa7-b6c5-4c42597ceb9f}.pdc b/DeltaVRFMOD/.cache/{5dbb0efd-7f4d-4aa7-b6c5-4c42597ceb9f}.pdc new file mode 100644 index 00000000..04a34c3e Binary files /dev/null and b/DeltaVRFMOD/.cache/{5dbb0efd-7f4d-4aa7-b6c5-4c42597ceb9f}.pdc differ diff --git a/DeltaVRFMOD/.cache/{68049f79-4a3e-48c1-88c9-b19082a26534}.pdc b/DeltaVRFMOD/.cache/{68049f79-4a3e-48c1-88c9-b19082a26534}.pdc new file mode 100644 index 00000000..be7d8b31 Binary files /dev/null and b/DeltaVRFMOD/.cache/{68049f79-4a3e-48c1-88c9-b19082a26534}.pdc differ diff --git a/DeltaVRFMOD/.cache/{719b6a8d-d0d5-4c6f-b2f5-f3713acff543}.pdc b/DeltaVRFMOD/.cache/{719b6a8d-d0d5-4c6f-b2f5-f3713acff543}.pdc new file mode 100644 index 00000000..6a4cddf9 Binary files /dev/null and b/DeltaVRFMOD/.cache/{719b6a8d-d0d5-4c6f-b2f5-f3713acff543}.pdc differ diff --git a/DeltaVRFMOD/.cache/{96a556a3-d086-40b0-aa07-991f8b6d0688}.pdc b/DeltaVRFMOD/.cache/{96a556a3-d086-40b0-aa07-991f8b6d0688}.pdc new file mode 100644 index 00000000..ee77c979 Binary files /dev/null and b/DeltaVRFMOD/.cache/{96a556a3-d086-40b0-aa07-991f8b6d0688}.pdc differ diff --git a/DeltaVRFMOD/.cache/{9e96b3a2-2ac7-4a0b-9663-f39b600a5b52}.pdc b/DeltaVRFMOD/.cache/{9e96b3a2-2ac7-4a0b-9663-f39b600a5b52}.pdc new file mode 100644 index 00000000..65fd3c37 Binary files /dev/null and b/DeltaVRFMOD/.cache/{9e96b3a2-2ac7-4a0b-9663-f39b600a5b52}.pdc differ diff --git a/DeltaVRFMOD/.cache/{ac76186e-4b86-4168-9573-a3517e8d0108}.pdc b/DeltaVRFMOD/.cache/{ac76186e-4b86-4168-9573-a3517e8d0108}.pdc new file mode 100644 index 00000000..5b6268d2 Binary files /dev/null and b/DeltaVRFMOD/.cache/{ac76186e-4b86-4168-9573-a3517e8d0108}.pdc differ diff --git a/DeltaVRFMOD/.cache/{ae02bd28-010d-4b08-afee-694a96f9d8da}.pdc b/DeltaVRFMOD/.cache/{ae02bd28-010d-4b08-afee-694a96f9d8da}.pdc new file mode 100644 index 00000000..6093e7b8 Binary files /dev/null and b/DeltaVRFMOD/.cache/{ae02bd28-010d-4b08-afee-694a96f9d8da}.pdc differ diff --git a/DeltaVRFMOD/.cache/{b572178e-26ac-4982-a27d-0c07ffa6ebd1}.pdc b/DeltaVRFMOD/.cache/{b572178e-26ac-4982-a27d-0c07ffa6ebd1}.pdc new file mode 100644 index 00000000..6a4cddf9 Binary files /dev/null and b/DeltaVRFMOD/.cache/{b572178e-26ac-4982-a27d-0c07ffa6ebd1}.pdc differ diff --git a/DeltaVRFMOD/.cache/{d40d142a-3f17-49b2-8eb8-6759b4b58997}.pdc b/DeltaVRFMOD/.cache/{d40d142a-3f17-49b2-8eb8-6759b4b58997}.pdc new file mode 100644 index 00000000..81a343ca Binary files /dev/null and b/DeltaVRFMOD/.cache/{d40d142a-3f17-49b2-8eb8-6759b4b58997}.pdc differ diff --git a/DeltaVRFMOD/.cache/{d7141960-1dbc-45af-b4c5-0e6f19d64758}.pdc b/DeltaVRFMOD/.cache/{d7141960-1dbc-45af-b4c5-0e6f19d64758}.pdc new file mode 100644 index 00000000..1860b1cc Binary files /dev/null and b/DeltaVRFMOD/.cache/{d7141960-1dbc-45af-b4c5-0e6f19d64758}.pdc differ diff --git a/DeltaVRFMOD/.cache/{daaab064-7023-4210-8707-b33201a917ee}.pdc b/DeltaVRFMOD/.cache/{daaab064-7023-4210-8707-b33201a917ee}.pdc new file mode 100644 index 00000000..0ed403d7 Binary files /dev/null and b/DeltaVRFMOD/.cache/{daaab064-7023-4210-8707-b33201a917ee}.pdc differ diff --git a/DeltaVRFMOD/.cache/{deb6cafe-72a0-41c5-ba23-1c0cc3a4c171}.pdc b/DeltaVRFMOD/.cache/{deb6cafe-72a0-41c5-ba23-1c0cc3a4c171}.pdc new file mode 100644 index 00000000..387211bf Binary files /dev/null and b/DeltaVRFMOD/.cache/{deb6cafe-72a0-41c5-ba23-1c0cc3a4c171}.pdc differ diff --git a/DeltaVRFMOD/.cache/{e5c8c7bf-afb1-4055-a1b0-a2c3f583f42c}.pdc b/DeltaVRFMOD/.cache/{e5c8c7bf-afb1-4055-a1b0-a2c3f583f42c}.pdc new file mode 100644 index 00000000..5e75ef94 Binary files /dev/null and b/DeltaVRFMOD/.cache/{e5c8c7bf-afb1-4055-a1b0-a2c3f583f42c}.pdc differ diff --git a/DeltaVRFMOD/.cache/{ef5c5feb-933a-4b36-9090-c6b9b1c920c6}.pdc b/DeltaVRFMOD/.cache/{ef5c5feb-933a-4b36-9090-c6b9b1c920c6}.pdc new file mode 100644 index 00000000..de1ca4f7 Binary files /dev/null and b/DeltaVRFMOD/.cache/{ef5c5feb-933a-4b36-9090-c6b9b1c920c6}.pdc differ diff --git a/DeltaVRFMOD/.cache/{f2e22545-34e4-4bbd-b5f8-a1f1c19855ec}.pdc b/DeltaVRFMOD/.cache/{f2e22545-34e4-4bbd-b5f8-a1f1c19855ec}.pdc new file mode 100644 index 00000000..1860b1cc Binary files /dev/null and b/DeltaVRFMOD/.cache/{f2e22545-34e4-4bbd-b5f8-a1f1c19855ec}.pdc differ diff --git a/DeltaVRFMOD/.cache/{f77f2e4c-c18d-4a98-beb1-90163d31825e}.pdc b/DeltaVRFMOD/.cache/{f77f2e4c-c18d-4a98-beb1-90163d31825e}.pdc new file mode 100644 index 00000000..de1ca4f7 Binary files /dev/null and b/DeltaVRFMOD/.cache/{f77f2e4c-c18d-4a98-beb1-90163d31825e}.pdc differ diff --git a/DeltaVRFMOD/.cache/{fa2fdeca-a8e3-4afe-b27a-fa141234805b}.pdc b/DeltaVRFMOD/.cache/{fa2fdeca-a8e3-4afe-b27a-fa141234805b}.pdc new file mode 100644 index 00000000..031aba01 Binary files /dev/null and b/DeltaVRFMOD/.cache/{fa2fdeca-a8e3-4afe-b27a-fa141234805b}.pdc differ diff --git a/DeltaVRFMOD/.cache/{fe3d1b00-0d47-4fa0-bba4-570be327dd84}.pdc b/DeltaVRFMOD/.cache/{fe3d1b00-0d47-4fa0-bba4-570be327dd84}.pdc new file mode 100644 index 00000000..acbc457c Binary files /dev/null and b/DeltaVRFMOD/.cache/{fe3d1b00-0d47-4fa0-bba4-570be327dd84}.pdc differ diff --git a/DeltaVRFMOD/Assets/Imported_Ambiences/Portal/122972__zimbot__portal_continuous_rumble.wav b/DeltaVRFMOD/Assets/Imported_Ambiences/Portal/122972__zimbot__portal_continuous_rumble.wav new file mode 100644 index 00000000..b4a73284 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_Ambiences/Portal/122972__zimbot__portal_continuous_rumble.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2b593a2944bcf45e5c9b58c89015807623fa56928c426b50441b1a21853f008 +size 2487648 diff --git a/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/248217__jameswrowles__hum1.wav b/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/248217__jameswrowles__hum1.wav new file mode 100644 index 00000000..e76fe8b5 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/248217__jameswrowles__hum1.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c6366024c77e2155f84dd8d9986ba834f756c6128a3fd617dcf75b4b4151c68 +size 5144722 diff --git a/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/646682__sounddesignforyou__server-room-ambience.wav b/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/646682__sounddesignforyou__server-room-ambience.wav new file mode 100644 index 00000000..aff28607 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/646682__sounddesignforyou__server-room-ambience.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cea42a9134cf264853b6d565faa71e95fd5e5b592c1c73b9ebef8b945486ab9 +size 17371802 diff --git a/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/Server room hum.mp3 b/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/Server room hum.mp3 new file mode 100644 index 00000000..33ef2b96 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_Ambiences/Server_room/Server room hum.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4df5db895d6db935d511e0d91700caedd231d087cb2810af539344becb320ffd +size 761976 diff --git a/DeltaVRFMOD/Assets/Imported_Ambiences/UFOs/209366__speedenza__spaceships-passing.mp3 b/DeltaVRFMOD/Assets/Imported_Ambiences/UFOs/209366__speedenza__spaceships-passing.mp3 new file mode 100644 index 00000000..507ab080 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_Ambiences/UFOs/209366__speedenza__spaceships-passing.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30c13d8606f3da84d8886c8b79c9e8dfaaedc77bd96fcdadb45805991961d8e5 +size 4109208 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/14371__pfujimoto__tire-rolling.wav b/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/14371__pfujimoto__tire-rolling.wav new file mode 100644 index 00000000..abc16095 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/14371__pfujimoto__tire-rolling.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fcc22c325efcbd42571807d3045ccbc20d97379c1a82f330856563f66b70ed3 +size 4860454 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/705385__chungus43a__car-horn-alarm.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/705385__chungus43a__car-horn-alarm.mp3 new file mode 100644 index 00000000..1afec328 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/705385__chungus43a__car-horn-alarm.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13dfa59300aacc775e9a782613f50f7bb36a57700c547065af8d04efb6409e19 +size 148308 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/Bolt stop sound.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/Bolt stop sound.mp3 new file mode 100644 index 00000000..b96cd5ce --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Bolt_Car/Bolt stop sound.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab5014dea9652d38e6266d4c482137c3df4c95d22097488d9dc1f6b5ba166c06 +size 62392 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 1.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 1.mp3 new file mode 100644 index 00000000..57fdbf60 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 1.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe985ab99ba2c4fe4f3bd5eb340cee075ab9ec3fc8a466035869ae97276725af +size 63893 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 2.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 2.mp3 new file mode 100644 index 00000000..ff57e12e --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 2.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c78086ced232a023c93c5c14a33c523e3c101daacb88a24026c80cbfc2b6e9b +size 65246 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 3.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 3.mp3 new file mode 100644 index 00000000..1b4c1325 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Doors closing/Lift doors close 3.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96e3c96e2c170de7c02f05114fb33c2ac940838af7d6a2526f00bc4e0adcf075 +size 64281 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_arrival/Lift arrival beep.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_arrival/Lift arrival beep.mp3 new file mode 100644 index 00000000..bf16e488 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_arrival/Lift arrival beep.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af5ebed5416ee36fa6e3f2c353881df6791c1832cda7b900f6d91b01775020ca +size 19693 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 1.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 1.mp3 new file mode 100644 index 00000000..357c703e --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 1.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c32a5c0e96435118aae3eb72944474b3faf6553696d4c7566cf736ca80651c75 +size 46464 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 2.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 2.mp3 new file mode 100644 index 00000000..c9261664 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 2.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a83de232d7544655f9c63de9a4b69cdc7ba0a7836577a741c577c7eedbe2f915 +size 46568 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 3.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 3.mp3 new file mode 100644 index 00000000..3d0ca568 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 3.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:935bb20e56bd55b4ec0177bc115aa8a9241aeea696cce38a27b0e7e7c0dc0f4e +size 48232 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 1.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 1.mp3 new file mode 100644 index 00000000..6d42a549 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 1.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d76ed99b940795d6edf3565cb174664d9731d06555b1a15f2b22c3df3b36080 +size 69527 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 2.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 2.mp3 new file mode 100644 index 00000000..9f5c7424 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 2.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b8c105e29c6150270a3b90f0166c7c027d957980c13050a3cdbb17234ddd892 +size 69369 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 3.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 3.mp3 new file mode 100644 index 00000000..27959277 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 3.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58f279c5da13fb41f98d236d406991659fc18e885cf07040166e8fdf7865a496 +size 69733 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 4.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 4.mp3 new file mode 100644 index 00000000..563a91b4 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Elevator/Elevator_movement/Lift moving 4.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:046ce3b83421a58e0dc7c262c253993a1170b8d5f9e0b1992aa31a98367e6ed5 +size 67851 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit01.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit01.wav new file mode 100644 index 00000000..98256d62 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit01.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba3ee09e6cbd36be0888a826d5783cfde0ed1142c53dd64ec2d6f5cab91e7f43 +size 70914 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit01.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit01.wav.meta new file mode 100644 index 00000000..9284370b --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit01.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 74068c08db651d34f81de9affa61f55d +timeCreated: 1436565697 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit02.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit02.wav new file mode 100644 index 00000000..c68f12d9 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit02.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49927365ebe39a9d6883ef6d392462c43bb4b011ca07dbfb303b32b0b976690a +size 88320 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit02.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit02.wav.meta new file mode 100644 index 00000000..3982cdbc --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit02.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 0e220b97baa73db4fab6fba879e1b024 +timeCreated: 1436565693 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit03.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit03.wav new file mode 100644 index 00000000..bf5f8424 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit03.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23fa64e19e4b671550ce2bc842f2a299f2c6508d25c21a16932477aed3f150c0 +size 88320 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit03.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit03.wav.meta new file mode 100644 index 00000000..2e3a0eb9 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit03.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: adaa56b2d3d8ca548a8467326825e514 +timeCreated: 1436565698 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit04.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit04.wav new file mode 100644 index 00000000..5f21f135 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit04.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1eca0c7343874c46023924d72ba1e9aab3cab20a75df364b395d9642d9327f42 +size 88320 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit04.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit04.wav.meta new file mode 100644 index 00000000..e9ac16b3 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit04.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: cef9a0102c9fe0c4fad4ebcf9ec72a45 +timeCreated: 1436565700 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit05.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit05.wav new file mode 100644 index 00000000..650fbf95 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit05.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ba0bde2362d9ef4ac9880c035c5a73d045911829aad3d8b9062fb28ecfe9179 +size 102924 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit05.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit05.wav.meta new file mode 100644 index 00000000..27c85afb --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit05.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: beefd4b7702d5874994c17328dc55b24 +timeCreated: 1436565699 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit06.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit06.wav new file mode 100644 index 00000000..286d8a38 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit06.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc9270e09adf42573e8c1c0ead04e3f2703ff760c6603f28dfeed3a5d60a8f12 +size 65204 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit06.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit06.wav.meta new file mode 100644 index 00000000..329e4154 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowHit06.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 6e984feb46a04284e8c6ce4ebfd791d0 +timeCreated: 1436565697 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock01.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock01.wav new file mode 100644 index 00000000..374a7bbd --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock01.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b7a8f25cb04fdb24ec527dc598dd3eaa84c981779b0d81138f25b2680be7e20 +size 46954 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock01.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock01.wav.meta new file mode 100644 index 00000000..54e57aa3 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock01.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 554ae4ff7aa47c0478d95d78e6a9be6b +timeCreated: 1436565696 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock02.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock02.wav new file mode 100644 index 00000000..a5aac7d1 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock02.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67ee6d8afc56cad77b972b5a98f7df990e0f89e65ae79dabe2281aeb2b4e5dee +size 55304 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock02.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock02.wav.meta new file mode 100644 index 00000000..4c017c63 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock02.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: dde0cb3ddafcf014a8c42e805de893e8 +timeCreated: 1436565701 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock03.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock03.wav new file mode 100644 index 00000000..6d2d9295 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock03.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9407319ae0a27a21b59ecdd557b406dabb05a198cde59b571d3bcd24199d61c5 +size 18500 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock03.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock03.wav.meta new file mode 100644 index 00000000..e7d5d7e4 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock03.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 36f326ccef0fe5546befe26be5ba337f +timeCreated: 1436565695 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock04.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock04.wav new file mode 100644 index 00000000..c9156d2f --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock04.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:197fe903ab9f5ddca71c82f97e6914072b0e0f7cd2b0de15fa794645d3a2e713 +size 56492 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock04.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock04.wav.meta new file mode 100644 index 00000000..e5888cd2 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock04.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: d5aa741aac337e14398adda80505bf9c +timeCreated: 1436565700 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock05.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock05.wav new file mode 100644 index 00000000..ad3e3234 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock05.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa14d43f539bfa521ddbfcf54f565253d034076f5cf3fbb036638a1fe5ccf66c +size 69020 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock05.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock05.wav.meta new file mode 100644 index 00000000..4e8fad94 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock05.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 1dfef04d7ab9ced4093c828025f5bf06 +timeCreated: 1436565694 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock06.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock06.wav new file mode 100644 index 00000000..e71d3784 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock06.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c105ff41b3aaff2bcf46f17594b311ab8f84e9d1a18595510e559518a7c6955d +size 25204 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock06.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock06.wav.meta new file mode 100644 index 00000000..7a60aba0 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock06.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: dd90b53139ec2fb4697f0cf3dceac679 +timeCreated: 1436565700 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock07.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock07.wav new file mode 100644 index 00000000..ad463bd2 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock07.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6da36ef7eb3a02cf13a7086511fa5fce7b841b8652d08f54580e82aaa1474ada +size 42690 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock07.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock07.wav.meta new file mode 100644 index 00000000..942dd3db --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock07.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 0d18ca862d5d9b743b42348751798528 +timeCreated: 1436565693 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock08.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock08.wav new file mode 100644 index 00000000..833bbdba --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock08.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:750644cba8fc0ae8695d2559cda9b498605827a1e96a23da117259c7f4561bd0 +size 67062 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock08.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock08.wav.meta new file mode 100644 index 00000000..2c2e57ee --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock08.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 6ad90a1b9664a154592fabedc7cef551 +timeCreated: 1436565697 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock09.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock09.wav new file mode 100644 index 00000000..01600b1c --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock09.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdedff2fd301d2419719b8d95f300cec8764398c3207a86f05ef8237c101d4c8 +size 78556 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock09.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock09.wav.meta new file mode 100644 index 00000000..ed99a448 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock09.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 8f094810949516a41a720a40a87d29cc +timeCreated: 1436565697 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock10.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock10.wav new file mode 100644 index 00000000..7d15a741 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock10.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d172fbdbba103b23eaf05fbde500a4f47b496099dbaa8c13478986b7827af02 +size 27446 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock10.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock10.wav.meta new file mode 100644 index 00000000..70053f19 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock10.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 37b6eb5cae1aaba4086f32bccf0cb47f +timeCreated: 1436565695 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock11.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock11.wav new file mode 100644 index 00000000..e0f98049 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock11.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b90e69d5e622d389a5cf6979179d59be7479f8902ed542b63005ad8cf624b70a +size 39994 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock11.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock11.wav.meta new file mode 100644 index 00000000..1abfd2ae --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock11.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 4fee3982c922af44babfca8a11dffaca +timeCreated: 1436565696 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock12.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock12.wav new file mode 100644 index 00000000..d981e0c3 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock12.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c491bf4ae30c1d1d3231c7574eae540999a5a1d7926587afee4ffb63fd01f3b +size 45068 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock12.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock12.wav.meta new file mode 100644 index 00000000..c6240dfa --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock12.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: dfd9b0fa043e3fc43821c159432a045c +timeCreated: 1436565701 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock13.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock13.wav new file mode 100644 index 00000000..9b90266b --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock13.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:021dd851f96f39d98ebeeb994a62c3af3ecd38dfc100c8e226a08b3fda2f119f +size 24796 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock13.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock13.wav.meta new file mode 100644 index 00000000..b30df858 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock13.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 6a2a42a4396b3ec4fbe844a811b77445 +timeCreated: 1436565696 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock14.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock14.wav new file mode 100644 index 00000000..f908861d --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock14.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b59163dea0f5bfc74a2f38a227be2c65bba380d5ccb6c803b2159e91da7260f +size 24058 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock14.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock14.wav.meta new file mode 100644 index 00000000..f61d4167 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock14.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: ab9d0c5c3fa27b34685e9b70737e281a +timeCreated: 1436565698 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock15.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock15.wav new file mode 100644 index 00000000..e166679d --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock15.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24da7633390b67dd66a5a91cef2fadcbef5f44a864c6839fc3931ecfb9c557db +size 28382 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock15.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock15.wav.meta new file mode 100644 index 00000000..99d5be00 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock15.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: f6870f0d62f5a624aabbd4e3e7bff65f +timeCreated: 1436565701 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock16.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock16.wav new file mode 100644 index 00000000..4ce4ac64 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock16.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd20a324cff523be8dbe0e20112a2fc61d5d48621525c7dc4a70b58c07a6987f +size 35614 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock16.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock16.wav.meta new file mode 100644 index 00000000..978905fe --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock16.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 3bad6fb5cb07dd44b88e0e1857e222be +timeCreated: 1436565695 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock17.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock17.wav new file mode 100644 index 00000000..12327ae5 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock17.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4dcf4723a3eb5219a78d0ca320b780fcd0b508fdce75334fc8045a11348cc96 +size 36024 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock17.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock17.wav.meta new file mode 100644 index 00000000..cf5d96bc --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowNock17.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: ece81cacdab36d745962207a515820a1 +timeCreated: 1436565701 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease01.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease01.wav new file mode 100644 index 00000000..e0159380 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease01.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd612f911146c515637ef95f0d7898570d7a45c63c624635c3cbab4f6aa80950 +size 112854 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease01.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease01.wav.meta new file mode 100644 index 00000000..0352d7d2 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease01.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 5dea26c1298d78149af149b8bd73ff63 +timeCreated: 1436565696 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease02.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease02.wav new file mode 100644 index 00000000..6c5526ce --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease02.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78a4df648cc74ab182cf6521327b1df2c793d9510cb797c7113b1e79bbacfd58 +size 79962 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease02.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease02.wav.meta new file mode 100644 index 00000000..13c372ae --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease02.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: f9d368eac27f70740bed52d36e0070d8 +timeCreated: 1436565702 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease03.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease03.wav new file mode 100644 index 00000000..51de012f --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease03.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a56dccefa44d87641e624445d90ad1d0c7f455e376bf40c25ac359326c8e38a +size 117502 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease03.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease03.wav.meta new file mode 100644 index 00000000..0a16889c --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease03.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: c4212c0047b94924e8982fea80fb6547 +timeCreated: 1436565699 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease04.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease04.wav new file mode 100644 index 00000000..8252e70b --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease04.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79081eec8a064bd2762b9bfd0d3d613374f3189ab001878879ec2f97102b6d47 +size 132772 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease04.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease04.wav.meta new file mode 100644 index 00000000..e8cff066 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease04.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 220813dc74ddc714fa8b1db1e6416e27 +timeCreated: 1436565694 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease05.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease05.wav new file mode 100644 index 00000000..bf5ad129 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease05.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0604d658b0fff641be409d7f8e2254909545ec75f1fc0d8b30f1b26ac027b1f2 +size 156292 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease05.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease05.wav.meta new file mode 100644 index 00000000..ff49f256 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease05.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 0e4ff6f209abadf45b1c2403b1382cdf +timeCreated: 1436565693 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease06.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease06.wav new file mode 100644 index 00000000..8705bdb1 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease06.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcbf7f5b4360f7be45826ee33aed80f9b3da672949449d50cfbbada6de386495 +size 113542 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease06.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease06.wav.meta new file mode 100644 index 00000000..ba1f49c9 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease06.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 0e1c54b10ce72f640a29eecbfced2363 +timeCreated: 1436565693 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease07.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease07.wav new file mode 100644 index 00000000..4dabecbe --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease07.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12b541e331bc612c0fb51b23b257c30aef6996e29d6af9d46cc6b8ffdcf0a72a +size 85118 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease07.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease07.wav.meta new file mode 100644 index 00000000..ff97aa45 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease07.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 0858be1afe7ac384698e357be00d670f +timeCreated: 1436565692 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease08.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease08.wav new file mode 100644 index 00000000..400d79e3 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease08.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bb9dab76599aaa6db0b03eecd7b57138213cf4712900d06656b2e60f0dbeb5e +size 118882 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease08.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease08.wav.meta new file mode 100644 index 00000000..cbf4b805 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease08.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 14d8c2eed68260f4d82a70201f2f19eb +timeCreated: 1436565694 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease09.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease09.wav new file mode 100644 index 00000000..e35e8a58 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease09.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7e95e34e723c3b772b499f4b2daa18aa782210f8a9d7e7dc581e9b77c9b143c +size 135528 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease09.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease09.wav.meta new file mode 100644 index 00000000..ee287cd2 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/ArrowRelease09.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: c2b473f54caf2504ba276643282bc0ab +timeCreated: 1436565699 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack01.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack01.wav new file mode 100644 index 00000000..4792e0bd --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack01.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:018969400d36f794f638ba31a2267a44a09264e764857e7f99e9644bbd8d8ee0 +size 92240 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack01.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack01.wav.meta new file mode 100644 index 00000000..a62d1761 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack01.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 51747ad9fd4c5564e873dbae5171e257 +timeCreated: 1436565696 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack02.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack02.wav new file mode 100644 index 00000000..ab7b0e12 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack02.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:709d2fd0342503a827ce5676786f9f23b12103145ea25b688d08b13b974bc16d +size 48962 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack02.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack02.wav.meta new file mode 100644 index 00000000..45ce9e74 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack02.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: bb1994a9358f0dc4782fe7535a9b384c +timeCreated: 1436565699 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack03.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack03.wav new file mode 100644 index 00000000..9fbc6cdc --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack03.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d221add6f82085180d57218cf8fc071f685a3a6dd29216a355bae33c3eaec25 +size 70602 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack03.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack03.wav.meta new file mode 100644 index 00000000..c2476897 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack03.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 1958d9dc4683f204793b607c688da2d7 +timeCreated: 1436565694 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack04.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack04.wav new file mode 100644 index 00000000..95dd465d --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack04.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c31ba209383129ad4c2825b1b0d357ab221483589a93ce3cabf586adbccc478 +size 68720 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack04.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack04.wav.meta new file mode 100644 index 00000000..11de1aaa --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack04.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 1b7c76f85bf1034498fefaa3ec8e600f +timeCreated: 1436565694 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack05.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack05.wav new file mode 100644 index 00000000..1091292b --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack05.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:827d06d9fa35456b968c4424154144b169b64f81e9439ed76b3c18dcbca7e0e5 +size 70602 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack05.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack05.wav.meta new file mode 100644 index 00000000..c72d223a --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack05.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: d27732ffed6c52840bb268571f66913e +timeCreated: 1436565700 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack06.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack06.wav new file mode 100644 index 00000000..ec2e55b4 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack06.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:324bae1188b4014810e3868e3d78456d435c72e819013a83967a3ea851557f0d +size 76246 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack06.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack06.wav.meta new file mode 100644 index 00000000..fbd036a9 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack06.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: cb68230ab01aab448b476ae3c84ee521 +timeCreated: 1436565700 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack07.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack07.wav new file mode 100644 index 00000000..bac93dd6 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack07.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2547398fd0938af953067031f412538879bd632df02d204f717e110d4082ad42 +size 92240 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack07.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack07.wav.meta new file mode 100644 index 00000000..f0ae1a34 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack07.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: b508660da1369664ea4fe1f9987c2150 +timeCreated: 1436565699 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack08.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack08.wav new file mode 100644 index 00000000..060b2d49 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack08.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a6044f8d17072922fa3e2114eae364e8372fc0e38375e746ac9ccdbfaf49201 +size 55548 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack08.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack08.wav.meta new file mode 100644 index 00000000..092d7913 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack08.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: c424271f5a0b34042978648f19f2da8b +timeCreated: 1436565699 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack09.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack09.wav new file mode 100644 index 00000000..634866a9 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack09.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:557e8782e3a21e690ed29180ec3f8425a557b9ecb9268f1b125ae374fc78c472 +size 119250 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack09.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack09.wav.meta new file mode 100644 index 00000000..7833d3bc --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack09.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: a8aded2ee3b41f04eaad3a7b9f35e37f +timeCreated: 1436565698 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack10.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack10.wav new file mode 100644 index 00000000..752fcf40 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack10.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f56f196d1b0e999a9bcd5bda6ca9776dde2001dad189d54b0f79e77c79f48c6 +size 104552 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack10.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack10.wav.meta new file mode 100644 index 00000000..dee313a8 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack10.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: aa14911b4b4eb894085dfe426f46ba98 +timeCreated: 1436565698 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack11.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack11.wav new file mode 100644 index 00000000..2e7825e4 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack11.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89125c8e955b2b9f1f038865c4bdfa2889098586dd7fa001eadeeca79c0301df +size 95196 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack11.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack11.wav.meta new file mode 100644 index 00000000..15c1a6f3 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack11.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 23932eb1f1528d34786ffa3381cb5922 +timeCreated: 1436565694 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack12.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack12.wav new file mode 100644 index 00000000..d8af47e8 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack12.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb291c7da879945ce26e784b4b8f07c14e29f07f1eb97a4796a62bb9022130b9 +size 128354 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack12.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack12.wav.meta new file mode 100644 index 00000000..9d1a148a --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack12.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 7f632b7ba3e0d004899c46e9d8261c81 +timeCreated: 1436565697 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack13.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack13.wav new file mode 100644 index 00000000..734e5144 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack13.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83a9fb27d94dbe940905268e1b0e81eddf130b3f178bf533804a6ed6b4fb8ba1 +size 100930 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack13.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack13.wav.meta new file mode 100644 index 00000000..e56b03c6 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack13.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 48e7e7e907cb4de4e89ebb5f2ecb5674 +timeCreated: 1454362609 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack14.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack14.wav new file mode 100644 index 00000000..13899dcc --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack14.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6ea02b98aab11964d0ca9b0c1f841342892ea5899ffb098b47cd9a009eab432 +size 85482 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack14.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack14.wav.meta new file mode 100644 index 00000000..c09babb3 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack14.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 5930d7d2e705ea74ca30ee6652eb4571 +timeCreated: 1454362609 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack15.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack15.wav new file mode 100644 index 00000000..e3925c82 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack15.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0becfc5f7bd25875d07102d5c079f737c3f3ed908dedd64346332389d62801ef +size 104998 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack15.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack15.wav.meta new file mode 100644 index 00000000..70cd1163 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack15.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 7b9d6636c126a33489ada91fd402f036 +timeCreated: 1454362609 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack16.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack16.wav new file mode 100644 index 00000000..3e30e03c --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack16.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f3fe9cf3fc971210d0ebc10172beb27f4f1178969b4cdbf318d1bd72d095e9f +size 117244 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack16.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack16.wav.meta new file mode 100644 index 00000000..c70381be --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBack16.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 4d23d5e2668be9f4b893c46b3802077f +timeCreated: 1454362609 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBackclick_01.wav b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBackclick_01.wav new file mode 100644 index 00000000..8cf2eaa3 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBackclick_01.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b630d2ce1eeddd565d57e27339a214999210a96edd4fc379a2589efc0f822891 +size 6778 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBackclick_01.wav.meta b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBackclick_01.wav.meta new file mode 100644 index 00000000..3fa80a0c --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Longbow_oneshots/LongbowPullBackclick_01.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 8a95f5613a17c0f4db5b93318e947568 +timeCreated: 1436565697 +licenseType: Store +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Server_room/Button Push.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Server_room/Button Push.mp3 new file mode 100644 index 00000000..245546ba --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Server_room/Button Push.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16e618e89a9822d9167a70edcf30ba810797d2ccbd1ede3c634c365c58408ed4 +size 11616 diff --git a/DeltaVRFMOD/Assets/Imported_SFX/Server_room/Server alarm sequence sound.mp3 b/DeltaVRFMOD/Assets/Imported_SFX/Server_room/Server alarm sequence sound.mp3 new file mode 100644 index 00000000..4cc06752 --- /dev/null +++ b/DeltaVRFMOD/Assets/Imported_SFX/Server_room/Server alarm sequence sound.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8aa3954c97ef0c84a6b988d77aaceaaa9b561025a210143dc10e0c42a458a9a +size 222972 diff --git a/DeltaVRFMOD/Build/Desktop/Ambience.bank b/DeltaVRFMOD/Build/Desktop/Ambience.bank new file mode 100644 index 00000000..0c2787f2 Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Ambience.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Desktop/Ambience.bank b/DeltaVRFMOD/Build/Desktop/Desktop/Ambience.bank new file mode 100644 index 00000000..a94f2b60 Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Desktop/Ambience.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Desktop/Master.bank b/DeltaVRFMOD/Build/Desktop/Desktop/Master.bank new file mode 100644 index 00000000..4eb2716b Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Desktop/Master.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Desktop/Master.strings.bank b/DeltaVRFMOD/Build/Desktop/Desktop/Master.strings.bank new file mode 100644 index 00000000..ba5a07eb Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Desktop/Master.strings.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Desktop/SFX.bank b/DeltaVRFMOD/Build/Desktop/Desktop/SFX.bank new file mode 100644 index 00000000..ca0026d9 Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Desktop/SFX.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Desktop/UI.bank b/DeltaVRFMOD/Build/Desktop/Desktop/UI.bank new file mode 100644 index 00000000..24624d7d Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Desktop/UI.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Desktop/Voiceovers.bank b/DeltaVRFMOD/Build/Desktop/Desktop/Voiceovers.bank new file mode 100644 index 00000000..91e9d6c8 Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Desktop/Voiceovers.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Master.bank b/DeltaVRFMOD/Build/Desktop/Master.bank new file mode 100644 index 00000000..4eb2716b Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Master.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Master.strings.bank b/DeltaVRFMOD/Build/Desktop/Master.strings.bank new file mode 100644 index 00000000..ba5a07eb Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Master.strings.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/SFX.bank b/DeltaVRFMOD/Build/Desktop/SFX.bank new file mode 100644 index 00000000..712fb706 Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/SFX.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/UI.bank b/DeltaVRFMOD/Build/Desktop/UI.bank new file mode 100644 index 00000000..24624d7d Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/UI.bank differ diff --git a/DeltaVRFMOD/Build/Desktop/Voiceovers.bank b/DeltaVRFMOD/Build/Desktop/Voiceovers.bank new file mode 100644 index 00000000..91e9d6c8 Binary files /dev/null and b/DeltaVRFMOD/Build/Desktop/Voiceovers.bank differ diff --git a/DeltaVRFMOD/DeltaVR.fspro b/DeltaVRFMOD/DeltaVR.fspro new file mode 100644 index 00000000..43c5a80b --- /dev/null +++ b/DeltaVRFMOD/DeltaVR.fspro @@ -0,0 +1,2 @@ + + diff --git a/DeltaVRFMOD/Metadata/Asset/{0df51a24-16fd-45cd-b1d4-eda30e333af6}.xml b/DeltaVRFMOD/Metadata/Asset/{0df51a24-16fd-45cd-b1d4-eda30e333af6}.xml new file mode 100644 index 00000000..8fb0e117 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{0df51a24-16fd-45cd-b1d4-eda30e333af6}.xml @@ -0,0 +1,11 @@ + + + + + New_SFX/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{0fbc34f9-6022-42da-8b3b-f18344a8ea0f}.xml b/DeltaVRFMOD/Metadata/Asset/{0fbc34f9-6022-42da-8b3b-f18344a8ea0f}.xml new file mode 100644 index 00000000..fd6aeb28 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{0fbc34f9-6022-42da-8b3b-f18344a8ea0f}.xml @@ -0,0 +1,4 @@ + + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{1ffe2c88-4a79-45f4-a1aa-be193fc5af1c}.xml b/DeltaVRFMOD/Metadata/Asset/{1ffe2c88-4a79-45f4-a1aa-be193fc5af1c}.xml new file mode 100644 index 00000000..07050c80 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{1ffe2c88-4a79-45f4-a1aa-be193fc5af1c}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{33889214-ceba-4ecf-851b-547a64398fe5}.xml b/DeltaVRFMOD/Metadata/Asset/{33889214-ceba-4ecf-851b-547a64398fe5}.xml new file mode 100644 index 00000000..c7eebff6 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{33889214-ceba-4ecf-851b-547a64398fe5}.xml @@ -0,0 +1,11 @@ + + + + + New_UI/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{3fb10032-ec1b-42ae-ae7e-6fd6d4ab00f1}.xml b/DeltaVRFMOD/Metadata/Asset/{3fb10032-ec1b-42ae-ae7e-6fd6d4ab00f1}.xml new file mode 100644 index 00000000..6e9c2075 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{3fb10032-ec1b-42ae-ae7e-6fd6d4ab00f1}.xml @@ -0,0 +1,11 @@ + + + + + Imported_Ambiences/Portal/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{5a6bc3cc-dd6c-4545-93ee-fcb900bdd0f1}.xml b/DeltaVRFMOD/Metadata/Asset/{5a6bc3cc-dd6c-4545-93ee-fcb900bdd0f1}.xml new file mode 100644 index 00000000..ffcd4fe3 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{5a6bc3cc-dd6c-4545-93ee-fcb900bdd0f1}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Elevator/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{5afc100c-0ddd-42f3-9a32-d519116021ed}.xml b/DeltaVRFMOD/Metadata/Asset/{5afc100c-0ddd-42f3-9a32-d519116021ed}.xml new file mode 100644 index 00000000..80bb14c3 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{5afc100c-0ddd-42f3-9a32-d519116021ed}.xml @@ -0,0 +1,11 @@ + + + + + Imported_Ambiences/Server_room/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{5daa2b44-78ee-4b2f-9233-f26a22be2f89}.xml b/DeltaVRFMOD/Metadata/Asset/{5daa2b44-78ee-4b2f-9233-f26a22be2f89}.xml new file mode 100644 index 00000000..d3b2b47a --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{5daa2b44-78ee-4b2f-9233-f26a22be2f89}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{669f8bec-1d2c-4964-a9af-bfc754b2c0df}.xml b/DeltaVRFMOD/Metadata/Asset/{669f8bec-1d2c-4964-a9af-bfc754b2c0df}.xml new file mode 100644 index 00000000..436e5472 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{669f8bec-1d2c-4964-a9af-bfc754b2c0df}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Server_room/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{77884a05-bf26-4fdf-a697-b88fc36bc157}.xml b/DeltaVRFMOD/Metadata/Asset/{77884a05-bf26-4fdf-a697-b88fc36bc157}.xml new file mode 100644 index 00000000..3b1da2d5 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{77884a05-bf26-4fdf-a697-b88fc36bc157}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Bolt_Car/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{8842dfdd-5b5a-4812-a844-954d543272c2}.xml b/DeltaVRFMOD/Metadata/Asset/{8842dfdd-5b5a-4812-a844-954d543272c2}.xml new file mode 100644 index 00000000..649f59fe --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{8842dfdd-5b5a-4812-a844-954d543272c2}.xml @@ -0,0 +1,11 @@ + + + + + Imported_Ambiences/UFOs/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{b841da18-fefd-486e-9614-e8a42e78ef66}.xml b/DeltaVRFMOD/Metadata/Asset/{b841da18-fefd-486e-9614-e8a42e78ef66}.xml new file mode 100644 index 00000000..27e07b60 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{b841da18-fefd-486e-9614-e8a42e78ef66}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Elevator/Elevator_movement/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{b9c9692a-6a1a-4eed-87f2-1fd13c92cc63}.xml b/DeltaVRFMOD/Metadata/Asset/{b9c9692a-6a1a-4eed-87f2-1fd13c92cc63}.xml new file mode 100644 index 00000000..34493b5d --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{b9c9692a-6a1a-4eed-87f2-1fd13c92cc63}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Elevator/Doors closing/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{bb675ef4-c928-4db5-b092-cf765166943c}.xml b/DeltaVRFMOD/Metadata/Asset/{bb675ef4-c928-4db5-b092-cf765166943c}.xml new file mode 100644 index 00000000..9dca1822 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{bb675ef4-c928-4db5-b092-cf765166943c}.xml @@ -0,0 +1,11 @@ + + + + + New_Ambiences/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{c8c15fe4-639e-4059-8977-4f864dcca18f}.xml b/DeltaVRFMOD/Metadata/Asset/{c8c15fe4-639e-4059-8977-4f864dcca18f}.xml new file mode 100644 index 00000000..d0405199 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{c8c15fe4-639e-4059-8977-4f864dcca18f}.xml @@ -0,0 +1,11 @@ + + + + + Imported_Ambiences/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{cbedb3bf-2acb-47ef-81bc-142e28e3dc6d}.xml b/DeltaVRFMOD/Metadata/Asset/{cbedb3bf-2acb-47ef-81bc-142e28e3dc6d}.xml new file mode 100644 index 00000000..1d9e1209 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{cbedb3bf-2acb-47ef-81bc-142e28e3dc6d}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Elevator/Elevator_arrival/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Asset/{e477e5fd-9bfd-40fd-bd22-37215dc2b5d2}.xml b/DeltaVRFMOD/Metadata/Asset/{e477e5fd-9bfd-40fd-bd22-37215dc2b5d2}.xml new file mode 100644 index 00000000..90752abd --- /dev/null +++ b/DeltaVRFMOD/Metadata/Asset/{e477e5fd-9bfd-40fd-bd22-37215dc2b5d2}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Elevator/Elevator_doors_open/ + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{03f292c7-8c72-40c9-9ebf-c1c530c414cc}.xml b/DeltaVRFMOD/Metadata/AudioFile/{03f292c7-8c72-40c9-9ebf-c1c530c414cc}.xml new file mode 100644 index 00000000..d57fa39d --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{03f292c7-8c72-40c9-9ebf-c1c530c414cc}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock11.wav + + + 44.0999985 + + + 1 + + + 0.45294784580498865 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{049afdf8-fd83-4c95-be65-f0a0e4cd7d1d}.xml b/DeltaVRFMOD/Metadata/AudioFile/{049afdf8-fd83-4c95-be65-f0a0e4cd7d1d}.xml new file mode 100644 index 00000000..ad97d032 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{049afdf8-fd83-4c95-be65-f0a0e4cd7d1d}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBackclick_01.wav + + + 44.0999985 + + + 1 + + + 0.076349206349206347 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{07e10d1d-e216-4f95-84eb-74637dcf8e4d}.xml b/DeltaVRFMOD/Metadata/AudioFile/{07e10d1d-e216-4f95-84eb-74637dcf8e4d}.xml new file mode 100644 index 00000000..6cd66ed4 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{07e10d1d-e216-4f95-84eb-74637dcf8e4d}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock17.wav + + + 44.0999985 + + + 1 + + + 0.40793650793650793 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{0d108476-7705-4e05-a7a9-86770589bc84}.xml b/DeltaVRFMOD/Metadata/AudioFile/{0d108476-7705-4e05-a7a9-86770589bc84}.xml new file mode 100644 index 00000000..0dce79db --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{0d108476-7705-4e05-a7a9-86770589bc84}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack04.wav + + + 44.0999985 + + + 1 + + + 0.77863945578231297 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{167a48a4-c106-4f35-ac62-6b6e20d93a8b}.xml b/DeltaVRFMOD/Metadata/AudioFile/{167a48a4-c106-4f35-ac62-6b6e20d93a8b}.xml new file mode 100644 index 00000000..0ac6c83f --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{167a48a4-c106-4f35-ac62-6b6e20d93a8b}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock07.wav + + + 44.0999985 + + + 1 + + + 0.48351473922902494 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{17aea034-b23b-4371-9fc5-d769415ad957}.xml b/DeltaVRFMOD/Metadata/AudioFile/{17aea034-b23b-4371-9fc5-d769415ad957}.xml new file mode 100644 index 00000000..67e63384 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{17aea034-b23b-4371-9fc5-d769415ad957}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack13.wav + + + 44.0999985 + + + 1 + + + 1.1420181405895691 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{26319f11-c1b4-4a17-b759-dc647869c6d0}.xml b/DeltaVRFMOD/Metadata/AudioFile/{26319f11-c1b4-4a17-b759-dc647869c6d0}.xml new file mode 100644 index 00000000..20874015 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{26319f11-c1b4-4a17-b759-dc647869c6d0}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Doors closing/Lift doors close 1.mp3 + + + 44.0999985 + + + 1 + + + 5.6424489795918369 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{29f6fb51-8034-4aa2-a99c-5da8bb1df69c}.xml b/DeltaVRFMOD/Metadata/AudioFile/{29f6fb51-8034-4aa2-a99c-5da8bb1df69c}.xml new file mode 100644 index 00000000..b3bb807f --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{29f6fb51-8034-4aa2-a99c-5da8bb1df69c}.xml @@ -0,0 +1,23 @@ + + + + + Imported_SFX/Bolt_Car/14371__pfujimoto__tire-rolling.wav + + + true + + + 44.0999985 + + + 2 + + + 27.550453514739228 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{2b3161f6-e132-48ca-bb2c-ccf9dd0c544f}.xml b/DeltaVRFMOD/Metadata/AudioFile/{2b3161f6-e132-48ca-bb2c-ccf9dd0c544f}.xml new file mode 100644 index 00000000..e9c0ba02 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{2b3161f6-e132-48ca-bb2c-ccf9dd0c544f}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Elevator_arrival/Lift arrival beep.mp3 + + + 44.0999985 + + + 1 + + + 1.6718367346938776 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{3092d3fd-32fb-4258-bced-99c794ed38b8}.xml b/DeltaVRFMOD/Metadata/AudioFile/{3092d3fd-32fb-4258-bced-99c794ed38b8}.xml new file mode 100644 index 00000000..b3a7daf9 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{3092d3fd-32fb-4258-bced-99c794ed38b8}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack06.wav + + + 44.0999985 + + + 1 + + + 0.86396825396825394 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{31de0034-c4a6-4889-a3d3-0877f4e1161f}.xml b/DeltaVRFMOD/Metadata/AudioFile/{31de0034-c4a6-4889-a3d3-0877f4e1161f}.xml new file mode 100644 index 00000000..b72f1607 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{31de0034-c4a6-4889-a3d3-0877f4e1161f}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack01.wav + + + 44.0999985 + + + 1 + + + 1.0453061224489797 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{323d8dc1-2e02-41e4-8571-3b8f3096c622}.xml b/DeltaVRFMOD/Metadata/AudioFile/{323d8dc1-2e02-41e4-8571-3b8f3096c622}.xml new file mode 100644 index 00000000..42d67261 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{323d8dc1-2e02-41e4-8571-3b8f3096c622}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack08.wav + + + 44.0999985 + + + 1 + + + 0.62929705215419496 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{37090999-9a2a-4d68-914e-a2b1c27956c2}.xml b/DeltaVRFMOD/Metadata/AudioFile/{37090999-9a2a-4d68-914e-a2b1c27956c2}.xml new file mode 100644 index 00000000..88a2924c --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{37090999-9a2a-4d68-914e-a2b1c27956c2}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease06.wav + + + 44.0999985 + + + 1 + + + 1.2859637188208617 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{3c536993-fa2e-438b-b9bc-63e57a24e8c9}.xml b/DeltaVRFMOD/Metadata/AudioFile/{3c536993-fa2e-438b-b9bc-63e57a24e8c9}.xml new file mode 100644 index 00000000..0f9b90d7 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{3c536993-fa2e-438b-b9bc-63e57a24e8c9}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock13.wav + + + 44.0999985 + + + 1 + + + 0.28063492063492063 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{3fb72931-9ce4-4b34-8107-48b93827d00d}.xml b/DeltaVRFMOD/Metadata/AudioFile/{3fb72931-9ce4-4b34-8107-48b93827d00d}.xml new file mode 100644 index 00000000..a993d67f --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{3fb72931-9ce4-4b34-8107-48b93827d00d}.xml @@ -0,0 +1,23 @@ + + + + + Imported_SFX/Bolt_Car/705385__chungus43a__car-horn-alarm.mp3 + + + true + + + 44.0999985 + + + 1 + + + 12.042448979591837 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{425fdf8a-6c3c-4957-8fdc-2ffbea1ba04d}.xml b/DeltaVRFMOD/Metadata/AudioFile/{425fdf8a-6c3c-4957-8fdc-2ffbea1ba04d}.xml new file mode 100644 index 00000000..eba278f8 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{425fdf8a-6c3c-4957-8fdc-2ffbea1ba04d}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease04.wav + + + 44.0999985 + + + 1 + + + 1.5039909297052154 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{4533e3c2-c81d-40d5-878b-24251314d35a}.xml b/DeltaVRFMOD/Metadata/AudioFile/{4533e3c2-c81d-40d5-878b-24251314d35a}.xml new file mode 100644 index 00000000..1642bdd8 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{4533e3c2-c81d-40d5-878b-24251314d35a}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit02.wav + + + 44.0999985 + + + 1 + + + 1 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{47a8123e-81fb-4689-986b-8eb75ef0d3f3}.xml b/DeltaVRFMOD/Metadata/AudioFile/{47a8123e-81fb-4689-986b-8eb75ef0d3f3}.xml new file mode 100644 index 00000000..3883eeef --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{47a8123e-81fb-4689-986b-8eb75ef0d3f3}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Elevator_movement/Lift moving 1.mp3 + + + 44.0999985 + + + 1 + + + 6.0342857142857147 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{4e9f4162-c020-48d3-90aa-c93f7a4d8b73}.xml b/DeltaVRFMOD/Metadata/AudioFile/{4e9f4162-c020-48d3-90aa-c93f7a4d8b73}.xml new file mode 100644 index 00000000..781c2063 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{4e9f4162-c020-48d3-90aa-c93f7a4d8b73}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Server_room/Button Push.mp3 + + + 48 + + + 2 + + + 0.45600000000000002 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{51837259-833b-45e0-971b-64f1ac3f79a6}.xml b/DeltaVRFMOD/Metadata/AudioFile/{51837259-833b-45e0-971b-64f1ac3f79a6}.xml new file mode 100644 index 00000000..8e6294a5 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{51837259-833b-45e0-971b-64f1ac3f79a6}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit06.wav + + + 44.0999985 + + + 1 + + + 0.73791383219954654 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{56c45e11-84a7-43db-b32d-be56962d0e0e}.xml b/DeltaVRFMOD/Metadata/AudioFile/{56c45e11-84a7-43db-b32d-be56962d0e0e}.xml new file mode 100644 index 00000000..f282a511 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{56c45e11-84a7-43db-b32d-be56962d0e0e}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock02.wav + + + 44.0999985 + + + 1 + + + 0.62653061224489792 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{57fca2cf-8680-4984-a89f-12539cc9bdc4}.xml b/DeltaVRFMOD/Metadata/AudioFile/{57fca2cf-8680-4984-a89f-12539cc9bdc4}.xml new file mode 100644 index 00000000..a7181dbe --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{57fca2cf-8680-4984-a89f-12539cc9bdc4}.xml @@ -0,0 +1,23 @@ + + + + + Imported_Ambiences/Server_room/Server room hum.mp3 + + + true + + + 48 + + + 2 + + + 56.520000000000003 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{5c5f7d53-9cd8-4ef6-ab83-43526ade6ab0}.xml b/DeltaVRFMOD/Metadata/AudioFile/{5c5f7d53-9cd8-4ef6-ab83-43526ade6ab0}.xml new file mode 100644 index 00000000..34140a50 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{5c5f7d53-9cd8-4ef6-ab83-43526ade6ab0}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease03.wav + + + 44.0999985 + + + 1 + + + 1.3308616780045353 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{5c800cbd-914c-470e-9152-e021a297f2b9}.xml b/DeltaVRFMOD/Metadata/AudioFile/{5c800cbd-914c-470e-9152-e021a297f2b9}.xml new file mode 100644 index 00000000..d1016c32 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{5c800cbd-914c-470e-9152-e021a297f2b9}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock14.wav + + + 44.0999985 + + + 1 + + + 0.27226757369614513 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{5dbb0efd-7f4d-4aa7-b6c5-4c42597ceb9f}.xml b/DeltaVRFMOD/Metadata/AudioFile/{5dbb0efd-7f4d-4aa7-b6c5-4c42597ceb9f}.xml new file mode 100644 index 00000000..7724d964 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{5dbb0efd-7f4d-4aa7-b6c5-4c42597ceb9f}.xml @@ -0,0 +1,23 @@ + + + + + Imported_Ambiences/Server_room/646682__sounddesignforyou__server-room-ambience.wav + + + true + + + 48 + + + 2 + + + 60.318604166666667 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{5e1339fd-e174-44f1-92ae-e4eb8b8df5d2}.xml b/DeltaVRFMOD/Metadata/AudioFile/{5e1339fd-e174-44f1-92ae-e4eb8b8df5d2}.xml new file mode 100644 index 00000000..edb4dbb8 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{5e1339fd-e174-44f1-92ae-e4eb8b8df5d2}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack10.wav + + + 44.0999985 + + + 1 + + + 1.1840362811791383 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{60a97d14-b2fa-451f-a040-3e73154ed018}.xml b/DeltaVRFMOD/Metadata/AudioFile/{60a97d14-b2fa-451f-a040-3e73154ed018}.xml new file mode 100644 index 00000000..9d26bf7e --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{60a97d14-b2fa-451f-a040-3e73154ed018}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Doors closing/Lift doors close 3.mp3 + + + 44.0999985 + + + 1 + + + 5.6424489795918369 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{61e976aa-1bc0-4bf3-9d61-2b36a7ee5c18}.xml b/DeltaVRFMOD/Metadata/AudioFile/{61e976aa-1bc0-4bf3-9d61-2b36a7ee5c18}.xml new file mode 100644 index 00000000..a1efbf89 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{61e976aa-1bc0-4bf3-9d61-2b36a7ee5c18}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock12.wav + + + 44.0999985 + + + 1 + + + 0.51047619047619053 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{658a75f2-fbc6-48c1-91f1-195c634398fd}.xml b/DeltaVRFMOD/Metadata/AudioFile/{658a75f2-fbc6-48c1-91f1-195c634398fd}.xml new file mode 100644 index 00000000..cf297d7b --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{658a75f2-fbc6-48c1-91f1-195c634398fd}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock05.wav + + + 44.0999985 + + + 1 + + + 0.78204081632653066 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{68049f79-4a3e-48c1-88c9-b19082a26534}.xml b/DeltaVRFMOD/Metadata/AudioFile/{68049f79-4a3e-48c1-88c9-b19082a26534}.xml new file mode 100644 index 00000000..c601871b --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{68049f79-4a3e-48c1-88c9-b19082a26534}.xml @@ -0,0 +1,23 @@ + + + + + Imported_Ambiences/Server_room/248217__jameswrowles__hum1.wav + + + true + + + 44.0999985 + + + 1 + + + 58.328526077097507 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{719b6a8d-d0d5-4c6f-b2f5-f3713acff543}.xml b/DeltaVRFMOD/Metadata/AudioFile/{719b6a8d-d0d5-4c6f-b2f5-f3713acff543}.xml new file mode 100644 index 00000000..d13e2789 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{719b6a8d-d0d5-4c6f-b2f5-f3713acff543}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 1.mp3 + + + 44.0999985 + + + 1 + + + 4.0228571428571431 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{728acf75-82ef-4019-8fee-5218410639fa}.xml b/DeltaVRFMOD/Metadata/AudioFile/{728acf75-82ef-4019-8fee-5218410639fa}.xml new file mode 100644 index 00000000..90512427 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{728acf75-82ef-4019-8fee-5218410639fa}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit05.wav + + + 44.0999985 + + + 1 + + + 1.1655782312925169 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{789e298b-8f46-4e64-9c23-c6046fab9a5a}.xml b/DeltaVRFMOD/Metadata/AudioFile/{789e298b-8f46-4e64-9c23-c6046fab9a5a}.xml new file mode 100644 index 00000000..fc7530d6 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{789e298b-8f46-4e64-9c23-c6046fab9a5a}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease01.wav + + + 44.0999985 + + + 1 + + + 1.2781632653061223 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{7e6f7df0-644f-49b1-bbae-1fa7914317b0}.xml b/DeltaVRFMOD/Metadata/AudioFile/{7e6f7df0-644f-49b1-bbae-1fa7914317b0}.xml new file mode 100644 index 00000000..68e9f29b --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{7e6f7df0-644f-49b1-bbae-1fa7914317b0}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock15.wav + + + 44.0999985 + + + 1 + + + 0.32129251700680272 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{7eb36daf-eca6-4648-a6cd-f848cf33a536}.xml b/DeltaVRFMOD/Metadata/AudioFile/{7eb36daf-eca6-4648-a6cd-f848cf33a536}.xml new file mode 100644 index 00000000..eb66fa9d --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{7eb36daf-eca6-4648-a6cd-f848cf33a536}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack09.wav + + + 44.0999985 + + + 1 + + + 1.3506802721088436 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{8bbc2846-4e1b-4e07-baf1-a7a7e0e86ef1}.xml b/DeltaVRFMOD/Metadata/AudioFile/{8bbc2846-4e1b-4e07-baf1-a7a7e0e86ef1}.xml new file mode 100644 index 00000000..3f4df813 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{8bbc2846-4e1b-4e07-baf1-a7a7e0e86ef1}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease08.wav + + + 44.0999985 + + + 1 + + + 1.3465079365079364 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{8cf27661-09e3-4586-8409-99181c67e518}.xml b/DeltaVRFMOD/Metadata/AudioFile/{8cf27661-09e3-4586-8409-99181c67e518}.xml new file mode 100644 index 00000000..6feab31a --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{8cf27661-09e3-4586-8409-99181c67e518}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock01.wav + + + 44.0999985 + + + 1 + + + 0.53185941043083895 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{8fa6b0ec-6549-41b0-903d-f4a722cacb32}.xml b/DeltaVRFMOD/Metadata/AudioFile/{8fa6b0ec-6549-41b0-903d-f4a722cacb32}.xml new file mode 100644 index 00000000..8fb5de11 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{8fa6b0ec-6549-41b0-903d-f4a722cacb32}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack03.wav + + + 44.0999985 + + + 1 + + + 0.79997732426303858 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{96a556a3-d086-40b0-aa07-991f8b6d0688}.xml b/DeltaVRFMOD/Metadata/AudioFile/{96a556a3-d086-40b0-aa07-991f8b6d0688}.xml new file mode 100644 index 00000000..56c501a2 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{96a556a3-d086-40b0-aa07-991f8b6d0688}.xml @@ -0,0 +1,23 @@ + + + + + Imported_Ambiences/Portal/122972__zimbot__portal_continuous_rumble.wav + + + true + + + 44.0999985 + + + 2 + + + 14.10047619047619 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{9bdce0d0-8638-4f3e-88a3-f07e1a74a210}.xml b/DeltaVRFMOD/Metadata/AudioFile/{9bdce0d0-8638-4f3e-88a3-f07e1a74a210}.xml new file mode 100644 index 00000000..93a74683 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{9bdce0d0-8638-4f3e-88a3-f07e1a74a210}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease05.wav + + + 44.0999985 + + + 1 + + + 1.770657596371882 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{9e96b3a2-2ac7-4a0b-9663-f39b600a5b52}.xml b/DeltaVRFMOD/Metadata/AudioFile/{9e96b3a2-2ac7-4a0b-9663-f39b600a5b52}.xml new file mode 100644 index 00000000..e74ce085 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{9e96b3a2-2ac7-4a0b-9663-f39b600a5b52}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit03.wav + + + 44.0999985 + + + 1 + + + 1 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{9f2e2302-9675-411f-bce3-f4ba310f53f8}.xml b/DeltaVRFMOD/Metadata/AudioFile/{9f2e2302-9675-411f-bce3-f4ba310f53f8}.xml new file mode 100644 index 00000000..d0a18d96 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{9f2e2302-9675-411f-bce3-f4ba310f53f8}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease09.wav + + + 44.0999985 + + + 1 + + + 1.5352380952380953 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{a2573bb9-079b-4b77-87ee-6eafcf7e8a43}.xml b/DeltaVRFMOD/Metadata/AudioFile/{a2573bb9-079b-4b77-87ee-6eafcf7e8a43}.xml new file mode 100644 index 00000000..0ddce42a --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{a2573bb9-079b-4b77-87ee-6eafcf7e8a43}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack05.wav + + + 44.0999985 + + + 1 + + + 0.79997732426303858 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{a2f27cdc-c37e-4d87-adff-b17cdc6c25af}.xml b/DeltaVRFMOD/Metadata/AudioFile/{a2f27cdc-c37e-4d87-adff-b17cdc6c25af}.xml new file mode 100644 index 00000000..9c4f6f0d --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{a2f27cdc-c37e-4d87-adff-b17cdc6c25af}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock03.wav + + + 44.0999985 + + + 1 + + + 0.2092517006802721 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{ac76186e-4b86-4168-9573-a3517e8d0108}.xml b/DeltaVRFMOD/Metadata/AudioFile/{ac76186e-4b86-4168-9573-a3517e8d0108}.xml new file mode 100644 index 00000000..b0d785dd --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{ac76186e-4b86-4168-9573-a3517e8d0108}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit01.wav + + + 44.0999985 + + + 1 + + + 0.80265306122448976 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{ae02bd28-010d-4b08-afee-694a96f9d8da}.xml b/DeltaVRFMOD/Metadata/AudioFile/{ae02bd28-010d-4b08-afee-694a96f9d8da}.xml new file mode 100644 index 00000000..b6419ac5 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{ae02bd28-010d-4b08-afee-694a96f9d8da}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit04.wav + + + 44.0999985 + + + 1 + + + 1 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{b6140407-1908-4acb-bed1-f91301f56203}.xml b/DeltaVRFMOD/Metadata/AudioFile/{b6140407-1908-4acb-bed1-f91301f56203}.xml new file mode 100644 index 00000000..438cc973 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{b6140407-1908-4acb-bed1-f91301f56203}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack07.wav + + + 44.0999985 + + + 1 + + + 1.0453061224489797 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{b788ce03-2cad-4fce-8d34-d4d61f686d18}.xml b/DeltaVRFMOD/Metadata/AudioFile/{b788ce03-2cad-4fce-8d34-d4d61f686d18}.xml new file mode 100644 index 00000000..fbe4b955 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{b788ce03-2cad-4fce-8d34-d4d61f686d18}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock16.wav + + + 44.0999985 + + + 1 + + + 0.40328798185941045 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{b7e3365a-5ca8-4f22-8754-ee5e298fd396}.xml b/DeltaVRFMOD/Metadata/AudioFile/{b7e3365a-5ca8-4f22-8754-ee5e298fd396}.xml new file mode 100644 index 00000000..938f3047 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{b7e3365a-5ca8-4f22-8754-ee5e298fd396}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease07.wav + + + 44.0999985 + + + 1 + + + 0.96369614512471657 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{b8d2b4b5-c825-410b-b27b-a12c40383965}.xml b/DeltaVRFMOD/Metadata/AudioFile/{b8d2b4b5-c825-410b-b27b-a12c40383965}.xml new file mode 100644 index 00000000..677f2e47 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{b8d2b4b5-c825-410b-b27b-a12c40383965}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack11.wav + + + 44.0999985 + + + 1 + + + 1.0779591836734694 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{bb1cd0ea-3280-42e0-b331-9f62485975b4}.xml b/DeltaVRFMOD/Metadata/AudioFile/{bb1cd0ea-3280-42e0-b331-9f62485975b4}.xml new file mode 100644 index 00000000..7ee80a09 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{bb1cd0ea-3280-42e0-b331-9f62485975b4}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack12.wav + + + 44.0999985 + + + 1 + + + 1.4539002267573695 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{c6c43a5f-c0d2-4dda-8b3e-2aaa300877f0}.xml b/DeltaVRFMOD/Metadata/AudioFile/{c6c43a5f-c0d2-4dda-8b3e-2aaa300877f0}.xml new file mode 100644 index 00000000..cb3b6935 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{c6c43a5f-c0d2-4dda-8b3e-2aaa300877f0}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack02.wav + + + 44.0999985 + + + 1 + + + 0.55462585034013601 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{c7251312-fc6a-4d41-a27e-7e1a7b042bf1}.xml b/DeltaVRFMOD/Metadata/AudioFile/{c7251312-fc6a-4d41-a27e-7e1a7b042bf1}.xml new file mode 100644 index 00000000..24b7df83 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{c7251312-fc6a-4d41-a27e-7e1a7b042bf1}.xml @@ -0,0 +1,23 @@ + + + + + Imported_SFX/Server_room/Server alarm sequence sound.mp3 + + + true + + + 48 + + + 2 + + + 15.6 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{d40d142a-3f17-49b2-8eb8-6759b4b58997}.xml b/DeltaVRFMOD/Metadata/AudioFile/{d40d142a-3f17-49b2-8eb8-6759b4b58997}.xml new file mode 100644 index 00000000..e62731d0 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{d40d142a-3f17-49b2-8eb8-6759b4b58997}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Elevator_movement/Lift moving 3.mp3 + + + 44.0999985 + + + 1 + + + 6.060408163265306 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{d7141960-1dbc-45af-b4c5-0e6f19d64758}.xml b/DeltaVRFMOD/Metadata/AudioFile/{d7141960-1dbc-45af-b4c5-0e6f19d64758}.xml new file mode 100644 index 00000000..790739d0 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{d7141960-1dbc-45af-b4c5-0e6f19d64758}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 3.mp3 + + + 44.0999985 + + + 1 + + + 4.0228571428571431 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{d9a29b5c-64f7-48df-a294-6e49632d52a0}.xml b/DeltaVRFMOD/Metadata/AudioFile/{d9a29b5c-64f7-48df-a294-6e49632d52a0}.xml new file mode 100644 index 00000000..9c5d02c0 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{d9a29b5c-64f7-48df-a294-6e49632d52a0}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock09.wav + + + 44.0999985 + + + 1 + + + 0.89015873015873015 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{daaab064-7023-4210-8707-b33201a917ee}.xml b/DeltaVRFMOD/Metadata/AudioFile/{daaab064-7023-4210-8707-b33201a917ee}.xml new file mode 100644 index 00000000..5a3d0eb3 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{daaab064-7023-4210-8707-b33201a917ee}.xml @@ -0,0 +1,23 @@ + + + + + Imported_Ambiences/UFOs/209366__speedenza__spaceships-passing.mp3 + + + true + + + 44.0999985 + + + 2 + + + 158.14530612244897 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{deb6cafe-72a0-41c5-ba23-1c0cc3a4c171}.xml b/DeltaVRFMOD/Metadata/AudioFile/{deb6cafe-72a0-41c5-ba23-1c0cc3a4c171}.xml new file mode 100644 index 00000000..bcc717ce --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{deb6cafe-72a0-41c5-ba23-1c0cc3a4c171}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Doors closing/Lift doors close 2.mp3 + + + 44.0999985 + + + 1 + + + 5.6424489795918369 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{e16f255a-924f-4f28-921b-58fd1df5b9f4}.xml b/DeltaVRFMOD/Metadata/AudioFile/{e16f255a-924f-4f28-921b-58fd1df5b9f4}.xml new file mode 100644 index 00000000..7ad43bfa --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{e16f255a-924f-4f28-921b-58fd1df5b9f4}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock08.wav + + + 44.0999985 + + + 1 + + + 0.75984126984126987 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{e5c8c7bf-afb1-4055-a1b0-a2c3f583f42c}.xml b/DeltaVRFMOD/Metadata/AudioFile/{e5c8c7bf-afb1-4055-a1b0-a2c3f583f42c}.xml new file mode 100644 index 00000000..6c3642e0 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{e5c8c7bf-afb1-4055-a1b0-a2c3f583f42c}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Bolt_Car/Bolt stop sound.mp3 + + + 48 + + + 2 + + + 3.6240000000000001 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{e667ee2d-cc11-4f84-b67e-edc79e209262}.xml b/DeltaVRFMOD/Metadata/AudioFile/{e667ee2d-cc11-4f84-b67e-edc79e209262}.xml new file mode 100644 index 00000000..57138c02 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{e667ee2d-cc11-4f84-b67e-edc79e209262}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease02.wav + + + 44.0999985 + + + 1 + + + 0.90523809523809529 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{e7273d47-bf76-4df0-b961-7996eed49132}.xml b/DeltaVRFMOD/Metadata/AudioFile/{e7273d47-bf76-4df0-b961-7996eed49132}.xml new file mode 100644 index 00000000..c3544876 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{e7273d47-bf76-4df0-b961-7996eed49132}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack16.wav + + + 44.0999985 + + + 1 + + + 1.3269841269841269 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{e851b9b3-99b3-4242-a1af-5152a4b0338f}.xml b/DeltaVRFMOD/Metadata/AudioFile/{e851b9b3-99b3-4242-a1af-5152a4b0338f}.xml new file mode 100644 index 00000000..f1bcb31d --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{e851b9b3-99b3-4242-a1af-5152a4b0338f}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack14.wav + + + 44.0999985 + + + 1 + + + 0.96687074829931974 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{ed50e416-c544-467f-811e-b40a9e710bee}.xml b/DeltaVRFMOD/Metadata/AudioFile/{ed50e416-c544-467f-811e-b40a9e710bee}.xml new file mode 100644 index 00000000..026d42e0 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{ed50e416-c544-467f-811e-b40a9e710bee}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack15.wav + + + 44.0999985 + + + 1 + + + 1.188140589569161 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{f77f2e4c-c18d-4a98-beb1-90163d31825e}.xml b/DeltaVRFMOD/Metadata/AudioFile/{f77f2e4c-c18d-4a98-beb1-90163d31825e}.xml new file mode 100644 index 00000000..bac06555 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{f77f2e4c-c18d-4a98-beb1-90163d31825e}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Elevator_doors_open/Lift doors open 2.mp3 + + + 44.0999985 + + + 1 + + + 4.0228571428571431 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{f7933d9d-82e3-4fce-8b52-6705f6b9c74e}.xml b/DeltaVRFMOD/Metadata/AudioFile/{f7933d9d-82e3-4fce-8b52-6705f6b9c74e}.xml new file mode 100644 index 00000000..2f6f678e --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{f7933d9d-82e3-4fce-8b52-6705f6b9c74e}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock04.wav + + + 44.0999985 + + + 1 + + + 0.64000000000000001 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{fa2fdeca-a8e3-4afe-b27a-fa141234805b}.xml b/DeltaVRFMOD/Metadata/AudioFile/{fa2fdeca-a8e3-4afe-b27a-fa141234805b}.xml new file mode 100644 index 00000000..c020f293 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{fa2fdeca-a8e3-4afe-b27a-fa141234805b}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Elevator_movement/Lift moving 2.mp3 + + + 44.0999985 + + + 1 + + + 6.0342857142857147 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{fe3d1b00-0d47-4fa0-bba4-570be327dd84}.xml b/DeltaVRFMOD/Metadata/AudioFile/{fe3d1b00-0d47-4fa0-bba4-570be327dd84}.xml new file mode 100644 index 00000000..5431081d --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{fe3d1b00-0d47-4fa0-bba4-570be327dd84}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Elevator/Elevator_movement/Lift moving 4.mp3 + + + 44.0999985 + + + 1 + + + 6.0342857142857147 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{fed33b43-c5ba-4e0e-9566-ac6a9511ebbb}.xml b/DeltaVRFMOD/Metadata/AudioFile/{fed33b43-c5ba-4e0e-9566-ac6a9511ebbb}.xml new file mode 100644 index 00000000..bbc1690d --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{fed33b43-c5ba-4e0e-9566-ac6a9511ebbb}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock06.wav + + + 44.0999985 + + + 1 + + + 0.2852607709750567 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/AudioFile/{ff43e65c-d1f8-4127-8d42-7b6d39b3685e}.xml b/DeltaVRFMOD/Metadata/AudioFile/{ff43e65c-d1f8-4127-8d42-7b6d39b3685e}.xml new file mode 100644 index 00000000..6b52cb84 --- /dev/null +++ b/DeltaVRFMOD/Metadata/AudioFile/{ff43e65c-d1f8-4127-8d42-7b6d39b3685e}.xml @@ -0,0 +1,20 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock10.wav + + + 44.0999985 + + + 1 + + + 0.31068027210884352 + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/Bank/{5ad1d5d3-838f-4dd9-8fbc-71db8367da13}.xml b/DeltaVRFMOD/Metadata/Bank/{5ad1d5d3-838f-4dd9-8fbc-71db8367da13}.xml new file mode 100644 index 00000000..971e661c --- /dev/null +++ b/DeltaVRFMOD/Metadata/Bank/{5ad1d5d3-838f-4dd9-8fbc-71db8367da13}.xml @@ -0,0 +1,14 @@ + + + + + Master + + + true + + + {b2d8e5a6-b2a3-4016-a958-fe70e51f4f68} + + + diff --git a/DeltaVRFMOD/Metadata/Bank/{9d1145b0-e099-4ee4-ab1d-23cc274af901}.xml b/DeltaVRFMOD/Metadata/Bank/{9d1145b0-e099-4ee4-ab1d-23cc274af901}.xml new file mode 100644 index 00000000..c3ece960 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Bank/{9d1145b0-e099-4ee4-ab1d-23cc274af901}.xml @@ -0,0 +1,11 @@ + + + + + SFX + + + {b2d8e5a6-b2a3-4016-a958-fe70e51f4f68} + + + diff --git a/DeltaVRFMOD/Metadata/Bank/{ec80a96c-f205-4a18-87f3-a3c6f162f9ae}.xml b/DeltaVRFMOD/Metadata/Bank/{ec80a96c-f205-4a18-87f3-a3c6f162f9ae}.xml new file mode 100644 index 00000000..6355eef9 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Bank/{ec80a96c-f205-4a18-87f3-a3c6f162f9ae}.xml @@ -0,0 +1,11 @@ + + + + + Voiceovers + + + {b2d8e5a6-b2a3-4016-a958-fe70e51f4f68} + + + diff --git a/DeltaVRFMOD/Metadata/Bank/{f141f2d4-6fa9-465a-a607-941cef3e083a}.xml b/DeltaVRFMOD/Metadata/Bank/{f141f2d4-6fa9-465a-a607-941cef3e083a}.xml new file mode 100644 index 00000000..ff757199 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Bank/{f141f2d4-6fa9-465a-a607-941cef3e083a}.xml @@ -0,0 +1,11 @@ + + + + + Ambience + + + {b2d8e5a6-b2a3-4016-a958-fe70e51f4f68} + + + diff --git a/DeltaVRFMOD/Metadata/Bank/{f7552d31-a573-4497-88a9-a5dcaae9ab02}.xml b/DeltaVRFMOD/Metadata/Bank/{f7552d31-a573-4497-88a9-a5dcaae9ab02}.xml new file mode 100644 index 00000000..273e020f --- /dev/null +++ b/DeltaVRFMOD/Metadata/Bank/{f7552d31-a573-4497-88a9-a5dcaae9ab02}.xml @@ -0,0 +1,11 @@ + + + + + UI + + + {b2d8e5a6-b2a3-4016-a958-fe70e51f4f68} + + + diff --git a/DeltaVRFMOD/Metadata/BankFolder/{b2d8e5a6-b2a3-4016-a958-fe70e51f4f68}.xml b/DeltaVRFMOD/Metadata/BankFolder/{b2d8e5a6-b2a3-4016-a958-fe70e51f4f68}.xml new file mode 100644 index 00000000..1a9120b6 --- /dev/null +++ b/DeltaVRFMOD/Metadata/BankFolder/{b2d8e5a6-b2a3-4016-a958-fe70e51f4f68}.xml @@ -0,0 +1,4 @@ + + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{078d0f30-5898-4901-aad6-8290e14cd961}.xml b/DeltaVRFMOD/Metadata/DataFile/{078d0f30-5898-4901-aad6-8290e14cd961}.xml new file mode 100644 index 00000000..69423c04 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{078d0f30-5898-4901-aad6-8290e14cd961}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock05.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{08aa1e28-2c93-4b63-97bf-8f6ae4f93c35}.xml b/DeltaVRFMOD/Metadata/DataFile/{08aa1e28-2c93-4b63-97bf-8f6ae4f93c35}.xml new file mode 100644 index 00000000..b744c6aa --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{08aa1e28-2c93-4b63-97bf-8f6ae4f93c35}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock14.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{0b377632-da6f-44a8-9eff-f3dc080a1758}.xml b/DeltaVRFMOD/Metadata/DataFile/{0b377632-da6f-44a8-9eff-f3dc080a1758}.xml new file mode 100644 index 00000000..8c68678a --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{0b377632-da6f-44a8-9eff-f3dc080a1758}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack13.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{0df9ab7c-8a92-4fae-8463-0a20ecaf5a67}.xml b/DeltaVRFMOD/Metadata/DataFile/{0df9ab7c-8a92-4fae-8463-0a20ecaf5a67}.xml new file mode 100644 index 00000000..b5c61cd5 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{0df9ab7c-8a92-4fae-8463-0a20ecaf5a67}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock04.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{13af134b-bf33-497d-a923-87ca3bf2d920}.xml b/DeltaVRFMOD/Metadata/DataFile/{13af134b-bf33-497d-a923-87ca3bf2d920}.xml new file mode 100644 index 00000000..2c94555c --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{13af134b-bf33-497d-a923-87ca3bf2d920}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit05.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{1855910d-595e-4e8c-80d9-7c49598d80d2}.xml b/DeltaVRFMOD/Metadata/DataFile/{1855910d-595e-4e8c-80d9-7c49598d80d2}.xml new file mode 100644 index 00000000..f601d2c7 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{1855910d-595e-4e8c-80d9-7c49598d80d2}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack06.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{25e5789d-99b7-4ecb-8624-b1f74455ae73}.xml b/DeltaVRFMOD/Metadata/DataFile/{25e5789d-99b7-4ecb-8624-b1f74455ae73}.xml new file mode 100644 index 00000000..6379e073 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{25e5789d-99b7-4ecb-8624-b1f74455ae73}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock07.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{2cd38a35-9af8-4aed-9d4b-3ab44ace482a}.xml b/DeltaVRFMOD/Metadata/DataFile/{2cd38a35-9af8-4aed-9d4b-3ab44ace482a}.xml new file mode 100644 index 00000000..bde38f51 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{2cd38a35-9af8-4aed-9d4b-3ab44ace482a}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease09.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{30ad106b-bcfa-44cb-8038-f9340fef4a83}.xml b/DeltaVRFMOD/Metadata/DataFile/{30ad106b-bcfa-44cb-8038-f9340fef4a83}.xml new file mode 100644 index 00000000..89ffe731 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{30ad106b-bcfa-44cb-8038-f9340fef4a83}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit06.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{3204dfd0-eef1-4476-9874-8c4389d3a8f8}.xml b/DeltaVRFMOD/Metadata/DataFile/{3204dfd0-eef1-4476-9874-8c4389d3a8f8}.xml new file mode 100644 index 00000000..9e3b9602 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{3204dfd0-eef1-4476-9874-8c4389d3a8f8}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack12.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{325202dc-fc29-4193-b21a-5aa9a065e88f}.xml b/DeltaVRFMOD/Metadata/DataFile/{325202dc-fc29-4193-b21a-5aa9a065e88f}.xml new file mode 100644 index 00000000..be4a805b --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{325202dc-fc29-4193-b21a-5aa9a065e88f}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease06.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{3560c333-aa73-4622-9523-c06cba9ad9b2}.xml b/DeltaVRFMOD/Metadata/DataFile/{3560c333-aa73-4622-9523-c06cba9ad9b2}.xml new file mode 100644 index 00000000..caa80998 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{3560c333-aa73-4622-9523-c06cba9ad9b2}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit01.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{373afda2-bc43-4db5-8046-f281924682bc}.xml b/DeltaVRFMOD/Metadata/DataFile/{373afda2-bc43-4db5-8046-f281924682bc}.xml new file mode 100644 index 00000000..dee3ad4e --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{373afda2-bc43-4db5-8046-f281924682bc}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock11.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{3a84b9b0-d1b4-475b-b670-e289800a4280}.xml b/DeltaVRFMOD/Metadata/DataFile/{3a84b9b0-d1b4-475b-b670-e289800a4280}.xml new file mode 100644 index 00000000..8f7a3de0 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{3a84b9b0-d1b4-475b-b670-e289800a4280}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack16.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{3d007b68-f73b-45dc-8d07-5da9b4f9343c}.xml b/DeltaVRFMOD/Metadata/DataFile/{3d007b68-f73b-45dc-8d07-5da9b4f9343c}.xml new file mode 100644 index 00000000..4e873ca7 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{3d007b68-f73b-45dc-8d07-5da9b4f9343c}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock15.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{3d346ec6-01bf-43d7-af5d-7f0fe2b164e8}.xml b/DeltaVRFMOD/Metadata/DataFile/{3d346ec6-01bf-43d7-af5d-7f0fe2b164e8}.xml new file mode 100644 index 00000000..f202aa42 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{3d346ec6-01bf-43d7-af5d-7f0fe2b164e8}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack04.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{484597bb-01b8-43e0-8e32-80f66806ce97}.xml b/DeltaVRFMOD/Metadata/DataFile/{484597bb-01b8-43e0-8e32-80f66806ce97}.xml new file mode 100644 index 00000000..4b1a88d1 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{484597bb-01b8-43e0-8e32-80f66806ce97}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit02.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{54e6b9c1-68f3-4969-a1be-f795f83c38d7}.xml b/DeltaVRFMOD/Metadata/DataFile/{54e6b9c1-68f3-4969-a1be-f795f83c38d7}.xml new file mode 100644 index 00000000..2f3b7b12 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{54e6b9c1-68f3-4969-a1be-f795f83c38d7}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack02.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{58cfe916-4b23-4b56-b0df-fd95663d6282}.xml b/DeltaVRFMOD/Metadata/DataFile/{58cfe916-4b23-4b56-b0df-fd95663d6282}.xml new file mode 100644 index 00000000..ad812b40 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{58cfe916-4b23-4b56-b0df-fd95663d6282}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease07.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{59cce780-ff51-4547-8d5a-e245d77cbd8d}.xml b/DeltaVRFMOD/Metadata/DataFile/{59cce780-ff51-4547-8d5a-e245d77cbd8d}.xml new file mode 100644 index 00000000..5ea9c906 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{59cce780-ff51-4547-8d5a-e245d77cbd8d}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease08.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{5d97af45-319d-4924-900c-9eefd55a51e4}.xml b/DeltaVRFMOD/Metadata/DataFile/{5d97af45-319d-4924-900c-9eefd55a51e4}.xml new file mode 100644 index 00000000..e206202b --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{5d97af45-319d-4924-900c-9eefd55a51e4}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack07.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{67874dc3-d9eb-4b50-b648-7f2e81d38477}.xml b/DeltaVRFMOD/Metadata/DataFile/{67874dc3-d9eb-4b50-b648-7f2e81d38477}.xml new file mode 100644 index 00000000..9ced4d7b --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{67874dc3-d9eb-4b50-b648-7f2e81d38477}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease04.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{735438cb-7dc9-4e67-a2f0-16e73aa4979a}.xml b/DeltaVRFMOD/Metadata/DataFile/{735438cb-7dc9-4e67-a2f0-16e73aa4979a}.xml new file mode 100644 index 00000000..4642d89c --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{735438cb-7dc9-4e67-a2f0-16e73aa4979a}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock10.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{7a8f7baf-bc40-4bc1-a5a9-1f66cc14c713}.xml b/DeltaVRFMOD/Metadata/DataFile/{7a8f7baf-bc40-4bc1-a5a9-1f66cc14c713}.xml new file mode 100644 index 00000000..80018369 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{7a8f7baf-bc40-4bc1-a5a9-1f66cc14c713}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack10.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{832ac40e-4d11-4f5b-a0e8-a9fe906fe7a1}.xml b/DeltaVRFMOD/Metadata/DataFile/{832ac40e-4d11-4f5b-a0e8-a9fe906fe7a1}.xml new file mode 100644 index 00000000..7fb41013 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{832ac40e-4d11-4f5b-a0e8-a9fe906fe7a1}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack05.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{84643f40-2bb1-42c4-aef6-0568162782f9}.xml b/DeltaVRFMOD/Metadata/DataFile/{84643f40-2bb1-42c4-aef6-0568162782f9}.xml new file mode 100644 index 00000000..aa60432c --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{84643f40-2bb1-42c4-aef6-0568162782f9}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack08.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{8d0387f0-804a-41dd-b732-7914861df3c9}.xml b/DeltaVRFMOD/Metadata/DataFile/{8d0387f0-804a-41dd-b732-7914861df3c9}.xml new file mode 100644 index 00000000..1ceb3754 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{8d0387f0-804a-41dd-b732-7914861df3c9}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit04.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{8e305627-39b8-439f-bc9f-31a01e28f987}.xml b/DeltaVRFMOD/Metadata/DataFile/{8e305627-39b8-439f-bc9f-31a01e28f987}.xml new file mode 100644 index 00000000..27b83f97 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{8e305627-39b8-439f-bc9f-31a01e28f987}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack03.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{93d67cea-d010-4238-b765-c368a81342ab}.xml b/DeltaVRFMOD/Metadata/DataFile/{93d67cea-d010-4238-b765-c368a81342ab}.xml new file mode 100644 index 00000000..86a3ecc9 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{93d67cea-d010-4238-b765-c368a81342ab}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBackclick_01.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{9c5e1ea0-b97f-4f91-bee3-705cb49d02e2}.xml b/DeltaVRFMOD/Metadata/DataFile/{9c5e1ea0-b97f-4f91-bee3-705cb49d02e2}.xml new file mode 100644 index 00000000..1087f539 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{9c5e1ea0-b97f-4f91-bee3-705cb49d02e2}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack09.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{a6a481c6-3b68-41e3-8c39-2a80eb5de371}.xml b/DeltaVRFMOD/Metadata/DataFile/{a6a481c6-3b68-41e3-8c39-2a80eb5de371}.xml new file mode 100644 index 00000000..d5720028 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{a6a481c6-3b68-41e3-8c39-2a80eb5de371}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock03.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{a98fc2dc-c626-4f73-99c3-97f38fb00002}.xml b/DeltaVRFMOD/Metadata/DataFile/{a98fc2dc-c626-4f73-99c3-97f38fb00002}.xml new file mode 100644 index 00000000..234e5da6 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{a98fc2dc-c626-4f73-99c3-97f38fb00002}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack15.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{b57f8c8f-281d-4dcd-9b12-a25748dd383f}.xml b/DeltaVRFMOD/Metadata/DataFile/{b57f8c8f-281d-4dcd-9b12-a25748dd383f}.xml new file mode 100644 index 00000000..8bf59324 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{b57f8c8f-281d-4dcd-9b12-a25748dd383f}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowHit03.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{b5cd9b41-05df-4c4c-8059-8745f9f4efe8}.xml b/DeltaVRFMOD/Metadata/DataFile/{b5cd9b41-05df-4c4c-8059-8745f9f4efe8}.xml new file mode 100644 index 00000000..0411e7dd --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{b5cd9b41-05df-4c4c-8059-8745f9f4efe8}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock02.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{b8887587-2fdb-47f2-b41a-62c86dd960be}.xml b/DeltaVRFMOD/Metadata/DataFile/{b8887587-2fdb-47f2-b41a-62c86dd960be}.xml new file mode 100644 index 00000000..70dc41d7 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{b8887587-2fdb-47f2-b41a-62c86dd960be}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock01.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{becaa627-4c25-486a-a5f9-7ef3ab697158}.xml b/DeltaVRFMOD/Metadata/DataFile/{becaa627-4c25-486a-a5f9-7ef3ab697158}.xml new file mode 100644 index 00000000..eaae84df --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{becaa627-4c25-486a-a5f9-7ef3ab697158}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack01.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{d2210083-7169-4f71-8d5f-baa7dd4d161f}.xml b/DeltaVRFMOD/Metadata/DataFile/{d2210083-7169-4f71-8d5f-baa7dd4d161f}.xml new file mode 100644 index 00000000..a1feda83 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{d2210083-7169-4f71-8d5f-baa7dd4d161f}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease03.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{d5b834e3-e381-4aef-bfc4-dcb67396fe52}.xml b/DeltaVRFMOD/Metadata/DataFile/{d5b834e3-e381-4aef-bfc4-dcb67396fe52}.xml new file mode 100644 index 00000000..deefb1ac --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{d5b834e3-e381-4aef-bfc4-dcb67396fe52}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock12.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{d815e3ce-d14f-43a8-8242-4b7338a206b3}.xml b/DeltaVRFMOD/Metadata/DataFile/{d815e3ce-d14f-43a8-8242-4b7338a206b3}.xml new file mode 100644 index 00000000..91bbe84a --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{d815e3ce-d14f-43a8-8242-4b7338a206b3}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease05.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{d953356f-ea00-41e6-aced-6b9bf000faea}.xml b/DeltaVRFMOD/Metadata/DataFile/{d953356f-ea00-41e6-aced-6b9bf000faea}.xml new file mode 100644 index 00000000..28912562 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{d953356f-ea00-41e6-aced-6b9bf000faea}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock16.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{dda752f0-e44b-40ac-aebd-3083d5f30bec}.xml b/DeltaVRFMOD/Metadata/DataFile/{dda752f0-e44b-40ac-aebd-3083d5f30bec}.xml new file mode 100644 index 00000000..a54c8a49 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{dda752f0-e44b-40ac-aebd-3083d5f30bec}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock08.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{e4c769f7-7137-4f03-afd6-5109f1f26bfa}.xml b/DeltaVRFMOD/Metadata/DataFile/{e4c769f7-7137-4f03-afd6-5109f1f26bfa}.xml new file mode 100644 index 00000000..f5d8a4a7 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{e4c769f7-7137-4f03-afd6-5109f1f26bfa}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock09.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{e76e2981-d455-4569-b6fd-b7bc5d924f43}.xml b/DeltaVRFMOD/Metadata/DataFile/{e76e2981-d455-4569-b6fd-b7bc5d924f43}.xml new file mode 100644 index 00000000..8c50a6f9 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{e76e2981-d455-4569-b6fd-b7bc5d924f43}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock13.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{e913805d-bed6-426c-8056-6d6a422116f1}.xml b/DeltaVRFMOD/Metadata/DataFile/{e913805d-bed6-426c-8056-6d6a422116f1}.xml new file mode 100644 index 00000000..66604a00 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{e913805d-bed6-426c-8056-6d6a422116f1}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack14.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{ea0a46ba-e1a3-4565-936a-2eb71278a94f}.xml b/DeltaVRFMOD/Metadata/DataFile/{ea0a46ba-e1a3-4565-936a-2eb71278a94f}.xml new file mode 100644 index 00000000..b359fb97 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{ea0a46ba-e1a3-4565-936a-2eb71278a94f}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease02.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{f56e0ec9-2320-4d3a-8c8b-1d3412f32f13}.xml b/DeltaVRFMOD/Metadata/DataFile/{f56e0ec9-2320-4d3a-8c8b-1d3412f32f13}.xml new file mode 100644 index 00000000..d539fb8c --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{f56e0ec9-2320-4d3a-8c8b-1d3412f32f13}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowRelease01.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{f8e04581-9b43-481f-92d0-fc2f7cba5cc6}.xml b/DeltaVRFMOD/Metadata/DataFile/{f8e04581-9b43-481f-92d0-fc2f7cba5cc6}.xml new file mode 100644 index 00000000..4e1b3bb4 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{f8e04581-9b43-481f-92d0-fc2f7cba5cc6}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock17.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{f9319e62-f37b-4194-9a32-4db42d99a0f9}.xml b/DeltaVRFMOD/Metadata/DataFile/{f9319e62-f37b-4194-9a32-4db42d99a0f9}.xml new file mode 100644 index 00000000..eaa3c326 --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{f9319e62-f37b-4194-9a32-4db42d99a0f9}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/LongbowPullBack11.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/DataFile/{fec75e00-501e-473e-b454-f6eb65810e91}.xml b/DeltaVRFMOD/Metadata/DataFile/{fec75e00-501e-473e-b454-f6eb65810e91}.xml new file mode 100644 index 00000000..aed02bfd --- /dev/null +++ b/DeltaVRFMOD/Metadata/DataFile/{fec75e00-501e-473e-b454-f6eb65810e91}.xml @@ -0,0 +1,11 @@ + + + + + Imported_SFX/Longbow_oneshots/ArrowNock06.wav.meta + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + diff --git a/DeltaVRFMOD/Metadata/EffectPresetFolder/{49b2c6c2-b26a-4e04-9b84-b96abf86e30a}.xml b/DeltaVRFMOD/Metadata/EffectPresetFolder/{49b2c6c2-b26a-4e04-9b84-b96abf86e30a}.xml new file mode 100644 index 00000000..7ef748c9 --- /dev/null +++ b/DeltaVRFMOD/Metadata/EffectPresetFolder/{49b2c6c2-b26a-4e04-9b84-b96abf86e30a}.xml @@ -0,0 +1,4 @@ + + + + diff --git a/DeltaVRFMOD/Metadata/EncodingSetting/{db21f68e-cbb6-4508-93fd-291c051c1dae}.xml b/DeltaVRFMOD/Metadata/EncodingSetting/{db21f68e-cbb6-4508-93fd-291c051c1dae}.xml new file mode 100644 index 00000000..c4c9b851 --- /dev/null +++ b/DeltaVRFMOD/Metadata/EncodingSetting/{db21f68e-cbb6-4508-93fd-291c051c1dae}.xml @@ -0,0 +1,17 @@ + + + + + 3 + + + 53 + + + {66cdeefb-266a-484b-97e7-58ddd0a32ff2} + + + {66cdeefb-266a-484b-97e7-58ddd0a32ff2} + + + diff --git a/DeltaVRFMOD/Metadata/Event/{edb8b086-c8c2-4f9b-a6c9-c324aa020ad3}.xml b/DeltaVRFMOD/Metadata/Event/{edb8b086-c8c2-4f9b-a6c9-c324aa020ad3}.xml new file mode 100644 index 00000000..73dcf24d --- /dev/null +++ b/DeltaVRFMOD/Metadata/Event/{edb8b086-c8c2-4f9b-a6c9-c324aa020ad3}.xml @@ -0,0 +1,134 @@ + + + + + ufo_passing + + + 2 + + + {e5bf65ee-d6e7-4aa2-8f58-f527d31905fa} + + + {48a24df6-748f-42db-a481-5e508e32716d} + + + {cb9c4a30-e45f-420d-a67c-47c3da7fe90a} + + + {7e8a243b-2912-47ee-9006-d06a2c5333d8} + + + {e23d01ca-9dc7-4a3f-8aa1-c370f97965d5} + + + {ecba1195-df31-4d27-8002-548a57a90149} + + + {bf21e3a9-cf22-4b6c-b20d-87356de9cb42} + + + {a7cc6b83-be5b-44c9-a665-3d4478702675} + + + {9d1145b0-e099-4ee4-ab1d-23cc274af901} + {f141f2d4-6fa9-465a-a607-941cef3e083a} + + + + + {e433b2c3-c785-4a1c-b442-a3852a45dd69} + + + + + {e433b2c3-c785-4a1c-b442-a3852a45dd69} + + + + + {3eec3933-5ec3-4034-aa41-5be7c20658d5} + + + {ec172963-8765-429e-85d2-f5ab8c6ee665} + + + {c751273e-6b77-46b1-8c19-a99f6f08e61e} + + + + + + + {33fba5d3-5139-4f9f-8f91-19e9ab9c3e32} + + + {a720d672-e628-459a-9738-c8f9bbee55c1} + + + + + {33fba5d3-5139-4f9f-8f91-19e9ab9c3e32} + + + + + {efa933aa-2985-443f-b5a0-84b32a469145} + + + {4578db60-977c-4192-a718-75c400c18343} + + + {48a24df6-748f-42db-a481-5e508e32716d} + + + + + {fc972962-6f64-4e27-b7db-cbc334f98447} + + + + + + 158.14530612244897 + + + {daaab064-7023-4210-8707-b33201a917ee} + + + + + 3.5 + + + Audio 1 + + + {66d0f274-7da0-40b9-b3f0-c2e99d4f28c9} + + + {48cc039b-f454-4ed9-b0d1-7f23e7387db0} + + + {e433b2c3-c785-4a1c-b442-a3852a45dd69} + + + + + {d21b3e78-cdee-4351-9bd7-08926907b4fb} + {9df5a77c-4560-44c7-aaaa-14a7aa237cc3} + + + + + + + {aab4b67b-78fa-4053-829d-522b1e90cd2a} + + + + + + + diff --git a/DeltaVRFMOD/Metadata/EventFolder/{51962f58-bf61-41ab-9a12-97570ba0bed8}.xml b/DeltaVRFMOD/Metadata/EventFolder/{51962f58-bf61-41ab-9a12-97570ba0bed8}.xml new file mode 100644 index 00000000..77b30650 --- /dev/null +++ b/DeltaVRFMOD/Metadata/EventFolder/{51962f58-bf61-41ab-9a12-97570ba0bed8}.xml @@ -0,0 +1,11 @@ + + + + + Voiceovers + + + {fffdca4e-3154-43d5-ac3e-e30f442123ad} + + + diff --git a/DeltaVRFMOD/Metadata/EventFolder/{7151fc52-9410-443c-ac8a-72d53c7a73c2}.xml b/DeltaVRFMOD/Metadata/EventFolder/{7151fc52-9410-443c-ac8a-72d53c7a73c2}.xml new file mode 100644 index 00000000..e203c000 --- /dev/null +++ b/DeltaVRFMOD/Metadata/EventFolder/{7151fc52-9410-443c-ac8a-72d53c7a73c2}.xml @@ -0,0 +1,11 @@ + + + + + UI + + + {fffdca4e-3154-43d5-ac3e-e30f442123ad} + + + diff --git a/DeltaVRFMOD/Metadata/EventFolder/{bb0dfa19-2848-45c1-b83a-f212448dc5ad}.xml b/DeltaVRFMOD/Metadata/EventFolder/{bb0dfa19-2848-45c1-b83a-f212448dc5ad}.xml new file mode 100644 index 00000000..b1d6d1a1 --- /dev/null +++ b/DeltaVRFMOD/Metadata/EventFolder/{bb0dfa19-2848-45c1-b83a-f212448dc5ad}.xml @@ -0,0 +1,11 @@ + + + + + SFX + + + {fffdca4e-3154-43d5-ac3e-e30f442123ad} + + + diff --git a/DeltaVRFMOD/Metadata/EventFolder/{e5bf65ee-d6e7-4aa2-8f58-f527d31905fa}.xml b/DeltaVRFMOD/Metadata/EventFolder/{e5bf65ee-d6e7-4aa2-8f58-f527d31905fa}.xml new file mode 100644 index 00000000..395cc40a --- /dev/null +++ b/DeltaVRFMOD/Metadata/EventFolder/{e5bf65ee-d6e7-4aa2-8f58-f527d31905fa}.xml @@ -0,0 +1,11 @@ + + + + + Ambiences + + + {fffdca4e-3154-43d5-ac3e-e30f442123ad} + + + diff --git a/DeltaVRFMOD/Metadata/EventFolder/{fffdca4e-3154-43d5-ac3e-e30f442123ad}.xml b/DeltaVRFMOD/Metadata/EventFolder/{fffdca4e-3154-43d5-ac3e-e30f442123ad}.xml new file mode 100644 index 00000000..fb601c67 --- /dev/null +++ b/DeltaVRFMOD/Metadata/EventFolder/{fffdca4e-3154-43d5-ac3e-e30f442123ad}.xml @@ -0,0 +1,8 @@ + + + + + Master + + + diff --git a/DeltaVRFMOD/Metadata/Group/{69ee688f-dc4e-4df2-a125-df79ed93217e}.xml b/DeltaVRFMOD/Metadata/Group/{69ee688f-dc4e-4df2-a125-df79ed93217e}.xml new file mode 100644 index 00000000..25096bf2 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Group/{69ee688f-dc4e-4df2-a125-df79ed93217e}.xml @@ -0,0 +1,24 @@ + + + + + SFX + + + {f7718f12-2a00-40d4-9061-39b5772aa050} + + + {4b689108-fd02-4ac7-9047-2a1c21fd99c9} + + + {c751273e-6b77-46b1-8c19-a99f6f08e61e} + + + + + {5557a20e-6198-4d3f-88e4-2e0f328e2cf6} + + + + + diff --git a/DeltaVRFMOD/Metadata/Group/{7a292e97-7d25-47a5-bc9a-d0b6c76125a2}.xml b/DeltaVRFMOD/Metadata/Group/{7a292e97-7d25-47a5-bc9a-d0b6c76125a2}.xml new file mode 100644 index 00000000..26eadecd --- /dev/null +++ b/DeltaVRFMOD/Metadata/Group/{7a292e97-7d25-47a5-bc9a-d0b6c76125a2}.xml @@ -0,0 +1,24 @@ + + + + + Voiceovers + + + {18fe57ae-4110-48b9-92ff-598d3be28f6c} + + + {f50afb9b-ec25-4548-a35a-682885bfb285} + + + {c751273e-6b77-46b1-8c19-a99f6f08e61e} + + + + + {ace42c8c-33f8-4dd9-8854-68aece7dac7d} + + + + + diff --git a/DeltaVRFMOD/Metadata/Group/{7ec75b45-6865-4d1b-bfab-f8e3ca952cf8}.xml b/DeltaVRFMOD/Metadata/Group/{7ec75b45-6865-4d1b-bfab-f8e3ca952cf8}.xml new file mode 100644 index 00000000..340ab2bd --- /dev/null +++ b/DeltaVRFMOD/Metadata/Group/{7ec75b45-6865-4d1b-bfab-f8e3ca952cf8}.xml @@ -0,0 +1,24 @@ + + + + + Car + + + {02d7cfc6-b23b-419e-b6b0-a0d3ff6f3b37} + + + {24ad219d-2c49-44e9-b50d-c15dd77a0dfd} + + + {c751273e-6b77-46b1-8c19-a99f6f08e61e} + + + + + {1bc06e27-7d01-4337-9d6a-554bc11f1617} + + + + + diff --git a/DeltaVRFMOD/Metadata/Group/{8431e203-753a-4633-bbee-15f9c2412d0a}.xml b/DeltaVRFMOD/Metadata/Group/{8431e203-753a-4633-bbee-15f9c2412d0a}.xml new file mode 100644 index 00000000..119f4080 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Group/{8431e203-753a-4633-bbee-15f9c2412d0a}.xml @@ -0,0 +1,24 @@ + + + + + UI + + + {e1a3bf76-f263-4ed7-b4a8-6777e50b4123} + + + {ccc4d58c-c47f-40dd-8f25-49e5302d5b07} + + + {c751273e-6b77-46b1-8c19-a99f6f08e61e} + + + + + {c0cc1ae4-e7bb-400a-ad15-7a46c7b85b52} + + + + + diff --git a/DeltaVRFMOD/Metadata/Group/{ce68ea24-56d6-4af5-a850-87bda0652ecc}.xml b/DeltaVRFMOD/Metadata/Group/{ce68ea24-56d6-4af5-a850-87bda0652ecc}.xml new file mode 100644 index 00000000..def2f5e7 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Group/{ce68ea24-56d6-4af5-a850-87bda0652ecc}.xml @@ -0,0 +1,24 @@ + + + + + Ambiences + + + {bd6035f4-9345-4a65-add5-a89f2d31f082} + + + {55db2213-ffe6-430c-a45e-2671bb82eac4} + + + {c751273e-6b77-46b1-8c19-a99f6f08e61e} + + + + + {28b438ff-ec1a-454d-a5a9-218791e5461e} + + + + + diff --git a/DeltaVRFMOD/Metadata/Master.xml b/DeltaVRFMOD/Metadata/Master.xml new file mode 100644 index 00000000..a7b2883d --- /dev/null +++ b/DeltaVRFMOD/Metadata/Master.xml @@ -0,0 +1,28 @@ + + + + + Master Bus + + + {5846e992-31e3-4ae3-ae44-d5e16aa2a367} + + + {4f5601fd-d15a-4ee3-b3ff-41c1111b8dec} + + + {a1197cab-76c8-4da4-a41f-969ff1afdca4} + + + + + {38240adf-e521-4d07-8baf-283382ad64e0} + + + + + 2 + + + + diff --git a/DeltaVRFMOD/Metadata/Mixer.xml b/DeltaVRFMOD/Metadata/Mixer.xml new file mode 100644 index 00000000..9f52f246 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Mixer.xml @@ -0,0 +1,11 @@ + + + + + {c751273e-6b77-46b1-8c19-a99f6f08e61e} + + + {95ae9b08-36b1-4258-a801-767b3d112a0e} + + + diff --git a/DeltaVRFMOD/Metadata/ParameterPresetFolder/{72821a40-1f9b-449e-9f29-45c4d8800c81}.xml b/DeltaVRFMOD/Metadata/ParameterPresetFolder/{72821a40-1f9b-449e-9f29-45c4d8800c81}.xml new file mode 100644 index 00000000..774aedbe --- /dev/null +++ b/DeltaVRFMOD/Metadata/ParameterPresetFolder/{72821a40-1f9b-449e-9f29-45c4d8800c81}.xml @@ -0,0 +1,4 @@ + + + + diff --git a/DeltaVRFMOD/Metadata/Platform/{66cdeefb-266a-484b-97e7-58ddd0a32ff2}.xml b/DeltaVRFMOD/Metadata/Platform/{66cdeefb-266a-484b-97e7-58ddd0a32ff2}.xml new file mode 100644 index 00000000..4a043af8 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Platform/{66cdeefb-266a-484b-97e7-58ddd0a32ff2}.xml @@ -0,0 +1,17 @@ + + + + + 0 + + + Desktop + + + Desktop + + + 5 + + + diff --git a/DeltaVRFMOD/Metadata/ProfilerFolder/{956ef15e-cc6e-457e-ac09-cb3434cc3b9b}.xml b/DeltaVRFMOD/Metadata/ProfilerFolder/{956ef15e-cc6e-457e-ac09-cb3434cc3b9b}.xml new file mode 100644 index 00000000..e079d25b --- /dev/null +++ b/DeltaVRFMOD/Metadata/ProfilerFolder/{956ef15e-cc6e-457e-ac09-cb3434cc3b9b}.xml @@ -0,0 +1,4 @@ + + + + diff --git a/DeltaVRFMOD/Metadata/Return/{453c12ff-bc21-4b80-88bc-2737cc792242}.xml b/DeltaVRFMOD/Metadata/Return/{453c12ff-bc21-4b80-88bc-2737cc792242}.xml new file mode 100644 index 00000000..ac0132ad --- /dev/null +++ b/DeltaVRFMOD/Metadata/Return/{453c12ff-bc21-4b80-88bc-2737cc792242}.xml @@ -0,0 +1,36 @@ + + + + + 2 + + + Reverb + + + {db3f4d6d-013d-4823-9314-7e2bd0ac6882} + + + {f95e1782-2d20-4dd3-9fc8-24768374cde0} + + + {c751273e-6b77-46b1-8c19-a99f6f08e61e} + + + + + {ff9d2cd2-c223-4a4a-8b32-923207ee71e3} + {7162df66-abae-4c85-9696-567c618bb202} + + + + + + 0 + + + -80 + + + + diff --git a/DeltaVRFMOD/Metadata/SandboxFolder/{f7a24b14-6fcc-46ce-bbf9-a8ec8cf419ce}.xml b/DeltaVRFMOD/Metadata/SandboxFolder/{f7a24b14-6fcc-46ce-bbf9-a8ec8cf419ce}.xml new file mode 100644 index 00000000..b9ec2400 --- /dev/null +++ b/DeltaVRFMOD/Metadata/SandboxFolder/{f7a24b14-6fcc-46ce-bbf9-a8ec8cf419ce}.xml @@ -0,0 +1,4 @@ + + + + diff --git a/DeltaVRFMOD/Metadata/SnapshotGroup/{95ae9b08-36b1-4258-a801-767b3d112a0e}.xml b/DeltaVRFMOD/Metadata/SnapshotGroup/{95ae9b08-36b1-4258-a801-767b3d112a0e}.xml new file mode 100644 index 00000000..2e1eb41c --- /dev/null +++ b/DeltaVRFMOD/Metadata/SnapshotGroup/{95ae9b08-36b1-4258-a801-767b3d112a0e}.xml @@ -0,0 +1,8 @@ + + + + + {a1197cab-76c8-4da4-a41f-969ff1afdca4} + + + diff --git a/DeltaVRFMOD/Metadata/Tags.xml b/DeltaVRFMOD/Metadata/Tags.xml new file mode 100644 index 00000000..e908be9c --- /dev/null +++ b/DeltaVRFMOD/Metadata/Tags.xml @@ -0,0 +1,8 @@ + + + + + Master + + + diff --git a/DeltaVRFMOD/Metadata/Workspace.xml b/DeltaVRFMOD/Metadata/Workspace.xml new file mode 100644 index 00000000..a04570b1 --- /dev/null +++ b/DeltaVRFMOD/Metadata/Workspace.xml @@ -0,0 +1,38 @@ + + + + + Build/Desktop + + + {fffdca4e-3154-43d5-ac3e-e30f442123ad} + + + {3cbcc79d-5472-446b-900a-79d92cafae31} + + + {49b2c6c2-b26a-4e04-9b84-b96abf86e30a} + + + {72821a40-1f9b-449e-9f29-45c4d8800c81} + + + {b2d8e5a6-b2a3-4016-a958-fe70e51f4f68} + + + {f7a24b14-6fcc-46ce-bbf9-a8ec8cf419ce} + + + {0fbc34f9-6022-42da-8b3b-f18344a8ea0f} + + + {a1197cab-76c8-4da4-a41f-969ff1afdca4} + + + {956ef15e-cc6e-457e-ac09-cb3434cc3b9b} + + + {66cdeefb-266a-484b-97e7-58ddd0a32ff2} + + + diff --git a/highscores.json b/highscores.json index 3e5446d3..fbdf3d31 100644 --- a/highscores.json +++ b/highscores.json @@ -4,10 +4,18 @@ "name": "DABESTEST", "score": 451.0 }, + { + "name": "rry", + "score": 428.0 + }, { "name": "Dabest", "score": 407.0 }, + { + "name": "rrc", + "score": 372.0 + }, { "name": "henri", "score": 333.0