Search the Community
Showing results for tags 'component system'.
-
I have been looking into component system in c++ and all the components created irrespective of the folder structure in the source folder is created in a single folder in the editor( component system) . I would like to organise the components of different node or entity in separate folder in the component system folder in the editor. Is there any way to do that?
-
Is it possible to create a component using an IDE with a generated GUID? Or should components be created only through the editor?
-
Hello , Is there a better way to find all the existing components of a given type in the world? Unigine::Vector<Unigine::NodePtr> nodes; Unigine::World::getRootNodes(nodes); for (int i = 0; i < nodes.size(); i++) { if (auto componentPtr = Unigine::ComponentSystem::get()->getComponentInChildren<AirportComponent>(nodes.get(i))) { ..... } Thank you.
-
Hello, I'd like to ask if its possible to create a abstract C# component class for inheritance only? I'm new to Unigine so I might be missing something. Here is a example of what I want to achieve: public abstract class MyComponentBase : Component { public MyComponentBase(...) { ... } protected virtual void Init() { System.Console.WriteLine("Hello from component base class!"); } } public sealed class MyComponent : MyComponentBase { public MyComponent() : base(...) { ... } protected override void Init() { base.Init(); System.Console.WriteLine("Hello from my component!"); } } Attempting to build the example results into the following build error: "System.MissingMethodException: Cannot create an abstract class." Is there a attribute I am not aware of that would prevent it from attempting to instantiate the abstract component during build process? Thanks.
-
What title says. Sounds similar to this problem: Project attached.tmp.zip
-
I have a problem with changing a property parameter that is of string type ____________________________________________________________________________________ #include <UnigineGame.h> #include "UnigineComponentSystem.h" class MaterialPaintingController final : public Unigine::ComponentBase { public: COMPONENT(MaterialPaintingController, Unigine::ComponentBase); COMPONENT_INIT(init); PROP_NAME("MaterialPaintingController"); PROP_PARAM(String, painting_variant, "DEF"); PROP_ARRAY(Node, surfaces); private: void init(); void parameterChanged(Unigine::PropertyPtr property, int propID); ____________________________________________________________________________________ then I use setParameterData in the call Unigine::String str("NewMat"); componentPtr->setParameterData("painting_variant", &str); I did not get a callback for a change and I can't find out what's going on. Is the use of setParameterData correct ? thanks for any help. Michal
-
Boids using the Unigine Component System
angus posted a topic in Tools, Plugins, Materials & Tutorials
I implemented the agent-based flocking algorithm "Boids" in the Unigine component system for fun. See http://www.kfish.org/boids/pseudocode.html It's an incomplete implementation, don't expect too much. But it does make for a nice organic-feeling movement pattern. To get started with the attached code, make a new project making sure to tick the "Component System" box Unpack the .ZIP attached C++ files over the defaults. In the editor, make a bunch of ObjectMeshDynamic cubes (Create->Primitive->Cube) and scatter them around. I used 14, but you can use any number. Scale them down to 0.1. If you click-drag you can clone them or select some in the "world" tab and right-click for "clone". So long as they're called "Cuboid<something>" (hard coded, see source) they'll be animated. Action shot with rule-vector debugging on. cs_1.zip -
Hello, are there examples available of: how to declare a struct how to create a single parameter of that struct how to create an array of that struct within a header file of custom component in C++? I.e. what would the C++ .h file look like for a Component, which creates the following property file: <property name="MyComponent"> <struct name="MyStruct"> <parameter name="someInt" type="int">0</parameter> <parameter name="someFile" type="file" flags="asset"/> </struct> <parameter name="someArray" type="array" array_type="MyStruct" array_dim="1"/> </property> Many thanks, Helmut