コード例 #1
0
    public override void handleClick()
    {
        Debug.Log("clicked drill");

        if (Salvaging.isActive())
        {
            Salvaging.createNotification(this.gameObject);
            return;
        }

        if (salvaging)
        {
            return;
        }

        if (Time.time - lastClick < 0.2f)
        {
            return;
        }

        lastClick = Time.time;

        if (this.busy)
        {
            Notification.createNotification(this.gameObject, Notification.sprites.Working, "Working", Color.cyan, true);
        }
        else
        {
            this.doStart();
        }
    }
コード例 #2
0
    public override void handleClick()
    {
        Debug.Log("clicked Mineralthingi");

        if (salvaging)
        {
            return;
        }

        if (Salvaging.isActive())
        {
            Salvaging.createNotification(this.gameObject);
            return;
        }

        if (this.getCurEnergy() < 5)
        {
            Notification.createNotification(this.gameObject, Notification.sprites.Energy_Low, "Not enough energy", Color.red);
            return;
        }

        this.busy = true;
        Notification.createNotification(this.gameObject, Notification.sprites.Working, "Processing...", Color.green, true);
        DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject, ressources.Iron);
        DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject, ressources.Gold);
    }
コード例 #3
0
    public override void handleClick()
    {
        Debug.Log("clicked Thing");

        if (salvaging)
        {
            return;
        }

        if (Salvaging.isActive())
        {
            Salvaging.createNotification(this.gameObject);
            return;
        }

        if (this.busy && this.getCurEnergy() > 3)
        {
            Notification.createNotification(this.gameObject, Notification.sprites.Working, "Working...", Color.green, true);
        }
        if (!this.busy && this.getCurEnergy() > 100)
        {
            doStart();
        }
        else if (!this.busy && this.getCurEnergy() <= 100)
        {
            Notification.createNotification(this.gameObject, Notification.sprites.Energy_Low, "Not enough Energy", Color.red, false);
        }
    }
コード例 #4
0
 public void salvage()
 {
     Debug.Log("Got salvage request!");
     this.salvaging = true;
     Salvaging.displayIndicator(this.gameObject);
     this.salvageStartHP = getHP().HP;
     this.network.Remove(this);
 }
コード例 #5
0
 public void handleClick()
 {
     if (Salvaging.isActive())
     {
         Salvaging.createNotification(this.gameObject);
         return;
     }
 }
コード例 #6
0
ファイル: pipeHandler.cs プロジェクト: hobo71/ColonyGame
 public void handleClick()
 {
     if (Salvaging.isActive())
     {
         salvage();
         return;
     }
 }
コード例 #7
0
    public virtual void handleClick()
    {
        Debug.Log("clicked structure");

        if (salvaging)
        {
            return;
        }

        if (Salvaging.isActive())
        {
            Salvaging.createNotification(this.gameObject);
            return;
        }
    }
コード例 #8
0
ファイル: ScrapBurner.cs プロジェクト: hobo71/ColonyGame
    public override void handleClick()
    {
        Debug.Log("clicked scrapburner");

        if (salvaging)
        {
            return;
        }

        if (Salvaging.isActive())
        {
            Salvaging.createNotification(this.gameObject);
            return;
        }

        this.busy = true;
        Notification.createNotification(this.gameObject, Notification.sprites.Working, "Burning...", Color.green, true);
    }
コード例 #9
0
ファイル: Dome_Basic.cs プロジェクト: hobo71/ColonyGame
    public override void handleClick()
    {
        Debug.Log("clicked dome");

        if (Salvaging.isActive())
        {
            Salvaging.createNotification(this.gameObject);
            return;
        }

        if (salvaging)
        {
            return;
        }

        if (Time.time - lastClick < 0.2f)
        {
            return;
        }

        lastClick = Time.time;

        if (this.getCurEnergy() >= 500 && !this.busy)
        {
            doClone();
            Notification.createNotification(this.gameObject, Notification.sprites.Starting,
                                            this.getCurEnergy() + 500 + "/500", Color.green);
        }
        else if (this.busy)
        {
            Notification.createNotification(this.gameObject, Notification.sprites.Working, "", Color.blue, true);
        }
        else
        {
            Notification.createNotification(this.gameObject, Notification.sprites.Energy_Low,
                                            this.getCurEnergy() + "/500", Color.red);
        }
    }
コード例 #10
0
ファイル: SimpleStructure.cs プロジェクト: hobo71/ColonyGame
 public void salvage()
 {
     this.salvaging = true;
     Salvaging.displayIndicator(this.gameObject);
 }
コード例 #11
0
ファイル: buttonClicked.cs プロジェクト: hobo71/ColonyGame
 public void onSalvage()
 {
     Salvaging.salvageTriggered();
 }
コード例 #12
0
 public void salvage()
 {
     Debug.Log("Got salvage request!");
     this.salvaging = true;
     Salvaging.displayIndicator(this.gameObject);
 }