示例#1
0
文件: SwingHeap.cs 项目: Verbess/Born
        public override void Render()
        {
            BlockModel swing = data.gameData.GetBlockModel(BlockType.Swing);

            if (!swing.isGathered)
            {
                this.Hide();
            }
            else
            {
                this.Show();
                coll.enabled = true;
            }
        }
示例#2
0
        public BlockModel GetBlockModel(BlockType block)
        {
            BlockModel model = null;

            foreach (var kv in levelDic)
            {
                model = kv.Value.blocks.Find(value => value.id == block.ToInt());
                if (model != null)
                {
                    return(model);
                }
            }
            return(model);
        }
示例#3
0
 public override void Exchange(Actor actor)
 {
     base.Exchange(actor);
     if (!blockModel.isUsed)
     {
         BlockModel tentSwitchModel = data.gameData.GetBlockModel(BlockType.TentSwitch);
         if (tentSwitchModel.isUsed)
         {
             chain.LockBox();
             audioManager.PlayMapSound(MapSFX.PutItem);
             sr.sprite         = locked;
             blockModel.isUsed = true;
             data.SaveData();
         }
     }
 }
示例#4
0
 public override void Render()
 {
     if (blockModel.isUsed)
     {
         BlockModel drawBridge = data.gameData.GetBlockModel(BlockType.DrawBridge);
         if (drawBridge.isUsed)
         {
             sr.sprite = used;
         }
         else
         {
             sr.sprite = jointedIn;
         }
     }
     else
     {
         sr.sprite = null;
     }
 }
示例#5
0
文件: SwingHeap.cs 项目: Verbess/Born
        public override void Exchange(Actor actor)
        {
            base.Exchange(actor);
            BlockModel swing = data.gameData.GetBlockModel(BlockType.Swing);

            if (swing.isGathered)
            {
                if (!blockModel.isGathered)
                {
                    InventoryModel rope = new InventoryModel(InventoryType.Rope);
                    ui.hudPage.inventoryGroup.InsertInventory(rope);
                    ui.obtainPanel.OnCloseOnce(() => {
                        InventoryModel bridgeBoard = new InventoryModel(InventoryType.SwingBoard);
                        ui.hudPage.inventoryGroup.InsertInventory(bridgeBoard);
                        blockModel.isGathered = true;
                        audioManager.PlayMapSound(MapSFX.UseAxe);
                        this.Hide();
                        data.SaveData();
                        ui.obtainPanel.OnCloseOnce(null);
                    });
                }
            }
        }
示例#6
0
        public override void Render()
        {
            MapGo      map         = transform.GetComponentInParent <MapGo>();
            LevelModel level       = data.gameData.GetLevelModel(map.levelId);
            BlockModel pillarBlock = level.GetBlock(BlockType.RopePillar.ToInt());

            if (pillarBlock.isUsed)
            {
                rope.transform.position = middle.transform.position;
                if (blockModel.isUsed)
                {
                    rope.transform.position = bottom.transform.position;
                }
                else
                {
                    rope.transform.position = middle.transform.position;
                }
            }
            else
            {
                rope.transform.position = top.transform.position;
            }
        }
示例#7
0
        void MoveTo(Actor actor, GameObject target)
        {
            BlockModel boxModel = data.gameData.GetBlockModel(BlockType.Box);

            if (boxModel.isUsed)
            {
                box.box.transform.parent = chain.transform;
                sr.sprite = null;
            }
            else
            {
                sr.sprite = chainSprite;
            }
            cameraManager.SetFollowingLimited(chain.gameObject, targetMap.transform.position, targetMap.size);
            actor.LockAct(true);
            action?.Kill();
            action = DOTween.Sequence();
            action.AppendInterval(1f);
            action.AppendCallback(() => {
                audioManager.PlayMapSound(MapSFX.Machinary);
            });
            action.Append(chain.transform.DOMoveY(target.transform.position.y, 2.5f));
            action.AppendCallback(() => {
                if (boxModel.isUsed && target == middle)
                {
                    cave.ShowCave(true);
                }
                else
                {
                    cave.ShowCave(false);
                }
                actor.SetTarget(actor.transform.position);
                actor.LockAct(false);
                world.EnterMap(currentMap);
            });
        }
示例#8
0
文件: Chest.cs 项目: Verbess/Born
 public override BlockModel GenerateBlockModel()
 {
     blockModel = new BlockModel(id, false, false);
     return(blockModel);
 }
示例#9
0
 public override BlockModel GenerateBlockModel()
 {
     blockModel = new BlockModel(id, true, true);
     return(blockModel);
 }
示例#10
0
文件: BlockBase.cs 项目: Verbess/Born
 public void LoadBlockModel(BlockModel model)
 {
     blockModel = model;
 }