Yashe
❔ What is the difference between these two pieces of code?
But you can do more complex stuff and for example make a property which will return some element from a list, or do some mathfs before.
If the player max health is 100, current is 65 and you want a field that represents the missing health you can make a private property:
private int MissingHealth => MaxHealth - CurrentHealth
and you can't do it while declaring the variable13 replies
❔ What is the difference between these two pieces of code?
The first one is body expresion of a property as phaseshift already tell.
When you are using '=' sign you are declearing a field and assigning a value :
variable = value
With this '=>' you are referencing something for example it can be simple as:
public int Score => score
: this propery reference to an existing score field variable or
public int Health => playerController.Health
: in this case you are referencing something from another class for example13 replies
❔ ✅The largest inscribed circle inside concave (non-convex) polygon 2D
https://github.com/mapbox/polylabel/issues/26 I'm trying to implement this poly label in c# but with no luck.. unfortunately
25 replies