Exemplo n.º 1
0
        public virtual void Stop()
        {
            // Get rid of the object
            GameObject.Destroy(this.gameObject);

            // Remove any color effect we performed
            WeaponEffect.ResetBackgroundColor();
        }
Exemplo n.º 2
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 WeaponEffect Create(WeaponEffect instance, Transform target)
        {
            WeaponEffect effect = Instantiate(instance);

            effect.target = target;

            return(effect);
        }
Exemplo n.º 3
0
 private void OnCastEffect()
 {
     // If we have an effect start it now
     if (this.Effect != null)
     {
         this.activeEffect = WeaponEffect.Create(this.Effect, this.EffectPoint);
     }
 }
Exemplo n.º 4
0
 private void OnCastEffectStop()
 {
     // If we have an effect stop it now
     if (this.activeEffect != null)
     {
         this.activeEffect.Stop();
         this.activeEffect = null;
     }
 }
Exemplo n.º 5
0
        protected override void Start()
        {
            base.Start();

            // 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)
            {
                WeaponEffect.SetBackgroundColor(this.BackgroundColor);
            }
        }