public void OpenMessageBox(ItemManager.ItemList item, ItemManager.PresentState presentState, GameObject gObject) { if (!isSelectBoxOn) { isSelectBoxOn = true; select.SetActive(true); buttons = select.GetComponentsInChildren <Button>(); //temporary code buttons[0].onClick.AddListener(gObject.GetComponent <CollectableItem>().Use); buttons[0].onClick.AddListener(GameManager.GameManagerInstance.WaitForAnotherItemForUse); buttons[1].onClick.AddListener(gObject.GetComponent <CollectableItem>().Mix); buttons[1].onClick.AddListener(GameManager.GameManagerInstance.WaitForAnotherItemForMix); buttons[2].onClick.AddListener(gObject.GetComponent <CollectableItem>().Cancel); foreach (var button in buttons) { button.onClick.AddListener(GameManager.GameManagerInstance.ButtonSelected); button.onClick.AddListener(CloseMessageBox); } ((RectTransform)itemImage.transform).position = originalImageTrans.position; ((RectTransform)itemImage.transform).sizeDelta = originalImageTrans.sizeDelta; if (item == ItemManager.ItemList.Paper) { BugManager.BugManagerInstance.BugOccured(BugManager.BugList.Paper); ((RectTransform)itemImage.transform).localPosition = new Vector3(-63.8f, -18.2f, 0); ((RectTransform)itemImage.transform).sizeDelta = new Vector2(660.4f, 522.6f); } itemImage.sprite = gObject.GetComponent <Image>().sprite; itemDescription.text = ScriptWindow.ScriptWindowInstance.ItemDescriptionForCheckedItem(item); itemName.text = ScriptWindow.ScriptWindowInstance.ItemNameForCheckedItem(item); GameManager.GameManagerInstance.WaitForButtonSelect(); } }
protected bool ClickEventHandlerInvoker(ItemManager.ItemList item, ItemManager.PresentState presentState, GameObject gObject) { if (GameManager.GameManagerInstance.IsWatingForAnotherItemForMix || GameManager.GameManagerInstance.IsWatingForAnotherItemForUse) { GameManager.GameManagerInstance.ItemChecked(item, presentState, gameObject); return(false); } if (GameManager.GameManagerInstance.IsWatingForButton) { return(false); } ClickEvent?.Invoke(item, presentState, gObject); return(true); }
public void ChangeColorOfBackground(ItemManager.ItemList item, ItemManager.PresentState presentState, GameObject gObject) { int i = pivot; foreach (var panelBox in itemPanelBoxes) { if (Inventory.InventoryInstance.ItemsInInventory[i % 9].item == item) { itemPanelBoxes[i - pivot].GetComponent <Image>().color = new Color(0.5f, 0.5f, 0.5f); return; } i += 1; } }
//아이템을 줍기 이전의 event public override void ImageChange(ItemManager.ItemList item, ItemManager.PresentState presentState, GameObject gObject) { gameObject.GetComponent <UnityEngine.UI.Image>().sprite = Resources.Load <Sprite>("Image/pillow_inventory"); }
public virtual void ImageChange(ItemManager.ItemList item, ItemManager.PresentState presentState, GameObject gObject) { }
// Start is called before the first frame update protected virtual void Start() { presentState = ItemManager.PresentState.Default; ClickEventHandlerReset(); //ClickEvent에 Subscriber를 붙여줍시다. }
public void ScriptPrinterForClickItem(ItemManager.ItemList item, ItemManager.PresentState presentState, GameObject gObject) { foreach (var srpt in Parser.ParserInstance.loadedDataForScriptOnclicks.ScriptOnclick) { if (srpt.target == item.ToString()) { Write(srpt.objectOnclick); break; } else if (item == ItemManager.ItemList.Fax) { if (srpt.target == item.ToString() + "On") { if (GameObject.Find("ButtonOnGame").GetComponent <ButtonOnGame>().IsValid == true) { Write(srpt.objectOnclick); } } else if (srpt.target == item.ToString() + "Off") { if (GameObject.Find("ButtonOnGame").GetComponent <ButtonOnGame>().IsValid == false) { Write(srpt.objectOnclick); } } } else if (item == ItemManager.ItemList.TV) { if (srpt.target == item.ToString() + "On") { if (GameObject.Find("TV").GetComponent <TV>().IsOpened == true) { Write(srpt.objectOnclick); } } else if (srpt.target == item.ToString() + "Off") { if (GameObject.Find("TV").GetComponent <TV>().IsOpened == false) { Write(srpt.objectOnclick); } } } else if (item == ItemManager.ItemList.ButtonOnGame) { if (srpt.target == item.ToString() + "On") { if (GameObject.Find("ButtonOnGame").GetComponent <ButtonOnGame>().IsOn == true) { Write(srpt.objectOnclick); } } else if (srpt.target == item.ToString() + "Off") { if (GameObject.Find("ButtonOnGame").GetComponent <ButtonOnGame>().IsOn == false) { Write(srpt.objectOnclick); } } } } }
//아이템을 줍기 이전의 event public override void ImageChange(ItemManager.ItemList item, ItemManager.PresentState presentState, GameObject gObject) { }