Exemplo n.º 1
0
    public void ReplacePlayerCollectInput(CollectibleTypesEnum newType, string newUUID)
    {
        var index     = GameComponentsLookup.PlayerCollectInput;
        var component = CreateComponent <PlayerCollectInputComponent>(index);

        component.Type = newType;
        component.UUID = newUUID;
        ReplaceComponent(index, component);
    }
Exemplo n.º 2
0
    public bool CanCollectCollectibleItem(CollectibleTypesEnum itemType)
    {
        bool canCollect = false;

        if (playerMountController.CurrentMountedItemPickUp == null)
        {
            return(!canCollect);
        }

        switch (playerMountController.CurrentMountedItemPickUp.mountableType)
        {
        case MountableTypesEnum.TYPE_A:
            if (itemType == CollectibleTypesEnum.TYPE_X || itemType == CollectibleTypesEnum.TYPE_Y)
            {
                canCollect = true;
            }
            break;

        case MountableTypesEnum.TYPE_B:
            if (itemType == CollectibleTypesEnum.TYPE_Z)
            {
                canCollect = true;
            }
            break;

        case MountableTypesEnum.TYPE_C:
            if (itemType == CollectibleTypesEnum.TYPE_X || itemType == CollectibleTypesEnum.TYPE_Y || itemType == CollectibleTypesEnum.TYPE_W)
            {
                canCollect = true;
            }
            break;

        case MountableTypesEnum.TYPE_D:
            if (itemType == CollectibleTypesEnum.TYPE_Z || itemType == CollectibleTypesEnum.TYPE_W)
            {
                canCollect = true;
            }
            break;
        }

        if (canCollect)
        {
            playerMountController.CurrentMountedItemPickUp.ItemCollectedWhileBeingMounted++;
        }

        return(canCollect);
    }