mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 12:54:51 +00:00
f434ed027b
* wrapper for sector * using world registry for sectors * using order id as unique sector key * sector manager * not checking closest sector every frame
21 lines
603 B
C#
21 lines
603 B
C#
using UnityEngine;
|
|
|
|
namespace QSB.Utility
|
|
{
|
|
public static class GOExtensions
|
|
{
|
|
public static void Show(this GameObject gameObject) => SetVisibility(gameObject, true);
|
|
|
|
public static void Hide(this GameObject gameObject) => SetVisibility(gameObject, false);
|
|
|
|
private static void SetVisibility(GameObject gameObject, bool isVisible)
|
|
{
|
|
var renderers = gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
|
|
foreach (var renderer in renderers)
|
|
{
|
|
renderer.enabled = isVisible;
|
|
}
|
|
}
|
|
}
|
|
}
|