Dinosaurus törmäyksenkäsittelijät
The snippet can be accessed without any authentication.
Authored by
tailkauh
Edited
Snippet.cs 385 B
// Lisätään/vähennetään pisteitä kun hahmo osuu dinoon
AddCollisionHandler(hahmo, "dino", (_,_) =>
{
int muutos = 0;
if (tagi == "miinus") muutos = -3;
else if (tagi == "plus") muutos = 1;
_pelaajanPisteet.Value += muutos;
hahmo.Destroy();
});
// Tuhotaan hahmo kun se osuu alareunaan
AddCollisionHandler(hahmo, "alareuna", (_, _) => hahmo.Destroy());
Please register or sign in to comment