1
0
mirror of https://github.com/HarukaKinen/Sinmai-Internal-Damage.git synced 2024-11-12 01:30:47 +01:00

Push today's work

This commit is contained in:
Moe Kotoki 2022-02-20 23:37:03 +08:00
parent 4f8f729df0
commit b2f8074cfd
5 changed files with 167 additions and 20 deletions

View File

@ -0,0 +1,103 @@
using System.Globalization;
using System.Reflection;
using Manager;
using Sinmai.Helper;
using UnityEngine;
namespace Sinmai.Functions
{
public class Skins
{
private static readonly BindingFlags BindFlags = BindingFlags.NonPublic | BindingFlags.Instance;
private static readonly BindingFlags pBindFlags = BindingFlags.NonPublic;
private static readonly BindingFlags iBindFlags = BindingFlags.Instance;
private static readonly BindingFlags sBindFlags = BindingFlags.Static;
private static UserInformationController lUserInformationController = GameObject
.Find("LeftMonitor/CommonProcess(Clone)/RearCanvas/Sub/UI_UserInformation/UI_UserData/")
.GetComponent<UserInformationController>();
private static UserInformationController rUserInformationController = GameObject
.Find("RightMonitor/CommonProcess(Clone)/RearCanvas/Sub/UI_UserInformation/UI_UserData/")
.GetComponent<UserInformationController>();
public static void GetTimer()
{
if (!Settings.CheckBox) return;
Render.DrawString(new Vector2(200, 210), "CheckBox Checked", false);
// CommonTimer (Unity.GameObject)
var lCommonTimer = GameObject
.Find("LeftMonitor/GenericProcess(Clone)/Canvas/Main/UI_Timer/CommonTimer(Clone)")
.GetComponent<CommonTimer>();
if (lCommonTimer != null)
{
var commonTimerType = typeof(TimerController);
var countDownSecond = commonTimerType.GetField("_countDownSecond", BindFlags);
Render.DrawString(new Vector2(200, 240), countDownSecond.GetValue(commonTimerType).ToString(),
false);
/*// 获取左屏幕的GenericProcess
var lGenericProcess = GameObject.Find("LeftMonitor/GenericProcess(Clone)").GetComponent<GenericProcess>();
// 定义GenericProcess的type
Type genericProcessType = typeof(GenericProcess);
// 从GenericProcess里获取private field timerController
FieldInfo _timerController = genericProcessType.GetField("_timerController", BindFlags);
// 获取timerController的值 array
TimerController timerController = _timerController?.GetValue(lGenericProcess) as TimerController;
// 定义TimerController的Type
Type leftMonitorTimerControllerType = typeof(TimerController);
// 从TimerController类里拿private field countDownSecond
FieldInfo leftMonitorTimerControllerFi = leftMonitorTimerControllerType.GetField("_countDownSecond", BindFlags);
// 修改 TimerController array 的值
leftMonitorTimerControllerFi.SetValue(timerController, 99U);
_timerController.SetValue(lGenericProcess, timerController);*/
}
else
{
Render.DrawString(new Vector2(200, 240), "CommonTimer = null", false);
}
/*
if(Timer)
Render.DrawString(new Vector2(200, 210), Timer.ToString(), false);
else
Render.DrawString(new Vector2(200, 210), "null object", false);*/
}
public static void PlayerOneOnly()
{
}
public static void RateChanger()
{
if (!Settings.RateCheckBox) return;
var rate = uint.Parse(Settings.RatingValue, NumberStyles.Integer);
if (lUserInformationController != null)
{
lUserInformationController.SetUserRating(rate);
}
}
public static void UdemaeChanger()
{
}
public static void ModifyVersionNum()
{
if (!Settings.FrameCheckBox)
return;
// CommonTimer (Unity.GameObject)
var UiFrame =
GameObject.Find(
"LeftMonitor/CommonProcess(Clone)/RearCanvas/Sub/UI_UserInformation/UI_UserData/UI_User/IMG_Frame/");
Render.DrawString(new Vector2(200, 220), UiFrame.ToString(), false);
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Manager;
using Sinmai.Helper;
using UnityEngine;
namespace Sinmai.Functions
{
public class Timer
{
private static readonly BindingFlags pBindFlags = BindingFlags.NonPublic;
private static readonly BindingFlags iBindFlags = BindingFlags.Instance;
private static readonly BindingFlags sBindFlags = BindingFlags.Static;
public static void InfinityFreedomTime()
{
if (!Settings.InfinityFreedomTimeCheckBox)
return;
var gameManagerType = typeof(GameManager);
var freedomTime = gameManagerType.GetField("_freedomTime", sBindFlags | pBindFlags);
freedomTime.SetValue(null, 6000000);
// if (freedomTime != null)
// Render.DrawString(new Vector2(200, 270), freedomTime.GetValue(null).ToString(), false);
}
}
}

View File

@ -258,14 +258,14 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Functions\Timer.cs" />
<Compile Include="Functions\Skins.cs" />
<Compile Include="Loader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UI\Menu.cs" />
<Compile Include="Utils\Render.cs" />
<Compile Include="UI\Settings.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Features\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,34 +1,38 @@
using Sinmai.Helper;
using Sinmai.Functions;
using Sinmai.Helper;
using UnityEngine;
namespace Sinmai.UI
{
public class Menu : MonoBehaviour
{
private Rect Window;
private bool MenuToggle = true;
private Rect Window;
private void Start()
{
Window = new Rect(20f, 60f, 250f, 350f);
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Insert)) //check Unity.Input when menu open unlock ur cursor
MenuToggle = !MenuToggle;
}
private void OnGUI()
{
//Draw ur epic hek here
if (MenuToggle)
Window = GUILayout.Window(0, Window, new GUI.WindowFunction(RenderMenu), "unity internal gui", new GUILayoutOption[0]);
Render.DrawCross(new Vector2(Screen.width /2, Screen.height /2), new Vector2(20, 20), 1f, new Color(0,255,0));
Render.DrawString(new Vector2(200, 200), "Sinmai-Internal-Damage-Csharp", false);
Window = GUILayout.Window(0, Window, RenderMenu, "Internal Damage for Sinmai");
Render.DrawCross(new Vector2(Screen.width / 2, Screen.height / 2), new Vector2(20, 20), 1f,
new Color(0, 255, 0));
Render.DrawString(new Vector2(200, 200), "Sinmai-Internal-Damage-Csharp");
Skins.ModifyVersionNum();
Timer.InfinityFreedomTime();
Skins.RateChanger();
}
private void RenderMenu(int id)
@ -36,18 +40,23 @@ namespace Sinmai.UI
switch (id)
{
case 0:
Settings.CheckBox = GUILayout.Toggle(Settings.CheckBox, "hi checkbox", new GUILayoutOption[0]);
GUILayout.Label("hi label", new GUILayoutOption[0]);
GUILayout.Button("hi button", new GUILayoutOption[0]);
GUILayout.Label("Skin Changer");
Settings.RateCheckBox = GUILayout.Toggle(Settings.RateCheckBox, "Rate Hacking");
if (Settings.RateCheckBox)
Settings.RatingValue = GUILayout.TextArea(Settings.RatingValue, 5);
if (GUILayout.Button("Unload", new GUILayoutOption[0]))
GUILayout.Label("Misc");
Settings.InfinityFreedomTimeCheckBox = GUILayout.Toggle(Settings.InfinityFreedomTimeCheckBox, "Infinity FreedomTime");
if (GUILayout.Button("Unload"))
Loader.Unload();
break;
default:
GUILayout.Label("Test Area");
Settings.FrameCheckBox = GUILayout.Toggle(Settings.FrameCheckBox, "Get Frame");
break;
}
GUI.DragWindow();
}
}
}
}

View File

@ -3,5 +3,9 @@
class Settings
{
public static bool CheckBox = false;
public static bool FrameCheckBox = false;
public static bool InfinityFreedomTimeCheckBox = false;
public static bool RateCheckBox = false;
public static string RatingValue = "13370";
}
}