コード例 #1
0
ファイル: NpcBehaviour.cs プロジェクト: kyn320/Festival
 void OnTriggerExit2D(Collider2D _col)
 {
     if (enterShop != null && _col.CompareTag("Shop"))
     {
         enterShop = null;
     }
 }
コード例 #2
0
ファイル: NpcBehaviour.cs プロジェクト: kyn320/Festival
 void OnTriggerEnter2D(Collider2D _col)
 {
     if ((state == NpcState.Find || state == NpcState.Buy) && enterShop == null && _col.CompareTag("Shop"))
     {
         enterShop = _col.GetComponent <ShopBehaviour>();
     }
 }
コード例 #3
0
ファイル: UISalePannel.cs プロジェクト: kyn320/Festival
    public void View(ShopBehaviour _shop, bool _isView, bool _isExit, bool _isEdit)
    {
        isEdit = _isEdit;

        SetShop(_shop);
        base.View(_isView, _isExit);
        isSaleAction = true;
        UpdateSlotList();
    }
コード例 #4
0
ファイル: UIShopDesign.cs プロジェクト: kyn320/Festival
 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);
 }
コード例 #5
0
ファイル: UISalePannel.cs プロジェクト: kyn320/Festival
    public void SetShop(ShopBehaviour _shop)
    {
        shop = _shop;

        SetAllSlot(false);

        itemList = shop.info.itemList;

        gridSize = shop.info.salePannelSize;
    }
コード例 #6
0
    // Start is called before the first frame update
    void Start()
    {
        if (!!shopParentUIGO)
        {
            shop = shopParentUIGO.GetComponentInChildren <ShopBehaviour>();
        }
        if (!!shop)
        {
            shop.gameObject.SetActive(false);
        }

        playerInShop = false;
    }
コード例 #7
0
    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();
    }
コード例 #8
0
ファイル: WantItem.cs プロジェクト: kyn320/Festival
    public void CheckSaleGold(ShopBehaviour _shop, int _gold)
    {
        if (_gold < lowGold)
        {
            lowShop = _shop;
            lowGold = _gold;
        }

        if (_gold > highGold)
        {
            highShop = _shop;
            highGold = _gold;
        }
    }
コード例 #9
0
ファイル: WantItem.cs プロジェクト: kyn320/Festival
 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);
     }
 }
コード例 #10
0
ファイル: NpcBehaviour.cs プロジェクト: kyn320/Festival
    /// <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;
        }
    }
コード例 #11
0
 public void View(ShopBehaviour _shop, bool _isView)
 {
     View(_isView);
     shop = _shop;
 }
コード例 #12
0
ファイル: UIInGame.cs プロジェクト: kyn320/Festival
 public void ViewShopDesign(ShopBehaviour _shop)
 {
     shopDesign.View(_shop);
 }
コード例 #13
0
ファイル: UIInGame.cs プロジェクト: kyn320/Festival
 public void ViewShopMenu(ShopBehaviour _shop, bool _isView)
 {
     shopMenu.View(_shop, _isView);
 }
コード例 #14
0
ファイル: UIInGame.cs プロジェクト: kyn320/Festival
 public void ViewSalePannel(ShopBehaviour _shop, bool _isView, bool _isExit, bool _isEdit)
 {
     salePannel.View(_shop, _isView, _isExit, _isEdit);
 }
コード例 #15
0
ファイル: ShopData.cs プロジェクト: FilipeJohansson/Teyrnas
 public ShopData(ShopBehaviour shop)
 {
     price          = shop.price;
     upIncrement    = shop.upIncrement;
     priceIncrement = shop.priceIncrement;
 }