using UnityEngine;
public class Class_연습 : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
UFO_달리기_자식_클래스 ufo_변수 = new UFO_달리기_자식_클래스();
ufo_변수.ufo_공격함수();
}
}
public class UFO_부모_클래스 // 클래스
{
public void ufo_대기함수() // Ufo_대기 함수
{
int second = 3;
Debug.Log("플레이어가 없으면" + second + "초 대기 중");
}
public void ufo_공격함수()
{
Debug.Log("===> 공격함수");
}
}
public class UFO_달리기_자식_클래스 : UFO_부모_클래스 // 클래스 상속
{
public void ufo_공격함수()
{
base.ufo_공격함수();
}
public void ufo_달리기함수()
{
Debug.Log("===> 달리기함수");
}
}
'유니티 unity, c#' 카테고리의 다른 글
(유니티 unity) c#, 비주얼 스튜디오 명령어 입력하기 (0) | 2022.06.24 |
---|---|
(유니티 unity) c#, 멤버변수(필드), 접근 제한자, private, public (0) | 2022.06.24 |
(유니티 unity) c#, 오브젝트 생성 (0) | 2022.06.23 |
(유니티 unity) c#, 클래스 참조, 주소 (0) | 2022.06.22 |
(유니티 unity) c# 함수 (0) | 2022.06.17 |
(유니티 unity) 설치 (3) 세번째 방법, 에디터 따로 설치 후 허브에 연결하기 (0) | 2022.06.12 |
(유니티 unity) 스크립트 추가, add component, new script, (0) | 2022.06.12 |
(유니티 unity) 에셋스토어, 오브젝트 상품 패키지, 다시 받기 asset store, package, download (0) | 2022.06.12 |