Server.GameObject.outOfBounds C# (CSharp) Méthode

outOfBounds() public méthode

public outOfBounds ( ) : void
Résultat void
        public virtual void outOfBounds()
        {
            if (x < 0)
            {
                this.speedX = this.speedX * (float)(-0.1);
                this.x = 0;
            }
            else if (x > MatchConfig.mapWidth)
            {
                this.speedX = this.speedX * (float)(-0.1);
                this.x = MatchConfig.mapWidth;
            }
            if (y < 0)
            {
                this.speedY = this.speedY * (float)(-0.1);
                this.y = 0;
            }
            else if (y > MatchConfig.mapHeight)
            {
                this.speedY = this.speedY * (float)(-0.1);
                this.y = MatchConfig.mapHeight;
            }
        }