/// <summary> /// Update and draw fractal /// </summary> public void Update() { if (!hasDrawn) { Color[] pixels = new Color[FractalTexture.Width * FractalTexture.Height]; for (int i = 0; i < pixels.Length; i++) { int escapeSpeed = EscapingIteration(PixelToCoordinate(i)); // Non-escaping complexes in white if (escapeSpeed >= iteration) { pixels[i].R = 255; pixels[i].G = 255; pixels[i].B = 255; } // Color in function of escaping speed else { pixels[i] = GetEscapingColor(escapeSpeed); } } FractalTexture.SetData(pixels); hasDrawn = true; } }
// Use this for initialization void Start() { gl = (GameLogic)FindObjectOfType(typeof(GameLogic)); ft = (FractalTexture)FindObjectOfType(typeof(FractalTexture)); pl = (Player)FindObjectOfType(typeof(Player)); whiteNoise = GameObject.Find("WhiteNoise"); Debug.Log("White Noise: " + whiteNoise.ToString()); }