-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
674cdb2
commit c13239f
Showing
71 changed files
with
1,131 additions
and
2,803 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Visual Pinball Engine | ||
// Copyright (C) 2023 freezy and VPE Team | ||
// | ||
// 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 <https://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Unity.VisualScripting.YamlDotNet.Core.Tokens; | ||
using UnityEngine; | ||
|
||
namespace VisualPinball.Engine.VPT | ||
{ | ||
//Implemented in components relating to sounds, including the Mechanical Sounds component. | ||
public interface ISoundEmitter | ||
{ | ||
SoundTrigger[] AvailableTriggers { get;} | ||
VolumeEmitter[] GetVolumeEmitters(SoundTrigger trigger); | ||
event EventHandler<SoundEventArgs> OnSound; | ||
} | ||
|
||
public struct SoundTrigger | ||
{ | ||
public string Id; | ||
public string Name; | ||
|
||
} | ||
|
||
//The emitter for the sound trigger. Determines how the volume will be calculated. | ||
//Example: The "Fixed" volume emitter would be an emitter for the "Coil On" trigger. Same volume as configured by the sound asset. | ||
//Example: The "Ball Velocity" volume emitter would be an emitter for the "Ball Collision" trigger. Volume depends on the ball velocity upon collision. | ||
public struct VolumeEmitter | ||
{ | ||
public string Id; | ||
public string Name; | ||
} | ||
|
||
public struct SoundEventArgs | ||
{ | ||
public SoundTrigger Trigger; | ||
public float Volume; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// Visual Pinball Engine | ||
// Copyright (C) 2023 freezy and VPE Team | ||
// | ||
// 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 <https://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using VisualPinball.Engine.IO; | ||
using System.IO; | ||
using VisualPinball.Engine.VPT.Table; | ||
using UnityEngine; | ||
|
||
namespace VisualPinball.Engine.VPT.MechSounds | ||
{ | ||
[Serializable] | ||
public class MechSoundsData : ItemData | ||
{ | ||
|
||
public override string GetName() => Name; | ||
public override void SetName(string name) { Name = name; } | ||
|
||
[BiffString("NAME", IsWideString = true, Pos = 14)] | ||
public string Name = string.Empty; | ||
public SoundTrigger[] AvailableTriggers; | ||
public SoundTrigger SelectedTrigger; | ||
public VolumeEmitter[] AvailableEmitters; | ||
|
||
[Serializable] | ||
public class MechSound | ||
{ | ||
public int Trigger; | ||
public ScriptableObject Sound; | ||
public int Volume; | ||
public float VolumeValue = 1; | ||
public actionType Action = actionType.PlayOnce; | ||
public float Fade = 50; | ||
|
||
} | ||
|
||
void AddNew() | ||
{ | ||
SoundList.Add(new MechSound()); | ||
} | ||
|
||
void Remove(int index) | ||
{ | ||
SoundList.RemoveAt(index); | ||
} | ||
|
||
public List<MechSound> SoundList; | ||
public enum actionType { PlayOnce, Loop }; | ||
|
||
#region BIFF | ||
|
||
|
||
public MechSoundsData() : base(StoragePrefix.VpeGameItem) | ||
{ | ||
} | ||
|
||
public MechSoundsData(string name) : base(StoragePrefix.VpeGameItem) | ||
{ | ||
Name = name; | ||
} | ||
|
||
static MechSoundsData() | ||
{ | ||
Init(typeof(MechSoundsData), Attributes); | ||
} | ||
|
||
public MechSoundsData(BinaryReader reader, string storageName) : this(storageName) | ||
{ | ||
Load(this, reader, Attributes); | ||
} | ||
|
||
public override void Write(BinaryWriter writer, HashWriter hashWriter) | ||
{ | ||
writer.Write((int)ItemType.Flipper); | ||
WriteRecord(writer, Attributes, hashWriter); | ||
WriteEnd(writer, hashWriter); | ||
} | ||
|
||
private static readonly Dictionary<string, List<BiffAttribute>> Attributes = new Dictionary<string, List<BiffAttribute>>(); | ||
|
||
#endregion | ||
|
||
|
||
} | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
VisualPinball.Engine/VPT/MechSounds/MechSoundsData.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
86 changes: 0 additions & 86 deletions
86
VisualPinball.Unity/Plugins/android-arm64-v8a/FluentAssertions.dll.meta
This file was deleted.
Oops, something went wrong.
68 changes: 0 additions & 68 deletions
68
VisualPinball.Unity/Plugins/android-arm64-v8a/JeremyAnsel.Media.WavefrontObj.dll.meta
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.