Пример #1
0
        private static Vector3 AdjustRenderOffsetFromDir(Pawn pawn, CompOversizedWeapon compOversizedWeapon)
        {
            var curDir = pawn.Rotation;

            Vector3 curOffset = Vector3.zero;

            if (compOversizedWeapon.Props != null)
            {
                curOffset = compOversizedWeapon.Props.northOffset;
                if (curDir == Rot4.East)
                {
                    curOffset = compOversizedWeapon.Props.eastOffset;
                }
                else if (curDir == Rot4.South)
                {
                    curOffset = compOversizedWeapon.Props.southOffset;
                }
                else if (curDir == Rot4.West)
                {
                    curOffset = compOversizedWeapon.Props.westOffset;
                }
            }

            return(curOffset);
        }
        private static float AdjustOffsetAtPeace(Thing eq, Pawn pawn, CompOversizedWeapon compOversizedWeapon, float num)
        {
            Mesh mesh;

            mesh = MeshPool.plane10;
            var offsetAtPeace = eq.def.equippedAngleOffset;

            if (compOversizedWeapon.Props != null && (!pawn.IsFighting() && compOversizedWeapon.Props.verticalFlipOutsideCombat))
            {
                offsetAtPeace += 180f;
            }
            num += offsetAtPeace;
            return(num);
        }
 private static float AdjustNonCombatRotation(Pawn pawn, float num, CompOversizedWeapon compOversizedWeapon)
 {
     if (compOversizedWeapon.Props != null)
     {
         if (pawn.Rotation == Rot4.North)
         {
             num += compOversizedWeapon.Props.angleAdjustmentNorth;
         }
         else if (pawn.Rotation == Rot4.East)
         {
             num += compOversizedWeapon.Props.angleAdjustmentEast;
         }
         else if (pawn.Rotation == Rot4.West)
         {
             num += compOversizedWeapon.Props.angleAdjustmentWest;
         }
         else if (pawn.Rotation == Rot4.South)
         {
             num += compOversizedWeapon.Props.angleAdjustmentSouth;
         }
     }
     return(num);
 }