docs.unity.cn
    Show / Hide Table of Contents

    Interface DefaultControls.IFactoryControls

    Factory interface to create a GameObject in this class. It is necessary to use this interface in the whole class so MenuOption and Editor can work using ObjectFactory and default Presets.

    Namespace: UnityEngine.UI
    Syntax
    public interface IFactoryControls
    Remarks

    The only available method is CreateGameObject. It needs to be called with every Components the created Object will need because of a bug with Undo and RectTransform. Adding a UI component on the created GameObject may crash if done after Undo.SetTransformParent, So it's better to prevent such behavior in this class by asking for full creation with all the components.

    Methods

    CreateGameObject(String, Type[])

    Declaration
    GameObject CreateGameObject(string name, params Type[] components)
    Parameters
    Type Name Description
    String name
    Type[] components
    Returns
    Type Description
    GameObject
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 12 June 2023