private void OnTapFreeStructureSocket(StructureSocket socket) { var selectedButtonType = Util.bootController.gameplayUI.GetSelectedButtonType(); if (!Util.placementManager.IsPlacingState() && selectedButtonType == StructureType.NONE) { PlaySound(data.structureSocketTap); } }
private void PlaceTower(StructureType structureType, Vector3 worldPosition, StructureSocket socket) { if (socket != null) { socket.SetHasStructure(true); } var tower = CreateStructure(structureType); tower.transform.position = worldPosition + placementOffset; var structure = tower.GetComponent <Structure>(); structure.Init(socket); }
private void OnTapStructureSocket(StructureSocket socket) { if (!InputController.canSpawnTowers) { return; } if (!IsPlacingState()) { return; } if (GameManager.Instance.econManager.CanBuyTower(structureToPlace)) { PlaceTower(structureToPlace, socket.transform.position, socket); GameManager.Instance.econManager.BuyTower(structureToPlace); } LeanTween.delayedCall(0.5f, () => { SetNoneState(); }); }
private void OnSocketPop(StructureSocket socket) { PlaySound(data.structureSocketPopUp); }