Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit f1c3771

Browse files
committed
2.0.0
lots, see release description
1 parent b012e23 commit f1c3771

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2547
-2020
lines changed

README.md

Lines changed: 26 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,11 @@
1212
<img src="https://img.shields.io/github/downloads/sinai-dev/Explorer/total.svg" />
1313
</p>
1414

15-
<p align="center">
16-
<img src="https://raw.githubusercontent.com/sinai-dev/Explorer/master/overview.png">
17-
</p>
18-
1915
- [Releases](#releases)
20-
- [How to install](#how-to-install)
21-
- [How to use](#how-to-use)
22-
- [Mod Config](#mod-config)
2316
- [Features](#features)
24-
- [Mouse Control](#mouse-control)
17+
- [How to install](#how-to-install)
18+
- [Mod Config](#mod-config)
19+
- [Mouse Control](#mouse-control)
2520
- [Building](#building)
2621
- [Credits](#credits)
2722

@@ -33,10 +28,23 @@
3328
| [BepInEx](https://github.com/BepInEx/BepInEx) |[link](https://github.com/sinai-dev/Explorer/releases/latest/download/Explorer.BepInEx.Il2Cpp.zip) | ✔️ [link](https://github.com/sinai-dev/Explorer/releases/latest/download/Explorer.BepInEx.Mono.zip) |
3429

3530
<b>Il2Cpp Issues:</b>
36-
* Some methods may still fail with a `MissingMethodException`, please let me know if you experience this (with full MelonLoader log please).
31+
* Some methods may still fail with a `MissingMethodException`, please let me know if you experience this (with full debug log please).
3732
* Reflection may fail with certain types, see [here](https://github.com/knah/Il2CppAssemblyUnhollower#known-issues) for more details.
3833
* Scrolling with mouse wheel in the Explorer menu may not work on all games at the moment.
3934

35+
## Features
36+
37+
<p align="center">
38+
<img src="https://raw.githubusercontent.com/sinai-dev/Explorer/master/overview.png">
39+
</p>
40+
41+
* <b>Scene Explorer</b>: Simple menu to traverse the Transform heirarchy of the scene.
42+
* <b>GameObject Inspector</b>: Various helpful tools to see and manipulate the GameObject, similar to what you can do in the Editor.
43+
* <b>Reflection Inspector</b>: Inspect Properties and Fields. Can also set primitive values and evaluate primitive methods.
44+
* <b>Search</b>: Search for UnityEngine.Objects with various filters, or use the helpers for static Instances and Classes.
45+
* <b>C# Console</b>: Interactive console for evaluating C# methods on the fly, with some basic helpers.
46+
* <b>Inspect-under-mouse</b>: Hover over an object with a collider and inspect it by clicking on it.
47+
4048
## How to install
4149

4250
### MelonLoader
@@ -53,73 +61,26 @@ Requires [BepInEx](https://github.com/BepInEx/BepInEx) to be installed for your
5361
2. Unzip the file into the `BepInEx\plugins\` folder in your game's installation directory, created by BepInEx.
5462
3. Make sure it's not in a sub-folder, `Explorer.dll` should be directly in the `plugins\` folder.
5563

56-
## How to use
57-
58-
* Press F7 to show or hide the menu.
59-
* Use the Scene Explorer or the Object Search to start Exploring, or the C# Console to test some code.
60-
* See below for more specific details.
61-
62-
### Mod Config
64+
## Mod Config
6365

6466
There is a simple Mod Config for the Explorer. You can access the settings via the "Options" page of the main menu.
6567

66-
`Main Menu Toggle` (KeyCode)
67-
* Sets the keybinding for the Main Menu toggle (show/hide all Explorer windows)
68+
`Main Menu Toggle` (KeyCode) | Default: `F7`
6869
* See [this article](https://docs.unity3d.com/ScriptReference/KeyCode.html) for a full list of all accepted KeyCodes.
69-
* Default: `F7`
7070

71-
`Default Window Size` (Vector2)
71+
`Default Window Size` (Vector2) | Default: `x: 550, y: 700`
7272
* Sets the default width and height for all Explorer windows when created.
73-
* `x` is width, `y` is height.
74-
* Default: `<x>550</x> <y>700</y>`
7573

76-
`Default Items per Page` (Int)
74+
`Default Items per Page` (int) | Default: `20`
7775
* Sets the default items per page when viewing lists or search results.
78-
* Default: `20`
79-
80-
## Features
81-
82-
### Scene Explorer
83-
84-
* A simple menu which allows you to traverse the Transform heirarchy of the scene.
85-
* Click on a GameObject to set it as the current path, or <b>Inspect</b> it to send it to an Inspector Window.
86-
87-
### Inspectors
88-
89-
Explorer has two main inspector modes: <b>GameObject Inspector</b>, and <b>Reflection Inspector</b>.
90-
91-
<b>Tips:</b>
92-
* When in Tab View, GameObjects are denoted by a [G] prefix, and Reflection objects are denoted by a [R] prefix.
93-
* Hold <b>Left Shift</b> when you click the Inspect button to force Reflection mode for GameObjects and Transforms.
94-
95-
### GameObject Inspector
96-
97-
* Allows you to see the children and components on a GameObject.
98-
* Can use some basic GameObject Controls such as translating and rotating the object, destroy it, clone it, etc.
99-
100-
### Reflection Inspector
101-
102-
* The Reflection Inspector is used for all other supported objects.
103-
* Allows you to inspect Properties, Fields and basic Methods, as well as set primitive values and evaluate primitive methods.
104-
* Can search and filter members for the ones you are interested in.
105-
106-
### Object Search
107-
108-
* You can search for an `UnityEngine.Object` with the Object Search feature.
109-
* Filter by name, type, etc.
110-
* For GameObjects and Transforms you can filter which scene they are found in too.
111-
112-
### C# console
113-
114-
* A simple C# console, allows you to execute a method body on the fly.
11576

116-
### Inspect-under-mouse
77+
`Enable Bitwise Editing` (bool) | Default: `false`
78+
* Whether or not to show the Bitwise Editing helper when inspecting integers
11779

118-
* Press Shift+RMB (Right Mouse Button) while the Explorer menu is open to begin Inspect-Under-Mouse.
119-
* Hover over your desired object, if you see the name appear then you can click on it to inspect it.
120-
* Only objects with Colliders are supported.
80+
`Enable Tab View` (bool) | Default: `true`
81+
* Whether or not all inspector windows a grouped into a single window with tabs.
12182

122-
### Mouse Control
83+
## Mouse Control
12384

12485
Explorer can force the mouse to be visible and unlocked when the menu is open, if you have enabled "Force Unlock Mouse" (Left-Alt toggle). However, you may also want to prevent the mouse clicking-through onto the game behind Explorer, this is possible but it requires specific patches for that game.
12586

src/CacheObject/CacheEnumerated.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using Explorer.UI;
7+
8+
namespace Explorer.CacheObject
9+
{
10+
public class CacheEnumerated : CacheObjectBase
11+
{
12+
public int Index { get; set; }
13+
public IList RefIList { get; set; }
14+
public InteractiveEnumerable ParentEnumeration { get; set; }
15+
16+
public override bool CanWrite => RefIList != null && ParentEnumeration.OwnerCacheObject.CanWrite;
17+
18+
public override void SetValue()
19+
{
20+
RefIList[Index] = IValue.Value;
21+
ParentEnumeration.Value = RefIList;
22+
23+
ParentEnumeration.OwnerCacheObject.SetValue();
24+
}
25+
}
26+
}

src/CacheObject/CacheFactory.cs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using System;
2+
using System.Reflection;
3+
using Explorer.CacheObject;
4+
using UnityEngine;
5+
6+
namespace Explorer
7+
{
8+
public static class CacheFactory
9+
{
10+
public static CacheObjectBase GetCacheObject(object obj)
11+
{
12+
if (obj == null) return null;
13+
14+
return GetCacheObject(obj, ReflectionHelpers.GetActualType(obj));
15+
}
16+
17+
public static CacheObjectBase GetCacheObject(object obj, Type type)
18+
{
19+
var ret = new CacheObjectBase();
20+
ret.Init(obj, type);
21+
return ret;
22+
}
23+
24+
public static CacheMember GetCacheObject(MemberInfo member, object declaringInstance)
25+
{
26+
CacheMember ret;
27+
28+
if (member is MethodInfo mi && CanProcessArgs(mi.GetParameters()))
29+
{
30+
ret = new CacheMethod();
31+
ret.InitMember(mi, declaringInstance);
32+
}
33+
else if (member is PropertyInfo pi && CanProcessArgs(pi.GetIndexParameters()))
34+
{
35+
ret = new CacheProperty();
36+
ret.InitMember(pi, declaringInstance);
37+
}
38+
else if (member is FieldInfo fi)
39+
{
40+
ret = new CacheField();
41+
ret.InitMember(fi, declaringInstance);
42+
}
43+
else
44+
{
45+
return null;
46+
}
47+
48+
return ret;
49+
}
50+
51+
public static bool CanProcessArgs(ParameterInfo[] parameters)
52+
{
53+
foreach (var param in parameters)
54+
{
55+
var pType = param.ParameterType;
56+
57+
if (pType.IsByRef && pType.HasElementType)
58+
{
59+
pType = pType.GetElementType();
60+
}
61+
62+
if (pType.IsPrimitive || pType == typeof(string))
63+
{
64+
continue;
65+
}
66+
else
67+
{
68+
return false;
69+
}
70+
}
71+
72+
return true;
73+
}
74+
}
75+
}

src/CacheObject/CacheField.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Reflection;
6+
7+
namespace Explorer.CacheObject
8+
{
9+
public class CacheField : CacheMember
10+
{
11+
public override bool IsStatic => (MemInfo as FieldInfo).IsStatic;
12+
13+
public override void InitMember(MemberInfo member, object declaringInstance)
14+
{
15+
base.InitMember(member, declaringInstance);
16+
17+
base.Init(null, (member as FieldInfo).FieldType);
18+
19+
UpdateValue();
20+
}
21+
22+
public override void UpdateValue()
23+
{
24+
try
25+
{
26+
var fi = MemInfo as FieldInfo;
27+
IValue.Value = fi.GetValue(fi.IsStatic ? null : DeclaringInstance);
28+
29+
base.UpdateValue();
30+
}
31+
catch (Exception e)
32+
{
33+
ReflectionException = ReflectionHelpers.ExceptionToString(e);
34+
}
35+
}
36+
37+
public override void SetValue()
38+
{
39+
var fi = MemInfo as FieldInfo;
40+
fi.SetValue(fi.IsStatic ? null : DeclaringInstance, IValue.Value);
41+
42+
base.SetValue();
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)