Example #1
0
    public void Observe(SlugEvents ev)
    {
        if (!topAnimator.isInitialized)
        {
            return;
        }

        if (ev == SlugEvents.Fall && !inExplosiveDeathAnim)
        {
            topAnimator.SetTrigger("jump_trigger");
            topAnimator.SetBool("jump_low_speed", true);
            bottomAnimator.SetTrigger("jump_low_speed");
        }
        else if (ev == SlugEvents.HitGround)
        {
            if (inExplosiveDeathAnim)
            {
                topAnimator.applyRootMotion = false;
                topAnimator.SetTrigger("touch_ground_death");
                return;
            }
            topAnimator.SetTrigger("hit_ground");
            bottomAnimator.SetTrigger("hit_ground");
            topAnimator.SetBool("jump_low_speed", false);
            topAnimator.SetBool("jump_high_speed", false);
        }
    }
 public void Observe(SlugEvents ev)
 {
     if (ev == SlugEvents.HitGround)
     {
         anim.SetTrigger("bounce");
     }
 }
Example #3
0
 void NotifyObservers(SlugEvents ev)
 {
     foreach (IObserver obs in observers)
     {
         obs.Observe(ev);
     }
 }
Example #4
0
 public void Observe(SlugEvents ev)
 {
     if (ev == SlugEvents.HitGround)
     {
         if (lookingDirection == Vector2.down)
         {
             Crouch();
         }
     }
 }
Example #5
0
 void NotifyObservers(SlugEvents ev)
 {
     if (observers == null)
     {
         return;
     }
     foreach (IObserver obs in observers)
     {
         obs.Observe(ev);
     }
 }
Example #6
0
 public void Observe(SlugEvents ev)
 {
     if (ev == SlugEvents.Fall)
     {
         anim.SetBool("falling", true);
     }
     else if (ev == SlugEvents.HitGround)
     {
         anim.SetBool("falling", false);
     }
 }
Example #7
0
 void NotifyObservers(SlugEvents ev)
 {
     if (observers == null)
     {
         observers = GetComponents <IObserver>();
     }
     foreach (IObserver obs in observers)
     {
         obs.Observe(ev);
     }
 }
Example #8
0
 public void Observe(SlugEvents ev)
 {
     if (ev == SlugEvents.Fall)
     {
         HippiesBrainBackup = HippiesBrain;
         HippiesBrain       = HippieTiedUp;
     }
     else if (ev == SlugEvents.HitGround)
     {
         HippiesBrain = HippiesBrainBackup;
     }
 }
 public void Observe(SlugEvents ev)
 {
     if (ev == SlugEvents.HitGround)
     {
         if (anim.GetBool("hit_by_grenade"))
         {
             anim.SetBool("hit_by_grenade", false);
         }
         else if (anim.GetBool("fall_death"))
         {
             anim.SetBool("fall_death", false);
         }
         else
         {
             anim.SetTrigger("hit_ground");
         }
     }
     else if (ev == SlugEvents.Fall)
     {
         anim.SetTrigger("falls");
     }
 }