Repository: FlaxEngine/FlaxEngine
File: Source/Engine/Level/Actor.cs (C#)

Code before:
            set
            {
                Quaternion.Euler(ref value, out var orientation);
                Internal_SetLocalOrientation(__unmanagedPtr, ref orientation);
            }
        }

        /// <summary>
        /// Returns true if actor has any children
        /// </summary>
        [HideInEditor, NoSerialize]
        public bool HasChildren => Internal_GetChildrenCount(__unmanagedPtr) != 0;

        /// <summary>
        /// Resets actor local transform.
        /// </summary>
        public void ResetLocalTransform()
        {
            LocalTransform = Transform.Identity;
        }

        /// <summary>
        /// Called in-editor when an actor is added to the scene.
        /// If not in the editor, this function will not be called.
        /// </summary>
        public virtual void OnActorSpawned()
        {

        }

        /// <summary>
        /// Creates a new child actor of the given type.
        /// </summary>
        /// <param name="type">Type of the actor.</param>
        /// <returns>The child actor.</returns>
        public Actor AddChild(Type type)
        {
            if (type.IsAbstract)
                return null;

            var result = (Actor)New(type);
            result.SetParent(this, false, false);
            return result;
        }

        /// <summary>
        /// Creates a new child actor of the given type.
        /// </summary>
        /// <typeparam name="T">Type of the actor to search for. Includes any actors derived from the type.</typeparam>
        /// <returns>The child actor.</returns>
        public T AddChild<T>() where T : Actor

Review comment (suggestion):
We have `ActorNode` system which handles editor-interactions with actors and scene objects.

Code after:
            set
            {
                Quaternion.Euler(ref value, out var orientation);
                Internal_SetLocalOrientation(__unmanagedPtr, ref orientation);
            }
        }

        /// <summary>
        /// Returns true if actor has any children
        /// </summary>
        [HideInEditor, NoSerialize]
        public bool HasChildren => Internal_GetChildrenCount(__unmanagedPtr) != 0;

        /// <summary>
        /// Resets actor local transform.
        /// </summary>
        public void ResetLocalTransform()
        {
            LocalTransform = Transform.Identity;
        }

        /// <summary>
        /// Creates a new child actor of the given type.
        /// </summary>
        /// <param name="type">Type of the actor.</param>
        /// <returns>The child actor.</returns>
        public Actor AddChild(Type type)
        {
            if (type.IsAbstract)
                return null;

            var result = (Actor)New(type);
            result.SetParent(this, false, false);
            return result;
        }

        /// <summary>
        /// Creates a new child actor of the given type.
        /// </summary>
        /// <typeparam name="T">Type of the actor to search for. Includes any actors derived from the type.</typeparam>
        /// <returns>The child actor.</returns>
        public T AddChild<T>() where T : Actor
        {
            if (typeof(T).IsAbstract)
                return null;

            var result = New<T>();
            result.SetParent(this, false, false);
            return result;
        }