mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 14:17:51 +08:00

* Implemented manual unstripping for ScrollView and Resize, should now work on any Unity 2018 or 2019 game. * Fixed a bug with page view on the Scene Explorer * Back-end cleanups
31 lines
872 B
C#
31 lines
872 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnhollowerBaseLib;
|
|
using UnityEngine;
|
|
|
|
namespace Explorer
|
|
{
|
|
public static class UnityExtensions
|
|
{
|
|
public static string GetGameObjectPath(this Transform _transform)
|
|
{
|
|
return GetGameObjectPath(_transform, true);
|
|
}
|
|
|
|
public static string GetGameObjectPath(this Transform _transform, bool _includeThisName)
|
|
{
|
|
string path = _includeThisName ? ("/" + _transform.name) : "";
|
|
GameObject gameObject = _transform.gameObject;
|
|
while (gameObject.transform.parent != null)
|
|
{
|
|
gameObject = gameObject.transform.parent.gameObject;
|
|
path = "/" + gameObject.name + path;
|
|
}
|
|
return path;
|
|
}
|
|
}
|
|
}
|