Object question

I’m trying to call the function FindObjectsOfType () from within a class that doesn’t derive from Object.

class TestClass {
     function DoSomething ()
     {
          var allTex = Object.FindObjectsOfType (Texture2D);
     }
}

This gives me the following error: MissingMethodException: Method not found: ‘System.Object.FindObjectsOfType’.

But FindObjectsOfType is a static function and a member of Object. Anyone know what I’m doing wrong?

Thanks

It’s a member of Unity’s Object class (http://unity3d.com/Documentation/ScriptReference/Object.html), not System.Object. Also, Let me know whether it actually works on Texture2D - I’ve only ever used it to find components and such before. I’m not sure what the results would be for Texture2D - all the textures in the scene? in the project?

Thanks for the clarification. How would I access Unity’s Object class. Does it have a different name?

It returns 0.