Search Unity

Question Delete items from the Economy configuration.

Discussion in 'Economy' started by Gernata, Jan 12, 2024.

  1. Gernata

    Gernata

    Joined:
    May 26, 2021
    Posts:
    9
    I'm using the Deployment package for deploying new Economy items to the Economy configuration, but i can't also delete these items from the editor,
    is it possible to delete items from the Economy configuration using an Editor script?
     
  2. GabKBelmonte

    GabKBelmonte

    Unity Technologies

    Joined:
    Dec 14, 2021
    Posts:
    113
    Hey!

    Thank you for the feedback, I'm part of the editor experience team for UGS. The deletion operation can be a bit tricky, since we don't necessarily know who has ownership of the resource, a dashboard user (live operator), or a editor operator, and we don't want to accidentally delete someone's work.

    We do, however, have a solution for you, the UGS CLI.
    The CLI supports the "deploy" command, which is the same business logic, but has access to two additional options, "reconcile", and "dry-run". It is also intended to be capable of being used with automation.

    By doing the following:
    Code (csharp):
    1.  
    2. ugs deploy my-economy-folder --reconcile -s economy --dry-run
    3.  
    You'll deploy all the contents of the directory and delete all content that's no longer present locally.
    I added the dry-run flag, which will give you a heads up as to what's expected to happen, before you run the actual command.

    That said, I recognize this answer may not be totally satisfactory, and we've had a few other considerations on how to implement it in the editor (including making reconcile available from the editor, and exposing the admin API directly from editor scripting). In short, whats your opinion? Your feedback on different ways it could be implemented will be taken into account moving forward!
     
    Arnaud_Gorain likes this.