void Start() { #if UNITY_EDITOR || UNITY_STANDALONE Application.runInBackground = true; #else Application.runInBackground = false; #endif _blackFilter.enabled = false; _stringBuilder = new System.Text.StringBuilder(); _times = new float[60]; _counts = new float[120]; _embossTextMaterial.EnableKeyword("FOR_TEXT"); _fillRenderer.ManualStart(); }
void Start() { _times = new float[60]; _fillRenderer.ManualStart(); }
void Start() { _logText.text = "Start Called."; _log = new Kayac.MemoryLogHandler(1000); _logText.text = "Log Initialized."; #if !UNITY_WEBGL || UNITY_EDITOR //WebGLではSlack初期化しない。なので叩くと死ぬ。 StartCoroutine(CoSetupSlack()); #endif _benchmarkToggle.onValueChanged.AddListener(toggle => { if (_benchmarkToggle.isOn) { _count = 0f; //1から始めることでだいぶ収束が速くなる。TODO: 速度も適切な値がありそう。 } else { _count = 0f; } _countVelocity = 0f; }); _speedSlider.value = 0.5f; _objects = new GameObject[SphereCount + CylinderCount]; _velocities = new Vector3[_objects.Length]; _angularVelocities = new Vector3[_objects.Length]; _material = new Material(_shader); for (int i = 0; i < SphereCount; i++) { _objects[i] = Instantiate(_spherePrefab, _objectsRoot, false); } for (int i = 0; i < CylinderCount; i++) { _objects[SphereCount + i] = Instantiate(_cylinderPrefab, _objectsRoot, false); } var block = new MaterialPropertyBlock(); var propertyId = Shader.PropertyToID("_Color"); for (int i = 0; i < _objects.Length; i++) { var renderer = _objects[i].GetComponent <MeshRenderer>(); renderer.sharedMaterial = _material; #if true // 動かなくして中央に置きたい時もある block.SetColor(propertyId, new Color( Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f), 1f)); renderer.SetPropertyBlock(block); _objects[i].transform.localPosition = new Vector3( Random.Range(-WorldSize, WorldSize), Random.Range(-WorldSize, WorldSize), Random.Range(-WorldSize, WorldSize)); _objects[i].transform.localRotation = Quaternion.Euler( Random.Range(-180f, 180f), Random.Range(-180f, 180f), Random.Range(-180f, 180f)); _velocities[i] = new Vector3( Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); _angularVelocities[i] = new Vector3( Random.Range(-10f, 10f), Random.Range(-10f, 10f), Random.Range(-10f, 10f)); #endif } // 以下ベンチマーク準備 _times = new float[60]; _fillRenderer.ManualStart(); _logText.text = "Start Finished."; }