예제 #1
0
파일: BasePart.cs 프로젝트: mrdivdiz/bpvita
    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);
        }
    }
예제 #2
0
 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);
 }
예제 #3
0
 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();
 }
예제 #4
0
파일: BasePart.cs 프로젝트: mrdivdiz/bpvita
 public virtual void SetRotation(BasePart.GridRotation rotation)
 {
     this.m_gridRotation          = rotation;
     base.transform.localRotation = Quaternion.AngleAxis(this.GetRotationAngle(rotation), Vector3.forward);
 }
예제 #5
0
파일: Kicker.cs 프로젝트: mrdivdiz/bpvita
 public override void SetRotation(BasePart.GridRotation rotation)
 {
     this.m_gridRotation = rotation;
     this.SetColorMark();
 }