示例#1
0
        static void CreateAndPlacePrimitive(PrimitiveType type, GameObject parent)
        {
            var primitive = ObjectFactory.CreatePrimitive(type);

            primitive.name = type.ToString();
            Place(primitive, parent);
        }
示例#2
0
        private static void CreateAndPlacePrimitive(PrimitiveType type, GameObject parent)
        {
            string     uniqueNameForSibling = GameObjectUtility.GetUniqueNameForSibling((!(parent != null)) ? null : parent.transform, type.ToString());
            GameObject gameObject           = ObjectFactory.CreatePrimitive(type);

            gameObject.name = uniqueNameForSibling;
            GOCreationCommands.Place(gameObject, parent);
        }
        static void CreateAndPlacePrimitive(PrimitiveType type, GameObject parent)
        {
            // make sure to get the unique name before the GameObject is created
            // or GetUniqueNameForSibling will always end up with (1) in empty scene
            string uniqueName = GameObjectUtility.GetUniqueNameForSibling(parent != null ? parent.transform : null, type.ToString());
            var    primitive  = ObjectFactory.CreatePrimitive(type);

            primitive.name = uniqueName;
            Place(primitive, parent);
        }