Ejemplo n.º 1
0
        public static AFSound Create(
            string name,
            AudioClip audio,
            Transform emitter    = null,
            float volume         = 1.0f,
            float pitch          = 1.0f,
            bool loop            = false,
            bool playOncePertime = true)
        {
            AFSound L_sound = AFObject.Create <AFSound>(name);

            L_sound.Initialize(name, audio, emitter, volume, pitch, loop, playOncePertime);
            return(L_sound);
        }
Ejemplo n.º 2
0
        public static AFSound Create(
            string path,
            string name          = "",
            Transform emitter    = null,
            float volume         = 1.0f,
            float pitch          = 1.0f,
            bool loop            = false,
            bool playOncePertime = true)
        {
            if (name.Equals(""))
            {
                name = path;
            }

            AFSound   L_sound     = AFObject.Create <AFSound>(name);
            AudioClip L_audioClip = AFAssetManager.Instance.Load <AudioClip>(path);

            L_sound.Initialize(name, L_audioClip, emitter, volume, pitch, loop, playOncePertime);
            return(L_sound);
        }