Skip to content

Commit

Permalink
Added 2 more scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
emcifuntik committed Jun 3, 2018
1 parent 2ddec71 commit 6533770
Show file tree
Hide file tree
Showing 8 changed files with 296 additions and 1 deletion.
30 changes: 30 additions & 0 deletions ModKit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion ModKit/MenuScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
54 changes: 54 additions & 0 deletions examples/CheatScript/CheatScript.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3FBE11BF-BF9E-43B7-B962-0F915BFDBE59}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CheatScript</RootNamespace>
<AssemblyName>CheatScript</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\bin\plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\SteamLibrary\steamapps\common\Raft\Raft_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\SteamLibrary\steamapps\common\Raft\Raft_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Script.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
36 changes: 36 additions & 0 deletions examples/CheatScript/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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")]
64 changes: 64 additions & 0 deletions examples/CheatScript/Script.cs
Original file line number Diff line number Diff line change
@@ -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<T>(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<T>(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<GameManager>();
//Cheat cheat = gm.GetPrivateField<Cheat>("cheat");

//if(!cheatsInited)
//{
// cheat.Initialize();
// cheatsInited = true;
//}

//if(cheatsActivated)
//{
// GameManager.UseCheats = true;
// cheatsActivated = false;
//}
//else
//{
// GameManager.UseCheats = true;
// cheatsActivated = true;
//}
}
}
}
}
}
54 changes: 54 additions & 0 deletions examples/NoSharkScript/NoSharkScript.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{142D25E4-F89B-4B02-960C-BA0D21B7FDBF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NoSharkScript</RootNamespace>
<AssemblyName>NoSharkScript</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\bin\plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\SteamLibrary\steamapps\common\Raft\Raft_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\SteamLibrary\steamapps\common\Raft\Raft_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Script.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
36 changes: 36 additions & 0 deletions examples/NoSharkScript/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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")]
21 changes: 21 additions & 0 deletions examples/NoSharkScript/Script.cs
Original file line number Diff line number Diff line change
@@ -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>();
shark.state = SharkState.None;
}
}
}
}

0 comments on commit 6533770

Please sign in to comment.