Merge branch 'Better-Actor-Toolbox' of https://github.com/Tryibion/FlaxEngine into Tryibion-Better-Actor-Toolbox
This commit is contained in:
@@ -100,6 +100,7 @@ namespace FlaxEditor.Windows
|
||||
|
||||
private TextBox _searchBox;
|
||||
private ContainerControl _groupSearch;
|
||||
private Tabs actorGroups;
|
||||
|
||||
/// <summary>
|
||||
/// The editor instance.
|
||||
@@ -117,8 +118,9 @@ namespace FlaxEditor.Windows
|
||||
Editor = editor;
|
||||
Selected += tab => Editor.Windows.EditWin.Viewport.SetActiveMode<TransformGizmoMode>();
|
||||
ScriptsBuilder.ScriptsReload += OnScriptsReload;
|
||||
ScriptsBuilder.ScriptsReloadEnd += OnScriptsReloadEnd;
|
||||
|
||||
var actorGroups = new Tabs
|
||||
actorGroups = new Tabs
|
||||
{
|
||||
Orientation = Orientation.Vertical,
|
||||
UseScroll = true,
|
||||
@@ -127,7 +129,7 @@ namespace FlaxEditor.Windows
|
||||
TabsSize = new Float2(120, 32),
|
||||
Parent = this,
|
||||
};
|
||||
|
||||
|
||||
_groupSearch = CreateGroupWithList(actorGroups, "Search", 26);
|
||||
_searchBox = new TextBox
|
||||
{
|
||||
@@ -138,63 +140,8 @@ namespace FlaxEditor.Windows
|
||||
};
|
||||
_searchBox.TextChanged += OnSearchBoxTextChanged;
|
||||
|
||||
var groupBasicModels = CreateGroupWithList(actorGroups, "Basic Models");
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Cube", "Primitives/Cube.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Sphere", "Primitives/Sphere.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Plane", "Primitives/Plane.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Cylinder", "Primitives/Cylinder.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Cone", "Primitives/Cone.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Capsule", "Primitives/Capsule.flax"));
|
||||
|
||||
var groupLights = CreateGroupWithList(actorGroups, "Lights");
|
||||
groupLights.AddChild(CreateActorItem("Directional Light", typeof(DirectionalLight)));
|
||||
groupLights.AddChild(CreateActorItem("Point Light", typeof(PointLight)));
|
||||
groupLights.AddChild(CreateActorItem("Spot Light", typeof(SpotLight)));
|
||||
groupLights.AddChild(CreateActorItem("Sky Light", typeof(SkyLight)));
|
||||
|
||||
var groupVisuals = CreateGroupWithList(actorGroups, "Visuals");
|
||||
groupVisuals.AddChild(CreateActorItem("Camera", typeof(Camera)));
|
||||
groupVisuals.AddChild(CreateActorItem("Environment Probe", typeof(EnvironmentProbe)));
|
||||
groupVisuals.AddChild(CreateActorItem("Skybox", typeof(Skybox)));
|
||||
groupVisuals.AddChild(CreateActorItem("Sky", typeof(Sky)));
|
||||
groupVisuals.AddChild(CreateActorItem("Exponential Height Fog", typeof(ExponentialHeightFog)));
|
||||
groupVisuals.AddChild(CreateActorItem("PostFx Volume", typeof(PostFxVolume)));
|
||||
groupVisuals.AddChild(CreateActorItem("Decal", typeof(Decal)));
|
||||
groupVisuals.AddChild(CreateActorItem("Particle Effect", typeof(ParticleEffect)));
|
||||
|
||||
var groupPhysics = CreateGroupWithList(actorGroups, "Physics");
|
||||
groupPhysics.AddChild(CreateActorItem("Rigid Body", typeof(RigidBody)));
|
||||
groupPhysics.AddChild(CreateActorItem("Character Controller", typeof(CharacterController)));
|
||||
groupPhysics.AddChild(CreateActorItem("Box Collider", typeof(BoxCollider)));
|
||||
groupPhysics.AddChild(CreateActorItem("Sphere Collider", typeof(SphereCollider)));
|
||||
groupPhysics.AddChild(CreateActorItem("Capsule Collider", typeof(CapsuleCollider)));
|
||||
groupPhysics.AddChild(CreateActorItem("Mesh Collider", typeof(MeshCollider)));
|
||||
groupPhysics.AddChild(CreateActorItem("Fixed Joint", typeof(FixedJoint)));
|
||||
groupPhysics.AddChild(CreateActorItem("Distance Joint", typeof(DistanceJoint)));
|
||||
groupPhysics.AddChild(CreateActorItem("Slider Joint", typeof(SliderJoint)));
|
||||
groupPhysics.AddChild(CreateActorItem("Spherical Joint", typeof(SphericalJoint)));
|
||||
groupPhysics.AddChild(CreateActorItem("Hinge Joint", typeof(HingeJoint)));
|
||||
groupPhysics.AddChild(CreateActorItem("D6 Joint", typeof(D6Joint)));
|
||||
|
||||
var groupOther = CreateGroupWithList(actorGroups, "Other");
|
||||
groupOther.AddChild(CreateActorItem("Animated Model", typeof(AnimatedModel)));
|
||||
groupOther.AddChild(CreateActorItem("Bone Socket", typeof(BoneSocket)));
|
||||
groupOther.AddChild(CreateActorItem("CSG Box Brush", typeof(BoxBrush)));
|
||||
groupOther.AddChild(CreateActorItem("Audio Source", typeof(AudioSource)));
|
||||
groupOther.AddChild(CreateActorItem("Audio Listener", typeof(AudioListener)));
|
||||
groupOther.AddChild(CreateActorItem("Empty Actor", typeof(EmptyActor)));
|
||||
groupOther.AddChild(CreateActorItem("Scene Animation", typeof(SceneAnimationPlayer)));
|
||||
groupOther.AddChild(CreateActorItem("Nav Mesh Bounds Volume", typeof(NavMeshBoundsVolume)));
|
||||
groupOther.AddChild(CreateActorItem("Nav Link", typeof(NavLink)));
|
||||
groupOther.AddChild(CreateActorItem("Nav Modifier Volume", typeof(NavModifierVolume)));
|
||||
groupOther.AddChild(CreateActorItem("Spline", typeof(Spline)));
|
||||
|
||||
var groupGui = CreateGroupWithList(actorGroups, "GUI");
|
||||
groupGui.AddChild(CreateActorItem("UI Control", typeof(UIControl)));
|
||||
groupGui.AddChild(CreateActorItem("UI Canvas", typeof(UICanvas)));
|
||||
groupGui.AddChild(CreateActorItem("Text Render", typeof(TextRender)));
|
||||
groupGui.AddChild(CreateActorItem("Sprite Render", typeof(SpriteRender)));
|
||||
|
||||
RefreshActorTabs();
|
||||
|
||||
actorGroups.SelectedTabIndex = 1;
|
||||
}
|
||||
|
||||
@@ -206,6 +153,94 @@ namespace FlaxEditor.Windows
|
||||
_groupSearch.PerformLayout();
|
||||
}
|
||||
|
||||
private void OnScriptsReloadEnd()
|
||||
{
|
||||
RefreshActorTabs();
|
||||
}
|
||||
|
||||
private void RefreshActorTabs()
|
||||
{
|
||||
// Remove tabs
|
||||
List<Tab> tabs = new List<Tab>();
|
||||
foreach (var child in actorGroups.Children)
|
||||
{
|
||||
if (child is Tab tab)
|
||||
{
|
||||
if (tab.Text != "Search")
|
||||
tabs.Add(tab);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var tab in tabs)
|
||||
{
|
||||
var group = actorGroups.Children.Find(T => T == tab);
|
||||
group.Dispose();
|
||||
}
|
||||
|
||||
var groupBasicModels = CreateGroupWithList(actorGroups, "Basic Models");
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Cube", "Primitives/Cube.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Sphere", "Primitives/Sphere.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Plane", "Primitives/Plane.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Cylinder", "Primitives/Cylinder.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Cone", "Primitives/Cone.flax"));
|
||||
groupBasicModels.AddChild(CreateEditorAssetItem("Capsule", "Primitives/Capsule.flax"));
|
||||
|
||||
// Created first to order specific tabs
|
||||
CreateGroupWithList(actorGroups, "Lights");
|
||||
CreateGroupWithList(actorGroups, "Visuals");
|
||||
CreateGroupWithList(actorGroups, "Physics");
|
||||
CreateGroupWithList(actorGroups, "GUI");
|
||||
CreateGroupWithList(actorGroups, "Other");
|
||||
|
||||
// Add other actor types to respective tab based on attribute
|
||||
foreach (var actorType in Editor.CodeEditing.Actors.Get())
|
||||
{
|
||||
if (actorType.IsAbstract)
|
||||
continue;
|
||||
|
||||
ActorToolboxAttribute attribute = null;
|
||||
foreach (var e in actorType.GetAttributes(false))
|
||||
{
|
||||
if (e is ActorToolboxAttribute actorToolboxAttribute)
|
||||
{
|
||||
attribute = actorToolboxAttribute;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (attribute == null)
|
||||
continue;
|
||||
|
||||
var groupName = attribute.Group;
|
||||
|
||||
// Check if tab already exists and add it to the tab
|
||||
var actorTabExists = false;
|
||||
foreach (var child in actorGroups.Children)
|
||||
{
|
||||
if (child is Tab tab)
|
||||
{
|
||||
if (tab.Text == groupName.Trim())
|
||||
{
|
||||
var tree = tab.GetChild<Panel>().GetChild<Tree>();
|
||||
if (tree != null)
|
||||
{
|
||||
tree.AddChild(string.IsNullOrEmpty(attribute.Name) ? CreateActorItem(Utilities.Utils.GetPropertyNameUI(actorType.Name), actorType) : CreateActorItem(attribute.Name, actorType));
|
||||
tree.SortChildren();
|
||||
}
|
||||
actorTabExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (actorTabExists)
|
||||
continue;
|
||||
|
||||
var group = CreateGroupWithList(actorGroups, groupName.Trim());
|
||||
group.AddChild(string.IsNullOrEmpty(attribute.Name) ? CreateActorItem(Utilities.Utils.GetPropertyNameUI(actorType.Name), actorType) : CreateActorItem(attribute.Name, actorType));
|
||||
group.SortChildren();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSearchBoxTextChanged()
|
||||
{
|
||||
// Skip events during setup or init stuff
|
||||
@@ -218,7 +253,17 @@ namespace FlaxEditor.Windows
|
||||
|
||||
foreach (var actorType in Editor.CodeEditing.Actors.Get())
|
||||
{
|
||||
var text = actorType.Name;
|
||||
ActorToolboxAttribute attribute = null;
|
||||
foreach (var e in actorType.GetAttributes(true))
|
||||
{
|
||||
if (e is ActorToolboxAttribute actorToolboxAttribute)
|
||||
{
|
||||
attribute = actorToolboxAttribute;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var text = (attribute == null) ? actorType.Name : string.IsNullOrEmpty(attribute.Name) ? actorType.Name : attribute.Name;
|
||||
|
||||
if (!QueryFilterHelper.Match(filterText, text, out QueryFilterHelper.Range[] ranges))
|
||||
continue;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/// <summary>
|
||||
/// The scene animation playback actor.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes = "ActorContextMenu(\"New/Other/Scene Animation\")") class FLAXENGINE_API SceneAnimationPlayer : public Actor, public IPostFxSettingsProvider
|
||||
API_CLASS(Attributes = "ActorContextMenu(\"New/Other/Scene Animation\"), ActorToolbox(\"Other\", \"Scene Animation\")") class FLAXENGINE_API SceneAnimationPlayer : public Actor, public IPostFxSettingsProvider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SceneAnimationPlayer);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Represents a listener that hears audio sources. For spatial audio the volume and pitch of played audio is determined by the distance, orientation and velocity differences between the source and the listener.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Audio/Audio Listener\")") class FLAXENGINE_API AudioListener : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Audio/Audio Listener\"), ActorToolbox(\"Other\")") class FLAXENGINE_API AudioListener : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(AudioListener);
|
||||
private:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/// <remarks>
|
||||
/// Whether or not an audio source is spatial is controlled by the assigned AudioClip.The volume and the pitch of a spatial audio source is controlled by its position and the AudioListener's position/direction/velocity.
|
||||
/// </remarks>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Audio/Audio Source\")") class FLAXENGINE_API AudioSource : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Audio/Audio Source\"), ActorToolbox(\"Other\")") class FLAXENGINE_API AudioSource : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(AudioSource);
|
||||
friend class AudioStreamingHandler;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/// <summary>
|
||||
/// Performs an animation and renders a skinned model.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Animated Model\")") class FLAXENGINE_API AnimatedModel : public ModelInstanceActor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Animated Model\"), ActorToolbox(\"Other\")") class FLAXENGINE_API AnimatedModel : public ModelInstanceActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(AnimatedModel);
|
||||
friend class AnimationsSystem;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Actor that links to the animated model skeleton node transformation.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Bone Socket\")") class FLAXENGINE_API BoneSocket : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Bone Socket\"), ActorToolbox(\"Other\")") class FLAXENGINE_API BoneSocket : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(BoneSocket);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
/// <summary>
|
||||
/// Performs CSG box brush operation that adds or removes geometry.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Box Brush\")") class FLAXENGINE_API BoxBrush : public Actor, public CSG::Brush
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Box Brush\"), ActorToolbox(\"Other\", \"CSG Box Brush\")") class FLAXENGINE_API BoxBrush : public Actor, public CSG::Brush
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(BoxBrush);
|
||||
private:
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/// <summary>
|
||||
/// Describes the camera projection and view. Provides information about how to render scene (viewport location and direction, etc.).
|
||||
/// </summary>
|
||||
API_CLASS(Sealed, Attributes="ActorContextMenu(\"New/Camera\")") class FLAXENGINE_API Camera : public Actor
|
||||
API_CLASS(Sealed, Attributes="ActorContextMenu(\"New/Camera\"), ActorToolbox(\"Visuals\")") class FLAXENGINE_API Camera : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Camera);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/// <summary>
|
||||
/// Actor that draws the can be used to draw a custom decals on top of the other objects.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Decal\")") class FLAXENGINE_API Decal : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Decal\"), ActorToolbox(\"Visuals\")") class FLAXENGINE_API Decal : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Decal);
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Directional light emits light from direction in space.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Directional Light\")") class FLAXENGINE_API DirectionalLight : public LightWithShadow
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Directional Light\"), ActorToolbox(\"Lights\")") class FLAXENGINE_API DirectionalLight : public LightWithShadow
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(DirectionalLight);
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// The empty actor that is useful to create hierarchy and/or hold scripts. See <see cref="Script"/>.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Actor\")") class FLAXENGINE_API EmptyActor : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Actor\"), ActorToolbox(\"Other\")") class FLAXENGINE_API EmptyActor : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(EmptyActor);
|
||||
public:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/// <summary>
|
||||
/// Environment Probe can capture space around the objects to provide reflections.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Environment Probe\")") class FLAXENGINE_API EnvironmentProbe : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Environment Probe\"), ActorToolbox(\"Visuals\")") class FLAXENGINE_API EnvironmentProbe : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(EnvironmentProbe);
|
||||
public:
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/// <summary>
|
||||
/// Used to create fogging effects such as clouds but with a density that is related to the height of the fog.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Exponential Height Fog\")") class FLAXENGINE_API ExponentialHeightFog : public Actor, public IFogRenderer
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Exponential Height Fog\"), ActorToolbox(\"Visuals\")") class FLAXENGINE_API ExponentialHeightFog : public Actor, public IFogRenderer
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(ExponentialHeightFog);
|
||||
private:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// <summary>
|
||||
/// Point light emits light from point in all directions.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Point Light\")") class FLAXENGINE_API PointLight : public LightWithShadow
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Point Light\"), ActorToolbox(\"Lights\")") class FLAXENGINE_API PointLight : public LightWithShadow
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(PointLight);
|
||||
private:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// <summary>
|
||||
/// A special type of volume that blends custom set of post process settings into the rendering.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Post Fx Volume\")") class FLAXENGINE_API PostFxVolume : public BoxVolume, public IPostFxSettingsProvider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Post Fx Volume\"), ActorToolbox(\"Visuals\")") class FLAXENGINE_API PostFxVolume : public BoxVolume, public IPostFxSettingsProvider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(PostFxVolume);
|
||||
private:
|
||||
|
||||
@@ -14,7 +14,7 @@ class GPUPipelineState;
|
||||
/// <summary>
|
||||
/// Sky actor renders atmosphere around the scene with fog and sky.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Sky\")") class FLAXENGINE_API Sky : public Actor, public IAtmosphericFogRenderer, public ISkyRenderer
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Sky\"), ActorToolbox(\"Visuals\")") class FLAXENGINE_API Sky : public Actor, public IAtmosphericFogRenderer, public ISkyRenderer
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Sky);
|
||||
private:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// <summary>
|
||||
/// Sky light captures the distant parts of the scene and applies it as a light. Allows to add ambient light.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Sky Light\")") class FLAXENGINE_API SkyLight : public Light
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Sky Light\"), ActorToolbox(\"Lights\")") class FLAXENGINE_API SkyLight : public Light
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SkyLight);
|
||||
public:
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/// <summary>
|
||||
/// Skybox actor renders sky using custom cube texture or material.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Sky Box\")") class FLAXENGINE_API Skybox : public Actor, public ISkyRenderer
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Sky Box\"), ActorToolbox(\"Visuals\")") class FLAXENGINE_API Skybox : public Actor, public ISkyRenderer
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Skybox);
|
||||
private:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// <summary>
|
||||
/// Spline shape actor that defines spatial curve with utility functions for general purpose usage.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Spline\")") class FLAXENGINE_API Spline : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Spline\"), ActorToolbox(\"Other\")") class FLAXENGINE_API Spline : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(Spline);
|
||||
typedef BezierCurveKeyframe<Transform> Keyframe;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// <summary>
|
||||
/// Spot light emits light from the point in a given direction.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Spot Light\")") class FLAXENGINE_API SpotLight : public LightWithShadow
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Lights/Spot Light\"), ActorToolbox(\"Lights\")") class FLAXENGINE_API SpotLight : public LightWithShadow
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SpotLight);
|
||||
private:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// The off-mesh link objects used to define a custom point-to-point edge within the navigation graph.
|
||||
/// An off-mesh connection is a user defined traversable connection made up to two vertices, at least one of which resides within a navigation mesh polygon allowing movement outside the navigation mesh.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Link\")") class FLAXENGINE_API NavLink : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Link\"), ActorToolbox(\"Other\")") class FLAXENGINE_API NavLink : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(NavLink);
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// <summary>
|
||||
/// A special type of volume that defines the area of the scene in which navigation meshes are generated.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Mesh Bounds Volume\")") class FLAXENGINE_API NavMeshBoundsVolume : public BoxVolume
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Mesh Bounds Volume\"), ActorToolbox(\"Other\")") class FLAXENGINE_API NavMeshBoundsVolume : public BoxVolume
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(NavMeshBoundsVolume);
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// <summary>
|
||||
/// A special type of volume that defines the area of the scene in which navigation is restricted (eg. higher traversal cost or dynamic obstacle block).
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Modifier Volume\")") class FLAXENGINE_API NavModifierVolume : public BoxVolume
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Other/Nav Modifier Volume\"), ActorToolbox(\"Other\")") class FLAXENGINE_API NavModifierVolume : public BoxVolume
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(NavModifierVolume);
|
||||
public:
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
/// <summary>
|
||||
/// The particle system instance that plays the particles simulation in the game.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Particle Effects\")") class FLAXENGINE_API ParticleEffect : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Particle Effects\"), ActorToolbox(\"Visuals\")") class FLAXENGINE_API ParticleEffect : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(ParticleEffect);
|
||||
public:
|
||||
|
||||
@@ -14,7 +14,7 @@ class Collider;
|
||||
/// Physics simulation driven object.
|
||||
/// </summary>
|
||||
/// <seealso cref="Actor" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Rigid Body\")") class FLAXENGINE_API RigidBody : public Actor, public IPhysicsActor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Rigid Body\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API RigidBody : public Actor, public IPhysicsActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(RigidBody);
|
||||
protected:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// A box-shaped primitive collider.
|
||||
/// </summary>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Box Collider\")") class FLAXENGINE_API BoxCollider : public Collider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Box Collider\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API BoxCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(BoxCollider);
|
||||
private:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/// </summary>
|
||||
/// <remarks>Capsules are cylinders with a half-sphere at each end centered at the origin and extending along the X axis, and two hemispherical ends.</remarks>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Capsule Collider\")") class FLAXENGINE_API CapsuleCollider : public Collider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Capsule Collider\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API CapsuleCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(CapsuleCollider);
|
||||
private:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// Physical objects that allows to easily do player movement constrained by collisions without having to deal with a rigidbody.
|
||||
/// </summary>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Character Controller\")") class FLAXENGINE_API CharacterController : public Collider, public IPhysicsActor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Character Controller\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API CharacterController : public Collider, public IPhysicsActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(CharacterController);
|
||||
public:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/// A collider represented by an arbitrary mesh.
|
||||
/// </summary>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Mesh Collider\")") class FLAXENGINE_API MeshCollider : public Collider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Mesh Collider\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API MeshCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(MeshCollider);
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// A sphere-shaped primitive collider.
|
||||
/// </summary>
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Sphere Collider\")") class FLAXENGINE_API SphereCollider : public Collider
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Sphere Collider\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API SphereCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SphereCollider);
|
||||
private:
|
||||
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
/// It also allows you to constrain limits to only specific axes or completely lock specific axes.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/D6 Joint\")") class FLAXENGINE_API D6Joint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/D6 Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API D6Joint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(D6Joint);
|
||||
private:
|
||||
|
||||
@@ -37,7 +37,7 @@ DECLARE_ENUM_OPERATORS(DistanceJointFlag);
|
||||
/// Physics joint that maintains an upper or lower (or both) bound on the distance between two bodies.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Distance Joint\")") class FLAXENGINE_API DistanceJoint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Distance Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API DistanceJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(DistanceJoint);
|
||||
private:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// Physics joint that maintains a fixed distance and orientation between its two attached bodies.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Fixed Joint\")") class FLAXENGINE_API FixedJoint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Fixed Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API FixedJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(FixedJoint);
|
||||
public:
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
/// Physics joint that removes all but a single rotation degree of freedom from its two attached bodies (for example a door hinge).
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Hinge Joint\")") class FLAXENGINE_API HingeJoint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Hinge Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API HingeJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(HingeJoint);
|
||||
private:
|
||||
|
||||
@@ -27,7 +27,7 @@ DECLARE_ENUM_OPERATORS(SliderJointFlag);
|
||||
/// Physics joint that removes all but a single translational degree of freedom. Bodies are allowed to move along a single axis.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Slider Joint\")") class FLAXENGINE_API SliderJoint : public Joint
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Slider Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API SliderJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SliderJoint);
|
||||
private:
|
||||
|
||||
@@ -29,7 +29,7 @@ DECLARE_ENUM_OPERATORS(SphericalJointFlag);
|
||||
/// rotate around the anchor points, and their rotation can be limited by an elliptical cone.
|
||||
/// </summary>
|
||||
/// <seealso cref="Joint" />
|
||||
API_CLASS(Attributes = "ActorContextMenu(\"New/Physics/Spherical Joint\")") class FLAXENGINE_API SphericalJoint : public Joint
|
||||
API_CLASS(Attributes = "ActorContextMenu(\"New/Physics/Spherical Joint\"), ActorToolbox(\"Physics\")") class FLAXENGINE_API SphericalJoint : public Joint
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SphericalJoint);
|
||||
private:
|
||||
|
||||
42
Source/Engine/Scripting/Attributes/Editor/ActorToolbox.cs
Normal file
42
Source/Engine/Scripting/Attributes/Editor/ActorToolbox.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
|
||||
namespace FlaxEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute is used to show actors that can be created in the actor tab of the toolbox.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class ActorToolboxAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// The path to be used in the tool box
|
||||
/// </summary>
|
||||
public string Group;
|
||||
|
||||
/// <summary>
|
||||
/// The name to be used for the actor in the tool box. Will default to actor name if now used.
|
||||
/// </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActorToolboxAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="group">The group to use to create the tab</param>
|
||||
public ActorToolboxAttribute(string group)
|
||||
{
|
||||
Group = group;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActorToolboxAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="group">The group used to creat the tab</param>
|
||||
/// <param name="name">The name to use rather than default</param>
|
||||
public ActorToolboxAttribute(string group, string name)
|
||||
: this(group)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
/// <summary>
|
||||
/// Sprite rendering object.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/UI/Sprite Render\")") class FLAXENGINE_API SpriteRender : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/UI/Sprite Render\"), ActorToolbox(\"GUI\")") class FLAXENGINE_API SpriteRender : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SpriteRender);
|
||||
private:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/// <summary>
|
||||
/// Text rendering object.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/UI/Text Render\")") class FLAXENGINE_API TextRender : public Actor
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/UI/Text Render\"), ActorToolbox(\"GUI\")") class FLAXENGINE_API TextRender : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(TextRender);
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Root of the UI structure. Renders GUI and handles input events forwarding.
|
||||
/// </summary>
|
||||
API_CLASS(Sealed, NoConstructor, Attributes="ActorContextMenu(\"New/UI/UI Canvas\")") class FLAXENGINE_API UICanvas : public Actor
|
||||
API_CLASS(Sealed, NoConstructor, Attributes="ActorContextMenu(\"New/UI/UI Canvas\"), ActorToolbox(\"GUI\")") class FLAXENGINE_API UICanvas : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(UICanvas);
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// <summary>
|
||||
/// Contains a single GUI control (on C# side).
|
||||
/// </summary>
|
||||
API_CLASS(Sealed, Attributes="ActorContextMenu(\"New/UI/UI Control\")") class FLAXENGINE_API UIControl : public Actor
|
||||
API_CLASS(Sealed, Attributes="ActorContextMenu(\"New/UI/UI Control\"), ActorToolbox(\"GUI\")") class FLAXENGINE_API UIControl : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(UIControl);
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user