quantum-space-buddies/QSB/Utility/QSBExtensions.cs

31 lines
687 B
C#
Raw Normal View History

2020-08-13 09:16:56 +00:00
using UnityEngine;
namespace QSB.Utility
2020-08-09 18:33:36 +00:00
{
public static class QSBExtensions
{
public static void ChangeEquipState(this PlayerTool tool, bool equipState)
{
if (equipState)
{
tool.EquipTool();
}
else
{
tool.UnequipTool();
}
}
2020-08-13 09:16:56 +00:00
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;
}
2020-08-09 18:33:36 +00:00
}
}