public void ResourceDropped(GameEventResourceDrop.ResourceDrop resourceDrop)
        {
            // this.Temp("ResourceDropped", "Dropped: " + resourceDrop);
            if (resourceDrop.targetBlock != this)
            {
                return;
            }

            if (resourceDrop.resource == ResourceType.Trees)
            {
                if (this.fireRiskCoroutine != null)
                {
                    this.Temp("ResourceDropped", "Stopping Fires.");
                    this.StopCoroutine(this.fireRiskCoroutine);
                }

                this.CreateTrees();

                this.resource = ResourceType.Trees;
                this.UpdateHealth();

                this.StartFirePotential();
            }

            if (resourceDrop.resource == ResourceType.Water)
            {
                if (this.fireRiskCoroutine != null)
                {
                    this.StopCoroutine(this.fireRiskCoroutine);
                }

                this.InstantiatorsWithFire.DoForEach(inst => inst.Instantiate(GameConfiguration.SpawnType.None));
                this.UpdateHealth();
            }
        }
Example #2
0
        private void Release(ContinentBlockController targetContinent)
        {
            // Return if there is not grabbed resource or if the target continent expects a different resource.
            if (this.lastGrabbedContinent == null || this.grabProgression < 0.9f ||
                this.grabbedResource == ContinentBlockController.ResourceType.None ||
                targetContinent.Resource == ContinentBlockController.ResourceType.Water && this.grabbedResource != ContinentBlockController.ResourceType.Water)
            {
                return;
            }

            // this.Temp("Release", "On " + targetContinent.name);
            GameEventResourceDrop.ResourceDrop resourceDropped = new GameEventResourceDrop.ResourceDrop
            {
                resource    = this.grabbedResource,
                targetBlock = targetContinent,
                sourceBlock = this.lastGrabbedContinent
            };
            this.resourceDrop.Raise(resourceDropped);
            targetContinent.ResourceDropped(resourceDropped);

            this.lastGrabbedContinent = null;
            this.grabbedResource      = ContinentBlockController.ResourceType.None;
        }
Example #3
0
 public void UpdateDroppedResource(GameEventResourceDrop.ResourceDrop resourceDrop)
 {
     this.image.fillAmount = 0;
     // this.image = this.GetComponent<Image>();
     // this.image.color = new Color(1, 1, 1, (resourceDrop.resource == this.Resource) ? 1 : 0.5f);
 }