Version: 2022.2
언어: 한국어
public static GameObject CreatePrimitive (PrimitiveType type);

파라미터

type The type of primitive to create.

설명

Creates a GameObject primitive.

using UnityEngine;
using UnityEditor;

public class CreatePrimitiveExample { [MenuItem("ObjectFactoryExample/Create Cube GameObject")] public void CreateCubeEditor() { Selection.activeGameObject = ObjectFactory.CreatePrimitive(PrimitiveType.Cube); } }