Internal_CreateGameObjectWithHideFlags() private method

private Internal_CreateGameObjectWithHideFlags ( string name, HideFlags flags ) : GameObject
name string
flags HideFlags
return UnityEngine.GameObject
示例#1
0
        /// <summary>
        ///   <para>Creates a game object with HideFlags and specified components.</para>
        /// </summary>
        /// <param name="name"></param>
        /// <param name="flags"></param>
        /// <param name="components"></param>
        public static GameObject CreateGameObjectWithHideFlags(string name, HideFlags flags, params System.Type[] components)
        {
            GameObject objectWithHideFlags = EditorUtility.Internal_CreateGameObjectWithHideFlags(name, flags);

            objectWithHideFlags.AddComponent(typeof(Transform));
            foreach (System.Type component in components)
            {
                objectWithHideFlags.AddComponent(component);
            }
            return(objectWithHideFlags);
        }
示例#2
0
        public static GameObject CreateGameObjectWithHideFlags(string name, HideFlags flags, params Type[] components)
        {
            GameObject gameObject = EditorUtility.Internal_CreateGameObjectWithHideFlags(name, flags);

            gameObject.AddComponent(typeof(Transform));
            for (int i = 0; i < components.Length; i++)
            {
                Type componentType = components[i];
                gameObject.AddComponent(componentType);
            }
            return(gameObject);
        }