Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about unsaved scenes before commit #1077

Closed
bartlomiej-dawidow opened this issue Mar 5, 2019 · 5 comments · Fixed by #2071
Closed

Warn about unsaved scenes before commit #1077

bartlomiej-dawidow opened this issue Mar 5, 2019 · 5 comments · Fixed by #2071
Assignees
Milestone

Comments

@bartlomiej-dawidow
Copy link

To reproduce:

  1. Make some changes to a Unity scene, e.g. rename a GameObject.
  2. Edit a script in Rider.
  3. Commit changes to git.

If you do not save the changes done in Unity, they will not be included in the commit. I routinely find myself forgetting to do this.

A suggested solution would be to add a prominent warning message somewhere in the Commit Changes dialog if there are any unsaved changes in Unity.

@van800
Copy link
Contributor

van800 commented Mar 6, 2019

I wonder if there is any api to check unsaved scenes in UnityEditor.

@citizenmatt
Copy link
Member

Yes, you can call Scene.isDirty to see if it's modified in memory, and use something like EditorSceneManger.GetSceneAt to iterate over all open scenes. I need something similar for the YAML stuff (don't want to rename something referenced in an unsaved scene), so I can look into this as part of that.

@van800
Copy link
Contributor

van800 commented Mar 6, 2019

for (var i = 0; i < SceneManager.sceneCount; ++i)
    if (SceneManager.GetSceneAt(i).isDirty) ...

@krasnotsvetov
Copy link
Collaborator

krasnotsvetov commented Mar 6, 2019

We have already do same check for Find Usages in scenes, so it is possible. But the connection should be established for this feature
https://github.com/JetBrains/resharper-unity/blob/191/unity/EditorPlugin/AfterUnity56/Navigation/Window/FindUsagesWindow.cs#L57

@van800 van800 added this to the Rider 2019.2 milestone Mar 15, 2019
@van800 van800 self-assigned this Mar 15, 2019
@citizenmatt citizenmatt removed this from the Rider 2019.2 milestone Aug 14, 2019
@van800 van800 removed their assignment Aug 20, 2019
@van800 van800 added the up for grabs Good issues for external contributors label Aug 20, 2019
@krasnotsvetov krasnotsvetov self-assigned this Nov 19, 2019
@van800 van800 assigned van800 and unassigned krasnotsvetov Apr 6, 2021
@van800
Copy link
Contributor

van800 commented Apr 6, 2021

closed in favor of https://youtrack.jetbrains.com/issue/RIDER-60824

@van800 van800 closed this as completed Apr 6, 2021
@citizenmatt citizenmatt added this to the Rider 2021.2 milestone Apr 20, 2021
@citizenmatt citizenmatt linked a pull request Apr 20, 2021 that will close this issue
@citizenmatt citizenmatt removed the up for grabs Good issues for external contributors label Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants