public static GameObject CreateNew(Vector3 position, Quaternion rotation) { GameObject go = new GameObject(); BBox bBox = go.AddComponent <BBox>(); CreateNewBase(go, position, rotation); bBox.BuildMesh(); go.name = "BBox"; return(go); }
[MenuItem("GameObject/Create Other/BulletForUnity/BBox")] //right click menu static void CreateBCube() { Selection.activeObject = BBox.CreateNew(GetCameraRaycastPosition(), Quaternion.identity); PostCreateObject(); }