Esempio n. 1
0
        private IEnumerator RemoveEnchant(float duration)
        {
            yield return(new WaitForSeconds(duration));

            _dispenser = null;
            enchantmentParticles.Stop();
        }
Esempio n. 2
0
		/// <summary>
		/// Enchants the weapon with the specified effect-dispenser, particle-color and duration.
		/// </summary>
		/// <param name="dispenser">EffectDispenser to instantiate effects.</param>
		/// <param name="particleColor">Particle color of the enchantment.</param>
		/// <param name="duration">Duration of the enchantment (0 yields until replaced).</param>
		public void Enchant(IEffectDispenser dispenser, Color particleColor, float duration) {
			_dispenser = dispenser;

			enchantmentParticles.startColor = particleColor;
			enchantmentParticles.Play();
			if(duration > 0) 
				StartCoroutine (RemoveEnchant (duration));
		}
Esempio n. 3
0
        /// <summary>
        /// Enchants the weapon with the specified effect-dispenser, particle-color and duration.
        /// </summary>
        /// <param name="dispenser">EffectDispenser to instantiate effects.</param>
        /// <param name="particleColor">Particle color of the enchantment.</param>
        /// <param name="duration">Duration of the enchantment (0 yields until replaced).</param>
        public void Enchant(IEffectDispenser dispenser, Color particleColor, float duration)
        {
            _dispenser = dispenser;

            enchantmentParticles.startColor = particleColor;
            enchantmentParticles.Play();
            if (duration > 0)
            {
                StartCoroutine(RemoveEnchant(duration));
            }
        }
Esempio n. 4
0
		private IEnumerator RemoveEnchant(float duration) {
			yield return new WaitForSeconds (duration);
			_dispenser = null;
			enchantmentParticles.Stop ();
		}