유니티로 배우는 c#

지정자

테오구 2021. 9. 30. 17:03
728x90
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test2
{
    private int a;
    public int b;
    
    public void Abc()
    {

    }

    private void Abc2()
    {

    }
}

public class test : MonoBehaviour
{
    Test2 aaa;// Test2를 가지고 있는 aaa

    void Abc(){
        aaa.b = 5;//사용가능
        aaa.a = 5; //사용불가
    }
}
728x90

'유니티로 배우는 c#' 카테고리의 다른 글

구조체  (0) 2021.10.10
네임스페이스  (0) 2021.10.10
컬렉션  (0) 2021.10.03
함수  (0) 2021.09.30
자료형  (0) 2021.09.30