Esempio n. 1
0
 public void AnchorDestroyed(StructureAnchor anchor)
 {
     if (base.gameObject)
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
Esempio n. 2
0
 public int GetAnchorIndex(StructureAnchor anchor)
 {
     if (this._mode == FoundationArchitect.Modes.Auto)
     {
         StructureAnchor[] componentsInChildren = base.gameObject.GetComponentsInChildren <StructureAnchor>();
         for (int i = 0; i < componentsInChildren.Length; i++)
         {
             if (object.ReferenceEquals(anchor, componentsInChildren[i]))
             {
                 return(i);
             }
         }
     }
     else
     {
         for (int j = 0; j < this._anchors.Count; j++)
         {
             if (object.ReferenceEquals(anchor, this._anchors[j]))
             {
                 return(j);
             }
         }
     }
     throw new Exception("Unknown anchor: " + anchor);
 }
Esempio n. 3
0
 private void CheckLockAnchor(StructureAnchor anchor)
 {
     if (anchor && anchor._hookedInStructure == null && anchor != this._anchor1 && this.ValidateAnchor(anchor.transform))
     {
         base.transform.parent   = null;
         base.transform.position = anchor.transform.TransformPoint(anchor._upperPositionOffset);
         base.transform.rotation = anchor.transform.rotation;
         this._anchor1           = anchor;
     }
 }
Esempio n. 4
0
        void IAnchorableStructure.AnchorDestroyed(StructureAnchor anchor)
        {
            BuildingHealth component = base.GetComponent <BuildingHealth>();

            if (component)
            {
                component.Collapse(anchor.transform.position);
            }
            else if (base.gameObject)
            {
                UnityEngine.Object.Destroy(base.gameObject);
            }
        }
Esempio n. 5
0
 private void CheckLockTempAnchor(StructureAnchor anchor)
 {
     if (LocalPlayer.Create.BuildingPlacer.OnDynamicClear && anchor && anchor._hookedInStructure == null && anchor != this._anchor1 && anchor != this._anchor2 && anchor != this._tmpAnchor && (!this._anchor1 || !this._anchor1.GetComponentInParent <PrefabIdentifier>().Equals(anchor.GetComponentInParent <PrefabIdentifier>())))
     {
         if (base.transform.parent == null)
         {
             this.RevertFirstAnchorSnapping();
         }
         this._placerOffset                 = base.transform.localPosition;
         base.transform.parent              = null;
         base.transform.position            = anchor.transform.position;
         base.transform.rotation            = anchor.transform.rotation;
         this._tmpAnchor                    = anchor;
         this._tmpAnchor._hookedInStructure = this;
     }
 }