D
D
Dmitry Korolev2017-02-11 01:42:04
C++ / C#
Dmitry Korolev, 2017-02-11 01:42:04

How can I attach an audio listener and an audio resource to a window object?

I have a window that inherits from EditorWindow. I need to somehow attach an audio listener and an audio source to it so that the sound can be heard. How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2017-02-11
@adressmoeistranici

No way, EditorWindow is a ScriptableObject, and components can only be hooked to a GameObject. Judging by the UnityEditor.SceneView code, they are used in the editor, but you need to understand the specific logic of their creation. I can assume that invisible sound sources are created on the active stage using HideFlags , but not a fact. In addition, there is a UnityEditor.AudioUtil class with methods PlayClip, StopClip and the like, you can probably somehow use it to play sounds.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question