Yes, as a resident of the United Kingdom, you can apply for a Schengen Visa from within the United Kingdom.
Note that different consulates may be responsible based on the area within the United Kingdom that you reside.
According to Schengen rules, applicants have to apply for a visa in the Counslate of the country which can be identified as the main destination of their journey.
Based on the wording of the German Mission - Visa Information site:
If you reside in Scotland or certain parts of northern England you can file your visa application at the VisaMetric Visa Application Centre in Edinburgh from 17 January 2019. Click here for more information.
the main condition is that you reside there. There is no time constraint stated.
So with your UK Tier 2 General Work Visa, that condition should be fulfilled.