Exemple #1
0
    void PropateExplotion(int x, int y, int limit, int xStep, int yStep)
    {
        Debug.Log("X: " + x + " Y: " + y);
        if (limit >= ExplotionRange)
        {
            return;
        }

        BaseTile tileToCheck = tile.GetNeigbourInDirection(x, y);

        if (tileToCheck.GetType() == typeof(Wall))
        {
            return;
        }
        ExplosionEffect SFX = Instantiate(effect, tileToCheck.transform.position, Quaternion.identity);

        tileToCheck.AddObjectToTile(SFX);

        tileToCheck.GetComponent <IDamage>().TakeDamage(Damage);
        if (xStep == 0 && yStep == 0)
        {
            return;
        }

        limit++;

        PropateExplotion(x + xStep, y + yStep, limit, xStep, yStep);
    }
Exemple #2
0
    void SpawnPowerUp(BaseTile baseTile)
    {
        if (baseTile != null)
        {
            PowerUp Inst = Instantiate(RandomChosenPowerUp(), baseTile.transform.position, Quaternion.identity);
            baseTile.AddObjectToTile(Inst);
            Inst.OnPowerUpDestroy += DecreasePowerUpCounter;

            powerUpCounter++;
        }
    }
Exemple #3
0
    void DeployObject(ref BaseTile baseTile)
    {
        Vector2Int position = baseTile.PositionOnGrid;
        PaintType  type     = GetPaintType(position.x, position.y);

        if (glossary.GetPrefabObject(type) == null)
        {
            return;
        }
        BaseObject baseObject = Instantiate(glossary.GetPrefabObject(type), baseTile.transform.position, Quaternion.identity, gameObject.transform);

        baseTile.AddObjectToTile(baseObject);
        baseObject.name = (baseObject.GetType()).ToString() + " x: " + position.x + " y: " + position.y;
    }
Exemple #4
0
 void InitBomb(ref BaseBomb bombToInit, BaseTile tile)
 {
     bombToInit.tile = tile;
     tile.AddObjectToTile(bombToInit);
     bombToInit.modifierProperties(ModifierDamageRange, ModifierDamageDuration, ModifierDamageValue);
 }