Exemplo n.º 1
0
 public override void Exchange(Actor actor)
 {
     base.Exchange(actor);
     if (!blockModel.isUsed)
     {
         OneInventory inventory = ui.hudPage.inventoryGroup.GetChosen();
         if (inventory.model != null && inventory.model.id == InventoryType.Rope.ToInt())
         {
             inventory.UseInventory();
             audioManager.PlayMapSound(MapSFX.PutItem);
             blockModel.isUsed = true;
             Render();
             data.SaveData();
         }
     }
     else
     {
         if (actor.transform.position.y < checkPoint.transform.position.y && bridgeControllerArea.isActorIn)
         {
             MoveToGround(actor);
         }
         else
         {
             MoveToBottom(actor);
         }
     }
 }
Exemplo n.º 2
0
 public override void Exchange(Actor actor)
 {
     base.Exchange(actor);
     if (!blockModel.isUsed)
     {
         OneInventory cur = ui.hudPage.inventoryGroup.GetChosen();
         if (cur.model != null && cur.model.id == InventoryType.JointedArm.ToInt())
         {
             cur.UseInventory();
             blockModel.isUsed = true;
             Render();
             data.SaveData();
         }
     }
     else
     {
         BlockModel drawBridge = data.gameData.GetBlockModel(BlockType.DrawBridge);
         if (!drawBridge.isUsed)
         {
             ui.PlayFade();
             audioManager.PlayMapSound(MapSFX.PutDownBridge);
             action?.Kill();
             action = DOTween.Sequence();
             action.AppendInterval(1.5f);
             action.AppendCallback(() => {
                 Activated();
                 bridge.Activated();
             });
         }
     }
 }
Exemplo n.º 3
0
        public void InsertInventory(InventoryModel model)
        {
            OneInventory one = inventoryList.Find(value => value.model == null);

            one.model = model;
            data.gameData.TryAddInventory(model);
            one.Render();
            ObtainPanel obtain = (ObtainPanel)ui.OpenPanel(PanelType.Obtain);
            Sprite      icon   = spriteCollection.GetInventory(model.id);

            obtain.ShowObtain(icon, data.localizationDao.GetUIName(UIType.ObtainPrefix) + data.localizationDao.GetInventory((InventoryType)model.id) + data.localizationDao.GetUIName(UIType.ObtainSuffix));
        }
Exemplo n.º 4
0
        public void Render(InventoryModel[] inventories)
        {
            Clear();

            for (int i = 0; i < inventories.Length; i += 1)
            {
                InventoryModel model = inventories[i];
                OneInventory   one   = Instantiate(inventoryPrefab, transform);
                one.onChoose += ChooseInv;
                one.Render(model, i);
                inventoryList.Add(one);
            }

            if (currentIndex == -1)
            {
                Choose(0);
            }
        }
Exemplo n.º 5
0
        public override void Exchange(Actor actor)
        {
            base.Exchange(actor);
            OneInventory inventory = ui.hudPage.inventoryGroup.GetChosen();
            List <int>   condition = new List <int>()
            {
                InventoryType.SwingBoard.ToInt(),
                         InventoryType.WoodBoard.ToInt(),
            };

            if (inventory.model != null && condition.Contains(inventory.model.id))
            {
                inventory.UseInventory();
                audioManager.PlayMapSound(MapSFX.PutItem);
                blockModel.isUsed = true;
                data.SaveData();
                Render();
            }
        }
Exemplo n.º 6
0
        public override void Exchange(Actor actor)
        {
            base.Exchange(actor);

            if (!blockModel.isUsed)
            {
                MoveToSeat(actor);
            }
            else
            {
                if (!blockModel.isGathered)
                {
                    OneInventory cur = ui.hudPage.inventoryGroup.GetChosen();
                    if (cur.model != null && cur.model.id == InventoryType.Axe.ToInt())
                    {
                        swing.Hide();
                        blockModel.isGathered = true;
                        swingHeap.Activated();
                        data.SaveData();
                    }
                }
            }
        }
Exemplo n.º 7
0
 void ChooseInv(OneInventory inventory)
 {
     // print(inventory.Index);
     Choose(inventory.Index);
 }