private void Start() { Random.InitState(42); int scale = 2; _width = Screen.width / scale; _height = Screen.height / scale; _size = _width * _height; _image = new Texture2D(_width, _height) { filterMode = FilterMode.Point }; _rectangle = new Rect(0, 0, Screen.width, Screen.height); _colors = new Color[_size]; _dla = new DLA(_width, _height); Task.Run(() => { while (true) { _cancel.Token.ThrowIfCancellationRequested(); _dla.NextGeneration(); } }, _cancel.Token); }
private void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; } }