Beispiel #1
0
        void OnMouseDown()
        {
            if (electricityReciever && !electricityFacility)
            {
                if (lastBuiltEnergyRecieverTower != null)
                {
                    lastBuiltEnergyRecieverTower.ClearTowerHighlighter();
                }
                //Debug.Log("setting dron start point");
                lastBuiltEnergyRecieverTower = this;
            }

            // Debug.Log((lastBuiltEnergyRecieverTower != null) + " " + electricityFacility);

            if (lastBuiltEnergyRecieverTower != null && electricityFacility)
            {
                Debug.Log("sending drone to the new destination");
                lastBuiltEnergyRecieverTower.energyProducer = this;
                lastBuiltEnergyRecieverTower.startDroneFlight(this);
                lastBuiltEnergyRecieverTower.ClearTowerHighlighter();
                lastBuiltEnergyRecieverTower = null;
            }
        }