FMODi paigaldamine projekti sisse, fmod project created, assets are imported into FMOD; AudioManager and FMODEvents scripts, VR is set up

This commit is contained in:
Timur Nizamov
2025-10-12 20:57:56 +03:00
parent cb73b9cbbc
commit f542c4c57e
770 changed files with 47580 additions and 3 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 194213485063a984b98ce9410892267a
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 935c6716e27bd481e97897dd9e1de595
timeCreated: 1511395157
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,3 @@
#if UNITY_2020_2_OR_NEWER
[assembly: UnityEditor.Localization]
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6711f1f86af21644c897cc89748266f6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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 "前墙"

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: df892acb3265e0043b3bb1b8981b5aeb
LocalizationImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: