out
- value type : ๋๋จธ์ง ์๋ฃํ์ผ๋ก ๋ง๋ ๋ณ์
- reference type : class์ ๋ณ์(๊ฐ์ฒด)
int aa = 10;
int bb = 20;
int result = Plus(aa,bb);
int Plus(int a, int b)
{
int result = a + b;
a = 100;
return result;
// result : 30 / aa : 10
}
int aa = 10;
int bb = 20;
int result = Plus(ref aa,bb);
int Plus(ref int a, int b)
{
int result = a + b;
a = 100;
return result;
// result : 30 / aa : 100
}
C#์ ์ฐธ์กฐ : ํฌ์ธํฐ
int aa = 10;
int bb = 20;
int result = Plus(out aa,bb);
int Plus(out int a, int b)
{
int result = a + b;
return result;
// ERROR
}
int aa = 10;
int bb = 20;
int result = Plus(out aa,bb);
int Plus(out int a, int b)
{
a = 20;
int result = a + b;
return result;
}
HACKS
๐ก transform.position = ๋ฌผ์ฒด์ ์ค์
๐ก Particle Systerm → play on awake // play on awake(False)์ผ ๋ ์ฌ์ํ๊ธฐ bi.GetComponent<ParticleSystem>().Play();
๐ก Normal ๋ฐฉํฅ - ๋ฒ์ ๋ฒกํฐ
'๐ฉโ๐ปProgramming > C#' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[C#] LINQ (0) | 2022.12.21 |
---|---|
[C#] Array ์์ฃผ ์ฌ์ฉํ๋ ๋ฉ์๋ (0) | 2022.12.19 |
[C#] Char.IsNumber / IsDigit (0) | 2022.12.11 |
[C#] Math ๋ฉ์๋ (0) | 2022.11.26 |
[C#] ๊ธฐ๋ณธ ๊ฐ๋ (0) | 2022.07.31 |
๋๊ธ