The “this” keyword is simply a class’s reference to itself. A common usage of “this” is being able to differentiate between a global variable & a local variable with the same name:
public class Example
{
int myVar;
void SetMyVar(int myVar)
{
//Without "this", C# wouldn't know you meant the global "myVar" variable,
//and not the local "myVar" variable passed into this method.
this.myVar = myVar;
}
}
In your particular example here, “this” is being used in what’s known as the singleton pattern, which states that there can only be one global instance of ObjectPool that other classes can reference by just calling the static ObjectPool.SharedInstance property.
What’s happening in Awake is that as soon as a new instance of ObjectPool is created, it will set SharedInstance to itself by using “this”. Basically meaning, “I am the SharedInstance”.