void OnTriggerExit2D(Collider2D _col) { if (enterShop != null && _col.CompareTag("Shop")) { enterShop = null; } }
void OnTriggerEnter2D(Collider2D _col) { if ((state == NpcState.Find || state == NpcState.Buy) && enterShop == null && _col.CompareTag("Shop")) { enterShop = _col.GetComponent <ShopBehaviour>(); } }
public void View(ShopBehaviour _shop, bool _isView, bool _isExit, bool _isEdit) { isEdit = _isEdit; SetShop(_shop); base.View(_isView, _isExit); isSaleAction = true; UpdateSlotList(); }
public void View(ShopBehaviour _shop) { UIInGame.instance.shopMenu.HideAnimate(null); gameObject.SetActive(true); shop = _shop; targetTracker.SetTarget(_shop.transform, Camera.main.WorldToScreenPoint(_shop.transform.position), Vector3.zero); colorPicker.Color = _shop.info.tentColor; colorPicker.SetOnValueChangeCallback(OnChangeColor); signListView.ViewList(true, false, UpdateSign); }
public void SetShop(ShopBehaviour _shop) { shop = _shop; SetAllSlot(false); itemList = shop.info.itemList; gridSize = shop.info.salePannelSize; }
// Start is called before the first frame update void Start() { if (!!shopParentUIGO) { shop = shopParentUIGO.GetComponentInChildren <ShopBehaviour>(); } if (!!shop) { shop.gameObject.SetActive(false); } playerInShop = false; }
public static void SaveLifeShop(ShopBehaviour shop) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/lifeShop.save"; FileStream stream = new FileStream(path, FileMode.Create); //Debug.Log(Application.persistentDataPath); ShopData data = new ShopData(shop); formatter.Serialize(stream, data); stream.Close(); }
public void CheckSaleGold(ShopBehaviour _shop, int _gold) { if (_gold < lowGold) { lowShop = _shop; lowGold = _gold; } if (_gold > highGold) { highShop = _shop; highGold = _gold; } }
public void UpdateSaleGold(ShopBehaviour _enterShop, List <Item> _itemList) { _itemList.Sort(delegate(Item a, Item b) { if (a.saleGold > b.saleGold) { return(1); } else if (a.saleGold < b.saleGold) { return(-1); } return(0); }); for (int i = 0; i < _itemList.Count; ++i) { CheckSaleGold(_enterShop, _itemList[i].saleGold); } }
/// <summary> /// NPC의 행동을 제어합니다. /// </summary> /// <param name="_state">행동 값</param> public void ChangeState(NpcState _state) { agent.ClearDestinationEvent(); state = _state; switch (state) { case NpcState.Move: if (moveCoroutine != null) { StopCoroutine(moveCoroutine); } moveCoroutine = StartCoroutine(Move()); break; case NpcState.Talk: break; case NpcState.Find: if (moveCoroutine != null) { StopCoroutine(moveCoroutine); } targetShop = ShopManager.instance.GetRandomShop(); moveCoroutine = StartCoroutine(MoveTargetAndAction(targetShop.salePannelBottom.position, Find)); break; case NpcState.Buy: Buy(); break; default: break; } }
public void View(ShopBehaviour _shop, bool _isView) { View(_isView); shop = _shop; }
public void ViewShopDesign(ShopBehaviour _shop) { shopDesign.View(_shop); }
public void ViewShopMenu(ShopBehaviour _shop, bool _isView) { shopMenu.View(_shop, _isView); }
public void ViewSalePannel(ShopBehaviour _shop, bool _isView, bool _isExit, bool _isEdit) { salePannel.View(_shop, _isView, _isExit, _isEdit); }
public ShopData(ShopBehaviour shop) { price = shop.price; upIncrement = shop.upIncrement; priceIncrement = shop.priceIncrement; }