public override void Render() { BlockModel swing = data.gameData.GetBlockModel(BlockType.Swing); if (!swing.isGathered) { this.Hide(); } else { this.Show(); coll.enabled = true; } }
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); }
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(); } } }
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; } }
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); }); } } }
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; } }
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); }); }
public override BlockModel GenerateBlockModel() { blockModel = new BlockModel(id, false, false); return(blockModel); }
public override BlockModel GenerateBlockModel() { blockModel = new BlockModel(id, true, true); return(blockModel); }
public void LoadBlockModel(BlockModel model) { blockModel = model; }