void Start() { // 가장 바탕의 판넬 지정 panel = transform.GetChild(0).gameObject; // 각 패널과 리스트를 저장. // 각 요소의 `상단 패널, 하단 패널, 툴팁 패널, 가격 패널`을 지정. buyTrade = new Trade(panel.transform.GetChild(2).gameObject , panel.transform.GetChild(4).gameObject , panel.transform.GetChild(8).gameObject , panel.transform.GetChild(5).GetChild(2).gameObject); sellTrade = new Trade(panel.transform.GetChild(7).gameObject , panel.transform.GetChild(6).gameObject , panel.transform.GetChild(9).gameObject , panel.transform.GetChild(5).GetChild(3).gameObject); bottomMoneyPanelText = panel.transform.GetChild(5).GetChild(1).GetChild(0).GetComponent <Text>(); // 더블 클릭 체크용 버퍼 초기화. posBuffer = new Vector2(0, 0); panel.SetActive(false); // 매핑 MappingInfo mapping = new MappingInfo("ShopUI"); mapping.AddMapping("OnLeftDoubleClick : ", "mouseL"); mapping.AddMapping("OnRightClick : ", "mouseR"); mapping.AddMapping("CloseUI : ", "esc"); mapping.Enroll("ShopUI"); }
int MAX_ITEM_BOX = 16; // 임시용이므로 16개로 한정. // 구조 /* * Inventory : * InventoryWindow : * Content : * TooltipPanel : * ItemName : Text * ItemTooltip : Text * ItemEffect : Text # ItemBox *16 # CloseButton : Text */ private void Start() { // 아이템 박스 프리팹 로드 itemBox = Resources.Load("Inventory/Prefab/ItemBox") as GameObject; // 아이템 판넬 오브젝트 저장 Content = transform.GetChild(0).GetChild(1).gameObject; // tooltip 판넬 프리팹 로드 및 부모 설정 및 tooltipPanel = transform.GetChild(0).GetChild(2).gameObject; tooltipPanel.SetActive(false); // 종료 버튼 할당. closeButton = transform.GetChild(0).GetChild(0).gameObject; closeButton.GetComponent <Button>().onClick.AddListener(CloseInventory); // 아이템 코드내임 리스트 세팅 for (int i = 0; i < MAX_ITEM_BOX; i++) { itemBoxCodenameList.Add(""); } // itemBox 배치자 실행 itemBoxPlacer(); MappingInfo mapping = new MappingInfo("Inventory"); mapping.AddMapping("CloseInventory : ", "esc"); mapping.AddMapping("CheckHoveringOnBox : ", "mouseL, !mouseR"); mapping.Enroll("inventory"); gameObject.SetActive(false); }
private void Start() { infoList = new MappingInfo("Cube1"); infoList.AddMapping("Move : up", "_w"); infoList.AddMapping("Move : down", "_s"); infoList.AddMapping("Toggle : ", "n2"); infoList.Enroll(); }
private void Start() { panel = transform.GetChild(0).gameObject; panel.SetActive(isActive); MappingInfo mapping = new MappingInfo("EquipmentUI"); mapping.AddMapping("CloseUI : ", "esc"); mapping.Enroll("EquipmentUI"); }
void Start() { MappingInfo mapping = new MappingInfo("Car"); mapping.AddMapping("Horizontal : 1", "_d"); //RightArrow mapping.AddMapping("Horizontal : -1", "_a"); //LeftArrow mapping.AddMapping("Horizontal : 0", "!d, !a"); mapping.AddMapping("Vertical : 1", "_w"); //UpArrow mapping.AddMapping("Vertical : -1", "_s"); //DownArrow mapping.AddMapping("Vertical : 0", "!w, !s"); mapping.AddMapping("Break : 1", "_n"); mapping.AddMapping("Break : 0", "!n"); mapping.Enroll("PlayerCar"); }
private void Start() { panel = transform.GetChild(0).gameObject; panel.SetActive(isActive); processingPanel = transform.GetChild(1).gameObject; for (int i = 0; i < processingPanel.transform.GetChild(1).childCount; i++) { processingQuestListTextList.Add(processingPanel.transform.GetChild(1).GetChild(i).GetChild(0).GetComponent <Text>()); } processingQuestNameList = new List <string>(); MappingInfo mapping = new MappingInfo("QuestUI"); mapping.AddMapping("CloseUI : ", "esc"); mapping.Enroll("QuestUI"); }
// Start is called before the first frame update void Start() { playerUI = transform.GetChild(6).gameObject; menuBase = new MenuBase(this, transform.GetChild(2).gameObject); confirmSave = new ConfirmSave(this, transform.GetChild(4).gameObject); confirmClose = new ConfirmClose(this, transform.GetChild(3).gameObject); optionMenu = new OptionMenu(this, transform.GetChild(5).gameObject); menuBase.lootPanel.SetActive(false); confirmSave.lootPanel.SetActive(false); confirmClose.lootPanel.SetActive(false); optionMenu.lootPanel.SetActive(false); // 레이어용. MappingInfo mapping = new MappingInfo("MenuUI"); mapping.Enroll("MenuUI"); }
void Start() { // 효과 없는 불필요한 코드 // Message msg4 = new Message("InventoryManager/modifyItem: Health, 0 "); // Message msg5 = new Message("InventoryManager/modifyItem: Fish, 0 "); // Message msg6 = new Message("InventoryManager/modifyItem: Bug, 0 "); // msg4.functionCall(); // msg5.functionCall(); // msg6.functionCall(); MappingInfo map1 = new MappingInfo("Zone"); map1.AddMapping("Tem :", "o"); map1.Enroll(); }
private void Start() { panel = transform.GetChild(0).gameObject; panel.SetActive(isActive); // 상세 텍스트 매핑. levelText = panel.transform.GetChild(1).GetChild(1).GetChild(0).GetChild(0).GetComponent <Text>(); playerNameText = panel.transform.GetChild(1).GetChild(1).GetChild(1).GetChild(0).GetComponent <Text>(); playerCalledText = panel.transform.GetChild(1).GetChild(1).GetChild(2).GetChild(0).GetComponent <Text>(); statHpText = panel.transform.GetChild(3).GetChild(0).GetChild(5).GetChild(0).GetComponent <Text>(); statSpText = panel.transform.GetChild(3).GetChild(0).GetChild(6).GetChild(0).GetComponent <Text>(); statAttackText = panel.transform.GetChild(3).GetChild(0).GetChild(7).GetChild(0).GetComponent <Text>(); statDefenceText = panel.transform.GetChild(3).GetChild(0).GetChild(8).GetChild(0).GetComponent <Text>(); statExpText = panel.transform.GetChild(3).GetChild(0).GetChild(9).GetChild(0).GetComponent <Text>(); // 키 매핑 MappingInfo mapping = new MappingInfo("PlayerInfoUI"); mapping.AddMapping("CloseUI : ", "esc"); mapping.Enroll("PlayerInfoUI"); }
// Start is called before the first frame update void Start() { // 디버그용 콘솔 생성. debugConsole = GameObject.Find("DefaultSetting/Canvas/DebugConsole"); debugConsole.SetActive(false); // 디버그 콘솔 관련 매핑. // 열기 MappingInfo openDebugConsole = new MappingInfo("DebugAction"); openDebugConsole.AddMapping("OpenDebugConsole : ", "slash"); openDebugConsole.Enroll(); // 닫기 MappingInfo closeDebugConsole = new MappingInfo("DebugAction"); closeDebugConsole.AddMapping("CloseDebugConsole : 0", "esc"); closeDebugConsole.AddMapping("CloseDebugConsole : 1", "enter"); closeDebugConsole.Enroll("Debug"); // PlayInfoManager 관련. MappingInfo playInfoManagerDebug = new MappingInfo("PlayInfoManager"); playInfoManagerDebug.AddMapping("ChangeData : Hp, 10", "_ctrlL, arrowU"); playInfoManagerDebug.AddMapping("ChangeData : Hp, -10", "_ctrlL, arrowD"); playInfoManagerDebug.AddMapping("ChangeData : Money, 1000", "_altL, arrowU"); playInfoManagerDebug.AddMapping("ChangeData : Money, -1000", "_altL, arrowD"); playInfoManagerDebug.Enroll(); // InventoryManager 관련. MappingInfo inventoryManagerDebug = new MappingInfo("InventoryManager"); inventoryManagerDebug.AddMapping("SaveInventory : ", "_shiftL, p"); inventoryManagerDebug.AddMapping("ModifyItem : Test, 1", "_shiftL, n1"); inventoryManagerDebug.Enroll(); // GamaProcessManager 관련. MappingInfo gameProcessManagerDebug = new MappingInfo("GameProcessManager"); gameProcessManagerDebug.AddMapping("CloseGame : ", "_ctrlL, _shiftL, q"); gameProcessManagerDebug.AddMapping("ChangeScene : finalSecen", "_ctrlL, _shiftL, n1"); gameProcessManagerDebug.AddMapping("ChangeScene : dummyScene ", "_ctrlL, _shiftL, n2"); gameProcessManagerDebug.Enroll(); EventListener.GetEventListener().Binding("BaseSystem", "None", "DebugAction/EventTest : 123"); new Message("BaseSystem/None : 456, 789").FunctionCall(); }
void Start() { // 캔버스와 그 자식 요소 로드 canvas = GameObject.Find("UICanvas"); foreach (Transform child in canvas.transform) { UIList.Add(child.gameObject); } MappingInfo mapping = new MappingInfo("UIManager"); mapping.AddMapping("OpenUI : PlayerInfoUI", "p"); mapping.AddMapping("OpenUI : InventoryUICanvas", "i"); mapping.AddMapping("OpenUI : MenuUI", "m"); // mapping.AddMapping("OpenUI : EquipmentUI" , "r"); // 시간 부족. // mapping.AddMapping("OpenUI : QuestUI" , "q"); // 시간 부족. // mapping.AddMapping("CloseUI : " , "!ctrlL, esc"); // mapping.AddMapping("CloseAllUI : " , "_ctrlL, esc"); // mapping.AddMapping("OpenTalkView : npc", "t"); // 디버그용. mapping.Enroll(); }
private void Awake() { // 자식 오브젝트 연결. panel = transform.GetChild(0).gameObject; panel.SetActive(isActive); equipmentInventories = new List <EquipmentInventory>(); comsumableInventories = new List <ComsumableInventory>(); etcInventories = new List <EtcInventory>(); Transform temp = panel.transform.GetChild(1); for (int i = 0; i < INVENTORY_CAPACITY; i++) { equipmentInventories.Add( new EquipmentInventory( temp.GetChild(1).GetChild(0).GetChild(0).GetChild(i))); comsumableInventories.Add( new ComsumableInventory( temp.GetChild(2).GetChild(0).GetChild(0).GetChild(i))); etcInventories.Add( new EtcInventory( temp.GetChild(3).GetChild(0).GetChild(0).GetChild(i))); } moneyText = panel.transform.GetChild(2).GetChild(0).GetChild(0).gameObject.GetComponent <Text>(); tooltipPanel = panel.transform.GetChild(3).gameObject; tooltipPanel.SetActive(false); // 이벤트 연결. EventListener.GetEventListener().Binding("InventoryManager", "ModifyItem", "InventoryUICanvas/Sync : "); EventListener.GetEventListener().Binding("PlayInfoManager", "ChangeData", "InventoryUICanvas/Sync : "); // 키 바인딩. MappingInfo mapping = new MappingInfo("InventoryUICanvas"); mapping.AddMapping("CloseUI : ", "esc"); mapping.AddMapping("CheckHoveringOnBox : ", "!mouseL, mouseR"); mapping.Enroll("InventoryUICanvas"); // 기타 초기화. equipmentList = new List <ItemBox>(); consumableList = new List <ItemBox>(); etcList = new List <ItemBox>(); }