示例#1
0
 public void Play(Effects.Source source)
 {
     durationRemaining = duration;
     if (!source.clips.Contains(this))
     {
         source.clips.Add(this);
     }
 }
示例#2
0
            void Initialize(Effects.Source source)
            {
                if (initialized)
                {
                    return;
                }

                audioSource              = source.parent.gameObject.AddComponent <AudioSource>();
                audioSource.rolloffMode  = AudioRolloffMode.Linear;
                audioSource.spatialBlend = 0f;

                initialized = true;
            }
示例#3
0
            public void Play(Effects.Source source)
            {
                Initialize(source);

                audioSource.clip = sound;
                audioSource.Stop();
                audioSource.pitch  = pitch;
                audioSource.loop   = loop;
                audioSource.clip   = sound;
                audioSource.volume = 0f;
                audioSource.Play();

                if (!source.clips.Contains(this))
                {
                    source.clips.Add(this);
                }
            }
示例#4
0
        // Use this for initialization
        void Start()
        {
            scrFpsController  = transform.root.GetComponent <ScrFpsController>();
            scrFpsWeaponPivot = transform.GetComponent <ScrFpsWeaponPivot>();
            sfxSource         = transform.root.GetComponent <ScrEffectsListener>().personalEffects;

            headCamera        = scrFpsController.headCamera.GetComponent <Camera>();
            headCameraOrigFov = headCamera.fieldOfView;

            weaponCamera        = scrFpsController.weaponCamera.GetComponent <Camera>();
            weaponCameraOrigFov = weaponCamera.fieldOfView;

            fireTimer.onIterate  += SpawnProjectiles;
            fireTimer.onCooldown += C**k;

            magazineCurrent = magazineMax;
        }
示例#5
0
            public void Play(Effects.Source source)
            {
                if (fadeTimer == null)
                {
                    fadeTimer = new DsLib.CyclicTimer(fadeInDuration, fadeOutDuration, 1, peakDuration, loop, false);
                }
                else
                {
                    fadeTimer.Configure(fadeInDuration, fadeOutDuration, 1, peakDuration, loop, false);
                }

                noisePositionOffsetCurrent = UnityEngine.Random.Range(0f, 100f);
                noiseRotationOffsetCurrent = UnityEngine.Random.Range(0f, 100f);

                if (!source.clips.Contains(this))
                {
                    source.clips.Add(this);
                }

                fadeTimer.Start(DsLib.CyclicTimer.StartMode.Forced);
            }
示例#6
0
 public void Stop(Effects.Source source)
 {
     durationRemaining = 0f;
     source.clips.Remove(this);
 }
示例#7
0
 public void Stop(Effects.Source source)
 {
     fadeTimer.Reset();
     source.clips.Remove(this);
 }
示例#8
0
 public void Stop(Effects.Source source)
 {
     audioSource.Stop();
     source.clips.Remove(this);
 }