Example #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();
        }
    }
Example #2
0
 private Blueprint GetCursorBlueprint()
 {
     if (cursorBlueprint == null)
     {
         cursorBlueprint = BlueprintFactory.MakeNewCursorBlueprint();
     }
     return(cursorBlueprint);
 }
Example #3
0
 public BlueprintFactoryTests()
 {
     testee    = new BlueprintFactory(new ItemRepository());
     utilities = new BlueprintUtilities();
 }