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); }
public override void handleOption(string option) { Debug.Log("handling option: " + option); if (salvaging) { return; } switch (option) { case "doStop": Debug.Log("Clicked stop button"); this.busy = false; Notification.createNotification(this.gameObject, Notification.sprites.Stopping, "Stopping", Color.red, false); //this.GetComponent<Animator>().SetBool("working", false); //this.transform.Find("CFX3_Fire_Shield").GetComponent<ParticleSystem>().Stop(); this.transform.Find("ProcessingPlant_Anim").GetComponent <ParticleSystem>().Stop(); break; case "doStart": Debug.Log("Clicked start button"); DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject); this.busy = true; Notification.createNotification(this.gameObject, Notification.sprites.Starting, "Processing...", Color.green, true); break; default: displayInfo(); break; } }
private void doStart() { Notification.createNotification(this.gameObject, Notification.sprites.Working, "Starting", Color.green, true); this.busy = true; DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject, ressources.Trees); }
private void doStart(Transform target) { Notification.createNotification(this.gameObject, Notification.sprites.Working, "Starting", Color.green, true); this.busy = true; curTarget = target; Debug.Log("setting harvest target to: " + curTarget); DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject); }
public override void doStart() { base.doStart(); if (useMovers) { foreach (var data in getProduceData()) { foreach (var kind in data.outcome) { DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject, kind.getRessource()); } } } }
public new void handleDeserialization(SaveLoad.SerializationInfo info) { serializationData data = (serializationData)info; this.storedEnergy = data.storedEnergy; this.busy = data.busy; this.ownResource = data.ownResource; this.salvaging = data.salvaging; if (this.busy) { DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject, ressources.Trees); } if (salvaging) { GameObject.Instantiate(ParticleHelper.getInstance().salvageParticles, this.gameObject.transform); } //reloadConnections(); }
public override void doStart() { base.doStart(); startAnim(); DeliveryRoutes.addRoute(this.gameObject, DeliveryRoutes.getClosest("dropBase", this.gameObject).gameObject, ingot); }