Posts
Q&A
ํฌ๋ก์คํค์ด ๋ฌธ์
์ ... ํด๊ฒฐํ์ต๋๋ค! Move()ํจ์์ ์๋ _velocity๋ฅผ ํจ์์์๋ค ๋์ง๋ง๊ณ ์ ค ์์ ์์ฑํด์ ์คํฌ๋ฆฝํธ ๋ด์์๋ ์ผ๋ง๋ ์ง ์ฌ์ฉํ ์ ์๊ฒ ํ๋ค์ MoveCheck() ํจ์๋ฅผ void MoveCheck() { if (!isRun && !isCrouch && isGround) { if (velocity.magnitude >= 0.01f) isWalk = true; else isWalk = false; theCrosshair.WalkingAnimation(isWalk); lastPos = transform.position; } } ์ด๋ ๊ฒ ์์ ๋ณด์ด๋ ๊ฒ์ฒ๋ผ ์ ์ผ์๋ฉด ๋ฉ๋๋ค. ์ ์์น์ ์ง๊ธ ์์น์ ๊ฑฐ๋ฆฌ๋ฅผ ์ด์ฉํ๋ ๊ฒ์ด ์๋ ์๋๋ฅผ ์ด์ฉํ๋ ๋ฐฉ์์ด์ฃ . ๊ทธ๋ผ ๋์์ด ๋ฌ์ผ๋ฉด ์ข๊ฒ ๊ตฐ์!
- 1
- 7
- 661
Q&A
ํฌ๋ก์คํค์ด ๋ฌธ์
์๋ ํ์ธ์. ์ ์ ๊ฐ์ ๋ฌธ์ ๋ฅผ ๊ฒฉ๊ณ ์๋ ์ฌ๋์ด ๋ง์ ๊ฒ ๊ฐ๊ตฐ์.ใ ใ ์ ๊ฐ์ ๊ฒฝ์ฐ์๋ ์์ ํฐ ๊ฒฐ์ฌ์ ํ๊ณ ์ฒ์๋ถํฐ ๋ค์ํ๊ณ ์์ด์. ํ.... ์์ ์ ํ๋ ๋ฐ๊น์ง ๊ฐ๋๋ฐ ์๊ฐ์ด ์ข ๊ฑธ๋ฆด ๊ฒ ๊ฐ์์.ใ ใ
- 1
- 7
- 661
Q&A
๊ธฐ๋ณธ์์ ์ด์์ด์!
์๋ ํ์ธ์. ๊ธฐ๋ณธ์์ ์ 'ํ์ตํ๊ธฐ'๋ฒํผ ๋ง๊ณ ๋ฐ๋ฅธ๋ฐ๋๋ฌ๋ณด์๋ฉด ์์ ๋ค์ด๋ก๋ํ๋ ๊ณณ์๋๋ฐ ๊ทธ๊ฑฐ ๋ค์ด๋ฐ์์ ๋ค์ด๋ฐ์๊ฑฐ ์ ๋ํฐ ํ๋ก์ ํธ์ฐฝ ์๋ค๊ฐ ๋๋๊ทธํด์ ๋์ผ์๋ฉด ๋์. ๋์ด ๋ฌ์ผ๋ฉด ์ข๊ฒ ๋ค์.ใ ใ (์ฌ์ง)์ฌ๊ธฐ์ ๋ฐ๋กํ์ต ๋ง๊ณ ์ ๊ทธ๋ฆผ ๋๋ฅด์๋ฉด (์ฌ์ง)์ด๋ฐ ์ฐฝ์ด ํ๋ ๋ณด์ผ๊ฑด๋ฐ ์ด๊ฑฐ ๋ค์ด๋ฐ์ผ์๋ฉด ๋ฉ๋๋ค.
- 0
- 1
- 273
Q&A
ํฌ๋ก์คํค์ด ๋ฌธ์
์๋ ํ์ธ์. ์ ์ ๋๊ฐ์ ์ํฉ์ ๊ฒฉ๊ณ ๊ณ์๊ตฐ์ใ ใ ์ ์ค๋ฅ๋๋ฌธ์ ์ ๋๋ฉ์ด์ ๋ ์คํ์ด ์ฌ๋๋ก ์๋ผ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ๋ ์์ฒญ ๋ง์ ์ค๋ฅ๋ฅผ ๊ฒช๊ณ ์๋๋ฐ ํด๊ฒฐ์ด ์๋ผ์ใ ใ
- 1
- 7
- 661
Q&A
ํฌ๋ก์คํค์ด ๋ฌธ์
์ ์ฒด์ฝ๋:(HUD) using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class HUD : MonoBehaviour { [SerializeField] private GunController theGunController; private Gun currentGun; [SerializeField] private GameObject go_BulletHUD; [SerializeField] private Text[] text_Bullet; // Update is called once per frame void Update() { CheckBullet(); } private void CheckBullet() { currentGun = theGunController.GetGun(); text_Bullet[0].text = currentGun.carryBulletCount.ToString(); text_Bullet[1].text = currentGun.reloadBulletCount.ToString(); text_Bullet[2].text = currentGun.currentBulletCount.ToString(); } }
- 1
- 7
- 661
Q&A
ํฌ๋ก์คํค์ด ๋ฌธ์
์ ์ฒด์ฝ๋:(crosshair) using System.Collections; using System.Collections.Generic; using UnityEngine; public class crosshair : MonoBehaviour { [SerializeField] private Animator animator; private float gunAccuracy; [SerializeField] private GameObject go_CrosshairHUD; public void walkingAnimation(bool _flag) { animator.SetBool("walking", _flag); } public void runningAnimation(bool _flag) { animator.SetBool("running", _flag); } public void crouchingAnimation(bool _flag) { animator.SetBool("crouching", _flag); } public void FireAnimation() { if(animator.GetBool("walking")) animator.SetTrigger("walk_fire"); else if(animator.GetBool("crouching")) animator.SetTrigger("crouch_fire"); else animator.SetTrigger("idle_fire"); } }
- 1
- 7
- 661
Q&A
ํจ๊ณผ์ ๋ฃ์ ๋ ์ค๋ฅ
์ ์ฒด ์ฝ๋: using System.Collections; using System.Collections.Generic; using UnityEngine; public class GunController : MonoBehaviour { [SerializeField] private Gun currentGun; private float currentFireRate; private AudioSource audioSource; void start() { audioSource = GetComponentAudioSource>(); } // Update is called once per frame void Update() { GunFireRateCalc(); TryFire(); } private void GunFireRateCalc() { if(currentFireRate > 0) currentFireRate -= Time.deltaTime; } private void TryFire() { if(Input.GetButton("Fire1") && currentFireRate 0) { Fire(); } } private void Fire() { currentFireRate = currentGun.fireRate; Shoot(); } private void Shoot() { PlaySE(currentGun.fire_Sound); currentGun.muzzleFlash.Play(); Debug.Log("์ด์ ๋ฐ์ฌํจ"); } private void PlaySE(AudioClip _clip) { audioSource.clip = _clip; audioSource.Play(); } }
- 0
- 1
- 423
Q&A
๊ณต ๋ง๋ค๊ธฐ์์(๊ณต ๋ถ๋ฌ์ค๊ธฐ) ์ค๋ฅ๊ฐ ๋น๋๋ค
์ ํด๊ฒฐํ์ต๋๋ค! ,(์ผํ)๊ฐ ์๋ค์ด๊ฐ ์์์ด์
- 0
- 3
- 332
Q&A
๊ณต ๋ง๋ค๊ธฐ์์(๊ณต ๋ถ๋ฌ์ค๊ธฐ) ์ค๋ฅ๊ฐ ๋น๋๋ค
์ฌ๊ธฐ์ File "c:\Users\w10\Desktop\python work space\pygame_basic\pygame_project\3_ball_movement.py", line 57 pygame.image.load("C:\\Users\\w10\\Desktop\\python work space\\pygame_basic\\pygame_project\\images\\balloon2.png") ^ SyntaxError: invalid syntax PS C:\Users\w10\Desktop\python work space\pygame_basic> ์ด๋ฐ ์ค๋ฅ๊ฐ ๋น๋๋ค. ์ฐธ๊ณ ๋ก ๋ถ๋ฌ์ค๊ธฐ๋ ์ ๋ฐฉ๋ฒ๋ฐ์ ์ ํตํฉ๋๋ค. weapon ๋ถ๋ฌ์ค๊ธฐ๋ ๋ฐ๋ฅธ ๊ฒ์ ์ ๋์๋๋ฐ ์ ๊ธฐ์์๋ง ์ค๋ฅ๊ฐ ์๋ค๊ณ ๋จ๋ค์ ๋ญ๊ฐ ๋ฌธ์ ์ธ์ง ์๋ ค์ฃผ์ธ์.
- 0
- 3
- 332
Q&A
๋ํจ์ฆ ์ปฌ๋ฌ๊ฐ ์์ด์
์ด! scanline์ผ๋ก ๋ฐ๊พผ ๊ฒ ๋ง์ผ๋ก๋ ๋๋ค์! ๊ฐ์ฌํฉ๋๋ค
- 0
- 17
- 530