예제 #1
0
 public void OnShapeSelectionChanged(BaseField f, object obj)
 {
     selectedPreset = shapePresets[selectedShape];
     shapePoints    = selectedPreset.points;
     SetFieldVisibility();
     OnShapeChanged(f, obj, true);
 }
예제 #2
0
 private void InitializeSelectedShape()
 {
     InitializePresets();
     if (string.IsNullOrEmpty(selectedShape) || !shapePresets.ContainsKey(selectedShape))
     {
         Debug.Log($"{ModTag} InitializeSelectedShape() Shape {selectedShape} not available, defaulting to {shapePresets.Keys.First()}");
         selectedShape = shapePresets.Keys.First();
     }
     selectedPreset = shapePresets[selectedShape];
     if (!selectedPreset.name.Equals(CustomShapeName))
     {
         shapePoints = selectedPreset.points;
     }
     else
     {
         (curve_x, curve_y, curve_z, curve_w) = (shapePoints.x, shapePoints.y, shapePoints.z, shapePoints.w);
     }
 }
예제 #3
0
 private void InitializePresets()
 {
     if (shapePresets.Count == 0 &&
         GameDatabase.Instance.GetConfigNode("ProceduralParts/ProceduralParts/ProceduralPartsSettings") is ConfigNode settings)
     {
         foreach (var shapeNode in settings.GetNodes("Shape"))
         {
             var shape = new ShapePreset();
             if (ConfigNode.LoadObjectFromConfig(shape, shapeNode))
             {
                 shapePresets.Add(shape.name, shape);
             }
         }
         var s = new ShapePreset
         {
             name        = CustomShapeName,
             displayName = CustomShapeName,
             points      = Vector4.zero
         };
         shapePresets.Add(s.name, s);
     }
 }
예제 #4
0
 public static void SetShapePreset(this Card view, ShapePreset value)
 {
     view.Layer.SetShapePreset(value);
     view.Container.SetShapePreset(value);
 }
 public static void SetShapePreset(this UIView view, ShapePreset value)
 {
     view.Layer.SetShapePreset(value);
 }
예제 #6
0
 public static void SetShapePreset(this CALayer layer, ShapePreset value)
 {
     layer.MaterialLayer().ShapePreset = value;
 }