Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by bcjordan · Jan 24, 2018 at 08:22 PM · editor-scriptingcommand-linebatchmode

Does EditorApplication.update get called in -batchmode when calling -executeMethod?

I'm experimenting with trying to get PlayFab's API helpers to work within batch mode for a build script.

It seems its internal HTTP calls rely on Update() to be called to dispatch changes. This presents a challenge as Update() does not get called within -batchmode -executeMethod mode.

To delay the editor application's exit, I currently use:

     while(!_isDone)
     {
         Thread.Sleep(100);
     }
     EditorApplication.Exit(0);

One option would be to try to bind EditorApplication.update to call the HTTP client's Update method.

Does EditorApplication.update get called within batchmode/executeMethod?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by GuillaumeCL · Aug 02, 2018 at 03:53 PM

I had the same question as you can ran a test. As far as I can tell, EditorApplication.update does in fact get called when running in batchmode with executeMethod. (As of Unity 2018.2)

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sgross · Feb 11, 2019 at 03:26 PM 0
Share

Are you sure? I tried it with Unity 2017.4.18f1 and it did get called.

avatar image GuillaumeCL sgross · Feb 11, 2019 at 03:35 PM 0
Share

I agree, it does get called. That's what I said.

avatar image sgross GuillaumeCL · Feb 12, 2019 at 11:38 AM 0
Share

Oh, I forgot a "not". I tried the following:

 public class TestScript {
     public static void Run()
     {
         EditorApplication.update += () => 
             UnityEngine.Debug.Log("Hello From Update");
         
         UnityEngine.Debug.Log("Hello From Script");
 
         var isRunning = true;
         
         var i = 0;
         while (isRunning)
         {
             Thread.Sleep(100);
             if (i++ == 1000)
                 isRunning = false;
         }
         
         EditorApplication.Exit(0);
     }
 }
 

And called it with

 Unity.exe -nographics -batchmode -projectPath C:\0\04_unity\TmpProject\TmpProjec
 t -execute$$anonymous$$ethod TestScript.Run -quit -logfile testlog.log


The output in testlog.log does not contain the "Hello from Update" logs. Unity Version is 2018.3.5f1.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

87 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to execute async method in batchmode correctly?,Questions about how to execute async method in batchmode 1 Answer

Unity standalone crash when lanughing on batchmode 0 Answers

-batchmode flag only available in PRO? 1 Answer

Linux editor attempting to connect to X even in batch mode with -nographics. 0 Answers

Unity Command Line Fails to Get license 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges