/// <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; }
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; } }
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; } }
override public void CharacterExit(Character p) { if (p == null) { return; } Dismount(p); p.ExitArea(Areas.Grabbable); p.grab = null; }
/// <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); } } }
/// <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); } } }
/// <summary> /// Notify Character to exit ladder area /// </summary> virtual public void DisableLadder(Character p) { Dismount(p); p.ExitArea(Areas.Ladder); p.ladder = null; }
virtual public void DisableFence(Character p) { Dismount(p); p.ExitArea(Areas.Fence); p.fence = null; }