Skip to content

Commit

Permalink
dotnet-format
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Oct 6, 2023
1 parent 5b11690 commit 4f95077
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions Assets/Editor/ReplaceGvr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ReplaceGvr : Editor

// Only used for console logging
private static string currentSceneOrPrefabName;

[MenuItem("Open Brush/Replace GoogleVR Audio")]
public static void Run()
{
Expand All @@ -17,7 +17,7 @@ public static void Run()
{
var scene = SceneManager.GetSceneAt(i);
EditorSceneManager.OpenScene(scene.path);

currentSceneOrPrefabName = scene.name;
foreach (GameObject obj in FindObjectsOfType<GameObject>(includeInactive: true))
{
Expand All @@ -34,12 +34,12 @@ public static void Run()
IteratePrefab(prefab.transform);
}
}

private static void IteratePrefab(Transform transform)
{
currentSceneOrPrefabName = transform.name;
FixAllGvr(transform.gameObject);

foreach (Transform child in transform)
{
IteratePrefab(child);
Expand Down Expand Up @@ -74,7 +74,7 @@ public static void FixGvrRoom(GameObject go)
ResonanceAudioRoom resAudioRoom = null;
if (go.GetComponent<ResonanceAudioRoom>() == null)
{
resAudioRoom = go.AddComponent<ResonanceAudioRoom>();
resAudioRoom = go.AddComponent<ResonanceAudioRoom>();
Debug.Log($"Added ResonanceAudioRoom to {currentSceneOrPrefabName}.{go.name}");
}

Expand Down Expand Up @@ -102,17 +102,17 @@ public static void FixGvrListener(GameObject go)
resAudioListener = go.AddComponent<ResonanceAudioListener>();
Debug.Log($"Added ResonanceAudioListener to {currentSceneOrPrefabName}.{go.name}");
}

resAudioListener.occlusionMask = gvr.occlusionMask;
resAudioListener.globalGainDb = gvr.globalGainDb;
// resAudioListener.??? = gvr.quality;
}

public static void FixGvrSource(GameObject go)
{
var gvr = go.GetComponent<GvrAudioSource>();
if (gvr == null) return;

var audioSource = go.GetComponent<AudioSource>();
if (audioSource == null)
{
Expand Down Expand Up @@ -141,7 +141,7 @@ public static void FixGvrSource(GameObject go)
resAudioSource = go.AddComponent<ResonanceAudioSource>();
Debug.Log($"Added ResonanceAudioSource to {currentSceneOrPrefabName}.{go.name}");
}

resAudioSource.directivityAlpha = gvr.directivityAlpha;
resAudioSource.directivitySharpness = gvr.directivitySharpness;
resAudioSource.listenerDirectivityAlpha = gvr.listenerDirectivityAlpha;
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/GvrStubs/GvrAudioSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class GvrAudioSource : MonoBehaviour
{

/// Denotes whether the room effects should be bypassed.
public bool bypassRoomEffects = false;

Expand Down

0 comments on commit 4f95077

Please sign in to comment.