pls help there is an error at line 30 in ColourSetter script,
5145500–509468–ColourButtonSetter.cs (766 Bytes)
5145500–509471–ColourSetterTest.cs (885 Bytes)
5145500–509474–ColourObject.cs (2.12 KB)
pls help there is an error at line 30 in ColourSetter script,
5145500–509468–ColourButtonSetter.cs (766 Bytes)
5145500–509471–ColourSetterTest.cs (885 Bytes)
5145500–509474–ColourObject.cs (2.12 KB)
You’re using the class name and not an instance of the class (an “object reference”). The AssignColoursToButton function is a normal function and not a static one, as written it needs to be executed on a ColourButtonSetter object, not the class itself.
It looks like what you need to do is make the AssignColoursToButton function static (by adding the word “static” between “public” and “void”).