public virtual void Stop() { // Get rid of the object GameObject.Destroy(this.gameObject); // Remove any color effect we performed WeaponEffect.ResetBackgroundColor(); }
/// <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); }
private void OnCastEffect() { // If we have an effect start it now if (this.Effect != null) { this.activeEffect = WeaponEffect.Create(this.Effect, this.EffectPoint); } }
private void OnCastEffectStop() { // If we have an effect stop it now if (this.activeEffect != null) { this.activeEffect.Stop(); this.activeEffect = null; } }
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); } }