๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90
๋ฐ˜์‘ํ˜•

์œ ๋‹ˆํ‹ฐ9

[Unity]2D๊ฒŒ์ž„๋งŒ๋“ค๊ธฐ #4_ ํ”Œ๋ ˆ์ด์–ด ์ ํ”„ ๊ตฌํ˜„ ๋ฌผ๋ฆฌ๋ ฅ์— ์˜ํ•œ ์ ํ”„ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 public class PlayerMove : MonoBehaviour { public float maxSpeed; public float jumpPower; Rigidbody2D rigid; SpriteRenderer spriteRenderer; Animator anim; void Awake() { rigid = GetComponent(); rigid.freezeRotation = true; spriteRenderer = GetComponent (); anim = GetComponent(); } // ํ‚ค๋ณด๋“œ์—์„œ ์†์„ ๋—์„ ๋•Œ ์™„์ „ stop -->๋ฉˆ์ถœ ๋•Œ ์†๋„ p.. 2021. 9. 26.
[Unity]2D๊ฒŒ์ž„ ๋งŒ๋“ค๊ธฐ #2 _์•„ํ‹€๋ผ์Šค/์• ๋‹ˆ๋ฉ”์ด์…˜ ์•„ํ‹€๋ผ์Šค ์œ ๋‹ˆํ‹ฐ์—์„œ '์•„ํ‹€๋ผ์Šค'๋Š” ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์Šคํ”„๋ผ์ดํŠธ(Sprite)๋ฅผ ํ•œ ์žฅ์˜ ํฐ ํ…์Šค์ณ์— ๋ชจ์•„๋†“์€ ๊ฒƒ์ด๋ผ๊ณ  ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์‰ฝ๊ฒŒ ์„ค๋ช…ํ•˜์ž๋ฉด, ์—์…‹ ์Šคํ† ์–ด์—์„œ Sprites๋ฅผ ๋‹ค์šด ๋ฐ›๊ณ  ๋‚˜์„œ ์œ„ ์‚ฌ์ง„์ฒ˜๋Ÿผ ์ด๋ฏธ์ง€๋ฅผ ๋”๋ธ”ํด๋ฆญํ•˜๋ฉด ์—ฌ๋Ÿฌ๊ฐœ์˜ ์ด๋ฏธ์ง€๊ฐ€ ์กฐ๊ฐ๋‚˜์„œ ๋˜ ๋‚˜ํƒ€๋‚˜๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์ด๊ฑธ ํ•˜๋‚˜๋กœ ๋ฌถ์–ด์ค€๊ฒŒ ์•„ํ‹€๋ผ์Šค์ด๋‹ค! ํŠนํžˆ ๋ชจ๋ฐ”์ผ์˜ ๊ฒฝ์šฐ ์•„ํ‹€๋ผ์Šค๋ฅผ ์‚ฌ์šฉํ•ด์ค˜์•ผ Batch๋ฅผ ์ค„์—ฌ์ค€๋‹ค +)Batch : ๊ทธ๋ž˜ํ”ฝ์„ ๊ทธ๋ฆฌ๊ธฐ ์œ„ํ•ด ๋ฉ”๋ชจ๋ฆฌ์™€ CPU๋ฅผ ์‚ฌ์šฉํ•œ ํšŸ์ˆ˜ https://skuld2000.tistory.com/28 [Unity] ์ด์ œ Sprite Packer ๋Š” ๊ทธ๋งŒ. Sprite Atlas ๋ฅผ ์‚ฌ์šฉํ•˜์ž. ์œ ๋‹ˆํ‹ฐ์—์„œ ์•„ํ‹€๋ผ์Šค(Atlas) ๋Š” ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์Šคํ”„๋ผ์ดํŠธ(Sprite)๋ฅผ ํ•œ ์žฅ์˜ ํฐ ํ…์Šค์ณ์— ๋ชจ์•„๋†“์€ ๊ฒƒ์ด.. 2021. 8. 24.
[Unity] 2D๊ฒŒ์ž„ ๋งŒ๋“ค๊ธฐ #1_ ํ”„๋กœ์ ํŠธ ๊ธฐ๋ณธ์„ค์ • ์œ ํŠœ๋ธŒ ๊ณจ๋“œ๋ฉ”ํƒˆ๋‹˜์˜ ๊ฐ•์˜ '2Dํ”Œ๋žซํฌ๋จธ'๋ฅผ ๊ณต๋ถ€ํ•˜๋ฉฐ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค https://www.youtube.com/watch?v=v_Y5FH_tCpc&list=PLO-mt5Iu5TeZGR_y6mHmTWyo0RyGgO0N_&index=1 ๊ณจ๋“œ๋ฉ”ํƒˆ๋‹˜ ์—์…‹์„ ๋‹ค์šด๋ฐ›๊ณ  ์‹ถ์œผ์‹œ๋‹ค๋ฉด http://u3d.as/2mvJ Simple 2D Platformer Assets Pack | 2D ์บ๋ฆญํ„ฐ | Unity Asset Store Elevate your workflow with the Simple 2D Platformer Assets Pack asset from Goldmetal. Find this & more ์บ๋ฆญํ„ฐ on the Unity Asset Store. assetstore.unity.com ์Šคํ”„๋ผ์ดํŠธ - 2D๋Š” Li.. 2021. 8. 23.
[Unity] ์บ๋ฆญํ„ฐ๋ฅผ WASDํ‚ค๋กœ ์ด๋™์‹œํ‚ค๊ธฐ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 public class PlayerController : MonoBehaviour { void Start() { } void Update() { // w ->์•ž if (Input.GetKey(KeyCode.W)) { transform.position += new Vector3(0.0f, 0.0f, 1.0f); } // s->๋’ค if (Input.GetKey(KeyCode.S)) { transform.position -= new Vector3(0.0f, 0.0f, 1.0f); } if (Input.GetKey(KeyCode.A)) { tran.. 2021. 8. 18.
728x90
๋ฐ˜์‘ํ˜•