diff --git a/ModKit.sln b/ModKit.sln index 15d4eb9..ea7c2bb 100644 --- a/ModKit.sln +++ b/ModKit.sln @@ -27,6 +27,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{8C EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeatherScript", "examples\WeatherManager\WeatherScript.csproj", "{1EFBA076-3ED2-403E-AE88-DB73421B925D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheatScript", "examples\CheatScript\CheatScript.csproj", "{3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoSharkScript", "examples\NoSharkScript\NoSharkScript.csproj", "{142D25E4-F89B-4B02-960C-BA0D21B7FDBF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -89,6 +93,30 @@ Global {1EFBA076-3ED2-403E-AE88-DB73421B925D}.Release|x64.Build.0 = Release|Any CPU {1EFBA076-3ED2-403E-AE88-DB73421B925D}.Release|x86.ActiveCfg = Release|Any CPU {1EFBA076-3ED2-403E-AE88-DB73421B925D}.Release|x86.Build.0 = Release|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Debug|x64.ActiveCfg = Debug|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Debug|x64.Build.0 = Debug|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Debug|x86.ActiveCfg = Debug|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Debug|x86.Build.0 = Debug|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Release|Any CPU.Build.0 = Release|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Release|x64.ActiveCfg = Release|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Release|x64.Build.0 = Release|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Release|x86.ActiveCfg = Release|Any CPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}.Release|x86.Build.0 = Release|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Debug|x64.ActiveCfg = Debug|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Debug|x64.Build.0 = Debug|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Debug|x86.ActiveCfg = Debug|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Debug|x86.Build.0 = Debug|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Release|Any CPU.Build.0 = Release|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Release|x64.ActiveCfg = Release|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Release|x64.Build.0 = Release|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Release|x86.ActiveCfg = Release|Any CPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -99,6 +127,8 @@ Global {2B492C4A-E6A8-4254-B6D0-B7A515C47960} = {05334CC9-0EFE-4679-AFDA-1818BFBB7C67} {F2ACC7C1-C8DA-4506-9081-1D6AC8AA3CB4} = {8C13F524-3B57-49E9-B96C-0C6F92FD220E} {1EFBA076-3ED2-403E-AE88-DB73421B925D} = {8C13F524-3B57-49E9-B96C-0C6F92FD220E} + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59} = {8C13F524-3B57-49E9-B96C-0C6F92FD220E} + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF} = {8C13F524-3B57-49E9-B96C-0C6F92FD220E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {80E653F7-0500-45D2-A9B9-E1EAE2FD385E} diff --git a/ModKit/MenuScript.cs b/ModKit/MenuScript.cs index b6a7d57..93b6d61 100644 --- a/ModKit/MenuScript.cs +++ b/ModKit/MenuScript.cs @@ -82,7 +82,7 @@ public void OnGUI() style.fontStyle = FontStyle.Bold; style.normal = styleState; - GUI.TextField(new Rect(Screen.width / 2 - 100, 10, 200, 30), "ModKit v.1.0.0.1", style); + GUI.Box(new Rect(Screen.width / 2 - 100, 10, 200, 30), "ModKit v.1.0.0.1", style); } public void Update() diff --git a/examples/CheatScript/CheatScript.csproj b/examples/CheatScript/CheatScript.csproj new file mode 100644 index 0000000..45b54e2 --- /dev/null +++ b/examples/CheatScript/CheatScript.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {3FBE11BF-BF9E-43B7-B962-0F915BFDBE59} + Library + Properties + CheatScript + CheatScript + v4.6.1 + 512 + + + true + full + false + ..\..\bin\plugins\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\bin\plugins\ + TRACE + prompt + 4 + + + + False + ..\..\..\..\SteamLibrary\steamapps\common\Raft\Raft_Data\Managed\Assembly-CSharp.dll + + + + + + + + + + + ..\..\..\..\SteamLibrary\steamapps\common\Raft\Raft_Data\Managed\UnityEngine.dll + + + + + + + + \ No newline at end of file diff --git a/examples/CheatScript/Properties/AssemblyInfo.cs b/examples/CheatScript/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3d632b0 --- /dev/null +++ b/examples/CheatScript/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CheatScript")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CheatScript")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3fbe11bf-bf9e-43b7-b962-0f915bfdbe59")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/examples/CheatScript/Script.cs b/examples/CheatScript/Script.cs new file mode 100644 index 0000000..c46f9a8 --- /dev/null +++ b/examples/CheatScript/Script.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace CheatScript +{ + public static class Utils + { + public static T GetPrivateField(this object obj, string name) + { + BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic; + Type type = obj.GetType(); + FieldInfo field = type.GetField(name, flags); + return (T)field.GetValue(obj); + } + + public static T GetPrivateProperty(this object obj, string name) + { + BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic; + Type type = obj.GetType(); + PropertyInfo field = type.GetProperty(name, flags); + return (T)field.GetValue(obj, null); + } + } + + public class Script: MonoBehaviour + { + //private static bool cheatsInited = false; + //private static bool cheatsActivated = false; + void Update() + { + if (GameManager.GameMode != GameMode.None) + { + if (Input.GetKeyDown(KeyCode.N)) + { + GameManager.UseCheats = !GameManager.UseCheats; + //GameManager gm = FindObjectOfType(); + //Cheat cheat = gm.GetPrivateField("cheat"); + + //if(!cheatsInited) + //{ + // cheat.Initialize(); + // cheatsInited = true; + //} + + //if(cheatsActivated) + //{ + // GameManager.UseCheats = true; + // cheatsActivated = false; + //} + //else + //{ + // GameManager.UseCheats = true; + // cheatsActivated = true; + //} + } + } + } + } +} diff --git a/examples/NoSharkScript/NoSharkScript.csproj b/examples/NoSharkScript/NoSharkScript.csproj new file mode 100644 index 0000000..5751e46 --- /dev/null +++ b/examples/NoSharkScript/NoSharkScript.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {142D25E4-F89B-4B02-960C-BA0D21B7FDBF} + Library + Properties + NoSharkScript + NoSharkScript + v4.6.1 + 512 + + + true + full + false + ..\..\bin\plugins\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\bin\plugins\ + TRACE + prompt + 4 + + + + False + ..\..\..\SteamLibrary\steamapps\common\Raft\Raft_Data\Managed\Assembly-CSharp.dll + + + + + + + + + + + ..\..\..\SteamLibrary\steamapps\common\Raft\Raft_Data\Managed\UnityEngine.dll + + + + + + + + \ No newline at end of file diff --git a/examples/NoSharkScript/Properties/AssemblyInfo.cs b/examples/NoSharkScript/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3ecca3f --- /dev/null +++ b/examples/NoSharkScript/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NoSharkScript")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NoSharkScript")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("142d25e4-f89b-4b02-960c-ba0d21b7fdbf")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/examples/NoSharkScript/Script.cs b/examples/NoSharkScript/Script.cs new file mode 100644 index 0000000..97eac98 --- /dev/null +++ b/examples/NoSharkScript/Script.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace NoSharkScript +{ + public class Script: MonoBehaviour + { + public void Update() + { + if(GameManager.GameMode != GameMode.None) + { + Shark shark = FindObjectOfType(); + shark.state = SharkState.None; + } + } + } +}