ํ”Œ๋ ˆ์ด์–ด Action ButtonPress


์™ธ๋ถ€ ํด๋ž˜์Šค other

other์˜ย Action func


์ธํ’‹ ๋งค๋‹ˆ์ € InputManager.instance.Action InputPress


์ด ์žˆ์„๋•Œ,


On() ์‹คํ–‰ํ•˜๋ฉด,


1. other ํด๋ž˜์Šค์—์„œย Player.ButtonPress += other.func

2. InputPress += ButtonPress


Off() ์‹คํ–‰ํ•˜๋ฉด,


1. other ํด๋ž˜์Šค์—์„œย (Player.ButtonPress -= other.func)

2. InputPress -= ButtonPress


์ด๋ ‡๊ฒŒ ํ–ˆ์„ ๋•Œ, Off๊ฐ€ ์‹คํ–‰ ๋˜์—ˆ๋‹ค ํ•˜๋”๋ผ๋„ ButtonPress๊ฐ€ ์ž๊พธ ๋ˆŒ๋ฆฌ๋Š” ํ˜„์ƒ์ด ์žˆ์Œ.


๋Œ€์‹ ์—


Off() ์‹คํ–‰ํ•˜๋ฉด,


1.ย InputPress -= ButtonPress

2. other ํด๋ž˜์Šค์—์„œย (Player.ButtonPress -= other.func)


ํ•˜๋ฉด,

์ •์ƒ์ ์œผ๋กœ ButtonPress๊ฐ€ ๋” ์ด์ƒ ๋ˆŒ๋ ค์ง€์ง€ ์•Š๋Š”๋‹ค.


์„ค๋งˆ.. ButtonPress๊ฐ€ ๋„์ค‘์— ๋ฐ”๋€Œ๋ฉด

์ด๋ฏธ InputPress์— ํ• ๋‹น๋œ ButtonPress๋ž‘ ๋ณ„๊ฐœ์˜ Action์ด ๋˜๋ฒ„๋ฆฌ๋Š”๊ฑฐ์ž„?