示例#1
0
        private static void Plot(Cone cone, GameObject parent, Point start, Point end, float baseScale,
                                 float pointScale, Material material)
        {
            cone.mesh.Clear();

            cone.gameObject.transform.parent   = parent.transform;
            cone.gameObject.transform.position = parent.transform.position;

            Vector3 pos      = PlotUtils.ToVector3(start);
            Vector3 finalPos = PlotUtils.ToVector3(end);

            Vector3[] vertices = Vertices(Vector3.Distance(pos, finalPos), baseScale, pointScale);

            cone.mesh.vertices  = vertices;
            cone.mesh.normals   = Normales(vertices);
            cone.mesh.uv        = Uvs(vertices);
            cone.mesh.triangles = Triangles();

            cone.mesh.RecalculateBounds();
            cone.mesh.Optimize();

            cone.meshRenderer.material = material;

            Locate(cone.gameObject, pos, finalPos);

            cone.gameObject.SetActive(true);
        }
示例#2
0
 public ConeAction(Cone cone, GameObject parent, Point start, Point end, float baseScale,
                   float pointScale, Material material)
 {
     this.cone       = cone;
     this.parent     = parent;
     this.start      = start;
     this.end        = end;
     this.baseScale  = baseScale;
     this.pointScale = pointScale;
     this.material   = material;
 }
示例#3
0
 private static void AddAction(Cone cone, GameObject parent, Point start, Point end, float baseScale,
                               float pointScale, Material material)
 {
     actions.Add(new ConeAction(cone, parent, start, end, baseScale, pointScale, material));
 }