public bool Close() { if (collidableComponent.TryCollision(Vector2.Zero)) { // Do nothing, somebody's in the door. return(false); } Opened = false; OpenTimeCounter = 0; collidableComponent.IsHardCollidable = true; return(true); }
public bool Close() { if (collidableComponent.TryCollision(Vector2.Zero)) { // Do nothing, somebody's in the door. return(false); } _state = DoorState.Closing; collidableComponent.IsHardCollidable = true; OpenTimeCounter = 0; _appearance.SetData(DoorVisuals.VisualState, DoorVisualState.Closing); Timer.Spawn(CloseTime, () => { _state = DoorState.Closed; _appearance.SetData(DoorVisuals.VisualState, DoorVisualState.Closed); }); return(true); }