오늘은 구 input 대신 new input system으로 리펙토링 했다.
기존 input manager가 지워져서 ball과 충돌이 있었으나
input system 타입을 바꾸고 vector2 → float(좌우만 움직이므로 vector2 필요없음)
PlayerInputController에서 public float moveInput 선언한뒤
ball.cs에서 아래 코드 가져오는 부분을 수정하여 오류 수정
PlayerInputController inputController;
void Start()
{
inputController = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerInputController>();
...생략
}
switch문과도 충돌이 있었으나 팀원분의 도움으로
public 선언한 PlayerInputController의 moveinput을 호출해서 오류해결!
switch (inputController.moveInput)
{
case -1f:
BallRotationEX = BallRotation;//?÷???? ????? ???????? ????? ??
break;
case 0f:
int zeroRadom = Random.Range(-1, 2);
BallRotationEX = (BallRotation * zeroRadom);//??????? -1,0,1?? ????? ??
break;
case 1f:
BallRotationEX = (-1f) * BallRotation;//?÷???? ????? ?????????? ????? ??
break;
default:
break;
}
'개발일지' 카테고리의 다른 글
241017(목) [간단한 학습 정리] (0) | 2024.10.17 |
---|---|
241016(수) [AddForce 함수] (0) | 2024.10.16 |
241011(금) [스파르타 타운 과제 : 필수 기능] (2) | 2024.10.11 |
241010(목) [스텟 시스템 Base 내용정리] (4) | 2024.10.10 |
241008(화) [쿼터니언(Quaternion), 삼각함수와 역삼각함수] (0) | 2024.10.08 |