Browse Source

Add more navigation component creation, add ParticleEffect importer

Josh Engebretson 10 years ago
parent
commit
cc8fdfc1a5

+ 5 - 0
Script/AtomicEditor/ui/frames/inspector/CreateComponentButton.ts

@@ -46,8 +46,13 @@ logicCreateSource.addItem(new Atomic.UIMenuItem("SplinePath", "SplinePath"));
 
 var navigationCreateSource = new Atomic.UIMenuItemSource();
 
+navigationCreateSource.addItem(new Atomic.UIMenuItem("CrowdAgent", "CrowdAgent"));
+navigationCreateSource.addItem(new Atomic.UIMenuItem("CrowdManager", "CrowdManager"));
+navigationCreateSource.addItem(new Atomic.UIMenuItem("NavArea", "NavArea"));
 navigationCreateSource.addItem(new Atomic.UIMenuItem("Navigable", "Navigable"));
 navigationCreateSource.addItem(new Atomic.UIMenuItem("NavigationMesh", "NavigationMesh"));
+navigationCreateSource.addItem(new Atomic.UIMenuItem("DynamicNavigationMesh", "DynamicNavigationMesh"));
+navigationCreateSource.addItem(new Atomic.UIMenuItem("Obstacle", "Obstacle"));
 navigationCreateSource.addItem(new Atomic.UIMenuItem("OffMeshConnection", "OffMeshConnection"));
 
 var networkCreateSource = new Atomic.UIMenuItemSource();

+ 5 - 0
Source/ToolCore/Assets/Asset.cpp

@@ -28,6 +28,7 @@
 #include "TextImporter.h"
 #include "NETAssemblyImporter.h"
 #include "TypeScriptImporter.h"
+#include "ParticleEffectImporter.h"
 
 #include "AssetEvents.h"
 #include "Asset.h"
@@ -298,6 +299,10 @@ bool Asset::CreateImporter()
         {
             importer_ = new PEXImporter(context_, this);
         }
+        else if (ext == ".peffect")
+        {
+            importer_ = new ParticleEffectImporter(context_, this);
+        }
         else if (ext == ".txt")
         {
             importer_ = new TextImporter(context_, this);

+ 1 - 0
Source/ToolCore/Assets/AssetDatabase.cpp

@@ -537,6 +537,7 @@ String AssetDatabase::GetResourceImporterName(const String& resourceTypeName)
         resourceTypeToImporterType_["JSComponentFile"] = "JavascriptImporter";        
         resourceTypeToImporterType_["JSONFile"] = "JSONImporter";
         resourceTypeToImporterType_["ParticleEffect2D"] = "PEXImporter";
+        resourceTypeToImporterType_["ParticleEffect"] = "ParticleEffectImporter";
 
         resourceTypeToImporterType_["Animation"] = "ModelImporter";
 

+ 71 - 0
Source/ToolCore/Assets/ParticleEffectImporter.cpp

@@ -0,0 +1,71 @@
+//
+// Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
+// LICENSE: Atomic Game Engine Editor and Tools EULA
+// Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
+// license information: https://github.com/AtomicGameEngine/AtomicGameEngine
+//
+
+#include <Atomic/Resource/ResourceCache.h>
+#include <Atomic/Resource/Image.h>
+#include <Atomic/Atomic3D/ParticleEffect.h>
+
+#include "Asset.h"
+#include "AssetDatabase.h"
+#include "ParticleEffectImporter.h"
+
+namespace ToolCore
+{
+
+ParticleEffectImporter::ParticleEffectImporter(Context* context, Asset *asset) : AssetImporter(context, asset)
+{
+
+}
+
+ParticleEffectImporter::~ParticleEffectImporter()
+{
+
+}
+
+void ParticleEffectImporter::SetDefaults()
+{
+    AssetImporter::SetDefaults();
+}
+
+bool ParticleEffectImporter::Import()
+{
+    return true;
+}
+
+bool ParticleEffectImporter::LoadSettingsInternal(JSONValue& jsonRoot)
+{
+    if (!AssetImporter::LoadSettingsInternal(jsonRoot))
+        return false;
+
+    JSONValue import = jsonRoot.Get("ParticleEffectImporter");
+
+    return true;
+}
+
+bool ParticleEffectImporter::SaveSettingsInternal(JSONValue& jsonRoot)
+{
+    if (!AssetImporter::SaveSettingsInternal(jsonRoot))
+        return false;
+
+    JSONValue import(JSONValue::emptyObject);
+    jsonRoot.Set("ParticleEffectImporter", import);
+
+
+    return true;
+}
+
+Resource* ParticleEffectImporter::GetResource(const String& typeName)
+{
+    ResourceCache* cache = GetSubsystem<ResourceCache>();
+
+    ParticleEffect* particleEffect = cache->GetResource<ParticleEffect>(asset_->GetPath());
+
+    return particleEffect;
+
+}
+
+}

+ 37 - 0
Source/ToolCore/Assets/ParticleEffectImporter.h

@@ -0,0 +1,37 @@
+//
+// Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
+// LICENSE: Atomic Game Engine Editor and Tools EULA
+// Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
+// license information: https://github.com/AtomicGameEngine/AtomicGameEngine
+//
+
+#pragma once
+
+#include "AssetImporter.h"
+
+namespace ToolCore
+{
+
+class ParticleEffectImporter : public AssetImporter
+{
+    OBJECT(ParticleEffectImporter);
+
+public:
+    /// Construct.
+    ParticleEffectImporter(Context* context, Asset* asset);
+    virtual ~ParticleEffectImporter();
+
+    virtual void SetDefaults();
+
+    Resource* GetResource(const String& typeName);
+
+protected:
+
+    bool Import();
+
+    virtual bool LoadSettingsInternal(JSONValue& jsonRoot);
+    virtual bool SaveSettingsInternal(JSONValue& jsonRoot);
+
+};
+
+}