Hey , i wanna change the image.color but i have a problem.
when i hit the play,
the color stay yellow, doesnt go back red ??? G increases but color doesnt change ??? by the way, sorry about my english :),
This is my code;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ChangingColorRGB : MonoBehaviour {
float G = 75;
Image imgcolor;
// Use this for initialization
void Start () {
imgcolor = this.GetComponent<Image>();
}
// Update is called once per frame
void FixedUpdate () {
Changing();
}
void Changing()
{
if(G < 255)
{
if(G == 254)
{
G = 75;
}
G += 1;
imgcolor.color = new Color (255, G, 0, 255);
print(G);
}
}
}