public void Add(HxObject hxObject) { Objects.Add(hxObject); if (hxObject is HxGameObject gameObject) { foreach (HxComponent component in gameObject.Components) { if (component is HxBehaviour behaviour) { if (behaviour is HxIUpdate iUpdate) { IUpdates.Add(iUpdate); } if (behaviour is HxIStart iStart) { IStarts.Add(iStart); } if (behaviour is HxIOnCollisionEnter iOnCollisionEnter) { HxIOnCollisionEnters.Add(iOnCollisionEnter); } } } } }
public static HxObject Instantiate(HxObject original) { HxObject copy = (HxObject)original.Clone(); return(copy); }