i wanna make that a Character have diferent Jump based on it color but when i try to access a public Static variable throw me the error C0176 somebody know how Fix it?
Color Switch Script:
public class Player_Switch : MonoBehaviour
{
public static Color color1;
public static Color color2;
public Color color_1;
public Color color_2;
public static Renderer ActualColor;
void Start ()
{
color1 = color_1;
color2 = color_2;
ActualColor = gameObject.GetComponent<Renderer>();
ActualColor.material.shader = Shader.Find ("Standard");
ActualColor.material.color = color1;
}
// Update is called once per frame
void Update ()
{
Character_Switch ();
}
void Character_Switch()
{
if (Input.GetButtonDown("Switch"))
{
if (ActualColor.material.color == color1)
{
ActualColor.material.color = color2;
}
else if (ActualColor.material.color == color2)
{
ActualColor.material.color = color1;
}
}
}
}
this is from the Script that try to access “public static Renderer ActualColor” but throw me the C0176
void Update()
{
if (Switch.ActualColor.material.color == Switch.color_1)
{
RojJump(); //Salto de Roja
}
else if (Switch.ActualColor.material.color == Switch.color_2)
{
EstJump(); //Slato de Estaño
}
}