Exemplo n.º 1
0
    // Adds unit to dictionary. If unit is not in safe zone the units group is damaged
    void UnitEntered(UnitBehavior unit)
    {
        if (unitInBelt.ContainsKey(unit))
        {
            unitInBelt[unit] = true;
        }
        else
        {
            unitInBelt.Add(unit, true);
        }

        if (!PointIsInSafeZones(unit.transform.position.x, unit.transform.position.z))
        {
            unit.DamageGroup(BeltDamage);
        }
        //else
        //{
        //    Debug.Log("Unit passed safely");
        //}
        //entrancePoints.Add(unit.transform.position);
    }