Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Scyye committed Apr 6, 2023
1 parent ffcedbb commit db2e6de
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 0 deletions.
67 changes: 67 additions & 0 deletions Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using BepInEx;
using HarmonyLib;
using System;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace MuteableJustinRun
{
[BepInPlugin(ModId, "Mutable Justin Run", "1.0.0")]
[BepInProcess("Justin run 2.exe")]
public class Main : BaseUnityPlugin
{
private const string ModId = "scyye.mutablejustinrun";

private Player player;
private GameObject musicPlayer;

private void Awake()
{
SceneManager.activeSceneChanged += ChangedActiveScene;
ToggleSound();
}

private void OnDestroy()
{
SceneManager.activeSceneChanged -= ChangedActiveScene;
}

private void ChangedActiveScene(Scene current, Scene next)
{
preInit();
System.Threading.Thread.Sleep(2000);
ToggleSound();
}

private void preInit()
{
player = GameObject.FindGameObjectWithTag("Player")?.GetComponent<Player>();
musicPlayer = GameObject.Find("music player");
}

private void Update()
{
if (Input.GetKeyDown(KeyCode.M))
{
ToggleSound();
}
}

private void ToggleSound()
{
if (player == null)
{
player = GameObject.FindGameObjectWithTag("Player")?.GetComponent<Player>();
}
if (musicPlayer == null)
{
musicPlayer = GameObject.Find("music player");
}
if (player != null && musicPlayer != null)
{
musicPlayer.SetActive(!musicPlayer.activeSelf);
player.playerSoundSource.mute = !player.playerSoundSource.mute;
}
}
}
}
90 changes: 90 additions & 0 deletions MutableJustinRun.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?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>{D0931FF9-748A-4C89-A212-4B234B2068B0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MutableJustinRun</RootNamespace>
<AssemblyName>MutableJustinRun</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\BepInEx\core\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\BepInEx\core\BepInEx.dll</HintPath>
</Reference>
<Reference Include="MonoMod.Utils">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\BepInEx\core\MonoMod.Utils.dll</HintPath>
</Reference>
<Reference Include="PhotonUnityNetworking">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\PhotonUnityNetworking.dll</HintPath>
</Reference>
<Reference Include="PhotonUnityNetworking.Demos">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\PhotonUnityNetworking.Demos.dll</HintPath>
</Reference>
<Reference Include="PhotonUnityNetworking.Utilities">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\PhotonUnityNetworking.Utilities.dll</HintPath>
</Reference>
<Reference Include="PhotonWebSocket">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\PhotonWebSocket.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Downloads\Justin Run 2 Demo\Justin run 2_Data\Managed\UnityEngine.UIModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
25 changes: 25 additions & 0 deletions MutableJustinRun.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33403.182
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MutableJustinRun", "MutableJustinRun.csproj", "{D0931FF9-748A-4C89-A212-4B234B2068B0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D0931FF9-748A-4C89-A212-4B234B2068B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D0931FF9-748A-4C89-A212-4B234B2068B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0931FF9-748A-4C89-A212-4B234B2068B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0931FF9-748A-4C89-A212-4B234B2068B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5EA52F67-367D-44C0-B7A2-AE3FDE56CE6F}
EndGlobalSection
EndGlobal

0 comments on commit db2e6de

Please sign in to comment.