Esempio n. 1
0
    protected override void Update()
    {
        if (!HasBeenPlaced || ParentObject == null || IsBuilding)
        {
            return;
        }

        GridCell[] neighbours = GridManager.Instance.GetNeighbors(Coordinates);
        for (int i = 0; i < neighbours.Length; i++)
        {
            if (neighbours[i].IsOccupied)
            {
                neighbours[i].Occupant.Drain(neighbours[i].Occupant.DrainRate * (_drainMultiplier - 1) * Time.deltaTime);
            }
        }
        ParentObject.Drain(DrainRate * (_drainMultiplier - 1) * Time.deltaTime);
    }