Example #1
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();
             });
         }
     }
 }
Example #2
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);
         }
     }
 }
Example #3
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();
            }
        }