コード例 #1
0
    void Update()
    {
        if (Input.anyKeyDown)
        {
            int alphaKey = GetAlphaKey(1, 8);
            if (alphaKey != -1)
            {
                SelectSlotIndex(alphaKey);
            }
        }

        if (Input.GetMouseButtonDown(0) && cursorBlueprint != null &&
            cursorBlueprint.CanBePlacedHere())
        {
            cursorBlueprint.DeployHere();
            Debug.Log("123");
            cursorBlueprint = BlueprintFactory.MakeNewCursorBlueprint();
            SelectSlotIndex(selectedSlotIndex);
        }

        if (Input.GetMouseButtonDown(1))
        {
            TryClickBlueprintNodes();
        }

        if (Input.GetMouseButton(0))
        {
            TryHoldClickBlueprintNodes();
        }

        if (Input.GetMouseButtonUp(0) && lastClickedBlueprintNode != null)
        {
            lastClickedBlueprintNode.UnholdClick();
        }
    }