Skip to content

Commit

Permalink
- SoundManager now returns the AudioSource that's playing
Browse files Browse the repository at this point in the history
- Fixed issues with compilation for builds
  • Loading branch information
DiogoDeAndrade committed Nov 5, 2024
1 parent 415cc1a commit 090cb2f
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 30 deletions.
3 changes: 0 additions & 3 deletions Assets/OkapiKit/Scripts/Movement/MovementGrid.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Codice.CM.Common;
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;

namespace OkapiKit
{
Expand Down
3 changes: 0 additions & 3 deletions Assets/OkapiKit/Scripts/Movement/MovementGridPath.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NaughtyAttributes;
using TMPro;
using Codice.Client.BaseCommands.FastImport;

namespace OkapiKit
{
Expand Down
8 changes: 5 additions & 3 deletions Assets/OkapiKit/Scripts/Systems/SoundManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void Start()
}
}

private void _PlaySound(AudioClip clip, float volume = 1.0f, float pitch = 1.0f)
private AudioSource _PlaySound(AudioClip clip, float volume = 1.0f, float pitch = 1.0f)
{
var audioSource = GetSource();

Expand All @@ -51,6 +51,8 @@ private void _PlaySound(AudioClip clip, float volume = 1.0f, float pitch = 1.0f)
audioSource.outputAudioMixerGroup = defaultMixerOutput;

audioSource.Play();

return audioSource;
}

private AudioSource GetSource()
Expand Down Expand Up @@ -85,9 +87,9 @@ private AudioSource NewSource()
return audioSource;
}

static public void PlaySound(AudioClip clip, float volume = 1.0f, float pitch = 1.0f)
static public AudioSource PlaySound(AudioClip clip, float volume = 1.0f, float pitch = 1.0f)
{
_instance._PlaySound(clip, volume, pitch);
return _instance._PlaySound(clip, volume, pitch);
}

public override string GetRawDescription(string ident, GameObject refObject)
Expand Down
4 changes: 0 additions & 4 deletions Assets/OkapiKit/Scripts/Triggers/TriggerOnGridEvent.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using Codice.Client.BaseCommands;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace OkapiKit
Expand Down
2 changes: 1 addition & 1 deletion Assets/OkapiKit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.videojogoslusofona.okapikit",
"displayName": "OkapiKit",
"version": "1.16.1",
"version": "1.16.2",
"unity": "6000.0",
"description": "OkapiKit is a toolkit for creation of simple games without code.",
"keywords": [ "kit" ],
Expand Down
4 changes: 2 additions & 2 deletions Assets/OkapiKitSamples/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "com.videojogoslusofona.okapikit.samples",
"displayName": "OkapiKit Samples",
"version": "1.16.1",
"version": "1.16.2",
"unity": "6000.0",
"description": "OkapiKit is a toolkit for creation of simple games without code. This package is just the samples for OkapiKit, they are not required to use Okapi Kit, and requires the Okapi Kit package.",
"keywords": [ "okapi", "samples" ],
"category": "samples",
"dependencies": {},
"relatedPackages": {
"com.videojogoslusofona.okapikit": "1.16.1"
"com.videojogoslusofona.okapikit": "1.16.2"
},
"author": {
"name": "Videojogos ULHT",
Expand Down
2 changes: 1 addition & 1 deletion Assets/Settings/UniversalRP.asset
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ MonoBehaviour:
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 1
m_PrefilterAlphaOutput: 0
m_PrefilterAlphaOutput: 1
m_PrefilterSSAODepthNormals: 1
m_PrefilterSSAOSourceDepthLow: 1
m_PrefilterSSAOSourceDepthMedium: 1
Expand Down
12 changes: 11 additions & 1 deletion Assets/Settings/UniversalRenderPipelineGlobalSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,17 @@ MonoBehaviour:
- rid: 7189466454756163603
- rid: 7189466454756163604
m_RuntimeSettings:
m_List: []
m_List:
- rid: 7189466454756163585
- rid: 7189466454756163586
- rid: 7189466454756163587
- rid: 7189466454756163589
- rid: 7189466454756163590
- rid: 7189466454756163592
- rid: 7189466454756163593
- rid: 7189466454756163596
- rid: 7189466454756163601
- rid: 7189466454756163604
m_AssetVersion: 8
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
m_RenderingLayerNames:
Expand Down
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes

## V1.16.2

- SoundManager now returns the AudioSource that's playing
- Fixed issues with compilation for builds

## V1.16.1

- Fixed issue with SoundManager initialization of singleton
Expand Down
12 changes: 0 additions & 12 deletions Todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ Features:
- Spawner should have random direction possibility
- Path shows direction (debug)
- Bool and string variables
- Press '+' to add a point at cursor when editing a path
- Add insert point option for path
- Comment Code
- Documentation
- Support for Analytics (extra package?)
- Add OnDestroy event
- Add stairs/moving platforms to system
- Add animator control on XY movement

Usability:
----------
Expand All @@ -45,21 +42,12 @@ Simple usage:
- Set object visible/invisible
- Set object velocity

Videos:
-------
- Ricochet bullet
- Look at player

Bugs:
-----
- Preserve gravity with velocity set (?)
- Tooltips don't work with Naughty Attributes range
- Maybe make my own to be able to have tooltips, or propose a fix

Polish:
-------
- Rounded corners on title boxes

Games:
------
- Add sounds to most games
Expand Down

0 comments on commit 090cb2f

Please sign in to comment.