Ejemplo n.º 1
0
        private void OnTapFreeStructureSocket(StructureSocket socket)
        {
            var selectedButtonType = Util.bootController.gameplayUI.GetSelectedButtonType();

            if (!Util.placementManager.IsPlacingState() && selectedButtonType == StructureType.NONE)
            {
                PlaySound(data.structureSocketTap);
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
            });
        }
Ejemplo n.º 4
0
 private void OnSocketPop(StructureSocket socket)
 {
     PlaySound(data.structureSocketPopUp);
 }