Internal_CreateGameObjectWithHideFlags() private méthode

private Internal_CreateGameObjectWithHideFlags ( string name, HideFlags flags ) : GameObject
name string
flags HideFlags
Résultat UnityEngine.GameObject
Exemple #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);
        }
        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);
        }