Question: C# and Unity: How would I pass a color from one scene to another? This would be using a dropdown. Example Code: Script1.cs: (In Scene1)

C# and Unity:

How would I pass a color from one scene to another? This would be using a dropdown.

Example Code:

Script1.cs: (In Scene1)

public class Script1.cs : Monobehaviour {

public void ColorChoice() {

public Dropdown colorOfBall;

public Text ColorTxt;

public static string UpdateColor;

switch (colorOfBall.value) {

case 1:

ColorTxt.text = colorOfBall.options[1].text;

Player.GetComponent().material.color = Color.red;

UpdateColor = ColorTxt.text;

break;

}

}

}

Script2.cs: (In Scene2)

public class UpdateColor : MonoBehaviour {

string ColorPass = Settings.UpdateColor;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!