예제 #1
0
        public virtual void Stop()
        {
            // Get rid of the object
            GameObject.Destroy(this.gameObject);

            // Remove any color effect we performed
            WeaponEffect.ResetBackgroundColor();
        }
예제 #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);
        }
예제 #3
0
파일: Character.cs 프로젝트: sso0632/NDG
 private void OnCastEffect()
 {
     // If we have an effect start it now
     if (this.Effect != null)
     {
         this.activeEffect = WeaponEffect.Create(this.Effect, this.EffectPoint);
     }
 }
예제 #4
0
파일: Character.cs 프로젝트: sso0632/NDG
 private void OnCastEffectStop()
 {
     // If we have an effect stop it now
     if (this.activeEffect != null)
     {
         this.activeEffect.Stop();
         this.activeEffect = null;
     }
 }
예제 #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);
            }
        }