Esempio n. 1
0
 protected override void AttributeSetup(GameObject rootObj, string name, bool serverside, bool clientside, bool bundling)
 {
     base.AttributeSetup(rootObj, name, serverside, clientside, bundling);
     isBuildingPrivilege = rootObj.GetComponent <BuildingPrivlidge>();
     bounds         = rootObj.GetComponent <BaseEntity>().bounds;
     deployable     = GetComponent <Deployable>();
     placeholder    = GetComponentInChildren <ConstructionPlaceholder>();
     allSockets     = GetComponentsInChildren <Socket_Base>(true);
     allProximities = GetComponentsInChildren <BuildingProximity>(true);
     socketHandle   = GetComponentsInChildren <SocketHandle>(true).FirstOrDefault();
     ConstructionGrade[] components = rootObj.GetComponents <ConstructionGrade>();
     grades = new ConstructionGrade[5];
     ConstructionGrade[] array = components;
     foreach (ConstructionGrade constructionGrade in array)
     {
         constructionGrade.construction = this;
         grades[(int)constructionGrade.gradeBase.type] = constructionGrade;
     }
     for (int j = 0; j < grades.Length; j++)
     {
         if (!(grades[j] == null))
         {
             defaultGrade = grades[j];
             break;
         }
     }
 }
Esempio n. 2
0
 protected override void AttributeSetup(
     GameObject rootObj,
     string name,
     bool serverside,
     bool clientside,
     bool bundling)
 {
     base.AttributeSetup(rootObj, name, serverside, clientside, bundling);
     this.isBuildingPrivilege = Object.op_Implicit((Object)rootObj.GetComponent <BuildingPrivlidge>());
     this.bounds         = ((BaseEntity)rootObj.GetComponent <BaseEntity>()).bounds;
     this.deployable     = (Deployable)((Component)this).GetComponent <Deployable>();
     this.placeholder    = (ConstructionPlaceholder)((Component)this).GetComponentInChildren <ConstructionPlaceholder>();
     this.allSockets     = (Socket_Base[])((Component)this).GetComponentsInChildren <Socket_Base>(true);
     this.allProximities = (BuildingProximity[])((Component)this).GetComponentsInChildren <BuildingProximity>(true);
     this.socketHandle   = ((IEnumerable <SocketHandle>)((Component)this).GetComponentsInChildren <SocketHandle>(true)).FirstOrDefault <SocketHandle>();
     M0[] components = rootObj.GetComponents <ConstructionGrade>();
     this.grades = new ConstructionGrade[5];
     foreach (ConstructionGrade constructionGrade in (ConstructionGrade[])components)
     {
         constructionGrade.construction = this;
         this.grades[(int)constructionGrade.gradeBase.type] = constructionGrade;
     }
     for (int index = 0; index < this.grades.Length; ++index)
     {
         if (!((PrefabAttribute)this.grades[index] == (PrefabAttribute)null))
         {
             this.defaultGrade = this.grades[index];
             break;
         }
     }
 }
Esempio n. 3
0
 protected override void AttributeSetup(GameObject rootObj, string name, bool serverside, bool clientside, bool bundling)
 {
     base.AttributeSetup(rootObj, name, serverside, clientside, bundling);
     this.isBuildingPrivilege = rootObj.GetComponent <BuildingPrivlidge>();
     this.bounds         = rootObj.GetComponent <BaseEntity>().bounds;
     this.deployable     = base.GetComponent <Deployable>();
     this.placeholder    = base.GetComponentInChildren <ConstructionPlaceholder>();
     this.allSockets     = base.GetComponentsInChildren <Socket_Base>(true);
     this.allProximities = base.GetComponentsInChildren <BuildingProximity>(true);
     this.socketHandle   = base.GetComponentsInChildren <SocketHandle>(true).FirstOrDefault <SocketHandle>();
     ConstructionGrade[] components = rootObj.GetComponents <ConstructionGrade>();
     this.grades = new ConstructionGrade[5];
     ConstructionGrade[] constructionGradeArray = components;
     for (int i = 0; i < (int)constructionGradeArray.Length; i++)
     {
         ConstructionGrade constructionGrade = constructionGradeArray[i];
         constructionGrade.construction = this;
         this.grades[(int)constructionGrade.gradeBase.type] = constructionGrade;
     }
     for (int j = 0; j < (int)this.grades.Length; j++)
     {
         if (this.grades[j] != null)
         {
             this.defaultGrade = this.grades[j];
             return;
         }
     }
 }