Esempio n. 1
0
        // -------------------------------------------------------------------------------
        // PlaySound
        // -------------------------------------------------------------------------------
        private static SoundObject PlaySound(SoundTemplate tmpl)
        {
            if (tmpl == null)
            {
                return(null);
            }
            SoundObject sound = ((GameObject)GameObject.Instantiate(tmpl.soundObjectPrefab)).GetComponent <SoundObject>();

            sound.SetClip(tmpl);
            return(sound);
        }
Esempio n. 2
0
        // -------------------------------------------------------------------------------
        // Play
        // -------------------------------------------------------------------------------
        public static SoundObject Play(SoundTemplate tmpl, Vector3 pos)
        {
            SoundObject sound = PlaySound(tmpl);

            if (sound == null)
            {
                return(null);
            }

            sound.transform.position = pos;
            return(sound);
        }
Esempio n. 3
0
        // -------------------------------------------------------------------------------
        // Play
        // -------------------------------------------------------------------------------
        public static SoundObject Play(SoundTemplate tmpl, Transform tran)
        {
            SoundObject sound = PlaySound(tmpl);

            if (sound == null)
            {
                return(null);
            }

            sound.transform.parent        = tran;
            sound.transform.localPosition = Vector3.zero;
            return(sound);
        }
Esempio n. 4
0
        // -------------------------------------------------------------------------------
        // Play
        // -------------------------------------------------------------------------------
        public static SoundObject Play(SoundTemplate tmpl)
        {
            SoundObject sound = PlaySound(tmpl);

            return(sound);
        }