예제 #1
0
        /// <summary>
        /// notify Character is out area item
        /// </summary>
        public virtual void Exit(Character p)
        {
            if (p == null)
            {
                return;
            }

            p.ExitArea(Areas.Item);
            p.item = null;
        }
예제 #2
0
 override public void CharacterExit(Character p)
 {
     // same as above, only diable if we leave the section we are grabbing
     if (p.track == this)
     {
         p.ExitArea(Areas.Track);
         p.track          = null;
         p.worldVelocity -= velocity;
     }
 }
예제 #3
0
 override public void CharacterExit(Character p)
 {
     // same as above, only diable if we leave the section we are grabbing
     if (p.ropeIndex == index)
     {
         Dismount(p);
         p.ExitArea(Areas.Rope);
         p.rope      = null;
         p.ropeIndex = -1;
     }
 }
예제 #4
0
        override public void CharacterExit(Character p)
        {
            if (p == null)
            {
                return;
            }

            Dismount(p);
            p.ExitArea(Areas.Grabbable);
            p.grab = null;
        }
예제 #5
0
        /// <summary>
        /// if a Hitbox(EnterAreas) enter -> exitArea
        /// </summary>
        public virtual void OnTriggerExit2D(Collider2D o)
        {
            HitBox h = o.GetComponent <HitBox>();

            if (h && h.type == HitBoxType.EnterAreas)
            {
                Character p = h.owner.GetComponent <Character>();
                if (p.liquid == this) // REVIEW with this liquid should overlap
                {
                    p.liquid = null;
                    p.ExitArea(Areas.Liquid);
                }
            }
        }
예제 #6
0
 /// <summary>
 /// Disable track
 /// </summary>
 override public void CharacterExit(Character character)
 {
     // same as above, only diable if we leave the section we are grabbing
     if (character.track != null && character.track.track == this)
     {
         Log.Silly("(Track) Leave " + character.gameObject.GetFullName());
         character.onBeforeMove -= Accelerate;
         character.ExitArea(Areas.Track);
         // when character exit, we must continue to apply the velocity
         // but this time not as world, as 'Character' velocity to keep
         // a smooth exit
         // this will be ok unless you exceeed terminalVelocity
         character.worldVelocity -= character.track.appliedAcceleration;
         character.velocity      += character.track.appliedAcceleration;
         character.track          = null;
         if (onExit != null)
         {
             onExit(character);
         }
     }
 }
예제 #7
0
 /// <summary>
 /// Notify Character to exit ladder area
 /// </summary>
 virtual public void DisableLadder(Character p)
 {
     Dismount(p);
     p.ExitArea(Areas.Ladder);
     p.ladder = null;
 }
예제 #8
0
 virtual public void DisableFence(Character p)
 {
     Dismount(p);
     p.ExitArea(Areas.Fence);
     p.fence = null;
 }