Author Topic: NGUI3.0.5 confuses perforce source control  (Read 8151 times)

c1393952

  • Guest
NGUI3.0.5 confuses perforce source control
« on: November 23, 2013, 12:25:46 PM »
Hello, everyone
Our project used Unity4.2 and NGUI2.6.1e, and we worked with perforce well until updating to NGUI3.0.5.
NGUI3.0.5 seems to modify prefabs automatically, and that will lead to perforce checkout all UI prefabs even no any changing......
I suppose this caused by NGUI Upgrated tool, but my guess is wrong, it still checkout all UI prefabs after I delete the tool.
Could anyone tell me how I stop this function?
Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #1 on: November 23, 2013, 08:36:49 PM »
Going from NGUI 2 to 3 you will need to update prefabs, but once they are updated / saved nothing should touch them again.

c1393952

  • Guest
Re: NGUI3.0.5 confuses perforce source control
« Reply #2 on: November 23, 2013, 10:16:24 PM »
I just open all scenes, save and apply all prefabs, but all UI prefabs are still checkout by perforce, even no anything is changed.

If I use "P4 diff" to see what is changed, I can find all end of line are changed to \n, the UNIX style EOL, and our project is developed under WINDOWS, \r\n EOL.

P4 server is just use UNIX EOL to save all "text" type files, and change to local EOL when download files to local, here is WINDOWS EOL.

The odd situation is all local UI prefabs are change to UNIX EOL when I just open and close unity once, NGUI seems to change them automatically, even no thing is changed.

I think NGUI open and save the prefab once during checking, does it is? Can I close this check function?

Thanks for reply.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #3 on: November 24, 2013, 01:45:02 AM »
No, NGUI doesn't do this. Prefabs contain disabled scripts. No scripts actually run on prefabs. The only way scripts execute on prefabs is if you at the very least select them so they show up in inspector.

SonarJetLens

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #4 on: January 13, 2014, 06:52:06 AM »
I can confirm that we're having the same problem; since we upgraded large numbers of prefabs are being automagically checked out when opening a project in Unity (without doing anything to it) - some can be "revert unchanged", some can not as the first poster pointed out.
It's a real pain in the back side tbh, can we provide any more information to help you identify the cause?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #5 on: January 13, 2014, 05:51:07 PM »
Change the editor metadata serialization to be Force Text type with visible metadata files, and you will be able to see what changes each time.

ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #6 on: January 13, 2014, 08:28:06 PM »
We've seen this, too.  Nothing actually changes in either the prefab or the meta file, they're just checked out of perforce.  (We've always had metadata serialization set to force text.)  For us, it usually happens after playing the game in the editor.  Just opening unity, saving, and quitting generally doesn't trigger it.  It's not strictly limited to NGUI prefabs, either, though they are the majority of affected files.  Occasionally something else like Physics2DSettings.asset will get checked out with no changes.

I personally usually check files in using P4V, even when they were checked out through Unity, so maybe Unity has some bad state cached and thinks those files are supposed to be checked out?  We've just been living with it here and reverting the checkouts when it happens.

SonarJetLens

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #7 on: January 14, 2014, 12:08:53 PM »
I just did a couple of test that might help;
  • Open project using NGUI 3, select "main" scene, run it and close project : 57 different prefab, meta and mat files checked out, 56 were unchanged but in one material file the texture guid had changed
  • Open same project, select "main" scene and close it straight away without running : 8 files checked out, 4 had changes in width and/or height
  • Opened a project which does not use NGUI at all; ran, selected different scenes etc. and then closed : no checkouts...

JumpCore

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #8 on: January 20, 2014, 08:55:08 PM »
We're using SVN, not perforce, but we're experiencing a similar issue.

After recently (finally!) getting around to updating our project to use NGUI 3.0.x (and also switching over all our labels to using dynamic fonts, fwiw), our prefabs that we use for our game's UI are getting flagged as changed without any changes having been implemented. This is after the initial upgrade changes have been checked in, and we even checked them in additional times thinking that perhaps we (or NGUI) missed them during the upgrade somehow, but they continue to get flagged as changed.

Found this thread while checking to see if anyone else was having similar problems . . .

Thanks in advance, Michael, for any further wisdom you might lend as to how we can get this sorted!

We're currently using Unity 4.3.3 and NGUI 3.0.8f7.

     ->Cameron

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #9 on: January 21, 2014, 01:11:43 AM »
So it turns out... Unity executes OnValidate function on scripts attached to prefabs that are not a part of the scene, and are not selected.

Yes, you read that right. Prefabs in the Project view cause their scripts to execute. So as it turns out, you may be doing your own thing, and you may be in a completely new scene with nothing in it, and your inspector may be showing nothing, but Unity will still take the liberty of running OnValidate functions on scripts of disabled objects that don't exist in your scene.

My guess is that this is what was causing those modifications.

JumpCore

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #10 on: January 29, 2014, 05:28:13 PM »
Took me a while to circle back around on this, but wanted to say thanks for sorting that out, and thanks even more for pushing out the quick fix in 3.0.9 f3 - that seems to have done the trick! Cheers!

ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
Re: NGUI3.0.5 confuses perforce source control
« Reply #11 on: January 30, 2014, 01:50:25 PM »
Oh yeah, same here.  I still see the Physics settings getting checked out every once in a while, but that's probably one of our import tools or something.  Certainly not NGUI-related.  Thanks, Michael!