diff --git a/CameraPlus/CameraMoverPointer.cs b/CameraPlus/CameraMoverPointer.cs index 6a99aa3..e9ec507 100644 --- a/CameraPlus/CameraMoverPointer.cs +++ b/CameraPlus/CameraMoverPointer.cs @@ -71,7 +71,7 @@ protected virtual void Update() protected virtual void LateUpdate() { - if (_grabbingController != null) + if (_grabbingController != null && !_cameraPlus.Config.LockCamera) { var diff = _grabbingController.verticalAxisValue * Time.unscaledDeltaTime; if (_grabPos.magnitude > MinScrollDistance) diff --git a/CameraPlus/CameraPlus.csproj b/CameraPlus/CameraPlus.csproj index ca2b28b..2a50c86 100644 --- a/CameraPlus/CameraPlus.csproj +++ b/CameraPlus/CameraPlus.csproj @@ -144,6 +144,10 @@ + + + + diff --git a/CameraPlus/Config.cs b/CameraPlus/Config.cs index a284c19..e8953ad 100644 --- a/CameraPlus/Config.cs +++ b/CameraPlus/Config.cs @@ -8,6 +8,7 @@ public class Config { public string FilePath { get; } public bool LockScreen = false; + public bool LockCamera = false; public float fov = 50; public int antiAliasing = 2; public float renderScale = 1; diff --git a/CameraPlus/ContextMenu.cs b/CameraPlus/ContextMenu.cs index a21b844..e8c2dfe 100644 --- a/CameraPlus/ContextMenu.cs +++ b/CameraPlus/ContextMenu.cs @@ -25,6 +25,7 @@ internal Vector2 menuPos internal string[] scriptName; internal int scriptPage; internal Texture2D texture = null; + internal Texture2D Cameratexture = null; internal GUIStyle CustomEnableStyle = null; internal GUIStyle CustomDisableStyle = null; @@ -45,6 +46,10 @@ public void EnableMenu(Vector2 mousePos, CameraPlusBehaviour parentBehaviour) texture = Utils.LoadTextureFromResources("CameraPlus.Resources.Lock.png"); else texture = Utils.LoadTextureFromResources("CameraPlus.Resources.UnLock.png"); + if (this.parentBehaviour.Config.LockCamera) + Cameratexture = Utils.LoadTextureFromResources("CameraPlus.Resources.CameraLock.png"); + else + Cameratexture = Utils.LoadTextureFromResources("CameraPlus.Resources.CameraUnlock.png"); } public void DisableMenu() { @@ -89,6 +94,17 @@ void OnGUI() } GUI.Box(new Rect(menuPos.x + 35, menuPos.y + 25, 115, 30), new GUIContent(parentBehaviour.Config.LockScreen ? "Locked Screen" : "Unlocked Screen")); + if (GUI.Button(new Rect(menuPos.x + 150, menuPos.y + 25, 30, 30), Cameratexture)) + { + parentBehaviour.Config.LockCamera = !parentBehaviour.Config.LockCamera; + parentBehaviour.Config.Save(); + if (this.parentBehaviour.Config.LockCamera) + Cameratexture = Utils.LoadTextureFromResources("CameraPlus.Resources.CameraLock.png"); + else + Cameratexture = Utils.LoadTextureFromResources("CameraPlus.Resources.CameraUnlock.png"); + } + GUI.Box(new Rect(menuPos.x + 185, menuPos.y + 25, 115, 30), new GUIContent(parentBehaviour.Config.LockCamera ? "Locked Camera" : "Unlocked Camera")); + if (GUI.Button(new Rect(menuPos.x + 5, menuPos.y + 60, 145, 60), new GUIContent("Add New Camera"))) { lock (Plugin.Instance.Cameras) diff --git a/CameraPlus/Properties/AssemblyInfo.cs b/CameraPlus/Properties/AssemblyInfo.cs index f82c9d4..04e298b 100644 --- a/CameraPlus/Properties/AssemblyInfo.cs +++ b/CameraPlus/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.7.4")] -[assembly: AssemblyFileVersion("4.7.4")] +[assembly: AssemblyVersion("4.7.5")] +[assembly: AssemblyFileVersion("4.7.5")] diff --git a/CameraPlus/Resources/CameraLock.png b/CameraPlus/Resources/CameraLock.png new file mode 100644 index 0000000..be9c21b Binary files /dev/null and b/CameraPlus/Resources/CameraLock.png differ diff --git a/CameraPlus/Resources/CameraUnlock.png b/CameraPlus/Resources/CameraUnlock.png new file mode 100644 index 0000000..4c3befd Binary files /dev/null and b/CameraPlus/Resources/CameraUnlock.png differ diff --git a/CameraPlus/manifest.json b/CameraPlus/manifest.json index 67f4672..fb1f5d3 100644 --- a/CameraPlus/manifest.json +++ b/CameraPlus/manifest.json @@ -5,7 +5,7 @@ "gameVersion": "1.13.2", "id": "CameraPlus", "name": "CameraPlus", - "version": "4.7.4", + "version": "4.7.5", "features": [], "dependsOn": { "BSIPA": "^4.1.4"