예제 #1
0
    public void RemoveAllHandlers()
    {
        if (_objectForTeleport != null)
        {
            _objectForTeleport.SetTeleportColor(false);

            _objectForTeleport = null;
        }

        OnEditField = null;

        ShowWalls(false);
    }
예제 #2
0
    public void ButtonTeleportFunction(int x, int y)
    {
        ViewFieldCell cellScript = _field[x, y];

        if (_objectForTeleport == null)
        {
            _objectForTeleport = cellScript;

            cellScript.SetTeleportColor(true);

            return;
        }
        else
        {
            _objectForTeleport.SetTeleportColor(false);

            if (_objectForTeleport != cellScript)
            {
                _objectForTeleport.SetTeleportInCell(cellScript.PositionY * Constants.MaxWidthOfField + cellScript.PositionX + 1);

                _level.profile.SetTeleport(_objectForTeleport.PositionX, _objectForTeleport.PositionY, cellScript.PositionY * Constants.MaxWidthOfField + cellScript.PositionX + 1);

                _objectForTeleport = null;
            }
            else
            {
                _objectForTeleport = null;
            }
        }
    }