Skip to content

Commit 31cd604

Browse files
committedMar 12, 2024
Apply code style changes, and update layout and psring code
1 parent 1618bbc commit 31cd604

File tree

297 files changed

+6677
-6765
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+6677
-6765
lines changed
 

‎Assets/UnityX/Scripts/Components/Audio/AudioSource/AudioSourceManager.cs

+9-25
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public bool currentlyPausedBecauseTimescaleIsZero {
1515
else return false;
1616
}
1717
}
18-
LogicBlender<bool> canPlayBlender = new LogicBlender<bool>(source => source == null || source.All(x => x));
18+
LogicBlender<bool> canPlayBlender = new(source => source == null || source.All(x => x));
1919
public bool startPlayingAtRandomTime;
2020

2121
private AudioSource _audioSource;
@@ -26,17 +26,11 @@ public AudioSource audioSource {
2626
if(_audioSource == null) _audioSource = gameObject.AddComponent<AudioSource>();
2727
}
2828
return _audioSource;
29-
} private set {
30-
_audioSource = value;
31-
}
29+
} private set => _audioSource = value;
3230
}
3331

3432
// Checks if we're not playing and not at the start of the clip
35-
public bool paused {
36-
get {
37-
return !audioSource.isPlaying && audioSource.timeSamples != 0;
38-
}
39-
}
33+
public bool paused => !audioSource.isPlaying && audioSource.timeSamples != 0;
4034

4135

4236
// Returns if the AudioSource is playing or supposed to be playing but currently out of focus
@@ -56,16 +50,9 @@ public bool isPlaying {
5650
}
5751

5852
bool wasPlaying;
59-
bool playStateChangedThisFrame {
60-
get {
61-
return wasPlaying != audioSource.isPlaying;
62-
}
63-
}
64-
bool changedFocusThisFrame {
65-
get {
66-
return wasFocused != Application.isFocused;
67-
}
68-
}
53+
bool playStateChangedThisFrame => wasPlaying != audioSource.isPlaying;
54+
55+
bool changedFocusThisFrame => wasFocused != Application.isFocused;
6956
bool wasFocused;
7057
public bool audioSourceWasPlayingWhileFocused;
7158

@@ -85,11 +72,8 @@ public float normalizedTime {
8572
public event AudioSourceEvent OnStopOrFinish;
8673

8774
public FloatTween volumeTween {
88-
get {
89-
return _volumeTween;
90-
} private set {
91-
_volumeTween = value;
92-
}
75+
get => _volumeTween;
76+
private set => _volumeTween = value;
9377
}
9478

9579
void Reset () {
@@ -179,7 +163,7 @@ void UpdateIsPlaying () {
179163

180164
bool _wasPlaying;
181165
[SerializeField]
182-
FloatTween _volumeTween = new FloatTween();
166+
FloatTween _volumeTween = new();
183167

184168
#if UNITY_EDITOR
185169
public void LogPauseBlender () {

‎Assets/UnityX/Scripts/Components/Audio/AudioSource/Editor/AudioSourceManagerEditor.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Collections;
2-
using System.Collections.Generic;
3-
using UnityEngine;
1+
using UnityEngine;
42
using UnityEditor;
53

64
[CustomEditor(typeof(AudioSourceManager)), CanEditMultipleObjects]

0 commit comments

Comments
 (0)