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