示例#1
0
 public static Mesh NewBoltMesh(float distance)
 {
     TM_MeshMaker.lightningTop = new Vector2(Rand.Range(-0.2f, 0.2f), distance);
     TM_MeshMaker.MakeVerticesBase();
     TM_MeshMaker.DoubleVertices();
     return(TM_MeshMaker.MeshFromVerts());
 }
示例#2
0
 public static Mesh NewBoltMesh(float distance, float amplitude)
 {
     TM_MeshMaker.lightningTop = new Vector2(Rand.Range(-0.2f, .2f), distance);
     TM_MeshMaker.MakeVerticesBase();
     if (amplitude > 0)
     {
         TM_MeshMaker.PeturbVerticesRandomly(amplitude);
     }
     TM_MeshMaker.DoubleVertices();
     return(TM_MeshMaker.MeshFromVerts());
 }
示例#3
0
        public void CreateBolt()
        {
            Vector3 vector;

            vector.x       = (float)this.hitThing.x;
            vector.y       = (float)this.hitThing.y;
            vector.z       = (float)this.hitThing.z;
            this.direction = Quaternion.LookRotation((vector - this.origin).normalized);
            float distance = Vector3.Distance(this.origin, vector);

            this.boltMesh = TM_MeshMaker.NewBoltMesh(distance);
            Graphics.DrawMesh(this.boltMesh, this.origin, this.direction, this.mat, 0);
        }
示例#4
0
        public void CreateFadedBolt(int magnitude)
        {
            Vector3 vector;

            vector.x       = (float)this.hitThing.x;
            vector.y       = (float)this.hitThing.y;
            vector.z       = (float)this.hitThing.z;
            this.direction = Quaternion.LookRotation((vector - this.origin).normalized);
            float distance = Vector3.Distance(this.origin, vector);

            this.boltMesh = TM_MeshMaker.NewBoltMesh(distance);
            //Graphics.DrawMesh(this.boltMesh, this.origin, this.direction, this.mat, 0);
            Graphics.DrawMesh(this.boltMesh, this.origin, this.direction, FadedMaterialPool.FadedVersionOf(this.mat, (float)magnitude), 0);
        }
示例#5
0
 public Mesh RandomBoltMesh(float range)
 {
     return(TM_MeshMaker.NewBoltMesh(range, 3));
 }