Below is from ChatGPT
1️⃣ out
-
Not exactly “outside the method”, but close.
-
outis a keyword that tells the method:“I want you to assign a value to this variable inside the method, and then I’ll use it afterward.”
-
The variable must be assigned by the method before it’s used.
-
It’s a way to return an extra value from a method (since a method normally can only return one thing).
Example:
int result;
bool success = int.TryParse("123", out result);
// result is assigned inside TryParse2️⃣ var
-
varjust tells the compiler:“Figure out the type of this variable automatically from the assigned value.”
-
In our case,
configwill automatically beAnimationStateConfigbecausestateConfigsis aDictionary<Attacks, AnimationStateConfig>.
3️⃣ config
-
This is the variable name that receives the value from the dictionary.
-
Its type is
AnimationStateConfig. -
After the
TryGetValuecall,configcontains the AnimationStateConfig instance corresponding to the current attack state.