コード例 #1
0
    public bool ReceivePart(RobotPartItem robotPartItem)
    {
        parts[robotPartItem.type] = true;
        newPartItemReceived.OnNext(robotPartItem);

        Debug.Log("Picked Item : " + Enum.GetName(typeof(RobotPartType), robotPartItem.type));

        if (parts[RobotPartType.LeftHand] && parts[RobotPartType.RightHand])
        {
            canCarryItems.Value = true;
        }
        else
        {
            canCarryItems.Value = false;
        }

        return(true);
    }
コード例 #2
0
    private void PickedItem(RobotPartItem newItem)
    {
        string info = "";

        if ((newItem.type == RobotPartType.LeftHand && playerState.parts[RobotPartType.RightHand]) ||
            (newItem.type == RobotPartType.RightHand && playerState.parts[RobotPartType.LeftHand]))
        {
            info = "You can now carry ship parts to repair your ship";
        }
        else if ((newItem.type == RobotPartType.LeftHand && !playerState.parts[RobotPartType.RightHand]) ||
                 (newItem.type == RobotPartType.RightHand && !playerState.parts[RobotPartType.LeftHand]))
        {
            info = "You can now attack enemies";
        }
        else if (newItem.type == RobotPartType.LeftLeg || newItem.type == RobotPartType.RightLeg)
        {
            info = "You can now move faster";
        }

        itemNotification.PopulateData(info, newItem.cardSprite);
    }