public void action() { const int wait = 1; const int time = 200; //1600; const float degree = 180.0f; //180.0f; const float delta = degree / (time - wait); for (int i = 0; i < NUM; ++i) { if (frame [i] < 0) { continue; } else if (frame[i]++ > time * 2) { frame[i] = -1; } else if (frame[i] > wait) { objs[i].obj.transform.Rotate(0, 0, delta); objs[i].obj.renderer.material.color = new Color(1.0f, 1.0f, 1.0f, 1.0f); } else { break; } } if (frame[NUM - 1] > time * 2) { scene.nextState(); } }
public void action() { int wait = 3; int time = 10; float delta = distance / time; for (int i = 0; i < NUM; ++i) { if (objs [i].frame++ > time) { continue; } else { objs[i].obj.transform.Translate(dir * delta); if (objs [i].frame < wait) { break; } } } if (objs [NUM - 1].frame > time) { scene.nextState(); } }
public void action() { // const int wait = 1; const int time = 130; for (int i = 0; i < NUM; ++i) { float scale = (Mathf.Cos(-pos / 20.0f + i / 20.0f) + 1.0f) / 10.0f + 0.8f; if (scale > 0.95f && frame[i] >= 0) { if (frame[i]++ > time) { frame[i] = -1; objs[i].obj.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); // objs[i].obj.renderer.material.color = Color.white; } else { // objs[i].obj.renderer.material.color = ColorHSV.FromHsv((i+pos/10)%360, 255, 255); } } if (frame[i] > 0) { objs[i].obj.transform.localScale = new Vector3(scale, scale, 1.0f); } else if (frame[i] == 0) { break; } } ++pos; if (frame [NUM - 1] > time) { scene.nextState(); } }