Exemple #1
0
        /// <summary>
        /// Stop the effect
        /// </summary>
        public virtual void EndFX()
        {
            // Get rid of the object
            GameObject.Destroy(this.gameObject);

            // Remove any color effect we performed
            WeaponFX.ResetBackgroundColor();
        }
Exemple #2
0
 private void OnCastFXStop()
 {
     // If we have an effect stop it now
     if (this.activeFX != null)
     {
         this.activeFX.EndFX();
         this.activeFX = null;
     }
 }
Exemple #3
0
        /// <summary>
        /// Instantiate a new instance of the WeaponEffect class using the supplied parameters
        /// </summary>
        /// <param name="instance">The instance to use as the base</param>
        /// <param name="target">The position that is being targeted</param>
        /// <returns>The new WeaponEffect</returns>
        public static WeaponFX Create(WeaponFX instance, Transform target, int directionX)
        {
            WeaponFX effect = GameObject.Instantiate <WeaponFX>(instance);

            effect.Target     = target;
            effect.DirectionX = directionX;

            return(effect);
        }
Exemple #4
0
 private void OnCastStart()
 {
     // If we have an effect start it now
     if (this.CastFX != null && this.CastProjectiles)
     {
         this.activeFX = WeaponFX.Create(
             this.CastFX,
             this.CastFXPoint,
             (this.CurrentDirection == Direction.Left ? -1 : 1));
     }
 }
Exemple #5
0
        public override void BeginFX()
        {
            base.BeginFX();

            // Get the line renderer that draws the lightning
            this.strikeLine = GetComponent <LineRenderer>();

            // We need to hide it until we have set the control points,
            // otherwise it will be drawn in the wrong place
            this.strikeLine.enabled = false;

            // Set the new background color if that was chosen
            if (this.ChangeBackgroundColor)
            {
                WeaponFX.SetBackgroundColor(this.BackgroundColor);
            }
        }