Help needed!!!

hello programmers… im making a project for school… but im stuck with something.
and the problem is that i make buttons for an status system but its not working…
can somebody help me with this.

( im very new with C#… i stept over to the C# camp)

the code :

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Rendering;
using System.Collections;

public class StatusSystem : MonoBehaviour {

    public bool StatusOnline = false;
    public bool StatusAway = false;
    public bool StatusOffline = false;

    public RawImage StatusImage;

    public Color ColorOnline;
    public Color ColorAway;
    public Color ColorOffline;

    void Start()
    {
        StatusOnline = false;
    }


    public void StatusOnline_f(RawImage RawImage)
    {
        StatusOnline = true;
        StatusAway = false;
        StatusOffline = false;

        if(StatusOnline == true)
        {
            GetComponent<RawImage>().color = ColorOnline;
        }
    }

    public void StatusAway_f(RawImage RawImage)
    {
        StatusAway = true;
        StatusOffline = false;
        StatusOnline = false;

        if(StatusAway == true)
        {
            GetComponent<RawImage>().color = ColorAway;
        }
    }

    public void StatusOffline_f(RawImage RawImage)
    {
        StatusOffline = true;
        StatusOnline = false;
        StatusAway = false;

        if(StatusOffline == true)
        {
            GetComponent<RawImage>().color = ColorOffline;
        }
    }
}

if somebody could help me with this i would like to say thanks.

Here is an example project that should help. Its just a button. You can set the status in the inspector and change the color. Hope it helps.

2286502–153629–example.unitypackage (8.27 KB)

many thanks… i edit your code and its now what i had in my mind… many thanks…
greets :smile:

code :

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Rendering;
using System.Collections;

public class StatusScript : MonoBehaviour {

    public int Status;
   

   
    public Color ColorOnline = new Color32(34,139,34,255);
    public Color ColorAway = new Color32(255,69,0,255);
    public Color ColorOffline= new Color32(255,0,0,255);
   
    void Start()
    {
        //Status
        // 0 for Online
        // 1 for Away
        // 2 for Offline
    }
   
   
    public void SetStatusColor(){
        Image GetImage = this.GetComponent<Image>();
        // Online
        if(Status == 0){
            GetImage.color = ColorOnline;
        }
        //Away
        else if(Status == 1){
            GetImage.color = ColorAway;
        }
        else GetImage.color = ColorOffline;
    }

    public void Online()
    {
        Status = 0;

        if (Status == 0) {

            Image GetImage = this.GetComponent<Image> ();

            GetImage.color = ColorOnline;

        }
    }

    public void Away()
    {
        Status = 1;
       
        if (Status == 1) {
           
            Image GetImage = this.GetComponent<Image> ();
           
            GetImage.color = ColorAway;
           
        }
    }

    public void Offline()
    {
        Status = 2;
       
        if (Status == 2) {
           
            Image GetImage = this.GetComponent<Image> ();
           
            GetImage.color = ColorOffline;
           
        }
    }

}