在国内百度不带还是去google了果然(哈哈我是大自然的搬运工)
解决方法有两个:
1)利用maya Blender等建模导入,太麻烦,看有没有其他方法,继续找。
2)国外网友贴了一个网址是unity的wifi,网址是 点击打开链接 或者 http://wiki.unity3d.com/index.php?title=CreateCone
CreateCone
Usage
Place this script as in YourProject/Assets/Editor and a menu item will automatically appear in the "GameObject/Create Other" menu after it is compiled.
使用方法,创建名为"CreateCone.cs"的文档然后放到你的项目/Assets/Editor 中,然后观察Hierarchy面板的create下拉菜单你会发现多了一个Create Other,点进去有cone,这就是圆锥了。以下是创建时可以设置的参数。不懂的找字典查下。
Num Vertices is the number of vertices each end will have.
Radius Top is the radius at the top. The center point will be located at (0/0/0).
Radius Bottom is the radius at the bottom. The center point will be located at (0/0/Length).(底圆的半径大小)
Length is the number of world units long the plane will be (+Z direction).
Opening Angle If this is >0, the top radius is set to 0, and the bottom radius is computed depending on the length, so that the given opening angle is created.(貌似是底圆是多少边形,即越大越接近圆形)
Outside defines whether the outside is visible (default).
Inside defines whether the inside is visible. Set both outside and inside to create a double-sided primitive.
Add Collider creates a matching mesh collider for the cone if checked.
以下是源码,直接粘贴,不放心的点上面链接,进去粘贴就好。是C#的。
using UnityEngine; using UnityEditor; using System.Collections; // an Editor method to create a cone primitive (so far no end caps) // the top center is placed at (0/0/0) // the bottom center is placed at (0/0/length) // if either one of the radii is 0, the result will be a cone, otherwise a truncated cone // note you will get inevitable breaks in the smooth shading at cone tips // note the resulting mesh will be created as an asset in Assets/Editor // Author: Wolfram Kresse public class CreateCone : ScriptableWizard { public int numVertices = 10; public float radiusTop = 0f; public float radiusBottom = 1f; public float length = 1f; public float openingAngle = 0f; // if >0, create a cone with this angle by setting radiusTop to 0, and adjust radiusBottom according to length; public bool outside = true; public bool inside = false; public bool addCollider = false; [MenuItem ("GameObject/Create Other/Cone")] static void CreateWizard() { ScriptableWizard.DisplayWizard("Create Cone", typeof(CreateCone)); } void OnWizardCreate(){ GameObject newCone=new GameObject("Cone"); if(openingAngle>0&&openingAngle<180){ radiusTop=0; radiusBottom=length*Mathf.Tan(openingAngle*Mathf.Deg2Rad/2); } string meshName = newCone.name + numVertices + "v" + radiusTop