-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): show object perms in console and inspector
- Loading branch information
Showing
10 changed files
with
133 additions
and
43 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
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,41 @@ | ||
/** | ||
* Open source software under the terms in /LICENSE | ||
* Copyright (c) 2021, The CONIX Research Center. All rights reserved. | ||
*/ | ||
|
||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace ArenaUnity | ||
{ | ||
#if UNITY_EDITOR | ||
[CustomEditor(typeof(ArenaCamera))] | ||
public class ArenaCameraEditor : Editor | ||
{ | ||
public override void OnInspectorGUI() | ||
{ | ||
ArenaCamera acobj = (ArenaCamera)target; | ||
|
||
// edit authorization | ||
GUILayout.BeginHorizontal("Box"); | ||
GUILayout.Label("Publish Permission:"); | ||
if (Application.isPlaying) | ||
{ | ||
var authStyle = new GUIStyle(EditorStyles.label); | ||
authStyle.normal.textColor = acobj.HasPermissions ? Color.green : (Color)new Color32(255, 165, 0, 255); | ||
var authString = acobj.HasPermissions ? "A" : "Not a"; | ||
GUILayout.Label($"{authString}uthorized to publish changes", authStyle); | ||
} | ||
else | ||
{ | ||
GUILayout.Label("Determined in playmode"); | ||
} | ||
GUILayout.EndHorizontal(); | ||
|
||
GUI.enabled = !Application.isPlaying && acobj.HasPermissions; | ||
DrawDefaultInspector(); | ||
GUI.enabled = true; | ||
} | ||
} | ||
#endif | ||
} |
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
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