So I can't figure this out for the life of me. And I have tried casting in multiple forms.
This is the parent.
/// <summary>
/// Colour Parent
/// </summary>
public class Colour
{
#region Public Fields
public float R;
public float G;
public float B;
public float A;
#endregion Public Fields
}
And this is the child. Which has pre defined variables. Meaning it has ALL the information it needs to downcast.
/// <summary>
/// Data strucutre extension of Base.Colour, Used for the variables stored inside the glow object in memory
/// </summary>
public class GlowStruct : Colour
{
public bool RWO = true;
public bool RWUO = true;
}
I try to cast it with.
return Base.Blue as GlowStruct;
Base.Blue is a static member of the Colour class. Using the "is" returns false.
Not sure why you need the definition of Base.Blue seeing as its just numbers. I already mentioned it was a static class.
public static Colour Blue = new Colour { R = 0, G = 0, B = 255, A = 255 };