I am using a color picker script to choose a color for my car on the main menu, and i would like the car to keep that color once you load the game.
Here's my script:
var xxx : float = 20;
var yyy : float = 20;
var colorPicker : Texture2D;
var car : Renderer;
var hood : Renderer;
var matnum : int = 0;
var matnum2 : int = 0;
if (GUI.RepeatButton (Rect (xxx,yyy,215,215), colorPicker, "ColorPicker")) {
var pickpos : Vector2 = Event.current.mousePosition;
var pixelPosX : int = pickpos.x-xxx+17;
var pixelPosY : int = -(pickpos.y-yyy+0);
var col : Color = colorPicker.GetPixel(pixelPosX,pixelPosY);
car.materials[matnum].SetColor("_Color",col);
hood.materials[matnum2].SetColor("_Color",col);
}
}
I would like to save the variable "col" into my other scene. I tried just making it a static variable, but that didn't work.
Thanks!