Answer the question
In order to leave comments, you need to log in
What is the best way to do a mass update?
Here I have a bunch of prefabs in which their elements move inside according to the update, for example, something like a planet and satellites fly around.
private void AngleMove(){
TestAngle -= Time.deltaTime;
TestPosZ -= Time.deltaTime * 30f;
for(byte n = 0; n < 8; ++n){
switch(n){
case 1: AnglePlus = 7.6f; break;
case 2: AnglePlus = 23.3f; break;
case 3: AnglePlus = 15.95f; break;
case 4: AnglePlus = 0.25f; break;
}
var x = Mathf.Cos ((TestAngle + AnglePlus) * 0.2f) * (transform.localScale.x / 3f);
var y = Mathf.Sin ((TestAngle + AnglePlus) * 0.2f) * (transform.localScale.x / 3f);
this.ArrayTestObject[n].transform.position = new Vector3(x + transform.position.x, y + transform.position.y, 1f);
this.ArrayTestObject[n].transform.rotation = Quaternion.Euler(0, 0, TestPosZ);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question