Ejemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Water") && !pulledByWater)
        {
            pulledByWater = true;
            waterTime     = GameManager.Instance.maxWaterTime;
            WaterController wc = other.GetComponentInParent <WaterController>();
            direction = wc.GetWaterDirection(other.transform.position);
            direction = direction.normalized * GameManager.Instance.waterForce;
        }
        else if (other.CompareTag("Bonus"))
        {
            switch (other.GetComponent <BonusController>().GetBonusType())
            {
            case BonusType.INCREASE_HYDRANT:
                IncreaseHydrantQtd();
                break;

            case BonusType.INCREASE_WATER:
                waterLength++;
                break;

            default:
                break;
            }
            board.SetTile(other.transform.position, TileType.FREE);
            Destroy(other.gameObject);
        }
    }