You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
512 B
C#
26 lines
512 B
C#
namespace Projectiles
|
|
{
|
|
using UnityEngine;
|
|
|
|
public static partial class ComponentExtensions
|
|
{
|
|
// PUBLIC METHODS
|
|
|
|
public static T GetComponentNoAlloc<T>(this Component component) where T : class
|
|
{
|
|
return GameObjectExtensions<T>.GetComponentNoAlloc(component.gameObject);
|
|
}
|
|
|
|
public static void SetActive(this Component component, bool value)
|
|
{
|
|
if (component == null)
|
|
return;
|
|
|
|
if (component.gameObject.activeSelf == value)
|
|
return;
|
|
|
|
component.gameObject.SetActive(value);
|
|
}
|
|
}
|
|
}
|