Esempio n. 1
0
    void CheckBlueprintInputs()
    {
        BuildingController blueprintBuildingController = inventoryManager.blueprint.GameObject.GetComponent <BuildingController>();

        blueprintBuildingController.ChangeTransform(groundManager.buildPoint);
        if (buildObjectInput.LeftClick)
        {
            buildManager.BuildObject(inventoryManager.blueprint, groundManager.buildPoint);
            if (!inventoryManager.selectedItem.MultiPlacingAllowed)
            {
                var c = inventoryManager.blueprint.GameObject.GetComponent <BuildingController>();
                Destroy(c);
                inventoryManager.DeselectBlueprint();
            }
        }
        if (blueprintRotateInput.Horizontal < 0)
        {
            blueprintBuildingController.RotateBlueprint(90);
        }
        if (blueprintRotateInput.Horizontal > 0)
        {
            blueprintBuildingController.RotateBlueprint(-90);
        }
        if (cancelBlueprintInput.KeyPressed)
        {
            inventoryManager.DeselectBlueprint();
        }
    }