public float GetRotationAngle(BasePart.GridRotation rotation) { switch (rotation) { case BasePart.GridRotation.Deg_0: return(0f); case BasePart.GridRotation.Deg_90: return(90f); case BasePart.GridRotation.Deg_180: return(180f); case BasePart.GridRotation.Deg_270: return(270f); case BasePart.GridRotation.Deg_45: return(45f); case BasePart.GridRotation.Deg_135: return(135f); case BasePart.GridRotation.Deg_225: return(225f); case BasePart.GridRotation.Deg_315: return(315f); default: return(0f); } }
public void AddPart(int x, int y, int partType, int customPartIndex, BasePart.GridRotation rotation, bool flipped) { ContraptionDatasetUnit contraptionDatasetUnit = new ContraptionDatasetUnit(); contraptionDatasetUnit.x = x; contraptionDatasetUnit.y = y; contraptionDatasetUnit.partType = partType; contraptionDatasetUnit.customPartIndex = customPartIndex; contraptionDatasetUnit.rot = (int)rotation; contraptionDatasetUnit.flipped = flipped; this.m_contraptionDataSet.Add(contraptionDatasetUnit); }
public override void SetRotation(BasePart.GridRotation rotation) { this.m_gridRotation = rotation; this.m_Visualization.transform.localRotation = Quaternion.AngleAxis(base.GetRotationAngle(rotation), Vector3.forward); this.CheckRotations(); }
public virtual void SetRotation(BasePart.GridRotation rotation) { this.m_gridRotation = rotation; base.transform.localRotation = Quaternion.AngleAxis(this.GetRotationAngle(rotation), Vector3.forward); }
public override void SetRotation(BasePart.GridRotation rotation) { this.m_gridRotation = rotation; this.SetColorMark(); }