public static void StartPlacing(GameObject prefab) { StartedConstructing.Invoke(); InputHandler.RotationKeyPressed += rotate; mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); currentGO = Instantiate(prefab, new Vector2(mousePos.x, mousePos.y), Quaternion.identity); currentGO.GetComponent <SpriteRenderer>().sortingOrder = 500; currentBuilding = currentGO.GetComponent <Building>(); currentBuilding.ShowSprite(currentRotation); instance.StartCoroutine(instance.draggingCour(currentBuilding)); }