Hello Guest

Author Topic: Frequent Saving with Anchors  (Read 4487 times)

PreciousL

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Frequent Saving with Anchors
« on: May 14, 2012, 02:52:42 pm »
When anchors are added to the scene then every action that is done in the editor causes you to have to re-save your file.  Even saving the file makes it so you have to save the file again.

So, if you are like me and hate to see that asterisk denoting that there is unsaved data in your Unity file or you are trying to work in a team and constantly having an unsaved file is leading to versioning issues, one possible solution is to add:

if(_transform.localPosition != anchoredPosition + new Vector3(offset.x, offset.y, 0))

before line 77 in the 'tk2dCameraAnchor.cs' file.  I don't see it causing any issues and it sure does make me less neurotic.  :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Frequent Saving with Anchors
« Reply #1 on: May 14, 2012, 05:08:57 pm »
Nice find, I've sorted it in the codebase now.

asdasd

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Frequent Saving with Anchors
« Reply #2 on: October 21, 2013, 01:48:06 pm »
In 2.2 same issue. Fixed it by replacing "AnchorCamera" with "_anchorCamera" on line 134.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Frequent Saving with Anchors
« Reply #3 on: October 21, 2013, 04:36:21 pm »
Just had a look at that. That was unintentional - thats for bringing it up. To fix it properly, revert to (use AnchorCamera instead of _anchorCamera), and in UpdateTransform, the line:
tk2dCamera = ...;
should read:
      tk2dCamera currentCamera = (AnchorTk2dCamera != null && AnchorTk2dCamera.CameraSettings.projection != tk2dCameraSettings.ProjectionType.Perspective) ? AnchorTk2dCamera : null;
and everywhere else in this function, it should use currentCamera instead of tk2dCamera.

This will be fixed in the next release.