Object vs object

I’m doing an EditorWindow script, and working with folders as well as prefabs and textures.

I’ve run into what appears to be a total inconsistency in Object vs object in the Unity documentation, and I hope someone clever can straighten out how the attached screenshots-combo makes sense?

Other than casting light over matter, I’m trying to get Object.name

But… that is - despite the documentations description… not possible… and so the example is instead just skipping and… is… using … GameObject (!)

I do understand what a GameObject is, but what’s heads and tale with Object/object? (And how do you extract the name of either?)

Thanks a bunch!! (It’s unfortunately hard to Google any possible clues out there, since capitalization does not seam to matter for Google.

.net in the System namespace has the Object type which is part of dot net. Lower case object is syntactic sugar for System.Object, which again is part of .net.

MSDN Object

MSDN object

You’re running into a problem using the using keyword and importing types from Namespaces. You either need to alias the Namespace:

using sys = System;

or just fully qualify the conflicting names. If you want to use System and reference the UnityEngine object type, then fully qualify the namespace before the type.

public UnityEngine.Object ObjectReference;

I don’t know about the capitalisation, but the resolve error can be explained because you’re importing both the System namespace and the UnityEngine namespace, and they both define Object classes. So your public Object whatever declaration becomes ambiguous between whether you mean System.Object or UnityEngine.Object.

Do you really need the using System? If so, explicitly declare UnityEngine.Object when you want to use it. Otherwise, get rid of the namespace import at the top of the file.