GameObject and Component
This commit is contained in:
16
src-csharp/Component.cs
Normal file
16
src-csharp/Component.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace Ougge;
|
||||
|
||||
public abstract class Component {
|
||||
private GameObject _gameObject;
|
||||
|
||||
internal Component(GameObject gameObject)
|
||||
{
|
||||
_gameObject = gameObject;
|
||||
}
|
||||
|
||||
public GameObject Owner { get => _gameObject.IsDestroyed ? throw new Exception("GameObject") : _gameObject; }
|
||||
|
||||
public virtual void Update(double deltaTime) {}
|
||||
}
|
||||
Reference in New Issue
Block a user