Ejemplo n.º 1
0
		/// <summary>
		/// tweens an AudioSource panStereo property
		/// </summary>
		/// <returns>The kpan stereo to.</returns>
		/// <param name="self">Self.</param>
		/// <param name="to">To.</param>
		/// <param name="duration">Duration.</param>
		public static ITween<float> ZKpanStereoTo( this AudioSource self, float to, float duration = 0.3f )
		{
			var tweenTarget = new AudioSourceFloatTarget( self, AudioSourceFloatTarget.AudioSourceFloatType.PanStereo );
			var tween = ZestKit.cacheFloatTweens ? QuickCache<FloatTween>.pop() : new FloatTween();
			tween.initialize( tweenTarget, self.panStereo, to, duration );

			return tween;
		}
Ejemplo n.º 2
0
        /// <summary>
        /// tweens an AudioSource volume property
        /// </summary>
        /// <returns>The kvolume to.</returns>
        /// <param name="self">Self.</param>
        /// <param name="to">To.</param>
        /// <param name="duration">Duration.</param>
        public static ITween<float> ZKvolumeTo( this AudioSource self, float to, float duration = 0.3f )
        {
            var tweenTarget = new AudioSourceFloatTarget( self, AudioSourceFloatTarget.AudioSourceFloatType.Volume );
            var tween = FloatTween.create();
            tween.initialize( tweenTarget, self.volume, to, duration );

            return tween;
        }