forked from AtomicGameEngine/AtomicGameEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponent.cs
More file actions
35 lines (26 loc) · 716 Bytes
/
Component.cs
File metadata and controls
35 lines (26 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
namespace AtomicEngine
{
public partial class Component : Animatable
{
/// <summary>
/// Whether the component has been explicitly destroyed
/// </summary>
public bool Destroyed { get; private set; }
/// <summary>
/// Explicitly removes component and disposes of it
/// </summary>
public virtual void Destroy()
{
if (Destroyed)
return;
Destroyed = true;
Remove();
Dispose();
}
public T GetComponent<T>(bool recursive = false) where T : Component
{
return Node.GetComponent<T>(recursive);
}
}
}