가 제가하고 싶은 것은 클래스 작업을 수행하는 방법 :OOP "폴더"
일부 스크립트가 접근 :
//...
string Str = "aab";
void Update(){
GUI3D.Label(Str);
GUI3D.TextField(ref Str);
}
//...
GUI3D 스크립트 :
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public static class GUI3D {
static void Label(string Text){
// make text apear
}
static int CursorField;
static void TextField(ref string Text){
// changing cursor field depending on the inputs
// change text and make it apear
}
}
내가하지 않았다 희망 너무 많이 찢어 버려. 하지만 내가하고 싶은 것은 오직 TextField만이 CursorField에 액세스 할 수 있다는 것입니다.
내가하고 싶은 것 경우 있도록 :static void Label(string Text){
// make text apear
CursorField = 0; // that I'd get error due to protection level.
}
가 어떻게 그 일을 할 것인가?
나는 GUI3D에 액세스 할 수있는 자식 함수를 만들 것이라고 말했지만, 멤버는 개인용이며, 왜 내 3D GUI가 이미 600 줄이고 약간 혼란 스럽기 때문에 숨길 필요가 있습니다. 또한 아키텍처를 변경해야하는지 상관하지 않기 때문에 질문을 던졌습니다. – MilitaryG