diff --git a/Assets/Scripts/RaccoonShowcase.cs b/Assets/Scripts/RaccoonShowcase.cs index 836b93d0..4583a699 100644 --- a/Assets/Scripts/RaccoonShowcase.cs +++ b/Assets/Scripts/RaccoonShowcase.cs @@ -27,11 +27,6 @@ public class RaccoonShowcase : Script Debug.LogError("Transform is NULL!"); } - foreach (var child in Owner) - { - Debug.Log(child.Name); - } - originalScale = Transform.LocalScale.z; } protected override void update() diff --git a/SHADE_Engine/src/Assets/SHAssetMacros.h b/SHADE_Engine/src/Assets/SHAssetMacros.h index e0551262..7ffdb5f1 100644 --- a/SHADE_Engine/src/Assets/SHAssetMacros.h +++ b/SHADE_Engine/src/Assets/SHAssetMacros.h @@ -51,8 +51,8 @@ enum class AssetType : AssetTypeMeta SCENE, PREFAB, MATERIAL, - SCRIPT, MESH, + SCRIPT, MAX_COUNT }; constexpr size_t TYPE_COUNT{ static_cast(AssetType::MAX_COUNT) }; @@ -97,6 +97,7 @@ constexpr std::string_view EXTENSIONS[] = { SCENE_EXTENSION, PREFAB_EXTENSION, MATERIAL_EXTENSION, + "dummy", SCRIPT_EXTENSION, AUDIO_WAV_EXTENSION, }; diff --git a/SHADE_Engine/src/Assets/SHAssetManager.cpp b/SHADE_Engine/src/Assets/SHAssetManager.cpp index f4727417..5a1bd5db 100644 --- a/SHADE_Engine/src/Assets/SHAssetManager.cpp +++ b/SHADE_Engine/src/Assets/SHAssetManager.cpp @@ -405,51 +405,6 @@ namespace SHADE return result; } - void SHAssetManager::CompileAll() noexcept - { - std::vector paths; - - for (auto const& dir : std::filesystem::recursive_directory_iterator{ ASSET_ROOT }) - { - if (dir.is_regular_file()) - { - for (auto const& ext : EXTERNALS) - { - if (dir.path().extension().string() == ext.data()) - { - paths.push_back(dir.path()); - } - } - } - } - - for (auto const& path : paths) - { - AssetPath newPath; - auto const ext{ path.extension().string() }; - if (ext == GLSL_EXTENSION.data()) - { - newPath = SHShaderSourceCompiler::LoadAndCompileShader(path).value(); - } - else if (ext == DDS_EXTENSION.data()) - { - newPath = SHTextureCompiler::CompileTextureAsset(path).value(); - } - else if (ext == GLTF_EXTENSION.data() || ext == FBX_EXTENSION.data()) - { - std::string command = MODEL_COMPILER_EXE.data(); - command += " " + path.string(); - std::system(command.c_str()); - - std::string modelPath = path.string().substr(0, path.string().find_last_of('.')); - modelPath += MODEL_EXTENSION; - newPath = modelPath; - } - - GenerateNewMeta(newPath); - } - } - bool SHAssetManager::DeleteLocalFile(AssetPath path) noexcept { //TODO Move this to dedicated library diff --git a/SHADE_Engine/src/Assets/SHAssetManager.h b/SHADE_Engine/src/Assets/SHAssetManager.h index a891ec23..5af648e4 100644 --- a/SHADE_Engine/src/Assets/SHAssetManager.h +++ b/SHADE_Engine/src/Assets/SHAssetManager.h @@ -107,8 +107,6 @@ namespace SHADE static SHAsset CreateAssetFromPath(AssetPath path) noexcept; - static void CompileAll() noexcept; - static bool DeleteLocalFile(AssetPath path) noexcept; //TODO use this function to create asset data internall at all calls to generate id diff --git a/SHADE_Engine/src/Assets/SHAssetMetaHandler.cpp b/SHADE_Engine/src/Assets/SHAssetMetaHandler.cpp index 9ae8cde2..b75ee1ad 100644 --- a/SHADE_Engine/src/Assets/SHAssetMetaHandler.cpp +++ b/SHADE_Engine/src/Assets/SHAssetMetaHandler.cpp @@ -98,6 +98,7 @@ namespace SHADE meta.type = static_cast(type); meta.isSubAsset = false; + meta.parent = 0; // Burn Line if (std::getline(metaFile, line)) diff --git a/SHADE_Engine/src/Scripting/SHScriptEngine.cpp b/SHADE_Engine/src/Scripting/SHScriptEngine.cpp index f279bec1..4f3fbce6 100644 --- a/SHADE_Engine/src/Scripting/SHScriptEngine.cpp +++ b/SHADE_Engine/src/Scripting/SHScriptEngine.cpp @@ -264,18 +264,18 @@ namespace SHADE \n\ \n\ \n\ - ..\\..\\bin\\Debug\\SHADE_Managed.dll\n\ - ..\\..\\bin\\Release\\SHADE_Managed.dll\n\ + ..\\bin\\Debug\\SHADE_Managed.dll\n\ + ..\\bin\\Release\\SHADE_Managed.dll\n\ \n\ \n\ - ..\\..\\bin\\Debug\\SHADE_CSharp.dll\n\ - ..\\..\\bin\\Release\\SHADE_CSharp.dll\n\ + ..\\bin\\Debug\\SHADE_CSharp.dll\n\ + ..\\bin\\Release\\SHADE_CSharp.dll\n\ \n\ \n\ "; // Attempt to create the file - std::ofstream file(path, std::ios::out | std::ios::trunc); + std::ofstream file(path); if (!file.is_open()) throw std::runtime_error("Unable to create CsProj file!"); @@ -318,20 +318,6 @@ namespace SHADE return eventData->handle; } - SHEventHandle SHScriptEngine::onSceneNodeChildrenAdded(SHEventPtr eventPtr) - { - auto eventData = reinterpret_cast*>(eventPtr.get()); - csSceneNodeChildrenChanged(eventData->data->parent->GetEntityID()); - return eventData->handle; - } - - SHEventHandle SHScriptEngine::onSceneNodeChildrenRemoved(SHEventPtr eventPtr) - { - auto eventData = reinterpret_cast*>(eventPtr.get()); - csSceneNodeChildrenChanged(eventData->data->parent->GetEntityID()); - return eventData->handle; - } - /*-----------------------------------------------------------------------------------*/ /* Helper Functions */ /*-----------------------------------------------------------------------------------*/ @@ -456,12 +442,6 @@ namespace SHADE DEFAULT_CSHARP_NAMESPACE + ".Collider", "OnCollisionShapeRemoved" ); - csSceneNodeChildrenChanged = dotNet.GetFunctionPtr - ( - DEFAULT_CSHARP_LIB_NAME, - DEFAULT_CSHARP_NAMESPACE + ".ChildListCache", - "OnChildrenChanged" - ); csEditorRenderScripts = dotNet.GetFunctionPtr ( DEFAULT_CSHARP_LIB_NAME, @@ -484,7 +464,6 @@ namespace SHADE void SHScriptEngine::registerEvents() { - /* Entity */ // Register for entity destroyed event std::shared_ptr> destroyedEventReceiver { @@ -492,39 +471,26 @@ namespace SHADE }; SHEventManager::SubscribeTo(SH_ENTITY_DESTROYED_EVENT, std::dynamic_pointer_cast(destroyedEventReceiver)); - /* Colliders */ // Register for collider added event std::shared_ptr> addedColliderEventReceiver { std::make_shared>(this, &SHScriptEngine::onColliderAdded) }; SHEventManager::SubscribeTo(SH_PHYSICS_COLLIDER_ADDED_EVENT, std::dynamic_pointer_cast(addedColliderEventReceiver)); + // Register for collider removed event std::shared_ptr> removedColliderEventReceiver { std::make_shared>(this, &SHScriptEngine::onColliderRemoved) }; SHEventManager::SubscribeTo(SH_PHYSICS_COLLIDER_REMOVED_EVENT, std::dynamic_pointer_cast(removedColliderEventReceiver)); + // Register for collider component removed event std::shared_ptr> removedColliderComponentEventReceiver { std::make_shared>(this, &SHScriptEngine::onColliderComponentRemoved) }; SHEventManager::SubscribeTo(SH_COMPONENT_REMOVED_EVENT, std::dynamic_pointer_cast(removedColliderComponentEventReceiver)); - - /* SceneGraph */ - // Register for SceneNode child added event - std::shared_ptr> addChildEventReceiver - { - std::make_shared>(this, &SHScriptEngine::onSceneNodeChildrenAdded) - }; - SHEventManager::SubscribeTo(SH_SCENEGRAPH_ADD_CHILD_EVENT, std::dynamic_pointer_cast(addChildEventReceiver)); - // Register for SceneNode child removed event - std::shared_ptr> removeChildEventReceiver - { - std::make_shared>(this, &SHScriptEngine::onSceneNodeChildrenRemoved) - }; - SHEventManager::SubscribeTo(SH_SCENEGRAPH_REMOVE_CHILD_EVENT, std::dynamic_pointer_cast(removeChildEventReceiver)); } void SHScriptEngine::dumpBuildLog(const std::string_view& buildLogPath) diff --git a/SHADE_Engine/src/Scripting/SHScriptEngine.h b/SHADE_Engine/src/Scripting/SHScriptEngine.h index ef778627..7d83606e 100644 --- a/SHADE_Engine/src/Scripting/SHScriptEngine.h +++ b/SHADE_Engine/src/Scripting/SHScriptEngine.h @@ -267,7 +267,6 @@ namespace SHADE // - Events CsEventRelayFuncPtr csColliderOnListChanged = nullptr; CsEventRelayFuncPtr csColliderOnRemoved = nullptr; - CsEventRelayFuncPtr csSceneNodeChildrenChanged = nullptr; // - Editor CsScriptEditorFuncPtr csEditorRenderScripts = nullptr; CsFuncPtr csEditorUndo = nullptr; @@ -280,8 +279,6 @@ namespace SHADE SHEventHandle onColliderAdded(SHEventPtr eventPtr); SHEventHandle onColliderRemoved(SHEventPtr eventPtr); SHEventHandle onColliderComponentRemoved(SHEventPtr eventPtr); - SHEventHandle onSceneNodeChildrenAdded(SHEventPtr eventPtr); - SHEventHandle onSceneNodeChildrenRemoved(SHEventPtr eventPtr); /*-----------------------------------------------------------------------------*/ /* Helper Functions */ diff --git a/SHADE_Managed/src/Engine/ChildListCache.cxx b/SHADE_Managed/src/Engine/ChildListCache.cxx deleted file mode 100644 index b183646f..00000000 --- a/SHADE_Managed/src/Engine/ChildListCache.cxx +++ /dev/null @@ -1,89 +0,0 @@ -/************************************************************************************//*! -\file ChildListCache.cxx -\author Tng Kah Wei, kahwei.tng, 390009620 -\par email: kahwei.tng\@digipen.edu -\date Nov 11, 2022 -\brief Contains the definition of the functions for the ChildListCache managed - class. - - Note: This file is written in C++17/CLI. - -Copyright (C) 2022 DigiPen Institute of Technology. -Reproduction or disclosure of this file or its contents without the prior written consent -of DigiPen Institute of Technology is prohibited. -*//*************************************************************************************/ -// Precompiled Headers -#include "SHpch.h" -// Primary Header -#include "ChildListCache.hxx" -// External Dependencies -#include "Scene/SHSceneManager.h" -// Project Headers -#include "Utility/Debug.hxx" - -namespace SHADE -{ - /*---------------------------------------------------------------------------------*/ - /* Static Usage Functions */ - /*---------------------------------------------------------------------------------*/ - ChildListCache::ChildEnumerable^ ChildListCache::GetChildList(Entity entity) - { - // Ignore if invalid - if (entity == MAX_EID) - return nullptr; - - // Check if in cache - if (cachedLists->ContainsKey(entity)) - return cachedLists[entity]; - - // Grab the native child list - auto node = GameObject(entity).GetSceneNode(); - if (!node || node->GetChildren().empty()) - return nullptr; - - // Otherwise - // - Create the list - ChildList^ list = gcnew ChildList(); - updateChildList(list, node); - // - Cache it - cachedLists[entity] = list; - - return list; - } - - void ChildListCache::UpdateChildList(Entity entity) - { - // Ignore if invalid - if (entity == MAX_EID) - return; - - // Check if in cache - if (!cachedLists->ContainsKey(entity)) - return; - - // Update - updateChildList(cachedLists[entity], GameObject(entity).GetSceneNode()); - } - - /*---------------------------------------------------------------------------------*/ - /* Event Handling Functions */ - /*---------------------------------------------------------------------------------*/ - void ChildListCache::OnChildrenChanged(EntityID entity) - { - SAFE_NATIVE_CALL_BEGIN - UpdateChildList(entity); - SAFE_NATIVE_CALL_END_N("SHADE_Managed.ChildListCache") - } - - /*---------------------------------------------------------------------------------*/ - /* Helper Functions */ - /*---------------------------------------------------------------------------------*/ - void ChildListCache::updateChildList(ChildList^ list, const SHSceneNode* sceneNode) - { - list->Clear(); - for (auto node : sceneNode->GetChildren()) - { - list->Add(GameObject(node->GetEntityID())); - } - } -} diff --git a/SHADE_Managed/src/Engine/ChildListCache.hxx b/SHADE_Managed/src/Engine/ChildListCache.hxx deleted file mode 100644 index 1a2637d3..00000000 --- a/SHADE_Managed/src/Engine/ChildListCache.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************************//*! -\file ChildListCache.hxx -\author Tng Kah Wei, kahwei.tng, 390009620 -\par email: kahwei.tng\@digipen.edu -\date Nov 11, 2022 -\brief Contains the definition of the ChildListCache managed class. - - Note: This file is written in C++17/CLI. - -Copyright (C) 2022 DigiPen Institute of Technology. -Reproduction or disclosure of this file or its contents without the prior written consent -of DigiPen Institute of Technology is prohibited. -*//*************************************************************************************/ -#pragma once - -// Project Includes -#include "GameObject.hxx" - -namespace SHADE { } - -namespace SHADE -{ - /*---------------------------------------------------------------------------------*/ - /* Forward Declarations */ - /*---------------------------------------------------------------------------------*/ - class SHSceneNode; - - /*---------------------------------------------------------------------------------*/ - /* Type Definitions */ - /*---------------------------------------------------------------------------------*/ - /// - /// Static class that caches all the lists of children for GameObjects. - /// - private ref class ChildListCache abstract sealed - { - public: - /*-----------------------------------------------------------------------------*/ - /* Type Definitions */ - /*-----------------------------------------------------------------------------*/ - using ChildList = System::Collections::Generic::List; - using ChildEnumerable = System::Collections::Generic::IEnumerable; - using ListMap = System::Collections::Generic::Dictionary; - - internal: - /*-----------------------------------------------------------------------------*/ - /* Static Usage Functions */ - /*-----------------------------------------------------------------------------*/ - /// - /// Retrieves the children list for the specified Entity. - /// - /// - /// Enumerable read only list of an Entity's children. Null if entity is invalid - /// or there are no children. - /// - static ChildEnumerable^ GetChildList(Entity entity); - /// - /// Updates the children list for the specified Entity if it exists. - /// - static void UpdateChildList(Entity entity); - - /*-----------------------------------------------------------------------------*/ - /* Event Handling Functions */ - /*-----------------------------------------------------------------------------*/ - /// - /// To be - /// - static void OnChildrenChanged(EntityID entity); - - private: - /*-----------------------------------------------------------------------------*/ - /* Static Data Members */ - /*-----------------------------------------------------------------------------*/ - static ListMap^ cachedLists = gcnew ListMap(); - - /*-----------------------------------------------------------------------------*/ - /* Helper Functions */ - /*-----------------------------------------------------------------------------*/ - static void updateChildList(ChildList^ list, const SHSceneNode* sceneNode); - }; -} \ No newline at end of file diff --git a/SHADE_Managed/src/Engine/GameObject.cxx b/SHADE_Managed/src/Engine/GameObject.cxx index 017366fe..bc17be8b 100644 --- a/SHADE_Managed/src/Engine/GameObject.cxx +++ b/SHADE_Managed/src/Engine/GameObject.cxx @@ -23,7 +23,6 @@ of DigiPen Institute of Technology is prohibited. #include "Utility/Convert.hxx" #include "Scripts/ScriptStore.hxx" #include "Utility/Debug.hxx" -#include "ChildListCache.hxx" namespace SHADE { @@ -88,43 +87,30 @@ namespace SHADE throw gcnew System::NullReferenceException(); return entity; } - GameObject GameObject::Parent::get() + GameObject^ GameObject::Parent::get() { if (!valid) throw gcnew System::NullReferenceException(); - const auto& SCENE_GRAPH = SHSceneManager::GetCurrentSceneGraph(); const auto* ROOT = SCENE_GRAPH.GetRoot(); + const auto* NODE = SCENE_GRAPH.GetNode(entity); if (NODE == nullptr) throw gcnew System::InvalidOperationException("Unable to retrieve SceneGraphNode for Entity " + entity.ToString()); const auto* PARENT = NODE->GetParent(); - return PARENT != ROOT ? GameObject(PARENT->GetEntityID()) : GameObject(); + return PARENT != ROOT ? gcnew GameObject(PARENT->GetEntityID()) : nullptr; } - void GameObject::Parent::set(GameObject newParent) + void GameObject::Parent::set(GameObject^ newParent) { if (!valid) throw gcnew System::NullReferenceException(); auto& SCENE_GRAPH = SHSceneManager::GetCurrentSceneGraph(); - if (newParent) - SCENE_GRAPH.SetParent(entity, newParent.EntityId); - else + if (newParent == nullptr) SCENE_GRAPH.SetParent(entity, nullptr); - } - int GameObject::ChildCount::get() - { - if (!valid) - throw gcnew System::NullReferenceException(); - - const auto& SCENE_GRAPH = SHSceneManager::GetCurrentSceneGraph(); - const auto* ROOT = SCENE_GRAPH.GetRoot(); - const auto* NODE = SCENE_GRAPH.GetNode(entity); - if (NODE == nullptr) - throw gcnew System::InvalidOperationException("Unable to retrieve SceneGraphNode for Entity " + entity.ToString()); - - return static_cast(NODE->GetChildren().size()); + else + SCENE_GRAPH.SetParent(entity, newParent->EntityId); } /*---------------------------------------------------------------------------------*/ @@ -229,90 +215,6 @@ namespace SHADE ScriptStore::RemoveScript(entity); } - /*---------------------------------------------------------------------------------*/ - /* Scene Graph Functions */ - /*---------------------------------------------------------------------------------*/ - void GameObject::DetachChildren() - { - // Validity Checks - if (!valid) - throw gcnew System::NullReferenceException(); - auto node = GetSceneNode(); - if (!node) - throw gcnew System::NullReferenceException(); - - // Unparent all children to the root - for (auto child : node->GetChildren()) - { - SHSceneManager::GetCurrentSceneGraph().SetParent(child->GetEntityID(), nullptr); - } - ChildListCache::UpdateChildList(entity); - } - - GameObject GameObject::GetChild(int index) - { - // Validity Checks - if (!valid) - throw gcnew System::NullReferenceException(); - auto node = GetSceneNode(); - if (!node) - throw gcnew System::NullReferenceException(); - - auto child = node->GetChild(index); - return child ? GameObject(child->GetEntityID()) : GameObject(); - } - - System::Collections::Generic::IEnumerable^ GameObject::GetChildren() - { - // Validity Checks - if (!valid) - throw gcnew System::NullReferenceException(); - return ChildListCache::GetChildList(entity); - } - - int GameObject::GetSiblingIndex() - { - throw gcnew System::NotImplementedException(); - } - - bool GameObject::IsChildOf(GameObject gameObj) - { - // Search parents recursively - auto node = GetSceneNode(); - while (node != nullptr) - { - if (node->GetEntityID() == gameObj.entity) - return true; - - // Go up higher - node = node->GetParent(); - } - return false; - } - - void GameObject::SetAsFirstSibling() - { - throw gcnew System::NotImplementedException(); - } - - void GameObject::SetAsLastSibling() - { - throw gcnew System::NotImplementedException(); - } - - void GameObject::SetSiblingIndex(int index) - { - throw gcnew System::NotImplementedException(); - } - - /*---------------------------------------------------------------------------------*/ - /* Operator Overloads */ - /*---------------------------------------------------------------------------------*/ - GameObject::operator bool(GameObject gameObj) - { - return gameObj.valid; - } - /*---------------------------------------------------------------------------------*/ /* Constructors */ /*---------------------------------------------------------------------------------*/ @@ -343,15 +245,11 @@ namespace SHADE } /*---------------------------------------------------------------------------------*/ - /* Helper Functions */ + /* Operator Overloads */ /*---------------------------------------------------------------------------------*/ - SHSceneNode* GameObject::GetSceneNode() + GameObject::operator bool(GameObject gameObj) { - const auto& SCENE_GRAPH = SHSceneManager::GetCurrentSceneGraph(); - const auto* ROOT = SCENE_GRAPH.GetRoot(); - if (!ROOT) - return nullptr; - return SCENE_GRAPH.GetNode(entity); + return gameObj.valid; } /*---------------------------------------------------------------------------------*/ @@ -392,21 +290,4 @@ namespace SHADE { return !(lhs == rhs); } - - /*---------------------------------------------------------------------------------*/ - /* IEnummerable */ - /*---------------------------------------------------------------------------------*/ - System::Collections::Generic::IEnumerator^ GameObject::GetEnumerator() - { - System::Collections::Generic::IEnumerable^ childList = GetChildren(); - if (childList == nullptr) - return System::Linq::Enumerable::Empty()->GetEnumerator(); - else - return childList->GetEnumerator(); - } - - System::Collections::IEnumerator^ GameObject::GetEnumeratorNonGeneric() - { - return GetEnumerator(); - } } diff --git a/SHADE_Managed/src/Engine/GameObject.hxx b/SHADE_Managed/src/Engine/GameObject.hxx index 2e0f360c..02a0ed4f 100644 --- a/SHADE_Managed/src/Engine/GameObject.hxx +++ b/SHADE_Managed/src/Engine/GameObject.hxx @@ -20,7 +20,7 @@ of DigiPen Institute of Technology is prohibited. namespace SHADE { /*---------------------------------------------------------------------------------*/ - /* Forward Declarations */ + /* Forward Declarations */ /*---------------------------------------------------------------------------------*/ ref class Script; ref class BaseComponent; @@ -32,9 +32,8 @@ namespace SHADE /// Lightweight object for an Entity that allows for easy access to Component and /// Script operations. /// Can be set to a invalid/null GameObject by default construction. - /// Can also be iterated to access children. /// - public value class GameObject : public System::IEquatable, public System::Collections::Generic::IEnumerable + public value class GameObject : public System::IEquatable { public: /*-----------------------------------------------------------------------------*/ @@ -98,17 +97,10 @@ namespace SHADE /// /// The parent entity for this GameObject. /// - property GameObject Parent + property GameObject^ Parent { - GameObject get(); - void set(GameObject); - } - /// - /// Number of Children held by this GameObject - /// - property int ChildCount - { - int get(); + GameObject^ get(); + void set(GameObject^); } /*-----------------------------------------------------------------------------*/ @@ -128,7 +120,8 @@ namespace SHADE /// /// Whether to activate or deactivate this GameObject. /// - void SetActive(bool active); + void SetActive(bool active); + /*-----------------------------------------------------------------------------*/ /* Component Access Functions */ @@ -221,82 +214,6 @@ namespace SHADE generic where T : ref class, Script void RemoveScript(); - /*-----------------------------------------------------------------------------*/ - /* Scene Graph Functions */ - /*-----------------------------------------------------------------------------*/ - /// - /// Unparents all children. Useful if you want to destroy the root of a hierarchy - /// without destroying the children. - /// - void DetachChildren(); - /// - /// Returns a child by index. - /// - /// Index of the child GameObject to retrieve. - /// - /// Handle to the GameObject if the index is valid. Invalid GameObject otherwise. - /// - GameObject GetChild(int index); - /// - /// Returns a cached enumerable container of child GameObjects of this - /// GameObject. - /// - /// - /// Enumerable container of child GameObjects of this GameObject. Null if - /// ChildCount is 0. - /// - System::Collections::Generic::IEnumerable^ GetChildren(); - /// - /// Gets the sibling index. Use GetSiblingIndex to find out the GameObject’s - /// place in this hierarchy. When the sibling index of a GameObject is changed, - /// its order in the Hierarchy window will also change. - /// - /// - /// Index of this GameObject among the parent GameObject's children. - /// - [System::ObsoleteAttribute("Not yet implemented.", true)] - int GetSiblingIndex(); - /// - /// Checks if this GameObject a direct or indirect child of the specified - /// GameObject. - /// - /// - /// True if this GameObject is a child, deep child (child of a child) or - /// identical to this GameObject, otherwise false. - /// - bool IsChildOf(GameObject gameObj); - /// - /// Move the GameObject to the start of the parent GameObject's children list. - /// - [System::ObsoleteAttribute("Not yet implemented.", true)] - void SetAsFirstSibling(); - /// - /// Move the GameObject to the end of the parent GameObject's children list. - /// - [System::ObsoleteAttribute("Not yet implemented.", true)] - void SetAsLastSibling(); - /// - /// Move the GameObject to the specified position in the parent GameObject's - /// children list. An existing object at that position if any, will be pushed - /// to the next index (existing element will be at index + 1). - /// - /// - /// Position to place this GameObject at in the hierarchy. Clamped to between - /// [0, parent.ChildCount]. - /// - [System::ObsoleteAttribute("Not yet implemented.", true)] - void SetSiblingIndex(int index); - - /*-----------------------------------------------------------------------------*/ - /* Operator Overloads */ - /*-----------------------------------------------------------------------------*/ - /// - /// Implicit conversion operator to enable checking if a GameObject is valid. - /// - /// GameObjects to check. - /// True if the GameObject is valid. - static operator bool(GameObject gameObj); - internal: /*-----------------------------------------------------------------------------*/ /* Constructors */ @@ -332,13 +249,13 @@ namespace SHADE SHEntity& GetNativeEntity(); /*-----------------------------------------------------------------------------*/ - /* Helper Functions */ + /* Operator Overloads */ /*-----------------------------------------------------------------------------*/ /// - /// Retrieves the SceneNode for this GameObject's referenced entity. + /// Implicit conversion operator to enable checking if a GameObject is valid. /// - /// Pointer to the SceneNode for this GameObject.. - SHSceneNode* GetSceneNode(); + /// GameObjects to check. + static operator bool(GameObject gameObj); private: /*-----------------------------------------------------------------------------*/ @@ -387,14 +304,6 @@ namespace SHADE /// Another GameObject to check with. /// True if both Components are different. static bool operator!=(GameObject lhs, GameObject rhs); - - /*-----------------------------------------------------------------------------*/ - /* IEnummerable */ - /*-----------------------------------------------------------------------------*/ - /// - System::Collections::Generic::IEnumerator^ GetEnumerator() override; - /// - System::Collections::IEnumerator^ GetEnumeratorNonGeneric() override = System::Collections::IEnumerable::GetEnumerator; }; }