Пример #1
0
    public virtual void Awake()
    {
        LineData.use     = this;
        this.ship1Points = VectorLine.BytesToVector3List(this.ship1.bytes);
        this.ship2Points = VectorLine.BytesToVector3List(this.ship2.bytes);
        this.ship3Points = VectorLine.BytesToVector3List(this.ship3.bytes);
        this.ship4Points = VectorLine.BytesToVector3List(this.ship4.bytes);
        this.titlePoints = VectorLine.BytesToVector3List(this.title.bytes);

        // Exploded ship parts
        this.partLocations = new Vector3[] { new Vector3(-0.02f, 3.17f, -1.52f), new Vector3(0f, 1.91f, -0.12f), new Vector3(0f, 1.8f, -2.29f), new Vector3(-0.6f, -0.36f, 0.13f), new Vector3(0.84f, -0.75f, 3f), new Vector3(-1.3f, -0.79f, -2.35f), new Vector3(1.12f, 0f, -1.89f) };
        this.partPoints    = new List <System.Collections.Generic.List <Vector3> >(7);
        int i = 0;

        while (i < 7)
        {
            this.partPoints.Add(VectorLine.BytesToVector3List(this.shipParts[i].bytes));
            i++;
        }

        // Reticle
        this.reticlePoints = new List <Vector3>(new Vector3[] { new Vector3(-30f, 0f), new Vector3(30f, 0f), new Vector3(0f, -30f), new Vector3(0f, 30f),
                                                                new Vector3(-5f, 10f), new Vector3(5f, 10f), new Vector3(10f, 5f), new Vector3(10f, -5f),
                                                                new Vector3(5f, -10f), new Vector3(-5f, -10f), new Vector3(-10f, 5f), new Vector3(-10f, -5f),
                                                                new Vector3(-10f, 20f), new Vector3(10f, 20f), new Vector3(20f, 10f), new Vector3(20f, -10f),
                                                                new Vector3(10f, -20f), new Vector3(-10f, -20f), new Vector3(-20f, 10f), new Vector3(-20f, -10f) });
    }
Пример #2
0
    // Token: 0x06000AF1 RID: 2801 RVA: 0x0002FDEC File Offset: 0x0002E1EC
    private void Start()
    {
        List <Vector3> points = VectorLine.BytesToVector3List(this.vectorCube.bytes);
        VectorLine     line   = new VectorLine(base.gameObject.name, points, 2f);

        VectorManager.ObjectSetup(base.gameObject, line, Visibility.Dynamic, Brightness.None);
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        if (GetComponent <MeshFilter>() == null)
        {
            Destroy(this);
        }

        offset = Random.Range(0f, Mathf.PI);
        shape  = new List <Vector3>();

        if (shapeFile == null)
        {
            fromFile = false;
            r        = GetComponent <MeshFilter>();
            mesh     = r.mesh;
            GetComponent <MeshRenderer>().enabled = false;
            foreach (Vector3 v in mesh.vertices)
            {
                shape.Add(v);
            }
        }
        else
        {
            fromFile = true;
            shape    = VectorLine.BytesToVector3List(shapeFile.bytes);
        }

        line             = new VectorLine(gameObject.name, shape, 0.5f, LineType.Continuous, Vectrosity.Joins.Weld);
        line.color       = color;
        line.smoothWidth = true;
        line.smoothColor = true;

        for (int i = 0; i < shape.Count; i++)
        {
            if (!fromFile)
            {
                line.points3[i] = transform.TransformPoint(mesh.vertices[i]);
            }
            else
            {
                Vector3 newPoint = transform.TransformPoint(shape[i]);
                if (i % 2 == 0)
                {
                    // newPoint = newPoint + Vector3.forward * Mathf.Sin(Time.time * 5f + (float)i/5f);
                }

                // newPoint = transform.TransformRotation(shape[i]);
                line.points3[i] = newPoint;
                if (i == 0)
                {
                    // Debug.Log( transform.TransformPoint(shape[i]));
                }
            }
        }

        line.Draw3D();
    }
    void Start()
    {
        // Make a Vector3 array from the data stored in the vectorCube text asset
        // Try using different assets from the Vectors folder for different shapes (the collider will still be a cube though!)
        var cubePoints = VectorLine.BytesToVector3List(vectorCube.bytes);

        // Make a line using the above points, with a width of 2 pixels
        var line = new VectorLine(gameObject.name, cubePoints, 2.0f);

        // Make this transform have the vector line object that's defined above
        // This object is a rigidbody, so the vector object will do exactly what this object does
        VectorManager.ObjectSetup(gameObject, line, Visibility.Dynamic, Brightness.None);
    }
Пример #5
0
    // Update is called once per frame
    void Update()
    {
        if (fromFile)
        {
            shape = VectorLine.BytesToVector3List(shapeFile.bytes);
        }

        if (!isStatic)
        {
            for (int i = 0; i < shape.Count; i++)
            {
                if (!fromFile)
                {
                    line.points3[i] = transform.TransformPoint(mesh.vertices[i]);
                }
                else
                {
                    Vector3 newPoint = transform.TransformPoint(shape[i]);
                    if (i % 2 == 0)
                    {
                        // newPoint = newPoint + Vector3.forward * Mathf.Sin(Time.time * 5f + (float)i/5f);
                    }

                    // newPoint = transform.TransformRotation(shape[i]);
                    line.points3[i] = newPoint;
                    if (i == 0)
                    {
                        // Debug.Log( transform.TransformPoint(shape[i]));
                    }
                }

                if (changeColor)
                {
                    line.SetColor(Color.Lerp(color, new Color(0, 0, 0, 0) + Color.white * 0.5f, Mathf.PingPong(Time.time + offset, 1)), i);
                }
            }

            line.Draw3D();
        }
    }
Пример #6
0
 private void Start()
 {
     VectorManager.ObjectSetup(((Component)this).get_gameObject(), new VectorLine(((Object)((Component)this).get_gameObject()).get_name(), VectorLine.BytesToVector3List(this.vectorCube.get_bytes()), 2f), (Visibility)0, (Brightness)1);
 }