private void CreateNodeBoundaryIFN(CreepingNode node, WorldArea nodeArea)
 {
     Diagnostics.Assert(node != null);
     Diagnostics.Assert(nodeArea != null);
     if (base.WorldEntityFactoryService == null)
     {
         return;
     }
     if (!this.nodeBoundryObjects.ContainsKey(node.GUID))
     {
         UnityEngine.Object @object = Resources.Load("Prefabs/Cities/VillageBoundary");
         if (@object != null)
         {
             GameObject gameObject = UnityEngine.Object.Instantiate(@object) as GameObject;
             if (gameObject != null)
             {
                 Diagnostics.Assert(base.GlobalPositionningService != null);
                 Diagnostics.Assert(base.WorldPositionningService != null);
                 GameObject gameObject2 = null;
                 if (base.WorldEntityFactoryService.TryGetValue(node.PointOfInterest.GUID, out gameObject2))
                 {
                     gameObject.transform.parent        = gameObject2.transform;
                     gameObject.transform.localPosition = new Vector3(0f, 0.03f, 0f);
                     WorldAreaHexagonRenderer component = gameObject.GetComponent <WorldAreaHexagonRenderer>();
                     Diagnostics.Assert(component != null);
                     if (component == null)
                     {
                         return;
                     }
                     Color color = (node.Empire == null) ? Color.grey : node.Empire.Color;
                     component.SetColor(color);
                     component.SetWorldArea(nodeArea.WorldPositions, node.WorldPosition, base.GlobalPositionningService);
                     component.SetMaterialSelectionStatus(false, true, true);
                     component.SetOnDestroyLaunchAutokillAnimation(0.5f);
                     this.nodeBoundryObjects.Add(node.GUID, gameObject);
                 }
             }
         }
     }
 }
示例#2
0
 private void CreateVillageBoundaryIFN()
 {
     Diagnostics.Assert(this.Village != null);
     Diagnostics.Assert(this.WorldArea != null);
     if (this.WorldEntityFactoryService == null)
     {
         return;
     }
     if (this.villageBoundaryObject == null)
     {
         UnityEngine.Object @object = Resources.Load("Prefabs/Cities/VillageBoundary");
         if (@object != null)
         {
             this.villageBoundaryObject = (UnityEngine.Object.Instantiate(@object) as GameObject);
             if (this.villageBoundaryObject != null)
             {
                 Diagnostics.Assert(base.GlobalPositionningService != null);
                 Diagnostics.Assert(this.WorldPositionningService != null);
                 GameObject gameObject = null;
                 if (this.WorldEntityFactoryService.TryGetValue(this.Village.PointOfInterest.GUID, out gameObject))
                 {
                     this.villageBoundaryObject.transform.parent        = gameObject.transform;
                     this.villageBoundaryObject.transform.localPosition = new Vector3(0f, 0.03f, 0f);
                     WorldAreaHexagonRenderer component = this.villageBoundaryObject.GetComponent <WorldAreaHexagonRenderer>();
                     Diagnostics.Assert(component != null);
                     if (component == null)
                     {
                         return;
                     }
                     Color color = (this.Village.Converter == null) ? Color.grey : this.Village.Converter.Color;
                     component.SetColor(color);
                     component.SetWorldArea(this.WorldArea.WorldPositions, this.Village.WorldPosition, base.GlobalPositionningService);
                     component.SetMaterialSelectionStatus(false, true, true);
                     component.SetOnDestroyLaunchAutokillAnimation(0.5f);
                 }
             }
         }
     }
 }