void Update() { if (Input.GetKey("1")) { part = 1; } else if (Input.GetKey("2")) { part = 2; } else if (Input.GetKey("p")) { po = 1; } else if (Input.GetKey("o")) { po = 2; } //Run the code in the class pixTex = new Texture2D(col, row, TextureFormat.RGB24, true); RayCast RayCast_M = new RayCast(); RayCast_M.caster(part, po, sun_dir, pointPosition, sun_color, point_color, eye, pixTex, Object_list, Width, Height, row, col); }