├── FUNDING.yml ├── .gitignore ├── Assets ├── preview.png └── preview-old.png ├── DesktopCamera.csproj.user ├── Settings.cs ├── DesktopCamera.sln ├── Buttons └── SingleButton.cs ├── Properties └── AssemblyInfo.cs ├── Utils ├── VRCUtils.cs └── CameraUtils.cs ├── README.md ├── DesktopCamera.csproj └── Main.cs /FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: nitrog0d -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /obj 3 | /.vs -------------------------------------------------------------------------------- /Assets/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitrog0d/DesktopCamera/HEAD/Assets/preview.png -------------------------------------------------------------------------------- /Assets/preview-old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitrog0d/DesktopCamera/HEAD/Assets/preview-old.png -------------------------------------------------------------------------------- /DesktopCamera.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /Settings.cs: -------------------------------------------------------------------------------- 1 | using DesktopCamera.Utils; 2 | 3 | namespace DesktopCamera { 4 | public class Settings { 5 | 6 | public static bool arrowKeysEnabled = true; 7 | public static bool rotateAroundUserCamera = false; 8 | public static bool moveCamera = false; 9 | public static bool allowCameraMovement = false; 10 | public static bool cameraEnabled = false; 11 | public static CameraUtils.CameraScale cameraScale = CameraUtils.CameraScale.Normal; 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DesktopCamera.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29509.3 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopCamera", "DesktopCamera.csproj", "{A02961D7-45A2-42C2-937A-8323FCBA5ED5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A02961D7-45A2-42C2-937A-8323FCBA5ED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A02961D7-45A2-42C2-937A-8323FCBA5ED5}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A02961D7-45A2-42C2-937A-8323FCBA5ED5}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A02961D7-45A2-42C2-937A-8323FCBA5ED5}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {D4A00F10-BE18-4802-BE30-0F7B6272056F} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Buttons/SingleButton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using UnityEngine.Events; 4 | using DesktopCamera.Utils; 5 | 6 | namespace DesktopCamera.Buttons { 7 | 8 | // Based on https://github.com/DubyaDude/RubyButtonAPI 9 | // Thanks DubyaDude and Emilia (yoshifan#9550) <3 10 | // I promise that one day I'll actually use the repo above, I just don't feel like rewriting the buttons codes in Main.cs right now :c 11 | 12 | class SingleButton { 13 | 14 | public Transform button; 15 | 16 | public SingleButton(string name, string text, string tooltip, int x, int y, Transform childOf = null, UnityAction action = null) { 17 | button = Object.Instantiate(VRCUtils.SingleButtonTemplate(), childOf); 18 | button.name = "nitro" + name; 19 | setText(text); 20 | setTooltip(tooltip); 21 | setButtonPosition(x, y); 22 | setAction(action); 23 | } 24 | 25 | public static Vector3 getButtonPositionFor(int x, int y) { 26 | return new Vector3(-630f + (x * 420f), 1050f + (y * -420f)); 27 | } 28 | 29 | public void setButtonPosition(int x, int y) { 30 | button.localPosition = getButtonPositionFor(x, y); 31 | } 32 | 33 | public void setTooltip(string tooltip) { 34 | button.GetComponent().field_Public_String_0 = tooltip; 35 | } 36 | 37 | public void setInteractable(bool interactable) { 38 | button.gameObject.GetComponent