Пример #1
0
 private void Awake()
 {
     this.building             = this.transform.root.GetComponentInChildren <IBuilding>();
     this.buildingAttackSystem = this.transform.root.GetComponentInChildren <IBuildingAttackSystem>();
     if (this.deployAreaRenderer != null)
     {
         this.deployAreaRenderer.transform.localScale = new Vector3(this.building.MapRect.width, this.building.MapRect.height, this.building.MapRect.height);
     }
     this.obstructRenderer.transform.localScale = new Vector3(this.building.MapRect.width, this.building.MapRect.height, this.building.MapRect.height);
     this.obstructRenderer.material.SetVector("_Scale", new Vector4(1 + (this.building.MapRect.width - 4) * 0.25f, 1 + (this.building.MapRect.height - 4) * 0.25f, 0f, 0f));
     this.currentTowerRenderer = this.meshRenderers[0];
 }
Пример #2
0
 private void Awake()
 {
     if (!this.mapRectEffect)
     {
         this.mapRectEffect = GetComponentInChildren <BuildingCommonEffect>();
     }
     if (this.attackSystem == null)
     {
         this.attackSystem = GetComponentInChildren <IBuildingAttackSystem>();
     }
     if (!this.itemCanvas)
     {
         this.itemCanvas = GetComponentInChildren <BuildingItemCanvas>();
     }
 }