GameObject and Component

This commit is contained in:
2025-04-18 18:24:02 +05:00
parent 47574e9b30
commit 04e4f63fd7
7 changed files with 136 additions and 41 deletions

16
src-csharp/Component.cs Normal file
View 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) {}
}