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