public void OnShapeSelectionChanged(BaseField f, object obj) { selectedPreset = shapePresets[selectedShape]; shapePoints = selectedPreset.points; SetFieldVisibility(); OnShapeChanged(f, obj, true); }
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); } }
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); } }
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); }
public static void SetShapePreset(this CALayer layer, ShapePreset value) { layer.MaterialLayer().ShapePreset = value; }