Browse Source

disable bloom effect in color corrector plugin

Genei Shouko 7 years ago
parent
commit
c8faaa7f73

+ 6 - 2
BepInEx/BepInEx.csproj

@@ -41,7 +41,11 @@
     </Reference>
     <Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>D:\koikatu\KoikatuTrial_Data\Managed\Assembly-CSharp.dll</HintPath>
+      <HintPath>..\lib\Assembly-CSharp.dll</HintPath>
+    </Reference>
+    <Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\lib\Assembly-CSharp-firstpass.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Windows.Forms" />
@@ -71,4 +75,4 @@
   </ItemGroup>
   <Import Project="..\BepInEx.Common\BepInEx.Common.projitems" Label="Shared" />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>
+</Project>

+ 9 - 7
Plugins/ColorCorrector/ColorCorrector.cs

@@ -5,6 +5,7 @@ using System.Linq;
 using System.Text;
 using UnityEngine;
 using UnityEngine.SceneManagement;
+using UnityStandardAssets.ImageEffects;
 
 namespace ColorCorrector
 {
@@ -12,17 +13,15 @@ namespace ColorCorrector
     {
         public override string Name => "Color Filter Remover";
         
-        AmplifyColorEffect component;
+        AmplifyColorEffect amplifyComponent;
+        BloomAndFlares bloomComponent;
 
         protected override void LevelFinishedLoading(Scene scene, LoadSceneMode mode)
         {
             if (Camera.main != null && Camera.main?.gameObject != null)
             {
-                var c = Camera.main.gameObject.GetComponent<AmplifyColorEffect>();
-                if (c != null)
-                {
-                    component = c;
-                }
+                amplifyComponent = Camera.main.gameObject.GetComponent<AmplifyColorEffect>(); ;
+                bloomComponent = Camera.main.gameObject.GetComponent<BloomAndFlares>();
             }
         }
 
@@ -36,7 +35,10 @@ namespace ColorCorrector
 
         void ToggleEffects()
         {
-            component.enabled = !component.enabled;
+            amplifyComponent.enabled = !amplifyComponent.enabled;
+            bloomComponent.enabled = !bloomComponent.enabled;
+            Console.WriteLine($"Amplify Filter Enabled: {amplifyComponent.enabled}");
+            Console.WriteLine($"Bloom Filter Enabled: {bloomComponent.enabled}");
         }
     }
 }

+ 4 - 1
Plugins/ColorCorrector/ColorCorrector.csproj

@@ -34,6 +34,9 @@
       <HintPath>..\..\lib\Assembly-CSharp.dll</HintPath>
       <Private>False</Private>
     </Reference>
+    <Reference Include="Assembly-CSharp-firstpass">
+      <HintPath>..\..\lib\Assembly-CSharp-firstpass.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
@@ -57,4 +60,4 @@
     </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>
+</Project>