Repository navigation
Game Engine
The integrated "Game Engine" in the Source API.
First of all, you need to include the API.GameEngine namespace in your project.
To initialize the Game Engine, you need to create a Game class instance, add all the "start" elements of your game and the execute Game.Run()
To add objects, you need to instantiate GameObjects and add Source classes to them.
There's a template called Source Game Engine Class with two methods in it:
Start() which is called at the start of the game.
Update() which is called once per frame.
Here you can add all the logic than you want.
Game.Run() Inits the game engine and call the Start() method of all the MainBrain classes instantiated before this method executes.
GameObject.name Specifies the name of the object.
GameObject.position Specifies the position of the object.
GameObject.parent Specifies the parent object of this one.
GameObject.activeInHierarchy Specifies if the current object is active in the hierarchy of objects.
GameObject.AddComponent<T>() Adds a new component into the GameObject.
GameObject.GetComponent<T>() Gets a component from the GameObject.
GameObject.GetComponents<T>() Gets all the components as the same type from the GameObject.
GameObject.TryGetComponent<T>(out T component) Tries to get a component from the GameObject.
GameObject.GetChild(index) Returns a child by index.
GameObject.SetActive(state) Activates/Deactivates the GameObject, depending on the given true or false value.
GameObject.Find(name) or Find(name, includeInactive) Tries to find a GameObject with the specified name.\