Question about Variable Declaration

Why are the Texture2D variables initialized with the assignment operator, but the other variables are initialized using braces? Does it make a difference when the code executes? And I guess to go further, when would you ever really use the assignment operator if braces make the code cleaner?

1 Like

You can actually initialize Texture2D with braced initialization as well! You just have to call LoadTexture within those braces.

I believe we demonstrate this later in the course, as well.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms