如果满足if语句,如何添加3(Unity3d)

hue*_*nny -2 if-statement unity-game-engine

我正在尝试制作一个if语句,每次满足if语句时都会向迭代器添加3.我知道如何添加1使用coins++但是有一种方法可以添加3.

if (other.tag == "yes") 
{
  coins + 3;
}               
Run Code Online (Sandbox Code Playgroud)

And*_*rea 5

coins += 3;                
Run Code Online (Sandbox Code Playgroud)

比一种更紧凑的方式coins = coins + 3;.