mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 03:40:46 +00:00
31 lines
687 B
C#
31 lines
687 B
C#
using UnityEngine;
|
|
|
|
namespace QSB.Utility
|
|
{
|
|
public static class QSBExtensions
|
|
{
|
|
public static void ChangeEquipState(this PlayerTool tool, bool equipState)
|
|
{
|
|
if (equipState)
|
|
{
|
|
tool.EquipTool();
|
|
}
|
|
else
|
|
{
|
|
tool.UnequipTool();
|
|
}
|
|
}
|
|
|
|
public static string GetHierarchy(this GameObject go)
|
|
{
|
|
var name = go.name;
|
|
while (go.transform.parent != null)
|
|
{
|
|
go = go.transform.parent.gameObject;
|
|
name = go.name + "/" + name;
|
|
}
|
|
return name;
|
|
}
|
|
}
|
|
}
|