Пример #1
0
        private void SpawnSplit(UnitsMap map, BoardController boardController, CardinalDirections direction, Point attackerPosition)
        {
            if (InstantiatedSplits >= maxSplits)
            {
                return;
            }

            InstantiatedSplits++;
            Logcat.I(this, $"Multisplit instances {InstantiatedSplits}");

            CardinalDirections[] directions = PlayerUtils.HoloBlastSplitDirections(direction);
            Vector3 position = PointConverter.ToVector(attackerPosition) + PointConverter.ToVector(Direction.GetDirection(direction));

            position.y = fixedPosition;
            Quaternion rotation = RotationHelper.GetRotation(direction);
            MultiSplit instance = Instantiate(split, position, rotation);

            instance.SetUp(this.unitsMap, boardController, attackerPosition, directions, secondAttackDamage, secondAttackDamage, knockback);
        }
Пример #2
0
        public override void Execute()
        {
            CardinalDirections direction = Direction.GetCardinalDirection(this.Unit.GetPosition(), this.Target);
            Vector3            point     = PointConverter.ToVector(Direction.GetDirection(direction));

            this.transform.localPosition += point;
            HoloBlast blast = MonoBehaviour.Instantiate(this.bullet, this.gameObject.transform.position, RotationHelper.GetRotation(direction));

            blast.SetUp(this.UnitsMap, this.BoardController, this.Unit.GetPosition(), PlayerUtils.HoloBlastSplitDirections(direction), this.firstAttackDamage, this.secondAttackDamage, this.Knockback);
            this.transform.localPosition -= point;
        }