// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. using System; using FlaxEditor.SceneGraph.Actors; using FlaxEngine; namespace FlaxEditor.SceneGraph { /// /// Helper base class for actor sub nodes (eg. link points, child parts). /// /// /// [HideInEditor] public abstract class ActorChildNode : SceneGraphNode { /// /// The node index. /// public readonly int Index; /// /// Initializes a new instance of the class. /// /// The child id. /// The child index. protected ActorChildNode(Guid id, int index) : base(id) { Index = index; } /// public override string Name => ParentNode.Name + "." + Index; /// public override SceneNode ParentScene => ParentNode.ParentScene; /// public override bool CanTransform => ParentNode.CanTransform; /// public override bool IsActive => ParentNode.IsActive; /// public override bool IsActiveInHierarchy => ParentNode.IsActiveInHierarchy; /// public override int OrderInParent { get => Index; set { } } /// public override bool CanDelete => false; /// public override bool CanCopyPaste => false; /// public override bool CanDrag => false; /// public override object EditableObject => ParentNode.EditableObject; /// public override object UndoRecordObject => ParentNode.UndoRecordObject; } /// /// Helper base class for actor sub nodes (eg. link points, child parts). /// /// The parent actor type. /// /// public abstract class ActorChildNode : ActorChildNode where T : ActorNode { /// /// The actor. /// protected readonly T _actor; /// /// Initializes a new instance of the class. /// /// The parent actor. /// The child id. /// The child index. protected ActorChildNode(T actor, Guid id, int index) : base(id, index) { _actor = actor; } } }