예제 #1
0
    public void ValueUpdated(ValueRegion.type type, int value, int index)
    {
        //print(type.ToString() + " - " + value.ToString() + " - " + index.ToString());
        switch (type)
        {
        case ValueRegion.type.craftInput:
            if (index < (myNode as CraftingNode).inputs.Count)
            {
                (myNode as CraftingNode).inputs[index].count = value;
            }
            break;

        case ValueRegion.type.craftOutput:
            if (index < (myNode as CraftingNode).outputs.Count)
            {
                (myNode as CraftingNode).outputs[index].count = value;
            }
            break;

        case ValueRegion.type.craftingType:
            (myNode as CraftingNode).myCraftingType = craftingTypes[value];
            break;

        case ValueRegion.type.craftingTier:
            (myNode as CraftingNode).tier = value;
            break;

        case ValueRegion.type.timeCost:
            (myNode as CraftingNode).craftingTime = value;
            break;
        }

        UpdateVisuals();
    }
예제 #2
0
    public void ValueUpdated(ValueRegion.type type, int value)
    {
        //print(type.ToString() + " - " + value.ToString() + " - " + index.ToString());
        switch (type)
        {
        case ValueRegion.type.port:
            Debug.LogError("Port types should not use this update!");
            break;

        case ValueRegion.type.craftingType:
            (myNode as CraftingNode).CraftingType = craftingTypes[value];
            break;

        case ValueRegion.type.craftingTier:
            (myNode as CraftingNode).tier = value;
            break;

        case ValueRegion.type.timeCost:
            (myNode as CraftingNode).timeCost = value;
            break;
        }

        UpdateVisuals();
    }
예제 #3
0
 public void ValueUpdated(ValueRegion.type type, int value)
 {
     (myMaster as CraftingNodeGfx).ValueUpdated(type, value, myIndex); // Only the crafting node has updateable value regions, so we can assume this
 }