Hey guys ,
I figured that this would be rather simple . All i needed to do was check the value of the bool against another bool, List count against an int,Int against an int etc…
but nope. I created these extension methods but then realized that tit makes no sense because the classes , functions and variables are all static.
Needless to say , it looks as if it works but it really does noting.
For our Rects
public static class RectExt
{
private static Rect T;
public static bool Changed(this Rect rect)
{
var result = false;
if (rect != T) { result = true; T = rect; }
return result;
}
}
For our lists
public static class ListExt
{
static int SetCount;
public static bool Changed<T>(this List<T> list)
{
var result = false;
if (SetCount != list.Count)
{
return true;
}
return result;
}
}
I could do this , but I don’t want to have to do this in every class and for every rect , bool , or int I want to check
public class Someclass
{
private Rect T;
private Rect OtherRect;
Boolean B;
private bool Changed
{
get
{
return this.B;
}
set
{
this.B = (T != OtherRect)? true : false;
}
}
void OnGUI()
{
if(Changed)
{
Debug.Log("WasChanged");
}
}
}