-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from suzuryg/feat/restoration-checkpoint
feat: Add restoration checkpoint
- Loading branch information
Showing
14 changed files
with
294 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
Packages/jp.suzuryg.face-emo/Editor/AppMain/FaceEmoRestorer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Suzuryg.FaceEmo.AppMain; | ||
using Suzuryg.FaceEmo.Components; | ||
|
||
namespace Suzuryg.FaceEmo.Detail | ||
{ | ||
public class FaceEmoRestorer : IRestorer | ||
{ | ||
private RestorationCheckpoint _restorationCheckpoint; | ||
|
||
public FaceEmoRestorer(RestorationCheckpoint restorationCheckpoint) | ||
{ | ||
_restorationCheckpoint = restorationCheckpoint; | ||
} | ||
|
||
public bool CanRestore() => FaceEmoLauncher.CanRestore(_restorationCheckpoint); | ||
public void Restore() => FaceEmoLauncher.Restore(_restorationCheckpoint); | ||
|
||
public (string current, string backup) GetNames() | ||
{ | ||
var current = _restorationCheckpoint.gameObject != null ? _restorationCheckpoint.gameObject.name : string.Empty; | ||
var backup = _restorationCheckpoint.LatestBackup != null ? _restorationCheckpoint.LatestBackup.name : string.Empty; | ||
return (current, backup); | ||
} | ||
} | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
Packages/jp.suzuryg.face-emo/Editor/AppMain/FaceEmoRestorer.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Suzuryg.FaceEmo.Detail | ||
{ | ||
public interface IRestorer | ||
{ | ||
bool CanRestore(); | ||
void Restore(); | ||
(string current, string backup) GetNames(); | ||
} | ||
} | ||
|
Oops, something went wrong.