Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Switching Project Ids with Scripting

Discussion in 'Unity Analytics' started by SimonOliver, May 17, 2016.

  1. SimonOliver

    SimonOliver

    Joined:
    Jul 16, 2007
    Posts:
    25
    Hi,

    We've got a single Unity project that outputs a number of different applications (different bundle ids), but currently it seems that there's no easy way of modifying cloudProjectId (its set as read only). We need to modify this at build time to switch project ids for analytics etc, otherwise the various builds can't be automated.

    What is the best way to do this? I've tried using reflection but get "
    EditorOnlyPlayerSettings property cloudProjectId::cloudProjectId not inititalized. Please initialize it using corresponding PlayerSettings.InitializeProperty function!"

    Thanks,
    Simon
     
  2. erika_d

    erika_d

    Unity Technologies

    Joined:
    Jan 20, 2016
    Posts:
    311
    Hi @SimonOliver,

    Unfortunately, we don't currently have a way to change project id's via code. Can I ask that you add this as a suggestion (or vote on the idea if it already exists) on our feedback page? I've seen this feature request before, but it's good to have it's popularity documented on the feedback page, since this is what we look at when trying to decide what new features to implement. Here's the link to the page: https://feedback.unity3d.com/forums...f8=✓&status=0&category=analytics&view=hottest
     
  3. SimonOliver

    SimonOliver

    Joined:
    Jul 16, 2007
    Posts:
    25
    Ok, thanks for letting me know - will add this.
     
  4. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    463
    Hi Erica, we need this feature as well. we have eight apps that we are producing from one unity project. Simple API like SwithProject(id) would be really helpful.
     
    erika_d likes this.
  5. erika_d

    erika_d

    Unity Technologies

    Joined:
    Jan 20, 2016
    Posts:
    311
    Hi @Foriero,

    Thanks for that information and use case! I will make note of that, and I would suggest creating an idea for it on the feedback page linked above. Right now the only one I see is for changing it at runtime, which is a bit different from build time which is what I believe you're describing. Having your use case documented there would be very useful.
     
  6. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    463
    Hi, if I can change it from code in runtime then it is enough. Can you provide us link or sample code?

    Thanks, Marek.
     
  7. erika_d

    erika_d

    Unity Technologies

    Joined:
    Jan 20, 2016
    Posts:
    311
  8. kodekq

    kodekq

    Joined:
    Sep 27, 2014
    Posts:
    16
    Please write if there have been any changes since 2016?
     
  9. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    344
    I'm afraid we have not opted to make this a feature or development priority.
     
  10. kodekq

    kodekq

    Joined:
    Sep 27, 2014
    Posts:
    16
    Ok( Thanks for answer.
     
  11. jekill

    jekill

    Joined:
    Sep 17, 2015
    Posts:
    1
    I understand that this is quite difficult to do in runtime. But can it be done in build time?
     
  12. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    463
    Yes please build time would be really helpful.