Added script inspector and serialization support for RigAsset and AnimationClipAsset
This commit is contained in:
parent
a0bafcc526
commit
933e963950
|
@ -18,6 +18,7 @@ of DigiPen Institute of Technology is prohibited.
|
|||
#include "Editor/Editor.hxx"
|
||||
// STL Includes
|
||||
#include <memory>
|
||||
#include <string>
|
||||
// Project Headers
|
||||
#include "Components/Component.hxx"
|
||||
#include "Scripts/ScriptStore.hxx"
|
||||
|
@ -30,7 +31,8 @@ of DigiPen Institute of Technology is prohibited.
|
|||
#include "RangeAttribute.hxx"
|
||||
#include "Math/Vector2.hxx"
|
||||
#include "Math/Vector3.hxx"
|
||||
#include <string>
|
||||
#include "Assets/RigAsset.hxx"
|
||||
#include "Assets/AnimationClipAsset.hxx"
|
||||
|
||||
// Using Directives
|
||||
using namespace System;
|
||||
|
@ -162,24 +164,26 @@ namespace SHADE
|
|||
bool isHovered = false;
|
||||
|
||||
const bool MODIFIED_PRIMITIVE =
|
||||
renderSpecificField<int , Int16 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , Int32 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , Int64 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , UInt16 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , UInt32 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , UInt64 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , Byte >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<bool , bool >(field, object, SHEditorUI::InputCheckbox, &isHovered) ||
|
||||
renderSpecificField<float , float >(field, object, SHEditorUI::InputFloat , &isHovered) ||
|
||||
renderSpecificField<double , double >(field, object, SHEditorUI::InputDouble , &isHovered) ||
|
||||
renderSpecificField<SHVec2 , Vector2 >(field, object, SHEditorUI::InputVec2 , &isHovered) ||
|
||||
renderSpecificField<SHVec3 , Vector3 >(field, object, SHEditorUI::InputVec3 , &isHovered) ||
|
||||
renderSpecificField<uint32_t , GameObject >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<std::string, System::String^>(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<int , System::Enum >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<AssetID , FontAsset >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<AssetID , MeshAsset >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<AssetID , MaterialAsset >(field, object, nullptr , &isHovered);
|
||||
renderSpecificField<int , Int16 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , Int32 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , Int64 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , UInt16 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , UInt32 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , UInt64 >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<int , Byte >(field, object, SHEditorUI::InputInt , &isHovered) ||
|
||||
renderSpecificField<bool , bool >(field, object, SHEditorUI::InputCheckbox, &isHovered) ||
|
||||
renderSpecificField<float , float >(field, object, SHEditorUI::InputFloat , &isHovered) ||
|
||||
renderSpecificField<double , double >(field, object, SHEditorUI::InputDouble , &isHovered) ||
|
||||
renderSpecificField<SHVec2 , Vector2 >(field, object, SHEditorUI::InputVec2 , &isHovered) ||
|
||||
renderSpecificField<SHVec3 , Vector3 >(field, object, SHEditorUI::InputVec3 , &isHovered) ||
|
||||
renderSpecificField<uint32_t , GameObject >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<std::string, System::String^ >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<int , System::Enum >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<AssetID , FontAsset >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<AssetID , MeshAsset >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<AssetID , MaterialAsset >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<AssetID , RigAsset >(field, object, nullptr , &isHovered) ||
|
||||
renderSpecificField<AssetID , AnimationClipAsset>(field, object, nullptr , &isHovered);
|
||||
|
||||
if (!MODIFIED_PRIMITIVE)
|
||||
{
|
||||
|
@ -323,24 +327,26 @@ namespace SHADE
|
|||
bool modified;
|
||||
|
||||
const bool RENDERED =
|
||||
renderFieldEditor<int , Int16 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , Int32 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , Int64 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , UInt16 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , UInt32 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , UInt64 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , Byte >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<bool , bool >(fieldName, object, SHEditorUI::InputCheckbox, nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<float , float >(fieldName, object, SHEditorUI::InputFloat , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<double , double >(fieldName, object, SHEditorUI::InputDouble , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<SHVec2 , Vector2 >(fieldName, object, SHEditorUI::InputVec2 , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<SHVec3 , Vector3 >(fieldName, object, SHEditorUI::InputVec3 , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<uint32_t , GameObject >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<std::string, System::String^>(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , System::Enum >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<AssetID , FontAsset >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<AssetID , MeshAsset >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<AssetID , MaterialAsset >(fieldName, object, nullptr , nullptr, rangeAttrib, modified);
|
||||
renderFieldEditor<int , Int16 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , Int32 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , Int64 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , UInt16 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , UInt32 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , UInt64 >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , Byte >(fieldName, object, SHEditorUI::InputInt , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<bool , bool >(fieldName, object, SHEditorUI::InputCheckbox, nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<float , float >(fieldName, object, SHEditorUI::InputFloat , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<double , double >(fieldName, object, SHEditorUI::InputDouble , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<SHVec2 , Vector2 >(fieldName, object, SHEditorUI::InputVec2 , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<SHVec3 , Vector3 >(fieldName, object, SHEditorUI::InputVec3 , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<uint32_t , GameObject >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<std::string, System::String^ >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<int , System::Enum >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<AssetID , FontAsset >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<AssetID , MeshAsset >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<AssetID , MaterialAsset >(fieldName, object, nullptr , nullptr, rangeAttrib, modified)||
|
||||
renderFieldEditor<AssetID , RigAsset >(fieldName, object, nullptr , nullptr, rangeAttrib, modified) ||
|
||||
renderFieldEditor<AssetID , AnimationClipAsset>(fieldName, object, nullptr , nullptr, rangeAttrib, modified);
|
||||
|
||||
return modified;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ of DigiPen Institute of Technology is prohibited.
|
|||
#include "Assets/FontAsset.hxx"
|
||||
#include "Assets/MeshAsset.hxx"
|
||||
#include "Assets/MaterialAsset.hxx"
|
||||
#include "Assets/RigAsset.hxx"
|
||||
#include "Assets/AnimationClipAsset.hxx"
|
||||
|
||||
namespace SHADE
|
||||
{
|
||||
|
@ -237,6 +239,30 @@ namespace SHADE
|
|||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
template<>
|
||||
bool Editor::renderFieldEditorInternal<AssetID, RigAsset>(const std::string& fieldName, interior_ptr<RigAsset> managedValPtr, EditorFieldFunc<uint32_t>, bool* isHovered, RangeAttribute^)
|
||||
{
|
||||
uint32_t assetId = managedValPtr->NativeAssetID;
|
||||
if (SHEditorUI::InputAssetField(fieldName, assetId, AssetType::MODEL, isHovered))
|
||||
{
|
||||
*managedValPtr = RigAsset(assetId);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
template<>
|
||||
bool Editor::renderFieldEditorInternal<AssetID, AnimationClipAsset>(const std::string& fieldName, interior_ptr<AnimationClipAsset> managedValPtr, EditorFieldFunc<uint32_t>, bool* isHovered, RangeAttribute^)
|
||||
{
|
||||
uint32_t assetId = managedValPtr->NativeAssetID;
|
||||
if (SHEditorUI::InputAssetField(fieldName, assetId, AssetType::MODEL, isHovered))
|
||||
{
|
||||
*managedValPtr = AnimationClipAsset(assetId);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ of DigiPen Institute of Technology is prohibited.
|
|||
#include "Assets/MaterialAsset.hxx"
|
||||
#include "Assets/MeshAsset.hxx"
|
||||
#include "Scripts/Script.hxx"
|
||||
#include "Assets/RigAsset.hxx"
|
||||
#include "Assets/AnimationClipAsset.hxx"
|
||||
|
||||
/*-------------------------------------------------------------------------------------*/
|
||||
/* File-Level Constants */
|
||||
|
@ -144,24 +146,26 @@ namespace SHADE
|
|||
YAML::Node fieldNode;
|
||||
|
||||
// Retrieve string for the YAML
|
||||
const bool PRIMITIVE_SERIALIZED = fieldInsertYaml<System::Int16 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::Int32 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::Int64 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::UInt16>(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::UInt32>(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::UInt64>(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::Byte >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<bool >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<float >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<double >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::Enum >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::String>(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<Vector2 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<Vector3 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<GameObject >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<FontAsset >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<MaterialAsset >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<MeshAsset >(fieldInfo, object, fieldNode);
|
||||
const bool PRIMITIVE_SERIALIZED = fieldInsertYaml<System::Int16 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::Int32 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::Int64 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::UInt16 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::UInt32 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::UInt64 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::Byte >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<bool >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<float >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<double >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::Enum >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<System::String >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<Vector2 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<Vector3 >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<GameObject >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<FontAsset >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<MaterialAsset >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<MeshAsset >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<RigAsset >(fieldInfo, object, fieldNode) ||
|
||||
fieldInsertYaml<AnimationClipAsset>(fieldInfo, object, fieldNode);
|
||||
|
||||
// Serialization of more complex types
|
||||
if (!PRIMITIVE_SERIALIZED)
|
||||
|
@ -208,24 +212,26 @@ namespace SHADE
|
|||
bool SerialisationUtilities::varInsertYaml(System::Object^ object, YAML::Node& fieldNode)
|
||||
{
|
||||
const bool INSERTED =
|
||||
varInsertYamlInternal<System::Int16 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::Int32 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::Int64 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::UInt16>(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::UInt32>(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::UInt64>(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::Byte >(object, fieldNode) ||
|
||||
varInsertYamlInternal<bool >(object, fieldNode) ||
|
||||
varInsertYamlInternal<float >(object, fieldNode) ||
|
||||
varInsertYamlInternal<double >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::Enum >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::String>(object, fieldNode) ||
|
||||
varInsertYamlInternal<Vector2 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<Vector3 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<GameObject >(object, fieldNode) ||
|
||||
varInsertYamlInternal<FontAsset >(object, fieldNode) ||
|
||||
varInsertYamlInternal<MaterialAsset >(object, fieldNode) ||
|
||||
varInsertYamlInternal<MeshAsset >(object, fieldNode);
|
||||
varInsertYamlInternal<System::Int16 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::Int32 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::Int64 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::UInt16 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::UInt32 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::UInt64 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::Byte >(object, fieldNode) ||
|
||||
varInsertYamlInternal<bool >(object, fieldNode) ||
|
||||
varInsertYamlInternal<float >(object, fieldNode) ||
|
||||
varInsertYamlInternal<double >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::Enum >(object, fieldNode) ||
|
||||
varInsertYamlInternal<System::String >(object, fieldNode) ||
|
||||
varInsertYamlInternal<Vector2 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<Vector3 >(object, fieldNode) ||
|
||||
varInsertYamlInternal<GameObject >(object, fieldNode) ||
|
||||
varInsertYamlInternal<FontAsset >(object, fieldNode) ||
|
||||
varInsertYamlInternal<MaterialAsset >(object, fieldNode) ||
|
||||
varInsertYamlInternal<MeshAsset >(object, fieldNode) ||
|
||||
varInsertYamlInternal<RigAsset >(object, fieldNode) ||
|
||||
varInsertYamlInternal<AnimationClipAsset>(object, fieldNode);
|
||||
return INSERTED;
|
||||
}
|
||||
|
||||
|
@ -235,24 +241,26 @@ namespace SHADE
|
|||
bool SerialisationUtilities::writeYamlIntoField(System::Reflection::FieldInfo^ fieldInfo, Object^ object, YAML::Node& node)
|
||||
{
|
||||
const bool ASSIGNED =
|
||||
fieldAssignYaml<System::Int16> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::Int32> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::Int64> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::UInt16>(fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::UInt32>(fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::UInt64>(fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::Byte> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<bool> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<float> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<double> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::Enum> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::String>(fieldInfo, object, node) ||
|
||||
fieldAssignYaml<Vector2> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<Vector3> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<GameObject> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<FontAsset> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<MaterialAsset> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<MeshAsset> (fieldInfo, object, node);
|
||||
fieldAssignYaml<System::Int16> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::Int32> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::Int64> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::UInt16> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::UInt32> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::UInt64> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::Byte> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<bool> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<float> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<double> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::Enum> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<System::String> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<Vector2> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<Vector3> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<GameObject> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<FontAsset> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<MaterialAsset> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<MeshAsset> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<RigAsset> (fieldInfo, object, node) ||
|
||||
fieldAssignYaml<AnimationClipAsset>(fieldInfo, object, node);
|
||||
if (!ASSIGNED)
|
||||
{
|
||||
if (ReflectionUtilities::FieldIsList(fieldInfo))
|
||||
|
@ -309,24 +317,26 @@ namespace SHADE
|
|||
bool SerialisationUtilities::varAssignYaml(System::Object^% object, YAML::Node& node)
|
||||
{
|
||||
const bool DESERIALISED =
|
||||
varAssignYamlInternal<System::Int16> (object, node) ||
|
||||
varAssignYamlInternal<System::Int32> (object, node) ||
|
||||
varAssignYamlInternal<System::Int64> (object, node) ||
|
||||
varAssignYamlInternal<System::UInt16>(object, node) ||
|
||||
varAssignYamlInternal<System::UInt32>(object, node) ||
|
||||
varAssignYamlInternal<System::UInt64>(object, node) ||
|
||||
varAssignYamlInternal<System::Byte> (object, node) ||
|
||||
varAssignYamlInternal<bool> (object, node) ||
|
||||
varAssignYamlInternal<float> (object, node) ||
|
||||
varAssignYamlInternal<double> (object, node) ||
|
||||
varAssignYamlInternal<System::Enum> (object, node) ||
|
||||
varAssignYamlInternal<System::String>(object, node) ||
|
||||
varAssignYamlInternal<Vector2> (object, node) ||
|
||||
varAssignYamlInternal<Vector3> (object, node) ||
|
||||
varAssignYamlInternal<GameObject> (object, node) ||
|
||||
varAssignYamlInternal<FontAsset> (object, node) ||
|
||||
varAssignYamlInternal<MaterialAsset> (object, node) ||
|
||||
varAssignYamlInternal<MeshAsset> (object, node);
|
||||
varAssignYamlInternal<System::Int16> (object, node) ||
|
||||
varAssignYamlInternal<System::Int32> (object, node) ||
|
||||
varAssignYamlInternal<System::Int64> (object, node) ||
|
||||
varAssignYamlInternal<System::UInt16> (object, node) ||
|
||||
varAssignYamlInternal<System::UInt32> (object, node) ||
|
||||
varAssignYamlInternal<System::UInt64> (object, node) ||
|
||||
varAssignYamlInternal<System::Byte> (object, node) ||
|
||||
varAssignYamlInternal<bool> (object, node) ||
|
||||
varAssignYamlInternal<float> (object, node) ||
|
||||
varAssignYamlInternal<double> (object, node) ||
|
||||
varAssignYamlInternal<System::Enum> (object, node) ||
|
||||
varAssignYamlInternal<System::String> (object, node) ||
|
||||
varAssignYamlInternal<Vector2> (object, node) ||
|
||||
varAssignYamlInternal<Vector3> (object, node) ||
|
||||
varAssignYamlInternal<GameObject> (object, node) ||
|
||||
varAssignYamlInternal<FontAsset> (object, node) ||
|
||||
varAssignYamlInternal<MaterialAsset> (object, node) ||
|
||||
varAssignYamlInternal<MeshAsset> (object, node) ||
|
||||
varAssignYamlInternal<RigAsset> (object, node) ||
|
||||
varAssignYamlInternal<AnimationClipAsset>(object, node);
|
||||
return DESERIALISED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,9 +60,11 @@ namespace SHADE
|
|||
{
|
||||
fieldNode = MAX_EID;
|
||||
}
|
||||
else if constexpr (std::is_same_v<FieldType, FontAsset> ||
|
||||
else if constexpr (std::is_same_v<FieldType, FontAsset> ||
|
||||
std::is_same_v<FieldType, MaterialAsset> ||
|
||||
std::is_same_v<FieldType, MeshAsset>)
|
||||
std::is_same_v<FieldType, MeshAsset> ||
|
||||
std::is_same_v<FieldType, RigAsset> ||
|
||||
std::is_same_v<FieldType, AnimationClipAsset>)
|
||||
{
|
||||
fieldNode = INVALID_ASSET_ID;
|
||||
}
|
||||
|
@ -130,7 +132,9 @@ namespace SHADE
|
|||
}
|
||||
else if constexpr (std::is_same_v<FieldType, FontAsset> ||
|
||||
std::is_same_v<FieldType, MaterialAsset> ||
|
||||
std::is_same_v<FieldType, MeshAsset>)
|
||||
std::is_same_v<FieldType, MeshAsset> ||
|
||||
std::is_same_v<FieldType, RigAsset> ||
|
||||
std::is_same_v<FieldType, AnimationClipAsset>)
|
||||
{
|
||||
if (object->GetType() == FieldType::typeid)
|
||||
{
|
||||
|
@ -256,7 +260,9 @@ namespace SHADE
|
|||
}
|
||||
else if constexpr (std::is_same_v<FieldType, FontAsset> ||
|
||||
std::is_same_v<FieldType, MaterialAsset> ||
|
||||
std::is_same_v<FieldType, MeshAsset>)
|
||||
std::is_same_v<FieldType, MeshAsset> ||
|
||||
std::is_same_v<FieldType, RigAsset> ||
|
||||
std::is_same_v<FieldType, AnimationClipAsset>)
|
||||
{
|
||||
if (object->GetType() == FieldType::typeid)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue