Almost-Native

(유니티 에러) warning CS0108: 'XXX.xxx' hides inherited member 'Component.audio'. Use the new keyword if hiding was intended. 본문

Java 프로그램 개발, IT/유니티 (Unity)

(유니티 에러) warning CS0108: 'XXX.xxx' hides inherited member 'Component.audio'. Use the new keyword if hiding was intended.

2021. 1. 3. 18:33

유니티 개발 Visual C# 소스에서 아래와 CS0108 에러가 나는 경우가 있습니다.

 

warning CS0108: 'Playerball.audio' hides inherited member 'Component.audio'. Use the new keyword if hiding was intended.

 

프로그램에서 audio 라는 변수를 쓴 것 때문에 경고를 보내고 있고, 쓸려면 new 키워드를 붙이라는 내용입니다.

 

new 키워드를 붙여서 해결하라고 되어 있지만, 실제로 붙여보면 다른 에러를 만납니다.

 

audio 라는 키워드가 내부적으로 어딘가에서 이미 쓰이고 있는 예약어인 듯 합니다.

그냥 변수이름을 다른 것으로 바꿔주면 간단히 해결됩니다.

 

 

Comments