Advertisement
uurha

Untitled

Feb 7th, 2022
961
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    public void SpawnDropWaterDown()
  2.     {
  3.         TempListDown.Clear();
  4.  
  5.         heading = LCController.LineChild[1].transform.position - LCController.LineChild[2].transform.position;
  6.         maxdist = heading.magnitude;
  7.         distance = heading.magnitude;
  8.         direction = heading / distance;
  9.  
  10.         Debug.DrawLine(new Vector3(Hero.transform.position.x, Hero.transform.position.y, Hero.transform.position.z), direction, Color.red);
  11.         i = 0;
  12.         iDown = 0;
  13.  
  14.         TempGO = Instantiate(DropWaterDown, new Vector3(Float[FFloat.i].transform.position.x+direction.x, Float[FFloat.i].transform.position.y + 0.2f, Float[FFloat.i].transform.position.z+direction.z), Quaternion.identity);
  15.         TempGO.SetActive(false);
  16.         Invoke("TempGODestroy", 0.5f);
  17.         TempGO.transform.Rotate(90, 0, 0);
  18.         Vector3 newScale = transform.localScale;
  19.         newScale *= 2f;
  20.  
  21.         tempHeading = TempGO.transform.position - LCController.LineChild[1].transform.position;
  22.         dist = tempHeading.magnitude;
  23.  
  24.         count = Convert.ToInt32(Math.Floor(Math.Round(maxdist, 1) / (Math.Floor(Math.Round(maxdist - dist, 1)))));
  25.         Debug.Log("MaxDist: " + Math.Round(maxdist, 1) + " Dist: " + Math.Round(dist, 1) + " MaxDist - Dist: " + Math.Floor(Math.Round(maxdist - dist, 1)));
  26.         Debug.Log("Dist: " + dist + " MaxDist: " + maxdist + " Count: " + count);
  27.  
  28.  
  29.         for(i = 0; i < count; i++)
  30.         {
  31.             Invoke("InvokeSpawn", (i+1)*0.25f);
  32.         }
  33.  
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement