void Update() { debugUiManager.ManualUpdate(); }
void Update() { _debugUi.ManualUpdate(Time.deltaTime); }
void Update() { float dt = Time.deltaTime; debugUi.ManualUpdate(dt); if (Input.GetKeyDown(KeyCode.Space)) { Fire(); } // テキトーに的を動かす var p = target.transform.localPosition; var dp = p - targetOrigin; targetVelocity *= 1f - targetDamping; targetVelocity -= dp * targetStiffness * dt; p += targetVelocity * dt; target.transform.localPosition = p; gunPoint.LookAt(p); for (int i = 0; i < beams.Length; i++) { if (beams[i].time >= 0) { UpdateBeam(beams[i]); } } UnityEngine.Profiling.Profiler.BeginSample("Main.Update.UpdateParticles"); var transform = mainCamera.gameObject.transform; var forwardVector = transform.forward; var upVector = transform.up; // TODO: 右ベクタ、上ベクタは前計算可能 // 右ベクタ、上ベクタを生成 axisX = cross(axisY, axisZ) Vector3 right = Vector3.Cross(upVector, forwardVector); right.Normalize(); // ビルボード空間の上ベクタを計算 Vector3 up = Vector3.Cross(forwardVector, right); int rest = particles.Length; int unit = rest / jobs.Length; if ((rest - (unit * jobs.Length)) > 0) { unit += 1; } int begin = 0; for (int i = 0; i < jobs.Length; i++) { int count = (rest >= unit) ? unit : rest; jobs[i].Set(begin, count, dt, ref up, ref right); particleRenderers[i].Mesh.SetTexture(texture); if (threadEnabled) { threadPool.AddJob(jobs[i]); } else { jobs[i].Execute(); } rest -= count; begin += count; } UnityEngine.Profiling.Profiler.EndSample(); var tp = target.transform.position; var gp = gunPoint.position; cameraController.FitByMove2PointVertical( gp, tp, Vector3.up, cameraPositionParameter, cameraMargin); cameraController.Stiffness = cameraStiffness; cameraController.ManualUpdate(dt); }