forked from Unity-Technologies/EditorXR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert IUsesGameObjectLocking to IProvides/UsesGameObjectLocking
- Loading branch information
Showing
12 changed files
with
128 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Unity.Labs.ModuleLoader; | ||
using UnityEngine; | ||
|
||
namespace Unity.Labs.EditorXR.Interfaces | ||
{ | ||
/// <summary> | ||
/// Provide access to grouping | ||
/// </summary> | ||
public interface IProvidesGameObjectLocking : IFunctionalityProvider | ||
{ | ||
/// <summary> | ||
/// Set a GameObject's locked status | ||
/// </summary> | ||
/// <param name="go">The GameObject to set locked or unlocked</param> | ||
/// <param name="locked">Locked or unlocked status</param> | ||
void SetLocked(GameObject go, bool locked); | ||
|
||
/// <summary> | ||
/// Check whether a GameObject is locked | ||
/// </summary> | ||
/// <param name="go">GameObject locked status to test</param> | ||
bool IsLocked(GameObject go); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Unity.Labs.ModuleLoader; | ||
using UnityEngine; | ||
|
||
namespace Unity.Labs.EditorXR.Interfaces | ||
{ | ||
/// <summary> | ||
/// Gives decorated class access to grouping | ||
/// </summary> | ||
public interface IUsesGameObjectLocking : IFunctionalitySubscriber<IProvidesGameObjectLocking> | ||
{ | ||
} | ||
|
||
public static class UsesGameObjectLocking | ||
{ | ||
/// <summary> | ||
/// Set a GameObject's locked status | ||
/// </summary> | ||
/// <param name="user">The functionality user</param> | ||
/// <param name="go">The GameObject to set locked or unlocked</param> | ||
/// <param name="locked">Locked or unlocked status</param> | ||
public static void SetLocked(this IUsesGameObjectLocking user, GameObject go, bool locked) | ||
{ | ||
{ | ||
#if !FI_AUTOFILL | ||
user.provider.SetLocked(go, locked); | ||
#endif | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Check whether a GameObject is locked | ||
/// </summary> | ||
/// <param name="user">The functionality user</param> | ||
/// <param name="go">GameObject locked status to test</param> | ||
public static bool IsLocked(this IUsesGameObjectLocking user, GameObject go) | ||
{ | ||
#if FI_AUTOFILL | ||
return default(bool); | ||
#else | ||
return user.provider.IsLocked(go); | ||
#endif | ||
} | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...yInjection/IUsesGameObjectLocking.cs.meta → ...ubscribers/IUsesGameObjectLocking.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
Runtime/Scripts/Interfaces/FunctionalityInjection/IUsesGameObjectLocking.cs
This file was deleted.
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
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
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