mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2024-12-23 01:59:40 +08:00
cleanup unstripping
This commit is contained in:
parent
3783638c89
commit
5e761e2379
@ -12,7 +12,7 @@ using UnityExplorer.UI.PageModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
#if CPP
|
||||
using UnityExplorer.Unstrip.Resources;
|
||||
using UnityExplorer.Unstrip;
|
||||
using UnityExplorer.Helpers;
|
||||
using UnhollowerRuntimeLib;
|
||||
#endif
|
||||
@ -421,7 +421,7 @@ The following helper methods are available:
|
||||
private static Color caretColor = new Color32(255, 255, 255, 255);
|
||||
private static Color textColor = new Color32(255, 255, 255, 255);
|
||||
private static Color backgroundColor = new Color32(37, 37, 37, 255);
|
||||
private static Color lineHighlightColor = new Color32(50, 50, 50, 255);
|
||||
//private static Color lineHighlightColor = new Color32(50, 50, 50, 255);
|
||||
private static Color lineNumberBackgroundColor = new Color32(25, 25, 25, 255);
|
||||
private static Color lineNumberTextColor = new Color32(180, 180, 180, 255);
|
||||
private static Color scrollbarColor = new Color32(45, 50, 50, 255);
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityExplorer.Unstrip.ColorUtility;
|
||||
using UnityExplorer.Unstrip;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityExplorer.Console.Lexer
|
||||
|
@ -6,6 +6,7 @@ using UnityExplorer.UI.PageModel;
|
||||
using UnityEngine;
|
||||
using UnityExplorer.Inspectors;
|
||||
using System.IO;
|
||||
using UnityExplorer.Unstrip;
|
||||
|
||||
namespace UnityExplorer
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using UnityEngine;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
#if CPP
|
||||
using UnityExplorer.Unstrip.ImageConversion;
|
||||
using UnityExplorer.Unstrip;
|
||||
#endif
|
||||
|
||||
namespace UnityExplorer.Helpers
|
||||
|
@ -4,8 +4,7 @@ using System.Linq;
|
||||
using UnityExplorer.Helpers;
|
||||
using UnityExplorer.UI;
|
||||
using UnityExplorer.UI.Shared;
|
||||
using UnityExplorer.Unstrip.ColorUtility;
|
||||
using UnityExplorer.Unstrip.LayerMasks;
|
||||
using UnityExplorer.Unstrip;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
@ -7,7 +7,7 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityExplorer.Input;
|
||||
using UnityExplorer.Unstrip.Resources;
|
||||
using UnityExplorer.Unstrip;
|
||||
|
||||
namespace UnityExplorer.Inspectors.GOInspector
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityExplorer.Helpers;
|
||||
using UnityExplorer.UI;
|
||||
using UnityExplorer.Unstrip.LayerMasks;
|
||||
using UnityExplorer.Unstrip;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@ -115,9 +115,7 @@ namespace UnityExplorer.Inspectors
|
||||
s_controls.RefreshControls();
|
||||
|
||||
if (GameObjectControls.s_sliderChangedWanted)
|
||||
{
|
||||
GameObjectControls.UpdateSliderControl();
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshTopInfo()
|
||||
@ -139,6 +137,7 @@ namespace UnityExplorer.Inspectors
|
||||
m_lastPath = path;
|
||||
m_pathInput.text = path;
|
||||
m_hiddenPathText.text = path;
|
||||
m_pathInput.ForceLabelUpdate();
|
||||
}
|
||||
}
|
||||
else if (m_pathGroupObj.activeSelf)
|
||||
@ -266,6 +265,7 @@ namespace UnityExplorer.Inspectors
|
||||
m_hiddenPathText = pathHiddenTextObj.GetComponent<Text>();
|
||||
m_hiddenPathText.color = Color.clear;
|
||||
m_hiddenPathText.fontSize = 14;
|
||||
m_hiddenPathText.lineSpacing = 1.5f;
|
||||
m_hiddenPathText.raycastTarget = false;
|
||||
var hiddenFitter = pathHiddenTextObj.AddComponent<ContentSizeFitter>();
|
||||
hiddenFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize;
|
||||
@ -291,6 +291,11 @@ namespace UnityExplorer.Inspectors
|
||||
pathInputLayout.flexibleHeight = 75;
|
||||
pathInputLayout.preferredWidth = 400;
|
||||
pathInputLayout.flexibleWidth = 9999;
|
||||
var textRect = m_pathInput.textComponent.GetComponent<RectTransform>();
|
||||
textRect.offsetMin = new Vector2(3, 3);
|
||||
textRect.offsetMax = new Vector2(3, 3);
|
||||
m_pathInput.textComponent.color = new Color(0.75f, 0.75f, 0.75f);
|
||||
m_pathInput.textComponent.lineSpacing = 1.5f;
|
||||
|
||||
// name row
|
||||
|
||||
|
@ -7,7 +7,7 @@ using UnityExplorer.UI.Shared;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using UnityExplorer.Unstrip.Scenes;
|
||||
using UnityExplorer.Unstrip;
|
||||
|
||||
namespace UnityExplorer.Inspectors
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityExplorer.Unstrip.ColorUtility;
|
||||
using UnityExplorer.Unstrip;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
@ -6,7 +6,7 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityExplorer.Config;
|
||||
using UnityExplorer.UI.Shared;
|
||||
using UnityExplorer.Unstrip.ColorUtility;
|
||||
using UnityExplorer.Unstrip;
|
||||
|
||||
namespace UnityExplorer.UI.PageModel
|
||||
{
|
||||
@ -169,7 +169,7 @@ namespace UnityExplorer.UI.PageModel
|
||||
labelLayout.minWidth = 150;
|
||||
labelLayout.minHeight = 25;
|
||||
|
||||
var toggleObj = UIFactory.CreateToggle(rowObj, out m_unlockMouseToggle, out Text toggleText);
|
||||
UIFactory.CreateToggle(rowObj, out m_unlockMouseToggle, out Text toggleText);
|
||||
m_unlockMouseToggle.isOn = ModConfig.Instance.Force_Unlock_Mouse;
|
||||
toggleText.text = "";
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ using UnityEngine.UI;
|
||||
using UnityExplorer.Helpers;
|
||||
using UnityExplorer.Inspectors;
|
||||
using UnityExplorer.UI.Shared;
|
||||
using UnityExplorer.Unstrip.Resources;
|
||||
using UnityExplorer.Unstrip;
|
||||
#if CPP
|
||||
using UnhollowerRuntimeLib;
|
||||
#endif
|
||||
@ -263,17 +263,17 @@ namespace UnityExplorer.UI.PageModel
|
||||
#endif
|
||||
var results = new List<object>();
|
||||
|
||||
// prefer filter comparers
|
||||
// perform filter comparers
|
||||
|
||||
string nameFilter = null;
|
||||
if (!string.IsNullOrEmpty(m_nameInput.text))
|
||||
nameFilter = m_nameInput.text.ToLower();
|
||||
|
||||
bool canFilterScene = (m_sceneFilter != SceneFilter.Any || m_childFilter != ChildFilter.Any)
|
||||
bool canGetGameObject = (m_sceneFilter != SceneFilter.Any || m_childFilter != ChildFilter.Any)
|
||||
&& (m_context == SearchContext.GameObject || typeof(Component).IsAssignableFrom(searchType));
|
||||
|
||||
string sceneFilter = null;
|
||||
if (!canFilterScene)
|
||||
if (!canGetGameObject)
|
||||
{
|
||||
if (m_context != SearchContext.UnityObject && (m_sceneFilter != SceneFilter.Any || m_childFilter != ChildFilter.Any))
|
||||
ExplorerCore.LogWarning($"Type '{searchType}' cannot have Scene or Child filters applied to it");
|
||||
@ -292,7 +292,7 @@ namespace UnityExplorer.UI.PageModel
|
||||
if (!string.IsNullOrEmpty(nameFilter) && !obj.name.ToLower().Contains(nameFilter))
|
||||
continue;
|
||||
|
||||
if (canFilterScene)
|
||||
if (canGetGameObject)
|
||||
{
|
||||
#if MONO
|
||||
var go = m_context == SearchContext.GameObject
|
||||
@ -304,6 +304,9 @@ namespace UnityExplorer.UI.PageModel
|
||||
: obj.TryCast<Component>().gameObject;
|
||||
#endif
|
||||
|
||||
if (!go)
|
||||
continue;
|
||||
|
||||
// scene check
|
||||
if (m_sceneFilter != SceneFilter.Any)
|
||||
{
|
||||
@ -484,7 +487,7 @@ namespace UnityExplorer.UI.PageModel
|
||||
customTypeLayout.minHeight = 25;
|
||||
customTypeLayout.flexibleHeight = 0;
|
||||
m_customTypeInput = customTypeObj.GetComponent<TMP_InputField>();
|
||||
m_customTypeInput.placeholder.gameObject.GetComponent<TextMeshProUGUI>().text = "eg. UnityEngine.Camera";
|
||||
m_customTypeInput.placeholder.gameObject.GetComponent<TextMeshProUGUI>().text = "eg. UnityEngine.Texture2D, etc...";
|
||||
m_customTypeInput.onFocusSelectAll = true;
|
||||
#if MONO
|
||||
m_customTypeInput.onSelect.AddListener((string val) => { OnContextButtonClicked(SearchContext.Custom); });
|
||||
@ -507,13 +510,14 @@ namespace UnityExplorer.UI.PageModel
|
||||
|
||||
var nameLabelObj = UIFactory.CreateLabel(nameRowObj, TextAnchor.MiddleLeft);
|
||||
var nameLabelText = nameLabelObj.GetComponent<Text>();
|
||||
nameLabelText.text = "Search by name:";
|
||||
nameLabelText.text = "Name contains:";
|
||||
var nameLabelLayout = nameLabelObj.AddComponent<LayoutElement>();
|
||||
nameLabelLayout.minWidth = 125;
|
||||
nameLabelLayout.minHeight = 25;
|
||||
|
||||
var nameInputObj = UIFactory.CreateTMPInput(nameRowObj, 14, 0, (int)TextAlignmentOptions.MidlineLeft);
|
||||
m_nameInput = nameInputObj.GetComponent<TMP_InputField>();
|
||||
//m_nameInput.placeholder.gameObject.GetComponent<TextMeshProUGUI>().text = "";
|
||||
var nameInputLayout = nameInputObj.AddComponent<LayoutElement>();
|
||||
nameInputLayout.minWidth = 150;
|
||||
nameInputLayout.flexibleWidth = 5000;
|
||||
|
@ -5,7 +5,7 @@ using UnityEngine.UI;
|
||||
using UnityExplorer.Input;
|
||||
using System.IO;
|
||||
#if CPP
|
||||
using UnityExplorer.Unstrip.ImageConversion;
|
||||
using UnityExplorer.Unstrip;
|
||||
#endif
|
||||
|
||||
namespace UnityExplorer.UI
|
||||
|
@ -35,11 +35,6 @@ public class SliderScrollbar
|
||||
this.m_slider.Set(1f, false);
|
||||
}
|
||||
|
||||
~SliderScrollbar()
|
||||
{
|
||||
Instances.Remove(this);
|
||||
}
|
||||
|
||||
internal void Update()
|
||||
{
|
||||
this.RefreshVisibility();
|
||||
@ -47,39 +42,36 @@ public class SliderScrollbar
|
||||
|
||||
internal void RefreshVisibility()
|
||||
{
|
||||
if (this.m_slider && this.m_scrollbar)
|
||||
{
|
||||
bool shouldShow = !Mathf.Approximately(this.m_scrollbar.size, 1);
|
||||
var obj = this.m_slider.handleRect.gameObject;
|
||||
|
||||
if (obj.activeSelf != shouldShow)
|
||||
{
|
||||
obj.SetActive(shouldShow);
|
||||
|
||||
if (shouldShow)
|
||||
this.m_slider.Set(this.m_scrollbar.value, false);
|
||||
else
|
||||
m_slider.Set(1f, false);
|
||||
}
|
||||
if (!m_slider || !m_scrollbar)
|
||||
{
|
||||
Instances.Remove(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool shouldShow = !Mathf.Approximately(this.m_scrollbar.size, 1);
|
||||
var obj = this.m_slider.handleRect.gameObject;
|
||||
|
||||
if (obj.activeSelf != shouldShow)
|
||||
{
|
||||
obj.SetActive(shouldShow);
|
||||
|
||||
if (shouldShow)
|
||||
this.m_slider.Set(this.m_scrollbar.value, false);
|
||||
else
|
||||
m_slider.Set(1f, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnScrollbarValueChanged(float _value)
|
||||
{
|
||||
//this.RefreshVisibility();
|
||||
if (this.m_slider && this.m_slider.value != _value)
|
||||
{
|
||||
if (this.m_slider.value != _value)
|
||||
this.m_slider.Set(_value, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnSliderValueChanged(float _value)
|
||||
{
|
||||
if (this.m_scrollbar)
|
||||
{
|
||||
this.m_scrollbar.value = _value;
|
||||
}
|
||||
}
|
||||
this.m_scrollbar.value = _value;
|
||||
}
|
||||
|
||||
#region UI CONSTRUCTION
|
||||
|
||||
|
@ -8,7 +8,7 @@ using TMPro;
|
||||
using System.Reflection;
|
||||
using UnityExplorer.Helpers;
|
||||
#if CPP
|
||||
using UnityExplorer.Unstrip.AssetBundle;
|
||||
using UnityExplorer.Unstrip;
|
||||
#endif
|
||||
|
||||
namespace UnityExplorer.UI
|
||||
|
@ -25,18 +25,18 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<RootNamespace>UnityExplorer</RootNamespace>
|
||||
<AssemblyName>UnityExplorer</AssemblyName>
|
||||
<!-- Set this to the BepInEx Il2Cpp Game folder, without the ending '\' character. -->
|
||||
<BIECppGameFolder>D:\Steam\steamapps\common\Outward</BIECppGameFolder>
|
||||
<!-- Set this to the BepInEx Mono Game folder, without the ending '\' character. -->
|
||||
<BIEMonoGameFolder>D:\source\Unity Projects\Test\_BUILD_MONO</BIEMonoGameFolder>
|
||||
<!-- Set this to the BepInEx Mono Managed folder, without the ending '\' character. -->
|
||||
<BIEMonoManagedFolder>D:\source\Unity Projects\Test\_BUILD_MONO\Test_Data\Managed</BIEMonoManagedFolder>
|
||||
<!-- Set this to the MelonLoader Il2Cpp Game folder, without the ending '\' character. -->
|
||||
<MLCppGameFolder>D:\Steam\steamapps\common\VRChat</MLCppGameFolder>
|
||||
<!-- Set this to the MelonLoader Mono Game folder, without the ending '\' character. -->
|
||||
<MLMonoGameFolder>D:\source\Unity Projects\Test\_BUILD_MONO</MLMonoGameFolder>
|
||||
<!-- Set this to the Mono Managed folder, without the ending '\' character. -->
|
||||
<!-- Set this to the MelonLoader Mono Managed folder, without the ending '\' character. -->
|
||||
<MLMonoManagedFolder>D:\source\Unity Projects\Test\_BUILD_MONO\Test_Data\Managed</MLMonoManagedFolder>
|
||||
<!-- Set this to the BepInEx Il2Cpp Game folder, without the ending '\' character. -->
|
||||
<BIECppGameFolder>D:\Steam\steamapps\common\Outward_Il2Cpp</BIECppGameFolder>
|
||||
<!-- Set this to the BepInEx Mono Game folder, without the ending '\' character. -->
|
||||
<BIEMonoGameFolder>D:\source\Unity Projects\Test\_BUILD_MONO</BIEMonoGameFolder>
|
||||
<!-- Set this to the BepInEx Managed folder, without the ending '\' character. -->
|
||||
<BIEMonoManagedFolder>D:\source\Unity Projects\Test\_BUILD_MONO\Test_Data\Managed</BIEMonoManagedFolder>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
@ -108,10 +108,6 @@
|
||||
<HintPath>$(MLMonoGameFolder)\MelonLoader\MelonLoader.ModHandler.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<!--<Reference Include="netstandard">
|
||||
<HintPath>$(MLMonoManagedFolder)\netstandard.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>-->
|
||||
<Reference Include="Unity.TextMeshPro">
|
||||
<HintPath>$(MLMonoManagedFolder)\Unity.TextMeshPro.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
@ -163,10 +159,6 @@
|
||||
<HintPath>$(BIEMonoGameFolder)\BepInEx\core\0Harmony.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<!--<Reference Include="netstandard">
|
||||
<HintPath>$(BIEMonoManagedFolder)\netstandard.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>-->
|
||||
<Reference Include="Unity.TextMeshPro">
|
||||
<HintPath>$(BIEMonoManagedFolder)\Unity.TextMeshPro.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
@ -388,13 +380,13 @@
|
||||
<Compile Include="UI\Shared\PageHandler.cs" />
|
||||
<Compile Include="UI\Shared\SyntaxColors.cs" />
|
||||
<Compile Include="UI\UIManager.cs" />
|
||||
<Compile Include="Unstrip\AssetBundle\AssetBundleUnstrip.cs" />
|
||||
<Compile Include="Unstrip\ColorUtility\ColorUtilityUnstrip.cs" />
|
||||
<Compile Include="Unstrip\ImageConversion\ImageConversionUnstrip.cs" />
|
||||
<Compile Include="Unstrip\AssetBundleUnstrip.cs" />
|
||||
<Compile Include="Unstrip\ColorUtilityUnstrip.cs" />
|
||||
<Compile Include="Unstrip\ImageConversionUnstrip.cs" />
|
||||
<Compile Include="Helpers\ICallHelper.cs" />
|
||||
<Compile Include="Unstrip\LayerMask\LayerMaskUnstrip.cs" />
|
||||
<Compile Include="Unstrip\Resources\ResourcesUnstrip.cs" />
|
||||
<Compile Include="Unstrip\Scene\SceneUnstrip.cs" />
|
||||
<Compile Include="Unstrip\LayerMaskUnstrip.cs" />
|
||||
<Compile Include="Unstrip\ResourcesUnstrip.cs" />
|
||||
<Compile Include="Unstrip\SceneUnstrip.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UI\UIFactory.cs" />
|
||||
</ItemGroup>
|
||||
|
@ -8,7 +8,7 @@ using UnhollowerRuntimeLib;
|
||||
using UnityEngine;
|
||||
using UnityExplorer.Helpers;
|
||||
|
||||
namespace UnityExplorer.Unstrip.AssetBundle
|
||||
namespace UnityExplorer.Unstrip
|
||||
{
|
||||
public class AssetBundle
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using System.Globalization;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityExplorer.Unstrip.ColorUtility
|
||||
namespace UnityExplorer.Unstrip
|
||||
{
|
||||
public static class ColorUtilityUnstrip
|
||||
{
|
@ -5,30 +5,34 @@ using UnityExplorer.Helpers;
|
||||
using UnhollowerBaseLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityExplorer.Unstrip.ImageConversion
|
||||
namespace UnityExplorer.Unstrip
|
||||
{
|
||||
public static class ImageConversionUnstrip
|
||||
{
|
||||
// byte[] ImageConversion.EncodeToPNG(this Texture2D image);
|
||||
|
||||
internal delegate byte[] d_EncodeToPNG(IntPtr tex);
|
||||
internal delegate IntPtr d_EncodeToPNG(IntPtr tex);
|
||||
|
||||
public static byte[] EncodeToPNG(this Texture2D tex)
|
||||
{
|
||||
byte[] data = ICallHelper.GetICall<d_EncodeToPNG>("UnityEngine.ImageConversion::EncodeToPNG")
|
||||
IntPtr ptr = ICallHelper.GetICall<d_EncodeToPNG>("UnityEngine.ImageConversion::EncodeToPNG")
|
||||
.Invoke(tex.Pointer);
|
||||
|
||||
// The Il2Cpp EncodeToPNG() method does return System.Byte[],
|
||||
// but for some reason it is not recognized or valid.
|
||||
// Simple fix is iterating into a new array manually.
|
||||
return new Il2CppStructArray<byte>(ptr);
|
||||
|
||||
byte[] safeData = new byte[data.Length];
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
safeData[i] = (byte)data[i];
|
||||
}
|
||||
//// This is a bit of a hack. The iCall actually returns an Il2CppStructArray<byte>...
|
||||
|
||||
return safeData;
|
||||
// byte[] data = ICallHelper.GetICall<d_EncodeToPNG>("UnityEngine.ImageConversion::EncodeToPNG")
|
||||
// .Invoke(tex.Pointer);
|
||||
|
||||
//// However, if you try to use that result with for example File.WriteAllBytes, it won't work.
|
||||
//// Simple fix: iterate into a new managed array.
|
||||
|
||||
//byte[] safeData = new byte[data.Length];
|
||||
//for (int i = 0; i < data.Length; i++)
|
||||
// safeData[i] = (byte)data[i];
|
||||
|
||||
//return safeData;
|
||||
}
|
||||
|
||||
// bool ImageConversion.LoadImage(this Texture2D tex, byte[] data, bool markNonReadable);
|
||||
@ -39,9 +43,7 @@ namespace UnityExplorer.Unstrip.ImageConversion
|
||||
{
|
||||
Il2CppStructArray<byte> il2cppArray = new Il2CppStructArray<byte>(data.Length);
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
{
|
||||
il2cppArray[i] = data[i];
|
||||
}
|
||||
|
||||
bool ret = ICallHelper.GetICall<d_LoadImage>("UnityEngine.ImageConversion::LoadImage")
|
||||
.Invoke(tex.Pointer, il2cppArray.Pointer, markNonReadable);
|
@ -5,7 +5,7 @@ using UnityEngine;
|
||||
using UnhollowerBaseLib;
|
||||
#endif
|
||||
|
||||
namespace UnityExplorer.Unstrip.LayerMasks
|
||||
namespace UnityExplorer.Unstrip
|
||||
{
|
||||
public static class LayerMaskUnstrip
|
||||
{
|
||||
@ -14,7 +14,7 @@ namespace UnityExplorer.Unstrip.LayerMasks
|
||||
|
||||
public static string LayerToName(int layer)
|
||||
{
|
||||
d_LayerToName iCall = ICallHelper.GetICall<d_LayerToName>("UnityEngine.LayerMask::LayerToName");
|
||||
var iCall = ICallHelper.GetICall<d_LayerToName>("UnityEngine.LayerMask::LayerToName");
|
||||
return IL2CPP.Il2CppStringToManaged(iCall.Invoke(layer));
|
||||
}
|
||||
#else
|
@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using Mono.CSharp;
|
||||
using UnityExplorer.Helpers;
|
||||
#if CPP
|
||||
using UnhollowerBaseLib;
|
||||
#endif
|
||||
|
||||
namespace UnityExplorer.Unstrip.Resources
|
||||
{
|
||||
public class ResourcesUnstrip
|
||||
{
|
||||
#if CPP
|
||||
internal delegate IntPtr d_FindObjectsOfTypeAll(IntPtr type);
|
||||
|
||||
public static UnityEngine.Object[] FindObjectsOfTypeAll(Il2CppSystem.Type type)
|
||||
{
|
||||
IntPtr arrayPtr = ICallHelper.GetICall<d_FindObjectsOfTypeAll>("UnityEngine.Resources::FindObjectsOfTypeAll")
|
||||
.Invoke(type.Pointer);
|
||||
|
||||
Il2CppReferenceArray<UnityEngine.Object> array = new Il2CppReferenceArray<UnityEngine.Object>(arrayPtr);
|
||||
|
||||
UnityEngine.Object[] ret = new UnityEngine.Object[array.Length];
|
||||
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
ret[i] = array[i];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
public static UnityEngine.Object[] FindObjectsOfTypeAll(Type type) => UnityEngine.Resources.FindObjectsOfTypeAll(type);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
26
src/Unstrip/ResourcesUnstrip.cs
Normal file
26
src/Unstrip/ResourcesUnstrip.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Mono.CSharp;
|
||||
using UnityExplorer.Helpers;
|
||||
#if CPP
|
||||
using UnhollowerBaseLib;
|
||||
#endif
|
||||
|
||||
namespace UnityExplorer.Unstrip
|
||||
{
|
||||
public class ResourcesUnstrip
|
||||
{
|
||||
#if CPP
|
||||
internal delegate IntPtr d_FindObjectsOfTypeAll(IntPtr type);
|
||||
|
||||
public static UnityEngine.Object[] FindObjectsOfTypeAll(Il2CppSystem.Type type)
|
||||
{
|
||||
var iCall = ICallHelper.GetICall<d_FindObjectsOfTypeAll>("UnityEngine.Resources::FindObjectsOfTypeAll");
|
||||
|
||||
return new Il2CppReferenceArray<UnityEngine.Object>(iCall.Invoke(type.Pointer));
|
||||
}
|
||||
#else
|
||||
public static UnityEngine.Object[] FindObjectsOfTypeAll(Type type) => UnityEngine.Resources.FindObjectsOfTypeAll(type);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityExplorer.Inspectors;
|
||||
|
||||
namespace UnityExplorer.Unstrip.Scenes
|
||||
namespace UnityExplorer.Unstrip
|
||||
{
|
||||
public class SceneUnstrip
|
||||
{
|
||||
@ -31,11 +31,11 @@ namespace UnityExplorer.Unstrip.Scenes
|
||||
|
||||
return new GameObject[0];
|
||||
}
|
||||
|
||||
//Scene.GetRootGameObjects();
|
||||
#endif
|
||||
|
||||
#if CPP
|
||||
//Scene.GetRootGameObjects();
|
||||
|
||||
internal delegate void d_GetRootGameObjects(int handle, IntPtr list);
|
||||
|
||||
public static GameObject[] GetRootGameObjects(Scene scene) => GetRootGameObjects(scene.handle);
|
Loading…
Reference in New Issue
Block a user