Skip to content

Commit

Permalink
fix incorrect editor API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
float3 authored Dec 23, 2024
1 parent 5dae16f commit a7e4054
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ public void LinkAll()

public static void LinkAll(AudioLink target)
{
BehaviourType[] allBehaviours = FindObjectsByType<BehaviourType>(
BehaviourType[] allBehaviours =
#if UNITY_2021_3_OR_NEWER
FindObjectsInactive.Include, FindObjectsSortMode.InstanceID
FindObjectsByType<BehaviourType>(FindObjectsInactive.Include, FindObjectsSortMode.InstanceID);
#else
true
FindObjectsOfType<BehaviourType>(true);
#endif
);

// this handles all reasonable cases of referencing audiolink
// (it doesn't handle referencing it multiple times in one monobehaviour, or referencing it as it's Base type)
foreach (BehaviourType behaviour in allBehaviours)
Expand Down

0 comments on commit a7e4054

Please sign in to comment.